Filter loci on the basis of minor allele frequency (MAF) in a genlight adegenet object
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.
gl.filter.maf(x, threshold = 0.01, verbose = NULL)
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] |
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.
The reduced genlight dataset
Arthur Georges (Post to https://groups.google.com/d/forum/dartr)
result <- gl.filter.monomorphs(testset.gl) result <- gl.filter.maf(result, threshold=0.05, verbose=3)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.