Mutation-selection equilibrium calculator
See how common a hidden recessive allele can remain: with a mutation rate of 0.000001 and a selection coefficient of 0.01, the allele settles at 0.01, carriers at 0.0198 and affected people at 0.0001. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Mutation rate
- 0.000001
- Selection coefficient
- 0.01
- Dominance
- 0
- Equilibrium frequency
- 0.01
- Wildtype frequency
- 0.99
- Heterozygote frequency
- 0.0198
Mutation–selection balance is the deterministic population-genetics equilibrium at which new copies of a deleterious allele created by mutation each generation are removed by selection at the same rate. For a completely recessive harmful allele the textbook result is that the equilibrium frequency q-hat equals the square root of the mutation rate μ divided by the selection coefficient s. Genetic counselors, conservation geneticists, and students use that identity to estimate how common a hidden recessive disease allele can remain in a large random-mating population, and to recover the carrier frequency 2pq and the affected-homozygote frequency q squared. This mutation-selection equilibrium calculator accepts a positive mutation rate and a positive selection coefficient, plus an optional dominance coefficient h that defaults to zero for the recessive case, and returns the textbook equilibrium frequency together with wild-type, heterozygote, and homozygote frequencies and Haldane mutation load.
What mutation–selection equilibrium means for a recessive allele
Every generation, mutation converts a few wild-type copies of a locus into a deleterious allele. If that allele is completely recessive, selection sees it only in homozygotes: heterozygotes have wild-type fitness and the harmful copies they carry are hidden from purging. In a large, randomly mating population the input of new mutants is about μ per generation (back-mutation neglected), while selection removes about s q squared copies when the homozygote pays cost s.
Setting those fluxes equal yields the classic mutation–selection balance μ equals s q squared, so the equilibrium frequency is the square root of μ over s. That square-root dependence is why a rare recessive disease allele can sit at a surprisingly high frequency: if μ is one in a million and s is one percent, q-hat is one percent, not one in a million. Most of those copies live in healthy carriers.
The complementary regime is a partially or fully dominant deleterious allele (h greater than zero). Then most copies are exposed in heterozygotes, the balance is μ equals h s q, and q-hat is simply μ over h s — usually far smaller than the recessive square root. This calculator implements those two textbook approximations.
It does not simulate genetic drift, inbreeding, overdominance, or a finite census; those change the picture and belong to other models. Use it when you already have μ and s and need the deterministic infinite-population frequency, the carrier rate, and the mutation load that Haldane showed is about μ for a complete recessive and about 2μ when heterozygotes are exposed.
Who uses mutation and selection balance
Population-genetics classrooms use a mutation-selection equilibrium calculator so students can see why a recessive lethal with μ of 10 to the minus five sits at q about 0.003 rather than at the mutation rate itself, without hand-sign errors under the square root. Genetic-counseling courses and LMS plugins need a deterministic oracle that also returns 2pq, because that carrier frequency is the number people actually quote when they ask how common a hidden recessive allele is at equilibrium.
Conservation and livestock programs comparing purging of recessive load versus a partially dominant deleterious variant can switch h from zero to a small positive value and read the drop in q-hat and the change in Haldane load without standing up a Wright–Fisher simulator. Failed validation does not consume balance.
What you can do with it
Classroom population genetics and homework keys
Let students submit μ and s for a recessive deleterious allele and verify q = √(μ/s), 2pq, and q² against textbook mutation–selection problems.
Carrier-frequency estimates for recessive loci
Turn a published mutation rate and selection coefficient into the Hardy–Weinberg carrier frequency 2pq at mutation–selection equilibrium.
LMS plugins and counseling-worksheet oracles
Embed a deterministic mutation–selection check that switches from √(μ/s) to μ/(h s) when dominance is supplied, without a simulation library.
FAQ
When should I supply a dominance coefficient h?
Leave h at 0 (or omit it) for a completely recessive allele. For a partially or fully dominant deleterious allele send h in (0, 1]; the calculator then uses q = μ/(h s) instead of the square-root formula.
What is mutation load at this equilibrium?
For a complete recessive that equals μ (Haldane). When heterozygotes are exposed it is about 2μ.
Why does the calculator reject some mutation rates?
If μ > s (recessive) or μ > h s (h > 0), the textbook equilibrium frequency would exceed 1.
How is the equilibrium frequency of a recessive harmful allele calculated?
Take the square root of the mutation rate divided by the selection coefficient. A rate of 0.000001 over a selection of 0.01 gives an allele frequency of 0.01, so 0.99 of copies are the normal version.
Does the result apply to any population?
It describes a large population that mates at random, where the balance between new mutations and selection is predictable. It is a textbook equilibrium, not a forecast for a small or isolated group.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/bio/mutation-equilibrium-frequency \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"mutation_rate":0.000001,"selection_coefficient":0.01}'const res = await fetch("https://api.kit.forhosting.com/bio/mutation-equilibrium-frequency", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"mutation_rate": 0.000001,
"selection_coefficient": 0.01
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/bio/mutation-equilibrium-frequency",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"mutation_rate": 0.000001,
"selection_coefficient": 0.01
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/bio/mutation-equilibrium-frequency", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"mutation_rate":0.000001,"selection_coefficient":0.01}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"mutation_rate":0.000001,"selection_coefficient":0.01}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/bio/mutation-equilibrium-frequency", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"mutation_rate": 0.000001,
"selection_coefficient": 0.01
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "bio.mutation_equilibrium_frequency",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Invalid values fail with invalid_input instead of inventing a frequency above one.
Input contract, formulas, response shape, and validation
An optional dominance h defaults to zero and must lie in the closed unit interval when provided. Zero or negative μ or s, values above one, and h outside [0, 1] are rejected with a clear message and are not billed. Example: μ equals 1e-6 and s equals 0.01 with default h yields q-hat 0.01, carrier frequency 0.0198, affected frequency 0.0001, and load 1e-6. Example: the same μ with s equals 0.1 and h equals 0.5 yields q-hat 2e-5. POST a JSON body with two required finite numbers: mutation_rate (μ, strictly positive and at most one) and selection_coefficient (s against the deleterious homozygote, strictly positive and at most one; s equals one is recessive lethal). Each field accepts a JSON number or a numeric string, including scientific notation such as 1e-6; aliases mu, u, mutation, mut for the mutation rate, s, selection, sel for the selection coefficient, and h, dominance_coefficient, het_dominance for dominance are normalized to the canonical keys. Missing fields, booleans, empty strings, and non-finite values fail with invalid_input naming the field. On success the body echoes the rounded inputs, reports equilibrium_frequency q-hat from √(μ/s) when h is zero or from μ/(h s) when h is positive, wildtype_frequency as one minus q-hat, heterozygote_frequency as 2pq, homozygote_frequency as q squared, mutation_load as 2 h s p q plus s q squared, plus formula, model (recessive, partial_dominance, or dominant), and a short message. If the textbook q-hat would exceed one — μ larger than s when recessive, or μ larger than h s when h is positive — the request fails rather than clamping to fixation. Pair successive loci yourself; each request solves one autosomal locus.
Where a mutation–selection equilibrium API earns its keep
Keep requests small, pin equilibrium_frequency and heterozygote_frequency in tests, and you get reproducible mutation–selection figures for homework, counseling worksheets, and edge workers without hosting a population-genetics stack of your own.
Technical questions
How do I calculate the equilibrium frequency of a recessive deleterious allele?
Send positive mutation_rate μ and selection_coefficient s (dominance defaults to 0). The API returns q = √(μ/s), plus wild-type p, carrier 2pq, homozygote q², and mutation load L = s q².
What does the mutation-selection equilibrium calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.