nuc.div

0th

Percentile

Nucleotide Diversity

This function computes the nucleotide diversity from a sample of DNA sequences.

Keywords
manip, univar
Usage
nuc.div(x, variance = FALSE, pairwise.deletion = FALSE)
Arguments
x
a matrix or a list which contains the DNA sequences.
variance
a logical indicating whether to compute the variance of the estimated nucleotide diversity.
pairwise.deletion
a logical indicating whether to delete the sites with missing data in a pairwise way. The default is to delete the sites with at least one missing data for all sequences.
Details

The nucleotide diversity is the sum of the number of differences between pairs of sequences divided by the number of comparisons (i.e. n(n - 1)/2, where n is the number of sequences).

The variance of the estimated diversity uses formula (10.9) from Nei (1987). This applies only if all sequences are of the same lengths, and cannot be used if pairwise.deletion = TRUE. A bootstrap estimate may be in order if you insist on using the latter option.

Value

  • A numeric vector with one or two values (if variance = TRUE).

References

Nei, M. (1987) Molecular evolutionary genetics. New York: Columbia University Press.

See Also

base.freq, GC.content, theta.s, seg.sites

Aliases
  • nuc.div
Examples
data(woodmouse)
nuc.div(woodmouse)
nuc.div(woodmouse, TRUE)
nuc.div(woodmouse, FALSE, TRUE)
Documentation reproduced from package ape, version 2.1-1, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.