Tutorials › Statistical Genetics › Common Errors In Allele And Genotype Frequency Calculations

Mendelian Probability and Allele Frequencies · Tutorial 18 of 989

Common Errors In Allele And Genotype Frequency Calculations

Practice calculating allele frequencies from genotype data, checking frequency arithmetic, and deciding whether Hardy–Weinberg expectations fit the data.

Beginner 9 min read

What You'll Learn

  • Distinguish genotype frequencies from allele frequencies.
  • Calculate allele frequencies by counting allele copies in diploid genotype data.
  • Check that genotype and allele frequencies are valid and use compatible denominators.
  • Derive Hardy–Weinberg expectations from allele frequencies without treating them as observed frequencies.
  • Identify ploidy and population mismatches that make a Hardy–Weinberg calculation unsuitable.

Why Frequency Calculations Go Wrong

Allele- and genotype-frequency calculations are simple once the quantity and its denominator are clear. Errors often arise because the same sample can be described in two different ways: by the genotypes of individuals or by the alleles carried in their chromosome copies. A count of individuals with at least one copy of an allele, for example, is not generally a count of that allele.

The distinction matters when summarizing data and when calculating Hardy–Weinberg expectations. Those expectations are calculated from allele frequencies, not by reusing a genotype frequency as though it were an allele frequency. Before calculating, identify what is being counted, what the denominator is, and whether the model matches the data.

Definition: At a biallelic autosomal locus, write the alleles as \(A\) and \(a\), and the diploid genotypes as \(AA\), \(Aa\), and \(aa\). The genotype frequency of a genotype is the proportion of individuals with that genotype. The allele frequency of \(A\) is the proportion of allele copies that are \(A\); the frequency of \(a\) is the proportion that are \(a\). In a sample of \(N\) correctly genotyped diploid individuals, let \(n_{AA}\), \(n_{Aa}\), and \(n_{aa}\) be the genotype counts, with \(N=n_{AA}+n_{Aa}+n_{aa}\).

Count Allele Copies, Not Individuals

Each individual in a diploid sample contributes two allele copies at the locus. An \(AA\) individual contributes two copies of \(A\); an \(Aa\) individual contributes one copy of \(A\) and one of \(a\); and an \(aa\) individual contributes two copies of \(a\). Thus the total number of allele copies is \(2N\), and the sample allele-frequency estimates are:

$$ \hat{p}=\frac{2n_{AA}+n_{Aa}}{2N}, \qquad \hat{q}=\frac{2n_{aa}+n_{Aa}}{2N}. $$

Here \(\hat{p}\) estimates the population frequency \(p\) of allele \(A\), and \(\hat{q}\) estimates the population frequency \(q\) of allele \(a\). The hat indicates an estimate from the sample; it does not mean the frequency is known exactly for the population. The genotype frequencies are instead \(n_{AA}/N\), \(n_{Aa}/N\), and \(n_{aa}/N\). These have individuals, not allele copies, in their denominator.

Key result: For complete biallelic genotype data from diploid individuals, the sample frequency of \(A\) can also be written as \(\hat{p}=f_{AA}+\frac{1}{2}f_{Aa}\), where \(f_{AA}=n_{AA}/N\) and \(f_{Aa}=n_{Aa}/N\). Each \(AA\) individual contributes two \(A\) copies, while each heterozygote contributes one.

A Short Check on the Counting Formula

The formula follows by counting the copies of \(A\) in each genotype class. Summing over the classes gives \(2n_{AA}+n_{Aa}\) copies of \(A\). The sample contains \(2N\) copies altogether, so dividing gives \(\hat{p}\). The corresponding count of \(a\) copies is \(2n_{aa}+n_{Aa}\). Adding the two allele-frequency estimates checks that no allele copies have been lost or counted twice:

$$ \hat{p}+\hat{q} =\frac{2n_{AA}+n_{Aa}+2n_{aa}+n_{Aa}}{2N} =\frac{2(n_{AA}+n_{Aa}+n_{aa})}{2N} =1. $$

This check depends on the genotype counts covering all \(N\) individuals and on each individual contributing exactly two copies at the locus. If some genotypes are missing, the denominator should reflect the individuals with valid genotype data. If ploidy differs, the total number of allele copies must be counted directly rather than assumed to equal \(2N\).

Worked Example: Counting Copies in a Diploid Sample

In a hypothetical sample of 100 diploid individuals, 30 have genotype \(AA\), 50 have \(Aa\), and 20 have \(aa\). Calculate the genotype frequencies and the sample allele frequencies.

