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.

🧬 Genetics📐 D = p_AB - p_A × p_B🧬 Biology
Frequency of haplotype AB (p_AB)
Frequency of allele A (p_A)
Frequency of allele B (p_B)
Please enter valid values.

Formula & Reference

VariableSymbolFormulaUnits
Linkage Disequilibrium Calculator—D = p_AB - p_A × p_Bdimensionless

Step-by-Step Examples

Example 1
Strong LD

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
✓ D=0.08, D'=0.44 (moderate LD), r²=0.127
Example 2
No LD

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
✓ D=0, D'=0: alleles in linkage equilibrium
Example 3
Perfect LD

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
✓ D'=1.0 means perfect association (haplotype block)

Real-World Applications

Common Mistakes to Avoid

⚠️
D vs D-prime vs r-squared

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.

⚠️
LD decays over generations

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.

⚠️
r² needed for GWAS power

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.

Frequently Asked Questions

What is linkage disequilibrium? ▾
Non-random association between alleles at two loci. If alleles A and B occur together more (or less) often than expected by chance: they are in LD. Caused by recent mutation, selection, drift, or admixture.
Why does LD exist? ▾
New mutations arise on a specific haplotype and start in complete LD with surrounding variants. Recombination breaks up LD over time. In regions with low recombination, LD extends further.
What is a haplotype block? ▾
A region of the genome showing very strong LD (D' > 0.8) with few or no recombination events within it. Blocks can span 10-100 kb. Common in regions with low recombination.
How is LD used in GWAS? ▾
Genotyping millions of SNPs creates a dense map. Disease-associated SNPs identified even if they are only in LD with the causal variant. Imputation uses LD to infer ungenotyped variants.
What is LD decay? ▾
LD decreases with physical distance between loci (more recombination opportunities). In humans: strong LD within 20-50 kb, decays to near-random at > 500 kb. Varies by population history.

Related Biology Calculators