Works on this device
Allele Frequency Calculator
Find how common each allele of a gene is. Start from the number of individuals with each genotype, from genotype frequencies, from counts of allele copies or from sequencing reads. The tool also follows allele frequencies over generations when genotypes differ in fitness.
Enter your values
Check these values
Your values are worked out in this browser. They are not sent to a server.
Your result will show here
Fill in the values, then choose Calculate.
Your result
How it was worked out
How to use this calculator
- Choose what you know: genotype counts (such as 90 AA, 75 Aa and 35 aa), genotype frequencies (such as AA 0.49), allele counts (copies of each allele), sequencing reads, or a starting frequency to follow over generations.
- Type one row for each genotype or allele. A genotype is two allele names, such as
Aa, or names with a slash, such asA1/A2. Capital and small letters are different alleles. - Choose the confidence level of the interval (95% is common).
- Choose Calculate. The result shows each allele frequency with its standard error and interval, the genotype frequencies that Hardy-Weinberg proportions expect, and the working.
The formulas
- From genotype counts: allele frequency = (2 × number of homozygotes for the allele + number of heterozygotes that carry it) ÷ 2N, where N is the number of individuals. Each individual has two copies of the gene, so there are 2N copies.
- From genotype frequencies: p = P(AA) + ½ P(Aa). In general, the frequency of a homozygote plus half the frequencies of the heterozygotes that carry the allele.
- From allele counts: frequency = copies of the allele ÷ all copies counted.
- Standard error (binomial): SE = √(p(1 − p) ÷ n), with n the number of allele copies counted (2N for N diploid individuals).
- Interval: the Wilson score interval, (p + z²/2n ± z √(p(1 − p)/n + z²/4n²)) ÷ (1 + z²/n), with z = 1.960 for 95%. It stays between 0 and 1.
- Variant allele frequency (VAF) = reads with the variant allele ÷ all reads at the position.
- Over generations: p' = (p² w_AA + pq w_Aa) ÷ w̄, with w̄ = p² w_AA + 2pq w_Aa + q² w_aa, where w is the relative fitness of each genotype.
Worked examples
Genotype counts. 90 AA, 75 Aa and 35 aa make N = 200 individuals and 400 allele copies. A has 2 × 90 + 75 = 255 copies, so p = 255 ÷ 400 = 0.6375 and q = 0.3625. The standard error is √(0.6375 × 0.3625 ÷ 400) = 0.0240, and the 95% interval for p is 0.5893 to 0.6831.
Genotype frequencies. AA 0.49, Aa 0.42 and aa 0.09 give p = 0.49 + 0.42 ÷ 2 = 0.7 and q = 0.3.
Reads. 37 of 82 reads show the variant: the VAF is 45.12%, with a 95% interval of 34.81% to 55.87%.
Over generations. Start with p = q = 0.5. If aa individuals never breed (fitness 0) and AA and Aa have fitness 1, q falls to 0.3333 after one generation and to 0.1429 after five, which is q₀ ÷ (1 + 5 q₀) = 0.5 ÷ 3.5.
Limits you should know
- One gene at a time, with up to 10 alleles. Genotypes you leave out count as 0.
- The standard error takes the allele copies as independent draws from a large population. Related individuals, a departure from Hardy-Weinberg proportions or errors in typing make the real uncertainty larger.
- The VAF interval counts only the chance in sampling reads, not sequencing or mapping errors.
- The generations model has random mating, a very large population, separate generations and selection on survival only. It has no mutation, migration or chance drift.
- To test genotype counts against Hardy-Weinberg proportions, use the Hardy Weinberg Calculator. For genotype frequencies on their own, use the Genotype Frequency Calculator.