Genotype frequencies. Divide each genotype count by the 100 individuals: \(f_{AA}=30/100=0.30\), \(f_{Aa}=50/100=0.50\), and \(f_{aa}=20/100=0.20\). These sum to \(1.00\), as they should when the three genotype classes include everyone.

Frequency of \(A\). There are \(2(30)+50=110\) copies of \(A\) among \(2(100)=200\) allele copies. Therefore,

$$ \hat{p}=\frac{2(30)+50}{2(100)} =\frac{110}{200}=0.550. $$

Frequency of \(a\). There are \(2(20)+50=90\) copies of \(a\), so \(\hat{q}=90/200=0.450\). The check is \(0.550+0.450=1.000\). By contrast, \(80/100=0.80\) is the proportion of individuals with at least one \(A\) copy, not the frequency of \(A\) among allele copies.

Genotype Frequencies Are Not Allele Frequencies

A genotype frequency describes a proportion of individuals. An allele frequency describes a proportion of chromosome copies. A heterozygote is one individual but contains one copy of each allele, which is why its contribution to an allele frequency is half its genotype frequency. Neither an \(AA\) frequency nor the proportion of individuals carrying \(A\) can be substituted for \(\hat{p}\) without checking the genotype composition.

The genotype frequencies and allele frequencies are connected, but they answer different questions. For example, the frequency of \(A\) is \(f_{AA}+\frac{1}{2}f_{Aa}\), while the proportion of individuals carrying at least one \(A\) is \(f_{AA}+f_{Aa}\). These expressions differ whenever heterozygotes are present. Confusing them can produce a number between zero and one that looks plausible but represents the wrong quantity.

Worked Example: Convert Genotype Frequencies to Allele Frequencies

In a hypothetical sample of 500 diploid individuals, the genotype counts are \(AA=90\), \(Aa=220\), and \(aa=190\). First calculate genotype frequencies, then use the genotype composition to estimate allele frequencies.

The genotype frequencies are \(90/500=0.180\), \(220/500=0.440\), and \(190/500=0.380\). They sum to \(1.000\). There are \(2(500)=1000\) allele copies. The number of \(A\) copies is \(2(90)+220=400\), giving:

$$ \hat{p}=\frac{2(90)+220}{1000} =\frac{400}{1000}=0.400. $$

The number of \(a\) copies is \(2(190)+220=600\), so \(\hat{q}=600/1000=0.600\). Equivalently, \(\hat{p}=0.180+\frac{1}{2}(0.440)=0.400\). The value \(0.440\) is the frequency of heterozygous individuals, not the frequency of either allele.

Using Allele Frequencies for Hardy–Weinberg Expectations

For a biallelic autosomal locus, the Hardy–Weinberg model gives expected genotype proportions \(p^2\), \(2pq\), and \(q^2\), where \(p\) and \(q\) are the allele frequencies and \(p+q=1\). A basic interpretation is that two allele copies are drawn from the population with probabilities \(p\) and \(q\), and paired to form a diploid genotype. This calculation describes model expectations; it does not turn the observed genotype proportions into those expectations.

Model condition: Use the standard biallelic Hardy–Weinberg proportions for a population of diploid individuals at an autosomal locus when the allele frequencies refer to the population being modeled and the assumptions behind random union of alleles are appropriate. In particular, the calculation should not silently combine incompatible populations or ploidies. The resulting proportions are expected frequencies under the model, not a guarantee about the observed sample.

The arithmetic also provides a useful check on the inputs. If \(p+q=1\), then \(p^2+2pq+q^2=(p+q)^2=1\). The three expected genotype proportions therefore add to one. If an allele frequency was calculated from valid biallelic diploid genotype data, substituting \(\hat{p}\) and \(\hat{q}\) gives sample-based expected proportions. These are not the observed genotype frequencies, even when they happen to be close.

Worked Example: Avoid Reusing a Genotype Frequency as an Allele Frequency

Suppose the observed genotype frequencies in a hypothetical sample are \(f_{AA}=0.40\), \(f_{Aa}=0.20\), and \(f_{aa}=0.40\). These are valid genotype frequencies because they sum to one. Calculate the allele frequencies and the Hardy–Weinberg expected genotype proportions, assuming the sample represents a population for which the model is appropriate.

The frequency of \(A\) is \(0.40+\frac{1}{2}(0.20)=0.50\); the frequency of \(a\) is \(0.40+\frac{1}{2}(0.20)=0.50\). Using these allele frequencies, the expected proportions are:

$$ p^2=(0.50)^2=0.250,\qquad 2pq=2(0.50)(0.50)=0.500,\qquad q^2=(0.50)^2=0.250. $$

