Allele frequency dynamics: Hardy-Weinberg, selection, and drift

Allele frequencies change between generations under the joint action of mutation, selection, drift, and migration. This page is the technical companion to the population and evolutionary genetics pillar, covering the Hardy-Weinberg equilibrium and its assumptions, the chi-square test for deviation from HWE, the Wahlund effect, selection (positive, negative, balancing) with selection coefficients and worked examples, mutation-selection balance for recessive disease, the Wright-Fisher model and effective population size, the Kingman coalescent, and the neutral and nearly neutral theory.

| 14 min read | Educational content — not medical advice

Short version. The Hardy-Weinberg principle is the null model: under random mating, no selection, no migration, no mutation, and infinite population size, genotype frequencies follow p² : 2pq : q² from allele frequencies p and q. Departures from HWE (testable by chi-square) flag stratification, inbreeding, selection, or genotyping artefact. Selection moves allele frequencies according to selection coefficients; balancing selection (heterozygote advantage) maintains polymorphism — the canonical example is the sickle-cell allele in malaria-endemic regions. Genetic drift is the random component, governed by effective population size; the coalescent (Kingman 1982) is the genealogical view of drift. The neutral and nearly neutral theory (Kimura 1968; Ohta 1973) is the modern null against which selection signals are detected.

Hardy-Weinberg equilibrium

The principle was published in Hardy 1908 (Science 28:49) in response to a misunderstanding about whether dominant alleles must increase in frequency over time. Wilhelm Weinberg published the same result in the same year (Jahresheft des Vereins für vaterländische Naturkunde in Württemberg 64:368). The principle: at a biallelic autosomal locus with allele frequencies p and q (p + q = 1), random union of gametes gives genotype frequencies p² (homozygous AA), 2pq (heterozygous Aa), and q² (homozygous aa). One generation of random mating is sufficient to reach equilibrium; the equilibrium is then stable in the absence of disturbing forces.

The assumptions, in detail:

  • Random mating with respect to the locus. Assortative mating, inbreeding, and population structure all violate this assumption.
  • No selection: all genotypes have equal fitness. Selection at the locus or at a linked locus moves frequencies away from HWE.
  • No migration: the population is closed. Migration introduces alleles at frequencies that may differ from the receiving population.
  • No mutation: alleles are not converted to other alleles between generations. Mutation rates are typically too low to perturb HWE meaningfully on a per-locus, per-generation scale.
  • Effectively infinite population: random sampling does not perturb frequencies. Finite populations show drift, which moves frequencies stochastically.

None of those assumptions hold strictly. Hardy-Weinberg works as a useful approximation because the deviations are usually small enough at most autosomal loci, in most populations, on a per-generation timescale, that genotype frequencies stay close to the equilibrium predictions. The interest is precisely in the loci and populations where they do not.

Testing for HWE deviation

The standard test is the chi-square goodness-of-fit test against expected genotype counts. With observed counts O₁₁, O₁₂, O₂₂ for the three genotypes and total N, the allele frequency estimate is Ŷp = (2O₁₁ + O₁₂) / 2N, expected counts are E₁₁ = NŶp², E₁₂ = 2NŶpŶq, E₂₂ = NŶq², and the statistic is Σ (O − E)² / E with one degree of freedom (allele frequency was estimated from the data). For low-count cells, the exact test of Wigginton, Cutler & Abecasis (2005, Am J Hum Genet 76:887) is the modern standard.

In genome-wide quality control, a HWE p-value below a threshold (commonly 1 × 10⁻⁶ in controls, looser in cases) is a flag for genotyping error rather than a discovery. In case-control association testing, deviation from HWE in cases but not controls can indicate true association at the locus or at a tagged variant in linkage disequilibrium. The exact threshold and direction of the test depend on the study design.

The Wahlund effect

If a sample is drawn from two or more subpopulations with different allele frequencies, the pooled sample shows an apparent deficit of heterozygotes relative to Hardy-Weinberg expectations even when each subpopulation is at HWE internally. This is the Wahlund effect, named for Sten Wahlund's 1928 paper. The magnitude of the heterozygote deficit is related to Wright's Fst statistic: the deficit equals 2̄p̄q × Fst, where ̄p and ̄q are mean allele frequencies. The Wahlund effect is one reason that HWE testing is informative for population stratification: a global excess of homozygotes across many loci is the signature.

Selection

Selection is differential reproductive success of genotypes. The classical bookkeeping is in terms of relative fitness. For a biallelic locus with genotypes AA, Aa, aa and relative fitnesses w₁₁ = 1, w₁₂ = 1 − hs, w₂₂ = 1 − s (with s the selection coefficient and h the dominance coefficient), the change in allele frequency per generation is Δq = (selection differential) / (mean fitness). For a fully recessive deleterious allele (h = 0), Δq is approximately −sq²p per generation when q is small.

Positive selection

