HWExact | R Documentation |
This function calculates Hardy-Weinburg (Fisher's) exact p-values for GWAS SNP data.
HWExact(GenotypeCounts)
GenotypeCounts |
A dataframe of genotype counts, with columns called |
A vector of exact p-values.
This function uses a C function SNPHWE.c
written by Jan Wigginton as described in the above reference.
Ian Painter
Wigginton, JE, Cutler, DJ, and Abecasis, GR (2005) A Note on Exact Tests of Hardy-Weinberg Equilibrium. American Journal of Human Genetics. 76
pA<- runif(1)
pAA<- pA^2
pAa<- 2*pA*(1-pA)
paa<- (1-pA)^2
counts<- rmultinom(1000, 3000, c(pAA, pAa, paa) )
genotypes<- data.frame(nAA = counts[1,], nAa = counts[2,], naa = counts[3,])
hwPvalues<- HWExact(genotypes)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.