gl.filter.hwe {dartR.base}R Documentation

Filters loci that show significant departure from Hardy-Weinberg Equilibrium @family matched filter

Description

This function filters out loci showing significant departure from H-W proportions based on observed frequencies of reference homozygotes, heterozygotes and alternate homozygotes. Loci are filtered out if they show HWE departure either in any one population (n.pop.threshold =1) or in at least X number of populations (n.pop.threshold > 1).

Usage

gl.filter.hwe(
  x,
  subset = "each",
  n.pop.threshold = 1,
  test.type = "Exact",
  mult.comp.adj = FALSE,
  mult.comp.adj.method = "BY",
  alpha = 0.05,
  pvalue.type = "midp",
  cc.val = 0.5,
  n.min = 5,
  verbose = NULL
)

Arguments

x

Name of the genlight object containing the SNP data [required].

subset

Way to group individuals to perform H-W tests. Either a vector with population names, 'each', 'all' (see details) [default 'each'].

n.pop.threshold

The minimum number of populations where the same locus has to be out of H-W proportions to be removed [default 1].

test.type

Method for determining statistical significance: 'ChiSquare' or 'Exact' [default 'Exact'].

mult.comp.adj

Whether to adjust p-values for multiple comparisons [default FALSE].

mult.comp.adj.method

Method to adjust p-values for multiple comparisons: 'holm', 'hochberg', 'hommel', 'bonferroni', 'BH', 'BY', 'fdr' (see details) [default 'fdr'].

alpha

Level of significance for testing [default 0.05].

pvalue.type

Type of p-value to be used in the Exact method. Either 'dost','selome','midp' (see details) [default 'midp'].

cc.val

The continuity correction applied to the ChiSquare test [default 0.5].

n.min

Minimum number of individuals per population in which perform H-W tests [default 5].

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

Several factors can cause deviations from Hardy-Weinberg equilibrium including: mutation, finite population size, selection, population structure, age structure, assortative mating, sex linkage, nonrandom sampling and genotyping errors. Refer to Waples (2015). Note that tests for departure from H-W equilibrium are only valid if there is no population substructure (assuming random mating) and have sufficient power only when there is sufficient sample size (n individuals > 15). Populations can be defined in three ways:

Two different statistical methods to test for deviations from Hardy Weinberg proportions:

Correction for multiple tests can be applied using the following methods based on the function p.adjust:

The first four methods are designed to give strong control of the family-wise error rate. The last two methods control the false discovery rate (FDR), the expected proportion of false discoveries among the rejected hypotheses. The false discovery rate is a less stringent condition than the family-wise error rate, so these methods are more powerful than the others, especially when number of tests is large. The number of tests on which the adjustment for multiple comparisons is the number of populations times the number of loci. From v2.1 gl.filter.hwe takes the argument n.pop.threshold. if n.pop.threshold > 1 loci will be removed only if they are concurrently significant (after adjustment if applied) out of hwe in >= n.pop.threshold > 1.

Value

A genlight object with the loci departing significantly from H-W proportions removed.

Author(s)

Custodian: Luis Mijangos – Post to https://groups.google.com/d/forum/dartr

References

See Also

gl.report.hwe

Other filter functions: gl.filter.allna()

Examples

result <- gl.filter.hwe(x = bandicoot.gl)

[Package dartR.base version 0.65 Index]