Algorithm Search⌘K

Definitioncore

Nucleotide diversity

Also called Tajima's pi, mean pairwise difference.

The average number of differences per site between two sequences drawn from a sample, an estimator of theta under neutrality.

Nucleotide diversity is the average number of differences between two sequences drawn at random from a sample, per site of the aligned region or per locus. Nei and Li defined it in 1979, and it is the most common measure of genetic variation in DNA data. Under the neutral infinite sites model, the per-locus value is an unbiased estimator of θ=4Nμ\theta = 4N\mu (Tajima 1983). It weights each segregating site by how evenly its two alleles split the sample, so it gives a different view of the same data than Watterson's estimator, and Tajima's D compares the two.

Definition

Take n≥2n \ge 2 aligned sequences of mm sites each. Let djkd_{jk} be the number of sites at which sequences jj and kk carry different bases. The mean pairwise difference of the sample is

π^=(n2)−1∑j<kdjk,\hat\pi = \binom{n}{2}^{-1} \sum_{j < k} d_{jk},

and the nucleotide diversity per site is π^/m\hat\pi / m. Both are called π\pi in the literature; a value below 1, such as 0.0010.001, is per site, and a value such as 33 is per locus. This page writes π^\hat\pi for the per-locus value.

Nei and Li stated the population version with haplotype frequencies. If haplotype ii has frequency xix_i and haplotypes ii and jj differ at a fraction πij\pi_{ij} of the sites, then π=∑i,jxixjπij\pi = \sum_{i, j} x_i x_j \pi_{ij}, the expected fraction of differing sites between two copies drawn with replacement. The sample version with the sample frequencies is multiplied by n/(n−1)n / (n - 1), to count pairs of two distinct copies. That gives the formula above, divided by mm.

As a sum over sites. A site where cc of the nn sequences carry one allele and n−cn - c the other separates exactly c(n−c)c(n - c) pairs. So

π^=(n2)−1∑sitescj(n−cj)=(n2)−1∑i=1n−1i(n−i) ξi,\hat\pi = \binom{n}{2}^{-1} \sum_{\text{sites}} c_j (n - c_j) = \binom{n}{2}^{-1} \sum_{i=1}^{n-1} i (n - i)\, \xi_i,

where ξi\xi_i is the site frequency spectrum. This takes O(nm)O(n m) time from the counts, against O(n2m)O(n^2 m) for the sum over pairs, and it does not need to know which allele is ancestral, because i(n−i)i(n - i) is the same for ii and n−in - i.

Expectation (Tajima 1983). Under the neutral infinite sites model with constant size, E[π^]=θE[\hat\pi] = \theta.

Proof. Each djkd_{jk} is the number of mutations on the path between jj and kk in the Kingman coalescent tree. The two lineages coalesce at rate 1, so the path has two branches of mean length 11 in units of 2N2N generations, and mutations fall at rate θ/2\theta/2 per branch. So E[djk]=2⋅1⋅θ/2=θE[d_{jk}] = 2 \cdot 1 \cdot \theta / 2 = \theta, and the mean of the (n2)\binom{n}{2} terms has the same expectation. □\square

The same result follows from the spectrum: (n2)−1∑ii(n−i)θ/i=(n2)−1θ∑i=1n−1(n−i)=θ\binom{n}{2}^{-1} \sum_i i(n - i) \theta / i = \binom{n}{2}^{-1} \theta \sum_{i=1}^{n-1} (n - i) = \theta.

Variance (Tajima 1983). Without recombination,

Var⁡[π^]=n+13(n−1)θ+2(n2+n+3)9n(n−1)θ2.\operatorname{Var}[\hat\pi] = \frac{n + 1}{3(n - 1)} \theta + \frac{2(n^2 + n + 3)}{9 n (n - 1)} \theta^2.

