Marbles, Jars, and Real Human Alleles: Watching Allele Frequencies Change
by Professor Stephen T. Abedon Steve Abedon, Ph.D., has taught well over 100 individual classes and ~10 individual courses (including introductory biology, microbiology, physiology, biochemistry, etc.) over his 30+ years as a college professor. He has over 150 publications, including multiple monographs, and is ranked in the top 1 or 2 percent among researchers of all disciplines worldwide. His research focuses on bacteriophage biology and phage therapy. (abedon.1@osu.edu)
phage.org | phage-therapy.org | biologyaspoetry.org | abedon.phage.org | google scholar | publications
Jump to: 🧬 Alleles | ⚖️ Hardy–Weinberg | 🎲 Drift | 📈 Selection | ✏️ Mutation | 🔄 Gene Flow | 👫 Non-random Mating | 🎛️ All Together | 🏁 Allele Fate | 🔗 Two Loci | 📖 Background | 🧮 More Calculators
biologyaspoetry.org/laboratories/evolution/ · All Laboratories · Abedon’s Books
How can I improve this page? contact: evolution@biologyaspoetry.org
Every allele in this catalog is a real human variant with a known location on a chromosome, apart from one clearly labeled hypothetical. The alleles fall into four groups:
Many alleles affect more than one trait, which is called pleiotropy. When an allele's effects pull fitness in opposite directions, helping in one way while harming in another, it shows antagonistic pleiotropy, an idea developed by George C. Williams (1957) to explain aging. Antagonistic pleiotropy is one reason so many alleles are context dependent: which effect matters more depends on the environment. Entries tagged pleiotropic or antagonistic pleiotropy name the traits involved in their details, and the Background tab says more.
Click a row in the tables, or a dot on the chromosome map, to see the details for that allele. The Use button makes it the current allele in every simulation tab. Each tab also has its own allele menu and a Random allele button, and the Choose at Random section below the tables hands out alleles for a class or laboratory.
Chromosomes are drawn to scale by length, with the short (p) arm on top and the centromere marked by the waist. Dots sit at each locus's approximate position; hover for the name, click for details. The Y chromosome carries none of the catalog's loci and is not drawn.
For a class or laboratory, the page can hand out alleles at random: one per student, one per group, or as many as you need. Choose which groups to draw from, how many alleles to draw, and whether repeats are allowed. Each card lists the allele's location and inheritance, along with a suggestion of what to try.
Real alleles are not required. Describe one of your own, give it a place on a chromosome and fitnesses for up to two environments, and it joins the catalog, the random draws, and every menu on the page. Alleles you make are kept in this browser only.
Relative fitness: 1 for the genotype that does best, smaller numbers for those that leave fewer offspring. Choosing the X chromosome adds separate fitnesses for males, who carry one X.
Pour marbles of two colors into a jar, draw them out two at a time, and call each pair a person. If a fraction p of the marbles carry the allele of interest and the rest, q = 1 − p, carry the alternative, then pairs with two copies turn up at a frequency of p², pairs with one copy at 2pq, and pairs with none at q². That is the Hardy–Weinberg principle, worked out independently by G. H. Hardy and Wilhelm Weinberg in 1908.
The principle is a baseline. Genotype frequencies settle at p², 2pq, and q² after a single generation of random mating, and allele frequencies then stay put, provided that nothing else is going on: no selection, no mutation, no gene flow, no non-random mating, and a population large enough that chance (drift) does not matter. Each of the following tabs breaks one of those conditions. Evolution, at its simplest, is a change in allele frequencies, and the Hardy–Weinberg jar is what a population looks like when nothing is changing them.
Hardy–Weinberg's best-known practical use runs backward. For a recessive condition, the people who have it are the q² class, so the square root of the condition's frequency estimates the allele frequency, and 2pq then estimates the frequency of carriers. A striking result follows: when a recessive allele is rare, nearly all copies of it sit in carriers who show no sign of it, out of reach of selection.
These calculations assume random mating at the locus. Inbreeding raises the frequency of recessive conditions above q² (see the Non-random Mating tab). For X-linked recessive conditions, males with one copy are affected, so the frequency of affected males estimates q directly.
Genetic drift is evolution by sampling. Fill a jar with marbles, two per person (one for each copy of a gene), so that a jar for N people holds 2N marbles. To make the next generation, draw a marble at random, put a marble of the same color into a new jar, return the drawn marble, and repeat until the new jar holds 2N marbles. No color is favored, yet the count in the new jar rarely matches the old one exactly. Repeat for enough generations and one color takes over the jar. Drawing with replacement in this way is the sampling scheme that population geneticists call the Wright–Fisher model, after Sewall Wright and Ronald Fisher.
Draw marbles from the left jar to fill the right one, or press Auto-play to let the page draw them, one marble at a time, generation after generation.
Drawing by hand shows how drift works; a computer shows what it does. Each line below is one jar (one population), all starting at the same frequency and all following identical rules. The spread of the lines is drift. Runs play out generation by generation, so you can watch the jars wander apart; pause, skip to the end, or replay with the controls above the chart.
A founder event is a bottleneck at generation 0: a few people found a new population, which then grows back to N. Regrowth is rounded up to whole people each generation.
Frequency of the allele in each jar, generation by generation. The dashed black line shows the same population without drift, a reference curve borrowed from Joe Felsenstein’s PopG; with no selection it simply stays at the starting frequency.
Average heterozygosity (2pq) across jars, compared with its expected loss of 1/(2N) per generation.
Selection changes the marble rules. Pairs of marbles (people) with some genotypes survive and reproduce better than others, so their marbles are overrepresented when the next jar is filled. The strength of that advantage is expressed as relative fitness, w: the average number of offspring a genotype leaves, divided by that of the genotype that does best. The best genotype therefore has w = 1, and a genotype with w = 0.9 leaves 10% fewer offspring. Its selection coefficient is s = 1 − w = 0.1.
Whether heterozygotes resemble one homozygote or the other matters a great deal, and is described by the dominance coefficient, h. If the three genotypes have fitnesses 1, 1 − hs, and 1 − s, then h = 0 means the disadvantage is recessive, h = 1 means it is dominant, and h = 0.5 means heterozygotes fall halfway between (additive).
When the environment changes, the fitnesses switch to that environment's values from the catalog, replacing the values in the boxes above.
Frequency of the allele over time; the darker line is the average of all replicates, and the dashed black line is the same population without drift.
Left: mean fitness, w̄, the average relative fitness of the population. Right: Δp, the change in allele frequency from one generation to the next. Dashed black lines: the same population without drift. (Graphs of w̄ and Δp follow the example of Bob Sheehy’s Web PopGen II.)
Mean fitness generally rises as selection proceeds and levels off at equilibrium; a change of environment can shift it abruptly, up or down, because the same allele frequencies are suddenly worth more or less. Δp shows where selection acts fastest: for a favored allele it peaks at intermediate frequencies, and it shrinks toward zero as the allele becomes rare or nearly fixed. Drift makes both graphs jitter.
Mutation is the ultimate source of new alleles. In marble terms, a marble occasionally changes color as it passes into the next jar. Mutation rates are tiny, roughly one change per hundred million base pairs per generation for a given site in human DNA, and somewhere between one in a hundred thousand and one in a million per generation for mutations that knock out a particular gene. Mutation on its own therefore changes allele frequencies extremely slowly.
With a forward rate u (alternative allele to this allele) and a back rate v (this allele to the alternative), mutation by itself pushes the allele frequency toward an equilibrium of p̂ = u / (u + v). Mutation matters most when it works against selection. Harmful alleles are removed by selection and replaced by new mutation, settling at a mutation–selection balance, roughly q̂ ≈ √(u/s) for a recessive allele and q̂ ≈ u/(hs) for one with an effect in heterozygotes.
Allele frequency over time; the dashed orange line marks the predicted equilibrium, and, with drift on, the dashed black line shows the same population without drift.
Gene flow is the movement of alleles between populations, or between jars. Each generation, a fraction m of a jar's marbles is replaced by marbles from elsewhere. One-way flow, from a large mainland into a small island, pulls the island's frequency toward the mainland's at a rate set by m. Two-way flow pulls two jars toward each other. Either way, gene flow makes populations more alike, which is why it works against both drift and local selection.
Even a little gene flow goes a long way. A rule of thumb that follows from Sewall Wright's 1931 island model is that about one migrant per generation (Nm ≈ 1) is enough to keep neutral allele frequencies in different populations from drifting far apart, whatever the population size.
The environment chosen in the allele bar applies to the island (or jar 1). With selection off, gene flow and drift act alone.
Allele frequency in each population; dashed lines show each population without drift.
Hardy–Weinberg proportions assume that marbles pair at random. People do not always pair at random. Inbreeding, mating with relatives, pairs marbles that are copies of the same ancestral marble more often than chance would. Assortative mating, choosing mates with similar traits, does something similar but only for genes affecting those traits. Either way the result is more homozygotes and fewer heterozygotes than Hardy–Weinberg predicts.
The effect is captured by the inbreeding coefficient, F, the probability that the two copies of a gene in a person are identical by descent. With inbreeding, the genotype frequencies become p² + Fpq, 2pq(1 − F), q² + Fpq. Notice what does not change: the allele frequencies. Non-random mating rearranges alleles into genotypes differently, but on its own it does not make any allele more or less common. It does, however, expose rare recessive alleles to selection by placing them in homozygotes more often.
A negative F stands in for disassortative mating, a preference for unlike mates, which produces more heterozygotes than Hardy–Weinberg predicts.
Run the current allele forward under random mating and under the inbreeding coefficient above, side by side. Without selection, the two lines lie on top of each other, since non-random mating does not change allele frequencies. With selection against a recessive allele, inbreeding exposes more copies to selection and the allele declines faster, a process called purging.
Real populations experience all of these forces at the same time, which is where a computer earns its keep. Set any combination below. Leaving a force at its neutral setting (fitnesses all 1, mutation and migration rates 0, F = 0, no bottleneck) turns it off.
One question this tab can answer is when selection matters at all. Selection and drift compete, and a rule of thumb compares the selection coefficient s with 1/(2N). When 2N|s| is well below 1, drift dominates and the allele behaves as if it were neutral; it is effectively neutral, an idea developed by Motoo Kimura and Tomoko Ohta. When 2N|s| is well above 1, selection dominates. The same allele can therefore be effectively neutral in a small population and clearly selected in a large one.
Allele frequency in each replicate population; the darker line is their average, and the dashed black line is the same population without drift.
Left: mean fitness, w̄, the average relative fitness of the population. Right: Δp, the change in allele frequency from one generation to the next. Dashed black lines: the same population without drift. (Graphs of w̄ and Δp follow the example of Bob Sheehy’s Web PopGen II.)
In a finite population, every allele eventually meets one of two fates. It is fixed, so that every marble in the jar is its color, or it is lost, so that none is. Until then it is still segregating. Which fate, and how soon, depends on its relative fitness, on how common it is to begin with, and on population size.
Population size plays three separate roles:
Motoo Kimura (1962) combined all three in a single formula for the probability of fixation, which this tab draws alongside the simulations. A striking special case goes back to J. B. S. Haldane (1927): a single new copy of a favored allele, whose heterozygous carriers have an advantage s, is eventually fixed with a probability of only about 2s. With a 1% advantage, about 98% of such alleles are lost, nearly all within their first few generations, and that fraction hardly depends on population size once Ns is large.
For neutral alleles, Kimura and Ohta worked out how long these fates take. A single new neutral copy that is eventually fixed takes about 4N generations to get there (Kimura and Ohta 1969a); one that is lost, as nearly all are, survives on average only about 2 ln(2N) generations (Kimura and Ohta 1969b).
Filled in from the allele and environment above; the preset buttons enter their own values.
Dots: the share of simulated populations in which the allele was fixed or lost. Lines: Kimura’s (1962) diffusion approximation for the same fitnesses. Dotted gray: the neutral expectation, where the chance of fixation equals the starting frequency.
Many harmful alleles are far more common than selection alone would seem to allow. This section follows the current allele under selection alone (no drift) in the environment chosen above, on a logarithmic scale so that the decline remains visible as the allele becomes rare. The dashed lines mark a single copy in a population of each size: once the selection curve falls to a line, the allele is down to its last copy or so in a population of that size, and drift finishes it off.
For context-dependent alleles, the question becomes whether an allele can ride out a stretch of time in which it is not favored. Here the environment that favors the allele gives way to one that does not, then returns. A large population keeps a reservoir of copies through the bad stretch; a small one may lose the allele entirely, and with it the ability to respond when the favoring environment comes back.
Uses the current allele. Choosing an allele with two or more environments, such as the sickle-cell allele, makes this section meaningful.
Share of populations that still carry the allele. Dashed vertical lines mark the stretch in which the allele is not favored.
Average allele frequency in each set of populations.
So far each marble has stood for one gene. Genes, though, sit on chromosomes, so alleles at nearby loci travel together like marbles on a string, separated only when recombination cuts the string between them. Following two loci at once brings in three new ideas:
Hardy–Weinberg also gains a dimension. Each locus can be in Hardy–Weinberg proportions on its own while the two-locus genotypes are not what the product of the single-locus frequencies predicts. The table under the results shows the difference whenever D is not zero.
Positions of catalog loci fill in automatically; hypothetical loci can be placed anywhere. r is estimated from distance assuming about 1 centimorgan per million base pairs, converted with Haldane's map function, r = ½(1 − e−2d) with d in morgans. Real recombination rates vary several-fold along chromosomes.
X-linked alleles are not offered here; this tab models two autosomal loci.
Allele frequencies at locus A and locus B in each replicate; dotted lines show each locus without drift.
Linkage disequilibrium, r², averaged across replicates.
Population genetics defines evolution, at its simplest, as a change in the frequencies of alleles in a population from one generation to the next. Four processes can change allele frequencies: natural selection, genetic drift, mutation, and gene flow. A fifth, non-random mating, changes how alleles are combined into genotypes without, on its own, changing allele frequencies. All five are departures from the Hardy–Weinberg baseline (Hardy 1908; Weinberg 1908).
Drawing marbles with replacement to fill the next generation's jar is the Wright–Fisher model of a population: generations do not overlap, the population has a constant size, and each new gene copy is a random draw from the gene pool of the previous generation (Fisher 1930; Wright 1931). Selection, mutation, gene flow, and inbreeding modify the contents of the jar before each draw. Real populations break these assumptions in many ways (generations overlap, sizes change, people do not reproduce at random), and population geneticists account for that partly by replacing the census size with an effective population size. The N on this page is best read as an effective size, which for humans is typically much smaller than the number of people alive.
Relative fitness, w, is a genotype's expected contribution of offspring to the next generation, divided by that of the best genotype. It combines survival and reproduction. With the allele of interest written A and the alternative a, the frequency of A after one generation of selection is
p′ = (p²wAA + pqwAa) / w̄, where w̄ = p²wAA + 2pqwAa + q²waa
The quantity w̄ is the population's mean fitness. When the heterozygote is fittest, the allele frequency settles at p̂ = (wAa − waa) / (2wAa − wAA − waa), the formula the Selection tab uses to predict the sickle-cell equilibrium. When the heterozygote is least fit, the same formula gives an unstable point, and whichever allele starts above it takes over.
Pleiotropy is one gene, or one allele, affecting more than one trait. The East Asian EDAR variant, for example, alters hair thickness, sweat glands, and tooth shape (Kamberov et al. 2013). Pleiotropy matters for evolution because selection acts on whole organisms: every effect of an allele is selected together, so an allele favored for one effect carries its other effects along with it.
When one effect raises fitness and another lowers it, the allele shows antagonistic pleiotropy. George C. Williams (1957) proposed that alleles beneficial early in life but harmful later could be favored, because selection acts more strongly on effects that come early, before and during reproduction, than on effects that come late. He offered this as an evolutionary explanation of aging. Variants associated with coronary artery disease, for example, are also associated with greater lifetime reproductive success in a long-running study of living people (Byars et al. 2017), which would be antagonistic pleiotropy in Williams's original sense.
Several context-dependent alleles in the catalog show a different form of antagonistic pleiotropy: a trade-off between resistance to one disease and susceptibility to another (CCR5-Δ32 with HIV and West Nile virus; blood group O with malaria and cholera), or between protection against an infection and harm to another organ (APOL1, with sleeping sickness and kidney disease). Two related ideas are worth keeping separate. In heterozygote advantage, as with the sickle-cell allele, one effect plays out differently in people with one copy and with two. In other cases one trait has consequences whose value depends on the environment, as with skin pigmentation, which affects both protection against UV damage and vitamin D synthesis.
The simulations on this page do not follow traits separately. An allele's relative fitness stands for the net result of all of its effects, and pleiotropy enters through that balance: when the environment changes the value of one effect, the allele's net fitness changes, and so does its fate. Switching environments partway through a run is a way to watch that happen.
Kimura (1968) argued that much of the genetic change seen at the molecular level is driven by drift acting on neutral variants rather than by selection. Ohta (1973) extended the idea to slightly harmful variants, whose fate depends on population size: where 2N|s| is much less than 1, they behave as neutral. This page uses neutral in that practical sense. The neutral alleles in the catalog have no known effect on survival or reproduction, and the hypothetical “nearly neutral allele” shows the effectively neutral case.
Each generation of a single-locus simulation proceeds in this order:
For X-linked alleles, females (two X chromosomes) and males (one) are tracked separately: daughters receive an X from each parent, sons only from their mother, and selection acts on the three female genotypes and the two male genotypes. Half of each generation is female.
The two-locus simulations follow the four chromosome types (haplotypes) AB, Ab, aB, and ab. Each generation, selection acts on the ten possible genotypes, recombination between A and B occurs at rate r in double heterozygotes, and 2N chromosomes are drawn at random to form the next generation. Double heterozygotes are given the same fitness whichever way their alleles are arranged on the two chromosomes.
Every run uses new random numbers, so repeated runs differ, just as repeated jars of marbles do. Each run is calculated in full the moment you press Run and is then drawn generation by generation, at the speed you choose; pausing or skipping ahead changes only the display, not the outcome.
Several features of this page follow the example of other teaching simulators. The dashed “without drift” curves drawn alongside drifting populations are a long-standing feature of PopG, the one-locus simulation program for teaching originally written by Joe Felsenstein (felsenst.github.io/popg). The graphs of mean fitness and of Δp, and a bottleneck followed by regrowth at a chosen rate, follow Bob Sheehy’s Web PopGen II (Radford University; sites.radford.edu/~rsheehy/Gen_flash/popgen). Both programs are worth a look in their own right.
The catalog was assembled for teaching, not as a review. Where the selective agent behind an allele is uncertain, or where whether selection acted at all is debated, the entry says so. The four groups are a simplification: lactase persistence, for example, is beneficial only where people drink milk, and is grouped with the beneficial alleles because it appears to cost nothing where they do not. Alleles grouped as context-dependent have a known cost in some setting or genotype.
Positions are approximate locations on the GRCh38 reference genome, rounded for display, and chromosome bands follow standard cytogenetic nomenclature. Reference SNP identifiers (rsIDs) link to the National Center for Biotechnology Information's dbSNP database, and gene names link to GeneCards.
Selection on human alleles is still being measured, in long-term medical studies of living people (Byars et al. 2010), in genome-wide scans for recent sweeps (Field et al. 2016), and in time series of ancient DNA (Mathieson et al. 2015).