Type: Package
Title: Exact Hardy-Weinburg Testing for Genome Wide Association Studies
Version: 1.2
Date: 2024-03-11
Author: Ian Painter, University of Washington
Maintainer: Stephanie Gogarten <sdmorris@uw.edu>
Description: Exact Hardy-Weinburg testing (using Fisher's test) for SNP genotypes as typically obtained in a Genome Wide Association Study (GWAS).
License: GPL-3
LazyLoad: yes
Repository: CRAN
NeedsCompilation: yes
Packaged: 2024-03-12 03:48:51 UTC; stephanie
Date/Publication: 2024-03-12 07:00:02 UTC

Exact Hardy-Weinburg testing for Genome Wide Association Studies

Description

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).

Details

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.

Author(s)

Ian Painter, University of Washington

Maintainer: Ian Painter <ipainter@u.washington.edu>

References

Wigginton, JE, Cutler, DJ, and Abecasis, GR (2005) A Note on Exact Tests of Hardy-Weinberg Equilibrium. American Journal of Human Genetics. 76


Function to calculate Hardy-Weinburg exact p-values

Description

This function calculates Hardy-Weinburg (Fisher's) exact p-values for GWAS SNP data.

Usage

HWExact(GenotypeCounts)

Arguments

GenotypeCounts

A dataframe of genotype counts, with columns called nAA, nAa and naa, one row for each SNP.

Value

A vector of exact p-values.

Note

This function uses a C function SNPHWE.c written by Jan Wigginton as described in the above reference.

Author(s)

Ian Painter

References

Wigginton, JE, Cutler, DJ, and Abecasis, GR (2005) A Note on Exact Tests of Hardy-Weinberg Equilibrium. American Journal of Human Genetics. 76

Examples


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)