View source: R/gl.recode.ind.r
gl.recode.ind | R Documentation |
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.
gl.recode.ind(x, ind.recode, recalc = FALSE, mono.rm = FALSE, verbose = NULL)
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]. |
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.
A genlight or genind object with the recoded and reduced data.
Custodian: Arthur Georges – Post to https://groups.google.com/d/forum/dartr
gl.filter.monomorphs
for filtering monomorphs,
gl.recalc.metrics
for recalculating locus metrics,
gl.recode.pop
for recoding populations
file <- system.file('extdata','testset_ind_recode.csv', package='dartR')
gl <- gl.recode.ind(testset.gl, ind.recode=file, verbose=3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.