Title: | Exact Hardy-Weinburg Testing for Genome Wide Association Studies |
---|---|
Description: | Exact Hardy-Weinburg testing (using Fisher's test) for SNP genotypes as typically obtained in a Genome Wide Association Study (GWAS). |
Authors: | Ian Painter, University of Washington |
Maintainer: | Stephanie Gogarten <[email protected]> |
License: | GPL-3 |
Version: | 1.2 |
Built: | 2024-11-08 03:56:43 UTC |
Source: | https://github.com/smgogarten/gwasexacthw |
This package contains a function to do exact Hardy-Weinburg testing (using Fisher's test) over all or a selection of SNP genotypes as typically obtained in a Genome Wide Association Study (GWAS).
Package: | GWASExactHW |
Type: | Package |
Version: | 1.01 |
Date: | 2013-01-04 |
License: | GNU |
LazyLoad: | yes |
The function HWExact runs fast Hardy-Weinburg testing for a set of bi-alleleic genotypes.
Ian Painter, University of Washington
Maintainer: Ian Painter <[email protected]>
Wigginton, JE, Cutler, DJ, and Abecasis, GR (2005) A Note on Exact Tests of Hardy-Weinberg Equilibrium. American Journal of Human Genetics. 76
This function calculates Hardy-Weinburg (Fisher's) exact p-values for GWAS SNP data.
HWExact(GenotypeCounts)
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)
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)