Learn R Programming

dartR (version 1.1.11)

gl.recalc.metrics: Recalculate locus metrics when individuals or populations are deleted from a genlight {adegenet} object

Description

When individuals are deleted from a genlight object generated by DArT, the locus metrics no longer apply. For example, the Call Rate may be different considering the subset of individuals, compared with the full set. This script recalculates those affected locus metrics, namely, avgPIC, CallRate, freqHets, freqHomRef, freqHomSnp, OneRatioRef, OneRatioSnp, PICRef and PICSnp. Metrics that remain unaltered are RepAvg and TrimmedSeq as they are unaffected by the removal of individuals.

Usage

gl.recalc.metrics(x, v = 2)

Arguments

x

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

v

-- verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log ; 3, progress and results summary; 5, full report [default 2]

Value

A genlight object with the recalculated locus metadata

Details

The script optionally removes resultant monomorphic loci or loci with all values missing and deletes them (using gl.filter.monomorphs.r).

The script returns a genlight object with the recalculated locus metadata.

See Also

gl.filter.monomorphs

Examples

Run this code
# NOT RUN {
  gl <- gl.recalc.metrics(testset.gl, v=2)
# }

Run the code above in your browser using DataLab