For n=2n = 2 this is θ+θ2\theta + \theta^2, the variance of the geometric law of the number of differences between two sequences. As n→∞n \to \infty it tends to θ/3+2θ2/9\theta/3 + 2\theta^2/9, not to 0: all pairs share one genealogy, and more sequences do not remove the randomness of the deep branches. For θ=5\theta = 5 the variance is 11.66711.667 at n=5n = 5, 9.0129.012 at n=10n = 10 and 7.5247.524 at n=50n = 50. Watterson's estimator has the variance θ/an+θ2bn/an2\theta / a_n + \theta^2 b_n / a_n^2, which is 10.60010.600, 6.5776.577 and 3.1413.141 at the same sample sizes and does tend to 0, slowly. So π^\hat\pi has the larger variance, and it is the less efficient estimator of θ\theta under the neutral model. Recombination lowers both variances, because sites then have partly independent trees.

Examples and non-examples

A sample of five. The matrix of the infinite sites model page,

copy s1 s2 s3 s4 s5 s6
1 1 0 0 0 0 1
2 1 0 0 0 0 0
3 0 1 0 1 0 0
4 0 0 1 1 0 0
5 0 0 1 1 1 0

has these pairwise differences:

pair 1,2 1,3 1,4 1,5 2,3 2,4 2,5 3,4 3,5 4,5
djkd_{jk} 1 4 4 5 3 3 4 2 3 1

The sum is 30, so π^=30/10=3\hat\pi = 30 / 10 = 3. By sites, the counts (2,1,2,3,1,1)(2, 1, 2, 3, 1, 1) give c(5−c)=(6,4,6,6,4,4)c(5 - c) = (6, 4, 6, 6, 4, 4), again a sum of 30. If the six sites lie in a region of m=1000m = 1000 aligned bases, the nucleotide diversity per site is 0.0030.003. Watterson's estimate from the same data is 6/a5=2.886 / a_5 = 2.88.

Scale. In humans, nucleotide diversity per site is about 0.0010.001: two copies of a genome differ at about one site in a thousand.

Non-examples.

  • The number of segregating sites SS is not π^\hat\pi. A singleton adds 11 to SS and only 2/n2/n to π^\hat\pi; a site with a 50:50 split adds 11 to SS and about 1/2⋅n/(n−1)1/2 \cdot n/(n - 1) to π^\hat\pi.
  • The fraction of sites that differ between two sequences of two species is a divergence, not a diversity. Under a substitution model it needs a correction for multiple hits, such as Jukes-Cantor, before it estimates a distance. Within a species the per-site values are small, and the correction is usually skipped.
  • Gene diversity (expected heterozygosity) 1−∑ixi21 - \sum_i x_i^2 counts whether two copies differ at all at a locus, not at how many sites. It belongs to the infinite alleles model.
  • Watterson's estimator S/anS / a_n, another unbiased estimator of θ\theta; see Watterson's estimator.
  • Tajima's D is (π^−S/an)(\hat\pi - S / a_n) divided by an estimate of its standard deviation; see Tajima's D. A deficit of intermediate-frequency sites makes π^\hat\pi small next to S/anS / a_n and DD negative.
  • Between-population diversity dXYd_{XY}: the mean number of differences per site between one sequence from population XX and one from population YY. With the within-population values it gives measures of differentiation such as the fixation index.
  • Per-site values with missing data. When some sequences have no base at some sites, a common definition sums, over the sites, the fraction of differing pairs among the pairs with data at that site, and divides by the number of sites with data. Tools differ in which sites they count in the denominator (all sites of the region, or only the sites with data), and the two choices give different values.

References

  1. Masatoshi Nei and Wen-Hsiung Li, Mathematical model for studying genetic variation in terms of restriction endonucleases, Proceedings of the National Academy of Sciences USA 76(10), 1979, pp. 5269-5273 (the definition of nucleotide diversity as the mean number of differences per site between two sequences)
  2. Fumio Tajima, Evolutionary relationship of DNA sequences in finite populations, Genetics 105(2), 1983, pp. 437-460 (the mean and the variance of the average number of pairwise differences in a sample)
  3. John Wakeley, Coalescent Theory, An Introduction, Roberts and Company, 2009, Chapter 4 (pairwise differences and estimators of theta)

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/SPH0ZW/text.yaml