gl.keep.loc | R Documentation |
This function deletes loci that are not specified to keep, and their associated metadata.
The script returns a dartR genlight object with the retained loci. The script works with both genlight objects containing SNP genotypes and Tag P/A data (SilicoDArT).
gl.keep.loc(x, loc.list = NULL, first = NULL, last = NULL, verbose = NULL)
x |
Name of the genlight object [required]. |
loc.list |
A list of loci to be kept [required, if loc.range not specified]. |
first |
First of a range of loci to be kept [required, if loc.list not specified]. |
last |
Last of a range of loci to be kept [if not specified, last locus in the dataset]. |
verbose |
Verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress but not results; 3, progress and results summary; 5, full report [default 2 or as specified using gl.set.verbosity]. |
A genlight object with the reduced data
Custodian: Arthur Georges – Post to https://groups.google.com/d/forum/dartr
gl.drop.loc
to drop rather than keep specified loci
Other dartR-base:
gl.drop.ind()
,
gl.drop.loc()
,
gl.drop.pop()
,
gl.edit.recode.ind()
,
gl.edit.recode.pop()
,
gl.make.recode.ind()
,
gl.read.dart()
,
gl.recode.ind()
,
gl.recode.pop()
,
gl.set.verbosity()
# SNP data
gl2 <- gl.keep.loc(testset.gl, loc.list=c('100051468|42-A/T', '100049816-51-A/G'))
# Tag P/A data
gs2 <- gl.keep.loc(testset.gs, loc.list=c('20134188','19249144'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.