Exact SNP test of Hardy-Weinberg Equilibrium
This code calculates an exact probability of departure from Hardy-Weinberg Equilibrium as described in Wigginton, JE, Cutler, DJ, and Abecasis, GR (2005) A Note on Exact Tests of Hardy-Weinberg Equilibrium. American Journal of Human Genetics. 76:887-893.
utils.prob.hwe(obs_hets, obs_hom1, obs_hom2)
obs_hets |
– count of heterozygotes by locus |
obs_hom1 |
– count of homozygotes, reference state |
obs_hom2 |
– count of homozygotes, alternate state |
Note: return code of -1.0 signals an error condition; return code of NA signals that all alleles are NA for a locus
Exact probability of agreement with HWE
Arthur Georges (Post to https://groups.google.com/d/forum/dartr)
hets <- 20 hom_1 <- 5 hom_2 <- 30 #p_value <- prob.hwe(hets, hom_1, hom_2)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.