Positive selection is selection in favour of an allele, raising its frequency. Recent positive selection in humans has been catalogued by genome-scan methods including the integrated haplotype score (iHS) and cross-population extended haplotype homozygosity (XP-EHH), reviewed in Sabeti et al. 2007 (Nature 449:913). The classical worked example is lactase persistence: variants in the regulatory region of LCT (most prominently −13910*T in European populations and several independent variants in pastoralist African populations, catalogued by Tishkoff et al. 2007 (Nat Genet 39:31)) confer continued expression of lactase into adulthood. The European variant rose to high frequency in approximately the past 5,000 to 10,000 years against a background of dairying, and the surrounding region of the genome carries a long haplotype consistent with strong recent positive selection.

Negative (purifying) selection

Negative selection removes deleterious alleles. The bulk of disease-associated coding variants are subject to purifying selection. The frequency spectrum of variants in large sequencing datasets — for example the gnomAD reference cohort — shows the signature: deleterious variants are systematically rarer than expected under neutrality, and constrained genes have fewer loss-of-function variants than expected. The constraint metrics published with gnomAD (pLI, LOEUF) summarise the strength of purifying selection at the gene level.

Balancing selection

Balancing selection maintains polymorphism. The classical mechanism is heterozygote advantage. The canonical worked example is sickle-cell anaemia: homozygotes for the HBB Glu6Val (HbS) allele have severe anaemia and historically low reproductive success, but heterozygotes (HbAS) have a substantial degree of protection from severe Plasmodium falciparum malaria. Allison 1954 (Br Med J 1:290) documented the geographical correlation between the frequency of the sickle allele and historical malaria endemicity. The equilibrium frequency q* of the HbS allele is set by the relative selection coefficients against the two homozygotes (s₁ against HbAA, s₂ against HbSS), giving q* = s₁ / (s₁ + s₂). For empirically estimated coefficients, q* lands at around 0.10 to 0.15, consistent with observed allele frequencies in West African populations.

A second balancing-selection example is G6PD deficiency. X-linked variants in G6PD (most common: G6PD A−, G6PD Mediterranean) cause haemolytic anaemia under specific triggers (fava beans, primaquine, certain infections) but appear to confer some protection against malaria. Allele frequencies of G6PD-deficient variants are elevated in historically malaria-endemic regions in the Mediterranean, sub-Saharan Africa, and South and Southeast Asia. The selection regime for X-linked balancing selection differs from the autosomal case because heterozygous females are mosaic for X-inactivation and selection on hemizygous males drives most of the dynamics.

A third balancing-selection example, with a different mechanism, is HLA / MHC polymorphism. Frequency-dependent selection (rare-allele advantage against pathogen escape) and overdominance both contribute. HLA loci are among the most polymorphic in the human genome.

Mutation-selection balance for recessive disease

For a deleterious recessive allele, mutation introduces new copies at rate µ per generation, and selection removes them at rate sq². At equilibrium, µ = sq², so the equilibrium allele frequency is q* = √(µ / s). For a typical recessive Mendelian disease with µ on the order of 1 × 10⁻⁶ per locus per generation and complete selection against homozygotes (s = 1), q* is approximately 1 × 10⁻³, giving a disease incidence (q*²) of approximately 1 × 10⁻⁶. For dominant disease alleles with complete penetrance and reduced fitness, the equivalent calculation gives q* = µ / s, much lower at the same parameter values. These approximations explain the order-of-magnitude relationship between mutation rate, selection, and disease incidence; they do not include drift, founder effects, or compound-heterozygote architectures, all of which modify the picture in real populations.

Genetic drift and the Wright-Fisher model

The Wright-Fisher model idealises a population as a sequence of generations of constant size N (or 2N alleles in a diploid), with each generation drawn by random sampling with replacement from the gamete pool of the previous generation. Wright 1931 (Genetics 16:97) showed that allele frequencies follow a binomial sampling process; over many generations the variance of the allele frequency grows, and in the absence of selection an allele either fixes (frequency 1) or is lost (frequency 0). The fixation probability of a neutral allele is its starting frequency. Under the diffusion approximation, the expected time to fixation of a neutral allele starting at frequency p, conditional on fixation, is approximately −(4N / p)(1 − p) ln(1 − p) generations.

The relevant population size for the strength of drift is the effective population size, Ne, not the census size. Ne is the size of an idealised Wright-Fisher population that would experience the same magnitude of drift as the real population. Ne is reduced by uneven sex ratios, variance in offspring number, generation overlap, fluctuations in size over time, and population structure. Estimates of long-term human Ne from genetic data sit around 10,000 — small relative to the census, reflecting the deep demographic history rather than the contemporary population.

The coalescent

The forward-in-time Wright-Fisher model has a backward-in-time dual: the coalescent, derived by Kingman 1982 (Stochastic Processes and their Applications 13:235). The coalescent describes the genealogy of a sample of sequences traced backwards in time to their most recent common ancestor (MRCA). The waiting time to the next coalescent event when k lineages remain is approximately exponential with rate k(k − 1) / (2 × 2Ne) generations. The total time to MRCA scales linearly with Ne and grows logarithmically with sample size beyond a threshold.

The coalescent is the inferential workhorse of modern population genetics. Site-frequency spectra, linkage-disequilibrium decay, and ancestry inference are all interpreted through the coalescent. Software including ms (Hudson 2002), msprime (Kelleher et al. 2016), and Relate (Speidel et al. 2019) simulate or infer coalescent genealogies under demographic models.

