]> git.donarmstrong.com Git - ape.git/blob - man/nuc.div.Rd
current 2.1 release
[ape.git] / man / nuc.div.Rd
1 \name{nuc.div}
2 \alias{nuc.div}
3 \title{Nucleotide Diversity}
4 \description{
5   This function computes the nucleotide diversity from a sample of DNA
6   sequences.
7 }
8 \usage{
9 nuc.div(x, variance = FALSE, pairwise.deletion = FALSE)
10 }
11 \arguments{
12   \item{x}{a matrix or a list which contains the DNA sequences.}
13   \item{variance}{a logical indicating whether to compute the variance
14     of the estimated nucleotide diversity.}
15   \item{pairwise.deletion}{a logical indicating whether to delete the
16     sites with missing data in a pairwise way. The default is to delete
17     the sites with at least one missing data for all sequences.}
18 }
19 \details{
20   The nucleotide diversity is the sum of the number of differences
21   between pairs of sequences divided by the number of comparisons
22   (i.e. n(n - 1)/2, where n is the number of sequences).
23
24   The variance of the estimated diversity uses formula (10.9) from Nei
25   (1987). This applies only if all sequences are of the same lengths,
26   and cannot be used if \code{pairwise.deletion = TRUE}. A bootstrap
27   estimate may be in order if you insist on using the latter option.
28 }
29 \value{
30   A numeric vector with one or two values (if \code{variance = TRUE}).
31 }
32 \references{
33   Nei, M. (1987) \emph{Molecular evolutionary genetics}. New York:
34   Columbia University Press.
35 }
36 \author{Emmanuel Paradis \email{Emmanuel.Paradis@mpl.ird.fr}}
37 \seealso{
38   \code{\link{base.freq}}, \code{\link{GC.content}},
39   \code{\link{theta.s}}, \code{\link{seg.sites}}
40 }
41 \examples{
42 data(woodmouse)
43 nuc.div(woodmouse)
44 nuc.div(woodmouse, TRUE)
45 nuc.div(woodmouse, FALSE, TRUE)
46 }
47 \keyword{manip}
48 \keyword{univar}