View source: R/utils.n.var.invariant.r
utils.n.var.invariant | R Documentation |
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.
utils.n.var.invariant(x, verbose = NULL)
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]. |
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.
The modified genlight object.
Carlo Pacioni (Post to https://groups.google.com/d/forum/dartr)
gl.filter.secondaries
,gl.report.heterozygosity
require("dartR.data")
out <- utils.n.var.invariant(platypus.gl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.