gl.filter.secondaries: Filters loci that represent secondary SNPs in a genlight...

View source: R/gl.filter.secondaries.r

gl.filter.secondariesR Documentation

Filters loci that represent secondary SNPs in a genlight object

Description

SNP datasets generated by DArT include fragments with more than one SNP and record them separately with the same CloneID (=AlleleID). These multiple SNP loci within a fragment (secondaries) are likely to be linked, and so you may wish to remove secondaries.

This script filters out all but one locus of those sharing the same CloneID, retaining the SNP with the highest repeatability (RepAvg), and on ties the highest AvgPIC (method='best'), or retaining one at random (method='random').

Usage

gl.filter.secondaries(x, method = "random", verbose = NULL)

Arguments

x

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

method

Method of selecting SNP locus to retain, 'best' or 'random' [default 'random'].

verbose

Verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log; 3, progress and results summary; 5, full report [default NULL, adopting the global verbosity set by gl.set.verbosity(), or 2 if no global is set].

Details

The filter has not been implemented for tag presence/absence data.

With method='random' the choice of SNP retained depends on the state of the random number generator; use set.seed() beforehand if reproducibility is required. The locus order of the input object is preserved in the output.

Value

The genlight object, with the secondary SNP loci removed.

Author(s)

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

See Also

gl.report.secondaries

Other matched filter: gl.filter.allna(), gl.filter.callrate(), gl.filter.contamination(), gl.filter.excess.het(), gl.filter.factorloadings(), gl.filter.hamming(), gl.filter.heterozygosity(), gl.filter.hwe(), gl.filter.ld(), gl.filter.locmetric(), gl.filter.maf(), gl.filter.monomorphs(), gl.filter.overshoot(), gl.filter.pa(), gl.filter.rdepth(), gl.filter.replicates(), gl.filter.replicates.KING(), gl.filter.reproducibility(), gl.filter.taglength()

Examples

require("dartR.data")
if (isTRUE(getOption("dartR_fbm"))) platypus.gl <- gl.gen2fbm(platypus.gl)
gl.report.secondaries(platypus.gl)
result <- gl.filter.secondaries(platypus.gl)

dartR.base documentation built on Nov. 18, 2026, 9:06 a.m.