Learn R Programming

dartR (version 1.9.9.1)

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]

Value

The reduced genlight dataset

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.

Examples

Run this code
# NOT RUN {
result <- gl.filter.monomorphs(testset.gl)
result <- gl.filter.maf(result, threshold=0.05, verbose=3)
# }

Run the code above in your browser using DataLab