How to Calculate Allele Frequencies in a Population

An allele is one version of a gene, and an allele frequency is the share of all copies of that gene in a population that are a particular version. At heart, the calculation is counting rather than complicated math, because every individual with paired chromosomes carries two copies to tally. Counting only works directly when you can tell every genotype apart, which is why a set of equations named Hardy-Weinberg exists for the cases where you can’t.

The Counting Method Step by Step

An individual’s genotype is the pair of alleles it carries: either two identical copies (homozygous) or two different ones (heterozygous). Since each individual carries a pair, a population of N individuals holds 2N copies of the gene in total.1Atlas of Genetics and Cytogenetics in Oncology and Haematology. Hardy-Weinberg model Each AA individual adds two A copies, and each Aa individual adds one.1Atlas of Genetics and Cytogenetics in Oncology and Haematology. Hardy-Weinberg model So the frequency of A equals (2 × number of AA + number of Aa) divided by 2N.1Atlas of Genetics and Cytogenetics in Oncology and Haematology. Hardy-Weinberg model The frequency of a works the same way, using aa individuals and heterozygotes.1Atlas of Genetics and Cytogenetics in Oncology and Haematology. Hardy-Weinberg model

Take a population of 100 individuals: 36 AA, 48 Aa, and 16 aa. There are 200 gene copies in total. The A copies number 72 from the AA individuals plus 48 from the heterozygotes, which is 120, so A is 0.6. The a copies number 32 plus 48, which is 80, so a is 0.4.

If you already have genotype shares rather than counts, the frequency of A is the AA share plus half the Aa share.1Atlas of Genetics and Cytogenetics in Oncology and Haematology. Hardy-Weinberg model The frequency of a is the aa share plus half the Aa share.1Atlas of Genetics and Cytogenetics in Oncology and Haematology. Hardy-Weinberg model The two frequencies always add up to 1, which gives you a quick check on your arithmetic.

A common slip is dividing by N instead of 2N, which gives frequencies that add up to 2. Another is forgetting heterozygotes, even though they count toward both alleles.

Direct counting works when every genotype can be identified, as with markers where heterozygotes show both alleles.2PubMed. Estimating Allele Frequencies In one study of chickens, a blood protein test showed one fast band, one slow band, or both, marking the two homozygotes and the heterozygote.3African Journal of Biotechnology. Biochemical characterization of indigenous Fulani and Yoruba ecotypes chicken of Nigeria

The same logic applies to raw phenotypes, but only if each phenotype maps to exactly one genotype. That is true for codominant markers such as MN blood groups. With a dominant-recessive trait, the dominant phenotype hides two genotypes, so you can’t tally alleles and need another method.

Using Hardy-Weinberg When Only the Recessive Trait Shows

By convention, p stands for the dominant allele’s frequency and q for the recessive allele’s, so p + q = 1. If mating is random, the genotype shares are p² for AA, 2pq for Aa, and q² for aa, and these add up to 1. That makes q² the share of homozygous recessive individuals.4Kansas State University. Hardy-Weinberg practice questions When dominant AA and Aa individuals look identical, the recessive individuals are the only group you can count directly.

A standard practice question gives a population where 36% are aa and asks for every allele and genotype frequency.4Kansas State University. Hardy-Weinberg practice questions Here q² is 0.36, and its square root gives q = 0.6. Then p = 1 − 0.6 = 0.4. AA is 0.4², or 16%, and Aa is 2 × 0.4 × 0.6, or 48%. That leaves 64% of the population showing the dominant trait and 36% the recessive one.

You can’t start from the dominant share, because those individuals are a mix of AA and Aa. Taking the square root of the dominant share gives a wrong answer. Always start from q² and work outward.

To turn the answers into numbers of individuals, multiply each genotype share by the population size. In 1,000 people at these frequencies, about 480 would be carriers.

