Chi-square Test on Observed vs Expected Genotypes
For one SNP and all offspring-parent-parent trios or single parent-offspring pairs, calculate the expected genotype frequencies given the allele frequency, genotyping error rate, and error flavour, and perform a chi-square test.
CalcChi2(E, q, A.obs, ErrF)
E |
presumed genotyping error rate. |
q |
allele frequency. |
A.obs |
array of dim 4x4x4 with counts of joined offspring-parent-parent at the SNPs |
ErrF |
ErrFlavour; function that takes the genotyping error rate
|
The chisquare value of the test.
## Not run: E.hat <- numeric(ncol(GenoM)) # based on trio where possible for (l in 1:ncol(GenoM)) { E.hat[l] <- stats::optimise(CalcChi2, interval=c(0,1), q=AF[l], A.obs=OO.trio[l,,,], ErrF=ErrF)$minimum } ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.