Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

utils.prob.hwe

Exact SNP test of Hardy-Weinberg Equilibrium


Description

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.

Usage

utils.prob.hwe(obs_hets, obs_hom1, obs_hom2)

Arguments

obs_hets

– count of heterozygotes by locus

obs_hom1

– count of homozygotes, reference state

obs_hom2

– count of homozygotes, alternate state

Details

Note: return code of -1.0 signals an error condition; return code of NA signals that all alleles are NA for a locus

Value

Exact probability of agreement with HWE

Author(s)

Arthur Georges (Post to https://groups.google.com/d/forum/dartr)

Examples

hets <- 20
hom_1 <- 5
hom_2 <- 30
#p_value <- prob.hwe(hets, hom_1, hom_2)

dartR

Importing and Analysing SNP and Silicodart Data Generated by Genome-Wide Restriction Fragment Analysis

v1.9.6
GPL-2
Authors
Bernd Gruber [aut, cre], Arthur Georges [aut], Jose L. Mijangos [aut], Peter J. Unmack [ctb], Oliver Berry [ctb], Lindsay V. Clark [ctb], Floriaan Devloo-Delva [ctb]
Initial release
2021-04-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.