Read the problem carefully to see what the given number is. Problems often say “9% of people have the recessive trait” or “1 in 2,500 is affected.” Convert a fraction like 1 in 2,500 into a decimal (0.0004) before taking the root. Percentages must become decimals too, since the square root of 36 is 6 but the square root of 0.36 is 0.6. Also check that the number describes individuals showing the recessive phenotype and not an allele frequency. If it is already q, no square root is needed.

To check a finished answer, confirm that p + q equals 1 and that p², 2pq and q² add to 1. Then square q again and see whether it returns the recessive share you were given.

The wording of the question matters as well. “Frequency of carriers” means heterozygotes, so the answer is 2pq, not q. “Frequency of the dominant phenotype” means AA plus Aa together, not p² alone. And q and q² are different quantities, an allele frequency and a genotype frequency, so mixing them up is the most common lost mark.

When the Hardy-Weinberg Shortcut Holds

Hardy-Weinberg equilibrium is the state where allele and genotype frequencies stay stable from one generation to the next. It assumes random mating, a large population, and no selection, migration, or new mutations. Break those and the equations stop predicting well. Inbreeding, for example, produces more homozygotes than the equations predict, so scientists studying inbred species must measure inbreeding first.5PubMed Central. Estimating inbreeding coefficients from NGS data: Impact on genotype calling and allele frequency estimation

The payoff is practical. Assuming equilibrium, doctors and researchers can estimate how many people will have a recessive disease from how common the disease allele is in sampled DNA.6PubMed. Prevalence estimation for monogenic autosomal recessive diseases using population-based genetic data A disease allele at 1% would mean about 1 in 10,000 people affected, since 0.01² is 0.0001.

So which approach should you use on a problem? If all three genotype counts are given, count directly and skip the equations. If only phenotypes of a dominant-recessive trait are given, you must assume equilibrium. Comparing counted genotypes to p², 2pq, and q² also tests whether the population is in equilibrium.

To run that test, calculate p and q by counting, then compute expected genotype numbers as p², 2pq, and q² times N. Big gaps between expected and observed numbers hint at inbreeding or selection.

Inbreeding changes the genotype shares but not the allele frequency, so frequencies from direct counting remain valid. A recessive-share shortcut, though, would give the wrong q.

Three or More Alleles Like ABO Blood Types

ABO blood type has three main alleles, often written p for A, q for B, and r for O, with p + q + r = 1. Type O people carry two O alleles, so r² is the share with type O, and the square root of that share gives r directly.

The difficulty is that A and B are dominant to O, and codominant with each other. Type A people may be AA or AO, and type B people may be BB or BO. Only type O (OO) and type AB (AB) map to a single genotype each, which is why the O share is the starting point. It is the three-allele version of a dominant trait hiding two genotypes.

To work a problem, take the square root of the type O share to get r. People with type A or type O are exactly those carrying no B allele, so their combined share is (p + r)². Take the square root of that to get p + r, then subtract r to leave p. Subtracting p and r from 1 gives q, so all three frequencies come from just two shares. As a check, recalculate the AB share as 2pq.

With numbers: if type O is 25% of the population, r is 0.5. If types A and O together are 64%, then p + r is 0.8, so p is 0.3 and q is 0.2. The expected AB share is 2 × 0.3 × 0.2, or 12%, which you compare to the observed AB share.

Genes on the X Chromosome

In humans, males have one X and females have two, so total copies are females × 2 plus males × 1. The share of males showing an X-linked recessive trait therefore equals the allele frequency q directly. Affected females are expected at q², which is why such traits are far rarer in women. The same logic applies to other species with two sex chromosome types, including birds and butterflies, where females carry the single chromosome.7PubMed Central. Testing for Hardy–Weinberg equilibrium at biallelic genetic markers on the X chromosome

Red-green color blindness shows how this plays out. If about 8% of men are affected, q is about 0.08, and expected affected women are about 0.08², which is under 1%.