These model expectations sum to \(1.000\). The observed \(AA\) frequency is \(0.40\), but using \(0.40\) as \(p\) would be an error: \(0.40\) is an observed genotype frequency. The allele frequency \(p\) is \(0.50\), because heterozygotes contribute one \(A\) copy each. The observed proportions \((0.40,0.20,0.40)\) and the expected proportions \((0.250,0.500,0.250)\) are different descriptions and should not be conflated.

Check Whether the Inputs Fit the Calculation

A correct formula can still yield a misleading result if the input data do not meet its basic requirements. Before calculating, check the locus, the individuals, and the denominator. The ordinary formula with denominator \(2N\) presumes that all \(N\) individuals are diploid at the locus and have usable genotype calls. It is not automatically appropriate for a sex-linked locus with different ploidy across individuals, a mixture of populations with different allele frequencies, or data in which the denominator changes across genotype categories.

Likewise, applying Hardy–Weinberg proportions requires more than having three genotype labels. The standard proportions concern diploid genotypes at a biallelic autosomal locus under a population model. A calculation based on pooled data may be inappropriate if the pooled individuals do not share the same relevant population allele frequencies or do not have the same ploidy. In such cases, first define the appropriate group and count the allele copies for that group; do not force the data into the standard formula.

Worked Example: Recognize a Ploidy Mismatch

Consider a hypothetical data set at a locus on the X chromosome: 60 females have diploid genotype calls (\(AA=24\), \(Aa=24\), \(aa=12\)), while 40 males have one allele call each (\(A=28\), \(a=12\)). Explain why pooling the 100 people as if all were diploid and applying the usual autosomal genotype-frequency calculation is unsuitable.

The females contribute \(2(60)=120\) allele copies, while the males contribute only 40 copies at this locus. The total is \(160\), not \(2(100)=200\). Among females, there are \(2(24)+24=72\) copies of \(A\); among males, there are 28. Counting copies directly gives a pooled sample proportion of \(A\) of \((72+28)/160=100/160=0.625\). This arithmetic does not make the pooled data a standard diploid genotype table: male calls are single alleles, not \(AA\), \(Aa\), or \(aa\) genotypes.

There is also a population-frequency check to consider. In the females, the \(A\) frequency is \(72/120=0.600\); among males, it is \(28/40=0.700\). These sample proportions differ. Without a model and sampling justification for pooling the sexes, one should not report pooled standard autosomal Hardy–Weinberg genotype expectations as though all 100 individuals had the same diploid genotype structure. The first correction is to respect ploidy and state which group and model a calculation concerns.

Common Mistakes and a Practical Audit

  • Counting carriers instead of allele copies. The proportion of individuals with at least one \(A\) is not generally the \(A\) allele frequency. Count two copies for \(AA\), one for \(Aa\), and zero for \(aa\).
  • Using a genotype frequency as \(p\) or \(q\). A genotype frequency has individuals in its denominator. Calculate allele frequency from the genotype composition, including half the heterozygote frequency.
  • Mixing denominators. Genotype frequencies divide by the number of individuals with valid calls; allele frequencies divide by the number of relevant allele copies. Check that missing data or ploidy differences do not change the denominator.
  • Calling model expectations observed data. Hardy–Weinberg proportions are calculated from allele frequencies under a model. They are not a relabeling of the observed genotype frequencies.
  • Applying the standard formula to unsuitable inputs. Check that the data concern the intended population and diploid autosomal locus before using \(2N\) or the standard three-genotype expectations.

A useful audit is to write down the target quantity before doing arithmetic: genotype frequency among individuals, or allele frequency among copies. Then state the count and denominator, verify that genotype frequencies sum to one and that allele frequencies sum to one, and only then calculate any model expectations. These checks catch many errors without requiring a more complicated analysis.

Check Your Understanding

For each question, identify the quantity being calculated and state the denominator or model condition that matters.

  1. A diploid sample has \(n_{AA}=12\), \(n_{Aa}=36\), and \(n_{aa}=52\). What are \(\hat{p}\) and \(\hat{q}\)?
  2. Explain why the proportion of individuals with at least one \(A\) is not generally the allele frequency of \(A\).
  3. If genotype frequencies are \(f_{AA}=0.25\), \(f_{Aa}=0.50\), and \(f_{aa}=0.25\), calculate the frequency of \(A\). Which quantity is the heterozygote frequency?
  4. Why should Hardy–Weinberg expected proportions be calculated from allele frequencies rather than by treating an observed genotype frequency as \(p\)?
  5. What denominator should be used for allele frequency if some diploid individuals have missing genotype calls?
  6. Why is the standard denominator \(2N\) unsuitable when a pooled sample includes individuals with different ploidy at the locus?
Clinical Biostats