Population Genetics: Wright-Fisher Ensemble (2D)
Run dozens of Wright-Fisher populations side by side: set genotype fitness, mutation rate and population size, then watch allele frequency p diverge, fix or stay balanced across every replicate at once.
The 3D original animates a single Wright-Fisher population: one allele-frequency curve, one genotype bar chart, one story about whether selection or drift wins. This 2D companion asks a different question — what does the spread of outcomes look like? It runs up to 40 replicate populations through the exact same selection/mutation/drift equations at once, all starting from p=0.5, and plots every trajectory together with a bold mean line and a live histogram of where each replicate's frequency currently sits. Fixation probability stops being an abstract number and becomes something you can literally count: how many faint lines ended up pinned to the top, how many to the bottom, and how many are still drifting in between.
Run dozens of Wright-Fisher populations side by side: set genotype fitness, mutation rate and population size, then watch allele frequency p diverge, fix or stay balanced across every replicate at once.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install
Frequently asked questions
Why run many replicate populations instead of one?
A single Wright-Fisher run only shows you one possible outcome of a random process. Genetic drift means two populations that start identical can end up completely different — one fixing allele A, another losing it, a third staying balanced. Running dozens side by side turns "fixation probability is roughly 1/(2N)" from an abstract formula into a countable outcome you watch happen across the ensemble.
What does the bold white line represent?
It is the mean allele frequency across every replicate still contributing data that generation. Under selection alone (drift off) it exactly follows the deterministic Δp equation; with drift on, individual replicates wander away from it while the mean itself stays close to the deterministic prediction as long as enough replicates remain segregating.
How is genetic drift simulated for each replicate?
Each replicate independently draws 2N alleles binomially from its own post-selection, post-mutation frequency, exactly as the 3D version does for its single population — the only difference here is that this sampling happens once per replicate per generation, so replicates with small N visibly separate from each other far faster than replicates with large N.
Why does the Heterozygote Advantage preset keep most replicates in the middle?
That preset gives the heterozygote genotype (Aa) the highest fitness, an overdominance scenario like sickle-cell trait in malaria-endemic regions. Because neither homozygote is favoured, selection pulls every replicate toward the same stable interior equilibrium instead of toward fixation, so the histogram stays clustered near the middle even after many generations, unlike the Dominant Advantage preset where most replicates end up pinned at p=1.