Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gl.recode.ind

Recode individual (=specimen = sample) labels in a genelight object {adegenet}


Description

This script recodes individual labels and/or deletes individuals from a DaRT genlight SNP file based on a lookup table provided as a csv file.

Usage

gl.recode.ind(x, ind.recode, recalc = FALSE, mono.rm = FALSE, verbose = NULL)

Arguments

x

– name of the genlight object containing SNP genotypes [required]

ind.recode

– name of the csv file containing the individual relabelling [required]

recalc

– if TRUE, recalculate the locus metadata statistics if any individuals are deleted in the filtering [default FALSE]

mono.rm

– if TRUE, remove monomorphic loci [default FALSE]

verbose

– verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log ; 3, progress and results summary; 5, full report [default 2 or as specified using gl.set.verbosity]

Details

Renaming individuals may be required when there have been errors in labelling arising in the process from sample to DArT files. There may be occasions where renaming individuals is required for preparation of figures. When caution needs to be exercised because of the potential for breaking the "chain of evidence" associated with the samples, recoding individuals using a recode table (csv) can provide a clear record of the changes.

The script, having deleted individuals, optionally identifies resultant monomorphic loci or loci with all values missing and deletes them (using gl.filter.monomorphs.r). The script also optionally recalculates statistics made incorrect by the deletion of individuals from the dataset.

The script returns a genlight object with the new individual labels, the monomorphic loci optionally removed and the optionally recalculated locus metadata.

Value

A genlight or genind object with the recoded and reduced data

Author(s)

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

See Also

gl.filter.monomorphs for filtering monomorphs, gl.recalc.metrics for recalculating locus metrics, gl.recode.pop for recoding populations

Examples

file <- system.file("extdata","testset_pop_recode.csv", package="dartR")
  #gl <- gl.recode.ind(testset.gl, ind.recode=file, verbose=0)

dartR

Importing and Analysing SNP and Silicodart Data Generated by Genome-Wide Restriction Fragment Analysis

v1.9.6
GPL-2
Authors
Bernd Gruber [aut, cre], Arthur Georges [aut], Jose L. Mijangos [aut], Peter J. Unmack [ctb], Oliver Berry [ctb], Lindsay V. Clark [ctb], Floriaan Devloo-Delva [ctb]
Initial release
2021-04-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.