Linkage disequilibrium from gamete counts
Four haplotype counts give D, D′, r² and a chi-square test of whether two loci are associated.
Read first: Genotype frequencies and Hardy-Weinberg
Four gametes, two loci
Take two loci on one chromosome. Locus A has alleles A and a, locus B has alleles B and b. A gamete carries one allele at each locus, so there are four gamete types: AB, Ab, aB and ab. The module takes a count of each type and works out whether the two loci are associated.
Start with what independence predicts. If the allele at B tells you nothing about the allele at A, the frequency of a gamete is the product of its allele frequencies: f(AB) = pA × pB, f(Ab) = pA × pb, and so on. This state is linkage equilibrium. Any departure from it is linkage disequilibrium (LD).
The default counts are 230 AB, 270 Ab, 120 aB and 380 ab, so N = 1000. Allele A is in 230 + 270 = 500 gametes, so pA = 0.5. Allele B is in 230 + 120 = 350 gametes, so pB = 0.35. Independence predicts 0.5 × 0.35 = 0.175 for AB, which is 175 gametes. The sample has 230.
Observed against expected counts
D and the chi-square test
The disequilibrium coefficient is D = f(AB) × f(ab) − f(Ab) × f(aB). It also equals f(AB) − pA × pB. For the defaults, D = 0.23 × 0.38 − 0.27 × 0.12 = 0.0874 − 0.0324 = 0.055. Multiply by N and you get the 55 gametes of excess in the figure. Every bar is off by exactly D: plus D for AB and ab, minus D for Ab and aB. Both loci keep their allele frequencies, so what AB gains, Ab and aB lose.
D depends on allele frequencies, so it is hard to compare across pairs of loci. The squared correlation r² = D² / (pA × pa × pB × pb) rescales it. Here r² = 0.0532. The test statistic is chi-square = N × r², with one degree of freedom. For the defaults that is 1000 × 0.0532 = 53.19. The 5% critical value is 3.84, so these loci are clearly not independent.
Exercise
Run the defaults, then shrink the sample
Open the module and press Run with the default counts. Read D, r² and Chi². Then enter 23, 27, 12 and 38, which are the defaults divided by ten, and run again.
What to expect. The defaults give D = 0.055, r² = 0.0532 and chi-square = 53.19. The small sample gives the same D and r², but chi-square falls to 5.32. It is still above 3.84.
Open the walkthrough step →D′: how much of the possible D is used
D cannot take any value. Given the allele frequencies, there is a largest D the sample could have. For positive D it is the smaller of pA × pb and pa × pB. For the defaults that is the smaller of 0.5 × 0.65 = 0.325 and 0.5 × 0.35 = 0.175, so D max = 0.175.
Lewontin's D′ is D divided by D max: 0.055 / 0.175 = 0.314. D′ = 1 means at least one of the four gametes is missing. D′ = 0 means linkage equilibrium. The sign says which pair of gametes is in excess: negative D means Ab and aB are over-represented (repulsion).
D′ and r² answer different questions. D′ asks whether recombination has ever separated the alleles. r² asks how well one locus predicts the other. They disagree when allele frequencies differ.
A missing haplotype
Exercise
Perfect association and equilibrium
Enter 50, 0, 0 and 50 and run. Then enter 175, 325, 175 and 325 and run again.
What to expect. The first sample gives D = 0.25, D′ = 1, r² = 1 and chi-square = 100. The second gives D = 0 and chi-square = 0, because observed equals expected.
Open the walkthrough step →What to keep
- D = f(AB) × f(ab) − f(Ab) × f(aB) measures how far the gametes are from the product of the allele frequencies. Every gamete bar is off by D.
- Chi-square = N × r² with one degree of freedom. It scales with N, so it measures detectability, not strength.
- D′ = D / D max reaches 1 when a gamete type is missing. r² reaches 1 only when the two loci have matching allele frequencies and just two gamete types.
- The defaults give D = 0.055, D′ = 0.314, r² = 0.0532 and chi-square = 53.19. This module has no time axis: Magnitude of D shows how recombination removes D.