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

gl.filter.hwe

Filters loci that show significant 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 prob.hwe() as developed by Wigginton, JE, Cutler, DJ, and Abecasis, GR.

Usage

gl.filter.hwe(x, alpha = 0.05, basis = "any", bon = TRUE, verbose = NULL)

Arguments

x

– a genlight object containing the SNP genotypes [Required]

alpha

– level of significance (per locus) [Default 0.05]

basis

– basis for filtering out loci (any, HWE departure in any one population) [default basis="any"]

bon

– apply bonferroni correction to significance levels for filtering [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, unless specified using gl.set.verbosity]

Details

Input is a genlight adegenet object containing SNP genotypes (0 homozygous for reference SNP, 1 heterozygous, 2 homozygous for alternate SNP).

Loci are filtered if they show HWE departure in any one population. Note that power to detect departures from HWE is affected by sample size and that effective filtering may require substantial sample sizes (n > 20).

Value

a genlight object with the loci departing significantly from HWE removed

Author(s)

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

Examples

result <- gl.filter.hwe(testset.gl, 0.05, bon=TRUE, verbose=3)

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.