Allele Frequency and Genotype Distribution Calculator
What this allele frequency calculator does
This calculator estimates allele frequencies for a two-allele system (A and a) using genotype counts (AA, Aa, aa). It also compares observed genotypes to simple Hardy–Weinberg expectations to help you spot obvious deviations.
Inputs you need
Enter the number of individuals in each genotype group:
- AA - homozygous dominant
- Aa - heterozygous
- aa - homozygous recessive
Allele frequency formulas
Let the total number of individuals be:
\( N = AA + Aa + aa \)
The total number of alleles in the sample is \(2N\). The allele copy counts are:
\( A_{count} = 2\cdot AA + Aa \)
\( a_{count} = 2\cdot aa + Aa \)
Allele frequencies are:
\( p = \frac{A_{count}}{2N} \)
\( q = \frac{a_{count}}{2N} \)
For a two-allele system, \(p + q = 1\).
Observed genotype frequencies
Observed genotype frequencies are calculated as:
\( f(AA) = \frac{AA}{N}, \quad f(Aa) = \frac{Aa}{N}, \quad f(aa) = \frac{aa}{N} \)
Hardy–Weinberg expectations
If the population is approximately in Hardy–Weinberg equilibrium, expected genotype frequencies are:
\( f_{exp}(AA) = p^2 \)
\( f_{exp}(Aa) = 2pq \)
\( f_{exp}(aa) = q^2 \)
Expected counts are found by multiplying by \(N\):
\( E(AA) = p^2N, \quad E(Aa) = 2pqN, \quad E(aa) = q^2N \)
Simple deviation check (chi-square)
A basic chi-square statistic can summarize how far observed counts are from expected counts:
\[ \chi^2 = \sum \frac{(O - E)^2}{E} \]
This calculator uses a simple rule-of-thumb threshold (commonly \( \chi^2 \ge 3.84 \)) to flag a possible deviation. This is a quick screening step, not a substitute for a complete statistical test design.