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

gl.filter.maf

Filter loci on the basis of minor allele frequency (MAF) in a genlight adegenet object


Description

This script calculates the minor allele frequency for each locus and updates the locus metadata for FreqHomRef, FreqHomSnp, FreqHets and MAF (if it exists). It then uses the updated metadata for MAF to filter loci.

Usage

gl.filter.maf(x, threshold = 0.01, verbose = NULL)

Arguments

x

– name of the genlight object containing the SNP data [required]

threshold

– threshold MAF – loci with a MAF less than the threshold will be removed [default 0.01]

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

Note the this filter applies to MAF calculated across all individuals, without regard to population structure. It is a means of removing overall rare alleles. To apply this to single populations, use sepPop and lapply.

Value

The reduced genlight dataset

Author(s)

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

Examples

result <- gl.filter.monomorphs(testset.gl)
result <- gl.filter.maf(result, threshold=0.05, 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.