For a mixed-sex sample, say 100 females and 100 males, there are 200 X copies from females plus 100 from males, so 300 in total, not 400. Count affected alleles the same way: two per homozygous recessive female, one per carrier female, and one per affected male. Divide by the 300 total copies to get q.

How Many Individuals You Need to Sample

The uncertainty in an allele frequency estimate shrinks as you sample more individuals, but each extra individual helps less than the last.8PubMed Central. Confidence Intervals for Population Allele Frequencies: The General Case of Sampling from a Finite Diploid Population of Any Size Going from 10 to 20 individuals narrows uncertainty far more than going from 200 to 210. It shrinks roughly with the square root of the sample size, so halving it takes about four times as many individuals. In one analysis, about 22 individuals were needed to keep the estimate within a moderate range, and about 49 for a tighter one.8PubMed Central. Confidence Intervals for Population Allele Frequencies: The General Case of Sampling from a Finite Diploid Population of Any Size Forensic DNA labs need reference databases large enough, such as 500 people, for match probabilities to be trustworthy.9PubMed. Impact of population size on population genetic analysis of Short Tandem Repeat (STR) allelic data, forensic and paternity parameters and its effect on forensic DNA analysis

Small samples swing widely. With 10 individuals, one extra heterozygote shifts a frequency by 5 percentage points. A rare allele at 1% may not appear at all in 30 people, so frequencies from small samples should be reported as rough.

Who you sample matters too. Sampling relatives counts the same alleles twice and inflates rare ones, which is why large genetic databases remove close relatives. Unrelated individuals chosen across the population give the cleanest estimate.

Rare alleles are the hardest to pin down: one may show up in only one or two individuals, so a single chance event can double its estimated frequency. Studying a rare disease allele needs a much bigger sample than studying a common one.

How Scientists Do It With DNA Data

When DNA is read only a few times per person, genotypes are uncertain, so methods estimate frequencies by weighing all three possible genotypes.10PubMed Central. Estimation of allele frequency and association mapping using next-generation sequencing data Guessing outright would bias the count, because with few reads a heterozygote can appear to have just one allele by chance. Instead, each possible genotype gets a probability based on the reads, and the allele frequency comes from the expected number of copies, a weighted version of the same counting.

Some studies mix DNA from many individuals and read the share of each allele in the pool.11Methods in Ecology and Evolution. poolHelper: An R package to help in designing Pool‐Seq studies The fraction of reads carrying one allele serves as the estimate of its frequency in the whole group. Individual genotypes are lost, so you can’t recover who carried what or test genotype shares directly. Unequal contributions to the pool and reading errors can skew estimates,11Methods in Ecology and Evolution. poolHelper: An R package to help in designing Pool‐Seq studies. Estimates improved as reads increased, with little extra gain past about 20 reads.12PubMed Central. Estimating microhaplotype allele frequencies from low-coverage or pooled sequencing data

Some alleles fail to show up in a test, making heterozygotes look homozygous.13Molecular Ecology Notes. A method for adjusting allele frequencies in the case of microsatellite allele drop‐out The visible homozygote share is then too high, which inflates how often people appear to be inbred. An excess of apparent homozygotes against Hardy-Weinberg conditions is one way such problems get flagged. Statistical corrections can detect and adjust for these missing alleles.14PubMed. Assessment of power and accuracy of methods for detection and frequency-estimation of null alleles Big reference databases like gnomAD also remove low-quality samples and doubtful variants before reporting frequencies.15PubMed Central. Variant interpretation using population databases: Lessons from gnomAD

Many crop and garden plants carry four or more copies of each chromosome.16PubMed. Estimation of allele frequencies in polyploids under certain patterns of inheritance In one four-copy case, 35 possible genotypes collapse into only 15 visible patterns, so simple counting fails.16PubMed. Estimation of allele frequencies in polyploids under certain patterns of inheritance Dedicated software exists to estimate frequencies for such plants.17PubMed. POLYSAT: an R package for polyploid microsatellite analysis