Linkage Disequilibrium Calculator
Calculate linkage disequilibrium (D, D-prime, r-squared) between two loci from haplotype frequencies. LD measures non-random allele associations and is key to GWAS and population genetics.
Formula & Reference
| Variable | Symbol | Formula | Units |
|---|---|---|---|
| Linkage Disequilibrium Calculator | — | D = p_AB - p_A × p_B | dimensionless |
Step-by-Step Examples
p_AB=0.50, p_A=0.60, p_B=0.70.
- D = 0.50 - 0.60 x 0.70 = 0.50 - 0.42 = 0.08
- D_max = min(0.60 x 0.30, 0.40 x 0.70) = min(0.18, 0.28) = 0.18
- D' = 0.08/0.18 = 0.44 (moderate LD)
- r² = 0.08²/(0.60 x 0.40 x 0.70 x 0.30) = 0.0064/0.0504 = 0.127
p_AB = p_A x p_B = random association.
- If p_A=0.6, p_B=0.7: no LD means p_AB = 0.42
- D = 0.42 - 0.60 x 0.70 = 0
- D' = 0, r² = 0
- Alleles at the two loci are randomly associated
p_A = p_B = p_AB = 0.60 (one haplotype dominates).
- D = 0.60 - 0.60 x 0.60 = 0.60 - 0.36 = 0.24
- D' = 1.0 (maximum LD)
- r² depends on allele frequencies
Real-World Applications
Common Mistakes to Avoid
D: raw LD measure, dependent on allele frequencies. D': normalized D, measures maximum LD. r²: squared correlation, most relevant for GWAS power. r² < D' usually.
Each generation of recombination reduces LD. Dt = D0 x (1-r)^t where r is recombination fraction. New mutations start in complete LD with surrounding variants.
If a SNP has r² = 0.8 with the causal variant, you need ~1/0.8 = 1.25x the sample size compared to directly testing causal variant.