Population Genetics Simulator
PopG Online
This is an online one-locus, two-allele genetic simulation tool, inspired by the classic population genetics program PopG. It can simulate multiple subpopulations and enables you to observe the effect of natural selection, mutation, migration, and genetic drift on allele frequencies.
It calculates allele frequencies in each generation according to the Wright–Fisher model, one of the foundational models in population genetics used to describe the evolutionary dynamics in finite populations, which assumes that there is no overlap of generations, and that each copy of the gene found in a new generation is drawn independently and at random from all copies of the gene in the previous generation.
This tool enables you to:
Investigate how viability selection influences allele frequencies under different fitness values for genotypes AA, Aa, and aa.
Explore bidirectional mutation (A → a, a → A), seeing how even small rates can shift allele frequencies over multiple generations.
Model migration among subpopulations, allowing you to observe how a fraction of migrants per generation affects local allele frequencies compared to the global average.
Compare subpopulations evolving independently (no migration) versus those exchanging alleles (with migration).
Visualise the number of subpopulations in which Allele A becomes fixed (frequency = 1) or lost (frequency = 0), along with the overall mean allele frequency.
Experiment with different random number seeds for reproducible simulations or fully stochastic runs.
How to use the simulator
Set your parameters: Indicate the population size per subpopulation, fitness values for the three genotypes, mutation rates in each direction, migration fraction, initial allele frequency, number of generations, and the number of subpopulations. Keep in mind that larger population sizes, more generations run, and more subpopulations will lead to higher memory use and longer runtimes (for reference: the original PopG has a hard limit of 1,000 for the number of simultaneously-evolving subpopulations and 10,000 for the size of each), and above 25 subpopulations the chart starts to become pretty messy although the summary statistics may still be of use.
Optional seed: Provide a random number seed if you want identical outcomes each run (blank yields a new random set).
Run Simulation: Click 'Run Simulation' to watch the frequency of Allele A evolve over time in each subpopulation.
Results & Analysis:
The simulator plots a line chart of allele frequencies vs. generation for each subpopulation.
A legend below the chart indicates each subpopulation line’s colour.
A vivid blue line shows what the gene frequencies would be in an infinite population with no drift.
You can hover over a data point with your cursor to view exact values.
The summary section highlights the number of subpopulations with Allele A or a fixed, plus the mean allele frequency across all subpopulations.
Download Chart: A 'Download Chart as PNG' button lets you export the graph.
Go ahead and test various selection intensities, mutation rates, and migration fractions to see how allele frequencies respond!
This tool is based on the wonderful PopG software developed by Joe Felsenstein at the University of Washington, reproduced and modified with permission as per its copyright notice (Apr 2025). PopG is a program first written in the 1970s but that was still used in my Genetics undergraduate workshops five decades later to easily visualise the effects of selection, mutation, migration, and drift. While there are benefits to offline, local software, each student having to download the program, ensure they have Java installed, and (on macOS) bypass Gatekeeper, was inconvenient. This tool enables learners to take advantage of PopG's main functionality right in their web browser - no downloads required. This also enables ChromeOS, iPadOS, and mobile users to join in!