Skip to content

D-statistics and the ABBA-BABA test, explained

The D-statistic, or ABBA-BABA test, detects gene flow from site patterns in four populations. How it works, how to read it, and its limits.

Updated 3 min read

The D-statistic tests whether four populations fit a tree, by comparing two kinds of shared alleles: ABBA and BABA. If the tree holds, the two patterns are equally common and D is zero. If one pattern is in excess, there was gene flow, or the tree is wrong.

The test is also called the ABBA-BABA test or Patterson's D. Green et al. 2010 used it to show that people outside Africa carry Neanderthal ancestry, and Durand et al. 2011 described its statistics in detail.

The four populations

D(P1, P2; P3, Outgroup) takes four populations. The usual setup is:

  • P1 and P2: two closely related populations, for example two present-day groups.
  • P3: a population that may have exchanged genes with one of them.
  • Outgroup: a distant population that tells which allele is ancestral, for example chimpanzee or Mbuti.

ABBA and BABA

At each SNP, write A for the outgroup's allele and B for the other allele. Look only at sites where P3 carries B.

  • ABBA: P1 has A, P2 has B, P3 has B. P2 and P3 share the derived allele.
  • BABA: P1 has B, P2 has A, P3 has B. P1 and P3 share the derived allele.

Under the tree ((P1, P2), P3), both patterns come only from incomplete lineage sorting, and they are equally likely. D is their normalised difference:

D = (ABBA − BABA) / (ABBA + BABA)

With allele frequencies in place of single genomes, the same formula becomes a normalised f4-statistic.

Reading D

  • D ≈ 0 (|Z| < 3): P1 and P2 are symmetrically related to P3. The tree is consistent with the data.
  • D significantly positive: P2 shares more derived alleles with P3 than P1 does. P2 (or its ancestors) and P3 exchanged genes.
  • D significantly negative: P1 shares more with P3.

Signs depend on the order of populations, and different programs order them differently. Always state which population pair is "excess".

The Neanderthal example

Green et al. 2010 computed D with P1 and P2 as pairs of present-day humans, P3 as the Neanderthal genome and chimpanzee as the outgroup. When P1 was an African genome and P2 a European or East Asian genome, D was significantly different from zero: non-Africans share more derived alleles with Neanderthals. When both P1 and P2 were non-Africans, D was close to zero. The best explanation was interbreeding between Neanderthals and the ancestors of non-Africans.

What D cannot tell you

  • Direction. D shows that P3 is closer to one of P1 and P2, but not which way genes moved.
  • Amount. D is not an admixture proportion. Use an f4-ratio or qpAdm to estimate one.
  • Structure versus gene flow. Old population structure in the ancestors can produce a non-zero D without later gene flow.

Running D-statistics

ADMIXTOOLS runs D-statistics with qpDstat, and ADMIXTOOLS 2 with qpdstat. Nexju runs single D-statistics on every plan and f-statistic tables on the Pro plan, on the AADR's ancient and modern populations or your own genome.

References

QQuestions

Frequently asked questions

Short answers to the questions people ask most about this topic.

What does ABBA-BABA mean?

The names describe allele patterns across four genomes, where A is the outgroup's allele and B the other one. ABBA means the second and third genomes share the derived allele; BABA means the first and third do. An excess of either pattern points to gene flow.

What is a significant D-statistic?

Most studies call a D-statistic significant when its Z-score, from a block jackknife, is 3 or more in absolute value. Smaller values are consistent with the tested tree.

Is the D-statistic the same as f4?

They share the same numerator. D divides it by a normalising term, so its value is between −1 and 1, while f4 stays in units of drift. They test the same hypothesis and almost always agree.

Can a D-statistic tell the direction of gene flow?

No. It shows that one of the first two populations is closer to the third, but not which population gave and which received. Other tests, such as admixture graphs or dated segments, are needed for direction.

Every help article

Allow analytics cookies? They help us see how the site is used so we can improve it. Your DNA and results are never included. Details