Evolution Frequency Calculator Gene?
- Time in years
- years
- Result
- Starting frequency
- 0.01
- You entered
- Target frequency
- 0.99
- You entered
This calculator does not compute an “evolution frequency” for a gene in the modern population-genetics sense, because that requires allele frequencies, selection coefficients, and generation times that you must supply. Instead, it works out the expected number of generations it takes for a beneficial allele to go from a starting frequency to a target frequency under a given selection coefficient, using the standard haploid selection formula. You enter the starting frequency, target frequency, and selection coefficient, and it returns the number of generations and the time in years if you provide a generation length.
Formula
The calculator uses the logit (log-odds) approximation for haploid selection:
t = (ln(p�/(1−p�)) − ln(p₀/(1−p₀))) / s
- t = number of generations
- pâ‚€ = starting frequency of the allele (as a proportion, 0 to 1)
- p� = target frequency (as a proportion, 0 to 1)
- s = selection coefficient (the proportional increase in fitness per generation, e.g., 0.1 = 10% advantage)
This comes from the continuous-time approximation of the haploid selection recurrence: p(t+1) = p(t)(1+s) / (1 + s·p(t)). Taking the natural logarithm of the odds ratio p/(1−p) turns the recurrence into a linear equation, which is why the formula is so simple.
Worked Example
Using the default values (p₀ = 0.01, p� = 0.99, s = 0.1, g = 1):
- Compute the logit of p₀: ln(0.01/0.99) = ln(0.010101) ≈ −4.595
- Compute the logit of p�: ln(0.99/0.01) = ln(99) ≈ 4.595
- Subtract: 4.595 − (−4.595) = 9.190
- Divide by s = 0.1: 9.190 / 0.1 = 91.9 generations
- Multiply by g = 1 year per generation: ≈ 91.9 years
The calculator shows 91.9 generations and 91.9 years. That means a beneficial allele with a 10% fitness advantage takes roughly 92 generations to sweep from 1% to 99% frequency in a large haploid population.
When to Use This Calculator
This tool is meant for educational exploration of population genetics, not for real-world breeding decisions or medical predictions. Use it when you want to see how quickly a strongly beneficial allele can spread, or how long it takes for a weakly beneficial allele to make a noticeable shift. It is also useful for teaching the concept of selection coefficients and logit transformations.
Real populations are messier: they have diploid genetics, dominance, drift, migration, mutation, and changing selection. This calculator gives a clean, deterministic answer that is a good first approximation only when selection is strong relative to drift (i.e., N·s >> 1, where N is the effective population size).
How to Choose Input Values
- Starting frequency (pâ‚€): Often the frequency after a new mutation appears, roughly 1/(2N) for diploids or 1/N for haploids. For a population of 1,000, that is 0.001 or 0.0005.
- Target frequency (p�): Usually 0.5 (half the population) or 0.99 (near fixation).
- Selection coefficient (s): For a beneficial allele, s is positive. Typical values in experimental evolution range from 0.01 to 0.2. For a lethal recessive, s can be 1, but that is a special case.
- Generation time (g): In years, e.g., 1 for many insects, 2 for mice, 20 for humans, 30 for elephants. If you want generations only, set g = 1.
Common Mistakes and Misconceptions
Mistake 1: Using percentages instead of proportions. Enter 0.1 for 10%, not 10. The formula will produce nonsense if you enter 10.
Mistake 2: Confusing haploid and diploid selection. This formula is for haploid selection (e.g., bacteria, or gametes). For diploids with dominance, the formula is different and depends on the dominance coefficient h. For an additive allele (h = 0.5), the rate of change is roughly half of the haploid rate for the same s, so the time doubles.
Mistake 3: Ignoring drift. In a small population, random genetic drift can fix a neutral allele or even a slightly deleterious one. The deterministic formula overestimates the time to fixation when N·s is small.
Mistake 4: Thinking the allele will always fix. The formula gives the time to reach a target frequency if it does reach it, but many beneficial alleles are lost by drift in the first few generations, especially if s is small.
Limits of the Formula
The logit approximation assumes constant selection and no mutation, migration, or drift. It also assumes that the allele frequency changes smoothly, which is only valid for large populations. In reality, selection coefficients can change over time (e.g., antibiotic resistance may be costly in the absence of the drug). The formula also breaks down when p₀ or p� is very close to 0 or 1, because the logit becomes infinite; you cannot use p₀ = 0 or p� = 1.
For diploid populations, the time to fixation is often longer because heterozygotes have only half the advantage. For a recessive beneficial allele, the initial spread is very slow because the allele is hidden in heterozygotes. This calculator does not capture those dynamics.
Frequently Asked Questions
What does “evolution frequency” mean? It usually refers to the frequency of an allele in a population over time. This calculator predicts how that frequency changes under selection, but it does not incorporate mutation or drift.
Can I use this for human evolution? Yes, but with caution. Human generation time is about 20–30 years, and selection coefficients for most traits are very small (often less than 0.01). For example, a variant with s = 0.001 would take thousands of generations to reach high frequency, which is why most human adaptations take tens of thousands of years.
What if my selection coefficient is negative? Then the allele is deleterious, and the formula still works mathematically, but the time becomes negative (or the allele decreases in frequency). The calculator will show a negative number, which is not meaningful as a time. In practice, you would use the absolute value to see how fast it is lost, but drift often dominates for deleterious alleles.
How do I convert generations to years? Multiply the number of generations by the average generation time in years. The calculator does this for you if you enter a generation time.
Is there a calculator for diploid selection? Yes, but it requires a dominance coefficient. The formula is more complex and not implemented here. For an additive allele (h = 0.5), you can approximate by halving the selection coefficient (i.e., use s/2 as the effective s) in this haploid calculator.
Why does the answer seem too fast? Because the calculator assumes strong selection and no drift. In a real population of millions, a 10% advantage is huge and would indeed sweep quickly, but most beneficial alleles have much smaller effects (s ≈ 0.001–0.01), so the time is much longer.
Related
Formula used
in p0 | Starting frequency | - | 0.01 | 0 in p1 | Target frequency | - | 0.99 | 0 in s | Selection coefficient | - | 0.1 | 0 in g | Generation time | years | 1 | 0 out gens | Generations needed | generations | (ln(p1/(1-p1)) - ln(p0/(1-p0))) / s | 1 out years | Time in years | years | gens * g | 1
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.