This function deletes individuals 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.drop.loc(
x,
loc.list = NULL,
first_tmp = NULL,
last_tmp = NULL,
verbose = NULL
)
Name of the genlight object [required].
A list of loci to be deleted [required, if loc.range not specified].
First of a range of loci to be deleted [required, if loc.list not specified].
Last of a range of loci to be deleted [if not specified, last_tmp locus in the dataset].
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 reduced dartR genlight object
gl.keep.loc
to keep rather than drop specified loci
Other dartR-base:
gl.drop.ind()
,
gl.drop.pop()
,
gl.edit.recode.ind()
,
gl.edit.recode.pop()
,
gl.keep.loc()
,
gl.make.recode.ind()
,
gl.read.dart()
,
gl.recode.ind()
,
gl.recode.pop()
,
gl.set.verbosity()
# SNP data
gl2 <- gl.drop.loc(testset.gl, loc.list=c('100051468|42-A/T', '100049816-51-A/G'),verbose=3)
#> Starting gl.drop.loc
#> Processing genlight object with SNP data
#> List of loci to drop has been specified
#> Warning: Listed loci 100049687-12-C/T not present in the dataset -- ignored
#> Deleting the specified loci
#> Summary of recoded dataset
#> Original No. of loci: 255
#> No. of loci deleted: 1
#> No. of loci retained: 254
#> Completed: gl.drop.loc
#>
# Tag P/A data
gs2 <- gl.drop.loc(testset.gs, loc.list=c('20134188','19249144'),verbose=3)
#> Starting gl.drop.loc
#> Processing genlight object with Presence/Absence (SilicoDArT) data
#> List of loci to drop has been specified
#> Deleting the specified loci
#> Summary of recoded dataset
#> Original No. of loci: 255
#> No. of loci deleted: 2
#> No. of loci retained: 253
#> Completed: gl.drop.loc
#>