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.
gl.filter.hwe(x, alpha = 0.05, basis = "any", bon = TRUE, v = 2)
-- a genlight object containing the SNP genotypes [Required]
-- level of significance (per locus) [Default 0.05]
-- basis for filtering out loci (any, HWE departure in any one population) [default basis="any"]
-- apply bonferroni correction to significance levels for filtering [default TRUE]
-- verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log ; 3, progress and results summary; 5, full report [default 2]
a genlight object with the loci departing significantly from HWE removed
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).
# NOT RUN {
list <- gl.filter.hwe(testset.gl, 0.05, bon=TRUE)
# }
Run the code above in your browser using DataLab