Learn R Programming

dartR (version 1.9.9.1)

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

Value

Exact probability of agreement with HWE

Details

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

Examples

Run this code
# NOT RUN {
hets <- 20
hom_1 <- 5
hom_2 <- 30
#p_value <- prob.hwe(hets, hom_1, hom_2)
# }

Run the code above in your browser using DataLab