The neutral and nearly neutral theory

Kimura 1968 (Nature 217:624) proposed that most molecular variation segregating in a population is selectively neutral or nearly so, with the rate of molecular evolution set by the rate at which neutral mutations drift to fixation. The rate of fixation per generation under neutrality equals the per-locus mutation rate (a striking and counterintuitive result independent of Ne). The neutral theory does not deny selection; it proposes a default expectation against which signals of selection can be tested.

Ohta 1973 (Nature 246:96) extended the framework to nearly neutral variation: variants with small selection coefficients (|s| comparable to 1 / Ne) are subject to drift in small populations and to selection in large populations. The nearly neutral framework explains the observation that synonymous-to-nonsynonymous substitution ratios depend on Ne and that the burden of slightly deleterious variation is shaped by demographic history.

Diffusion theory (Kimura 1955, 1962) provides the mathematical machinery: allele-frequency change under selection and drift is described by a Kolmogorov forward equation whose solutions give the probability distribution of allele frequency over time. Stationary distributions for variants under mutation-selection-drift equilibrium are central to interpreting site-frequency spectra and to estimating selection coefficients from polymorphism data.

Worked examples in human genetics

The three classical examples illustrate the categories.

  • Sickle cell as balancing selection. The HBB Glu6Val allele is at substantially elevated frequency in malaria-endemic regions, and the geographical correlation with historical malaria endemicity is one of the strongest published cases of human balancing selection (Allison 1954).
  • Lactase persistence as recent positive selection. Independent regulatory variants in LCT have risen to high frequency on long haplotypes in European, East African, and Arabian Peninsula populations, in each case associated with histories of dairying (Tishkoff et al. 2007).
  • G6PD deficiency as balancing selection. Multiple independent G6PD-deficient variants are at elevated frequency in malaria-endemic regions, with the dynamics shaped by X-linked inheritance and triggered haemolysis as the cost.

Human genome-scan literature, including the haplotype-based methods reviewed in Sabeti et al. 2007, has expanded the catalogue beyond these classical cases — pigmentation loci (SLC24A5, SLC45A2, MFSD12), high-altitude adaptation (EPAS1 in Tibetan populations, BHLHE41 / MTHFR in Andean populations), and a long tail of more uncertain candidates. The methodological caveat in all of these scans is that selection signals are easily confounded by demographic history; the strongest published cases are those where independent lines of evidence (haplotype length, frequency differentiation, archaeological correlation with a plausible selective regime) all converge.

Why these dynamics matter for pedigree work

Recurrence-risk calculations in a single pedigree depend on inputs that are population-genetics quantities. The carrier frequency of a recessive allele in the relevant population sets the prior for a partner who is not a known carrier. The penetrance of a dominant allele estimated from population samples sets the expected risk in a relative who carries it. The polygenic-risk-score percentile a family-specific score is compared against is itself the distribution of a population-genetics quantity. Evagene's implementations of published risk-model algorithms (Claus 1994, Couch 1997, Frank 2002, Tyrer / Duffy / Cuzick 2004 in IBIS-style approximation, BayesMendel BRCAPRO / MMRpro / PancPRO, family-history scoring) all consume population-genetics inputs as parameters; the educational pages here are background literacy for users of those implementations.

Frequently asked questions

What does it mean for a population to be in Hardy-Weinberg equilibrium?

Genotype frequencies at the locus follow p² : 2pq : q² from the allele frequencies p and q after one generation of random mating, in the absence of selection, migration, mutation, and drift. The equilibrium is stable until disturbed.

How is HWE deviation tested in case-control data?

By chi-square goodness-of-fit on observed versus expected genotype counts, or by the exact test (Wigginton, Cutler & Abecasis 2005). HWE is normally tested in controls only; deviation in cases can flag association.

What is the equilibrium frequency of a recessive disease allele under mutation-selection balance?

Approximately q* = √(µ / s), where µ is the per-locus mutation rate and s is the selection coefficient against affected homozygotes. For a fully lethal recessive (s = 1) at µ = 10⁻⁶, q* is around 10⁻³, giving a disease incidence near 10⁻⁶.

What is the coalescent?

The backward-in-time genealogy of a sample of sequences, derived by Kingman 1982. It describes the waiting times to common-ancestor events and is the inferential framework underlying coalescent simulators (ms, msprime), site-frequency-spectrum methods, and ancestry inference.

Why is the neutral theory the modern null model?

Because most molecular variation appears to be selectively neutral or nearly so, neutrality is the default expectation against which the magnitude and statistical significance of any selection signal must be tested. Departures from a neutral expectation, calibrated to the demographic history of the population, are how positive and balancing selection are detected today.

Related reading

Try Evagene's pedigree drawing tool

In-browser pedigree drawing with NSGC notation, gesture drawing, GEDCOM and CanRisk export, and a 1,900-entry help catalogue. Free during alpha for clinicians, researchers, educators, and students.

Join the Alpha Waiting List