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

gl.report.hwe

Reports departure from Hardy-Weinberg Equilibrium


Description

Calculates the probabilities of agreement with H-W equilibrium based on observed frequencies of reference homozygotes, heterozygotes and alternate homozygotes. Uses the exact calculations contained in function utils.prob.hwe() as developed by Wigginton et al. (2005).

Usage

gl.report.hwe(
  x,
  subset = "each",
  plot = FALSE,
  method = "ChiSquare",
  alpha = 0.05,
  bonf = TRUE,
  verbose = NULL
)

Arguments

x

– a genlight object containing the SNP genotypes [Required]

subset

– either, list populations to combine in the analysis | each | all [Default "each"]

plot

– if TRUE, will produce a Ternary Plot(s) [default FALSE]

method

– for determining the statistical signicance in the ternary plot: ChiSquare (with continuity correction) | Fisher [default "ChiSquare"]

alpha

– level of significance for testing [default 0.05]

bonf

– if TRUE, Bonferroni correction will be applied to the level of significance [default TRUE]

verbose

– verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log ; 3, progress and results summary; 5, full report [default 2 or as specified using gl.set.verbosity]

Details

Tests are applied to each locus across all populations pooled (subset="all"), to each locus considered within each population treated separately (subset="each") or to each locus within selected populations pooled (subset=c("pop1","pop2")). Tests for HWE are only valid if there is no population substructure (assuming random mating), and the tests have sufficient power only when there is sufficient sample size (say, n individuals > 20). Note also that correction for multiple comparisons is probably required if you wish to place particular importance on one or a few significant departures.

A Ternary Plot is optionally produced – see Graffelman et al.(2008) for further details. Implementation of the Ternary Plot is via package HardyWeinberg (Graffelman (2015). The plot labels loci that depart significantly from HWE as red, and those not showing significant departure as green. Two methods are used to determine significance. ChiSquare (with correction) is traditional but involves approximations; Fisher is computationally more expensive, but applies a Fisher Exact Test of departure from HWE.

Value

returns a dataframe containing loci, counts of reference SNP homozygotes, heterozygotes and alternate SNP homozygotes; probability of departure from H-W equilibrium, and per locus significance with and without Bonferroni Correction.

Author(s)

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

References

Wigginton, J.E., Cutler, D.J., & Abecasis, G.R. (2005). A Note on Exact Tests of Hardy-Weinberg Equilibrium. American Journal of Human Genetics 76:887-893.

Graffelman, J. & Morales-Camarena, J. (2008). Graphical tests for Hardy-Weinberg equilibrium based on the ternary plot. Human Heredity 65:77-84.

Graffelman, J. (2015). Exploring Diallelic Genetic Markers: The HardyWeinberg Package. Journal of Statistical Software 64:1-23.

Examples

list <- gl.report.hwe(testset.gl,subset=c("EmmacMaclGeor", "EmmacCoopCully"),plot=TRUE,bonf=FALSE)
gl.report.hwe(testset.gl,subset=c("EmmacCoopCully"), plot=TRUE, verbose=3)
gl.report.hwe(testset.gl,subset="all", plot=TRUE, bonf=FALSE, verbose=3)
gl.report.hwe(testset.gl, subset="each", plot=TRUE, bonf=FALSE)

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.