utils.n.var.invariant: A utility script to calculate the number of variant and...

View source: R/utils.n.var.invariant.r

utils.n.var.invariantR Documentation

A utility script to calculate the number of variant and invariant sites by locus

Description

Calculate the number of variant and invariant sites by locus and add them as columns in loc.metrics. This can be useful to conduct further filtering, for example where only loci with secondaries are wanted for phylogenetic analyses.

Usage

utils.n.var.invariant(x, verbose = NULL)

Arguments

x

Name of the genlight object containing the SNP data [required].

verbose

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

Details

Invariant sites are the sites (nucleotide) that are not polymorphic. When the locus metadata supplied by DArT includes the sequence of the allele (TrimmedSequence), it is used by this function to estimate the number of sites that were sequenced in each tag (read). This script then subtracts the number of polymorphic sites. The length of the trimmed sequence (lenTrimSeq), the number of variant (n.variant) and invariant (n.invariant) sites are the added to the table in gl@others$loc.metrics.

NOTE: It is important to realise that this function correctly estimates the number of variant and invariant sites only when it is executed on genlight objects before secondaries are removed.

Value

The modified genlight object.

Author(s)

Carlo Pacioni (Post to https://groups.google.com/d/forum/dartr)

See Also

gl.filter.secondaries,gl.report.heterozygosity

Examples

require("dartR.data")
out <- utils.n.var.invariant(platypus.gl)

dartR documentation built on June 8, 2023, 6:48 a.m.