Package 'GWASExactHW'

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

Help Index


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 <[email protected]>

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)