Tutorials › Statistical Genetics › Heterozygosity Outliers and Contamination Checks

Genotyping Data and Quality Control · Tutorial 93 of 989

Heterozygosity Outliers and Contamination Checks

Calculate sample heterozygosity and use it with missingness and allele balance to investigate, rather than automatically diagnose, unusual genotype patterns.

Beginner 10 min read

What You'll Learn

  • Calculate observed heterozygosity using called diploid genotypes at eligible markers.
  • Explain how an allele-frequency benchmark gives an expected heterozygosity.
  • Compare a sample with an appropriate reference set and identify high or low outliers.
  • Combine heterozygosity with sample missingness and heterozygous-call allele balance.
  • Distinguish possible contamination, inbreeding, and technical failure without treating any one pattern as conclusive.

Why Heterozygosity Is a Sample-Level QC Measure

At a biallelic diploid site, a called genotype is heterozygous when the individual carries one copy of each allele. Across many sites, the fraction of heterozygous calls provides a compact summary of a sample’s genotype pattern. A sample with a markedly different fraction from comparable samples deserves investigation: excess heterozygosity can be consistent with contamination, while a deficit can be consistent with inbreeding or technical problems.

The fraction is a diagnostic, not a verdict. Its value depends on which variants were included, how calls were filtered, and how the sample compares with the right reference group. A useful QC interpretation therefore considers heterozygosity together with sample missingness and, where available, allele balance in heterozygous calls.

Definition: For a sample and a specified set of eligible diploid markers, observed heterozygosity is the number of called heterozygous genotypes divided by the number of called genotypes at those markers. Missing genotypes are not counted as heterozygous or homozygous; they are excluded from the denominator. The sample missingness rate is the number of missing genotypes divided by the total number of eligible markers.

Calculating Observed Heterozygosity

Let \(M\) be the number of eligible markers, \(m_i\) the number with a missing genotype in sample \(i\), and \(h_i\) the number with a called heterozygous genotype. The number of called genotypes is \(M-m_i\). The sample’s observed heterozygosity is therefore \(h_i/(M-m_i)\), and its missingness rate is \(m_i/M\).

$$ H_{\mathrm{obs},i}=\frac{h_i}{M-m_i}, \qquad \text{missingness}_i=\frac{m_i}{M}. $$

The denominator matters. Dividing by all eligible markers would treat missing genotypes as though they were non-heterozygous calls, artificially lowering the heterozygosity rate in samples with substantial missingness. Always state which marker set is being used and whether the rate is based on called genotypes.

For a meaningful comparison, use a consistent set of high-quality markers and apply the same genotype filters to every sample. In many genome-wide checks, investigators use autosomal biallelic SNPs and remove markers with poor call quality or problematic characteristics. They may also prune markers in strong linkage disequilibrium: many correlated markers can otherwise give an unbalanced impression of the genome-wide pattern. The exact marker set and filtering decisions should be recorded, since changing them can change the rate.

Worked Example: Calculating a Sample’s Observed Heterozygosity

In a hypothetical QC set, 20 eligible diploid SNPs were considered for one sample. The sample had 2 missing calls, 8 called heterozygous genotypes, and 10 called homozygous genotypes. Calculate its observed heterozygosity and missingness.

There are \(20-2=18\) called genotypes. Thus,

$$ H_{\mathrm{obs}}=\frac{8}{18}=0.4444. $$

The observed heterozygosity is 0.4444, or 44.44% of called genotypes. Missingness is \(2/20=0.1000\), or 10.00%. The heterozygosity denominator is 18, not 20, because the two missing genotypes provide no observed genotype category.

Expected Heterozygosity as a Comparison

An observed rate is most useful when compared with a suitable expectation. At a biallelic marker with allele frequencies \(p\) and \(1-p\), if two alleles pair independently according to those frequencies, the probability of a heterozygous genotype is \(p(1-p)+(1-p)p=2p(1-p)\). This is a simple benchmark for that marker, not a universal prediction for every sample or population.

$$ P(\text{heterozygous at a marker})=2p(1-p). $$

Across a fixed marker set, the mean of these marker-specific expectations can serve as a reference for observed heterozygosity. For instance, if the expected heterozygosity values at \(K\) eligible markers are \(e_1,\ldots,e_K\), their unweighted mean is \(\sum_{j=1}^{K} e_j/K\). The benchmark depends on the allele frequencies used. A reference that is poorly matched to a sample’s ancestry can make a normal sample appear unusual, so comparisons should be made with an appropriate reference group or a well-matched set of samples.

This calculation does not require every marker to have the same allele frequency. It does require that the frequency reference and marker set be defined consistently. It is also not a substitute for QC: a sample’s observed calls may be affected by missingness, calling errors, or contamination even when the benchmark is well chosen.

Worked Example: A Marker-Specific Expected Rate

At one hypothetical biallelic marker, a suitable reference gives \(p=0.30\) for one allele and \(1-p=0.70\) for the other. Under independent pairing of alleles, calculate the expected heterozygous fraction at this marker.

The two ways to form a heterozygote are first allele then second allele, or second then first. Therefore,

$$ 2p(1-p)=2(0.30)(0.70)=0.42. $$

The benchmark is 0.42, or 42%. This is an expected probability for this marker under the stated pairing assumption; it is not a claim that exactly 42% of a finite sample must be heterozygous, and it is not by itself a contamination threshold.

Finding and Interpreting Heterozygosity Outliers

A QC workflow typically compares each sample’s rate with the distribution among samples processed and interpreted on a comparable basis. If most rates form a central cluster, samples far above or below it are candidates for review. A standardized score can describe distance from a reference distribution: subtract its mean and divide by its standard deviation. This score is only a screening summary; it does not establish why a sample differs, and a mean and standard deviation can be misleading when the distribution is strongly skewed or contains several groups.

A comparison should not mix samples whose expected patterns differ substantially without checking that the reference is appropriate. In particular, ancestry composition can affect the distribution of allele frequencies and hence the expected heterozygosity. Differences in marker set, genotype filtering, or assay conditions can also make apparent outliers that are not directly comparable.

Worked Example: Comparing a Sample With a Reference Distribution

In a hypothetical set of comparable samples, the mean observed heterozygosity is 0.320 and its standard deviation is 0.025. A new sample has \(H_{\mathrm{obs}}=0.390\), calculated on the same marker set and with the same filters. Calculate its standardized distance from the reference mean.

Using \(z=(H_{\mathrm{obs}}-\text{reference mean})/\text{reference standard deviation}\),

$$ z=\frac{0.390-0.320}{0.025} =\frac{0.070}{0.025} =2.80. $$

The sample is 2.80 reference standard deviations above the mean, so it is a high-heterozygosity candidate for review. This calculation does not assign a probability that contamination occurred, nor does it prove contamination. The reference is assumed to be suitable and the observed rates to have been computed comparably; those assumptions should be checked before interpreting the score.

Use Missingness and Allele Balance Together

A high heterozygosity rate can arise when DNA from more than one individual contributes to a sample: at sites where the contributors differ, mixed reads may support both alleles and lead to extra heterozygous calls. Heterozygous calls may also show unusual allele balance. For sequencing data, allele balance is commonly summarized as the fraction of reads supporting one allele among reads at a heterozygous call; the expected pattern depends on the assay and on the calling and filtering process. Many intermediate or otherwise atypical balances, especially alongside excess heterozygosity, strengthen concern about a technical mixture. They do not uniquely identify its source.

A low heterozygosity rate may be consistent with inbreeding, because a relatedness pattern that increases homozygosity can reduce the fraction of heterozygous genotypes. It can also result from technical failure, such as allele dropout or systematic calling problems. If low heterozygosity occurs with high missingness, poor genotype quality, or abnormal allele balance, technical explanations deserve particular attention. A low rate with otherwise sound calls is a different pattern and may warrant checking the sample’s biological context and the comparison group.

Missingness helps distinguish these possibilities but is not definitive. A sample can have excess heterozygosity and ordinary missingness; it can also have high missingness without unusual heterozygosity. Likewise, a sample with low heterozygosity is not automatically inbred. The purpose of combining diagnostics is to decide what evidence to investigate next, not to force a single interpretation from one summary.

Worked Example: Interpreting a Joint QC Pattern

Three hypothetical samples were evaluated on the same 1,000 eligible markers. The reference group’s typical observed heterozygosity is about 0.30. Sample A has 300 heterozygous calls among 950 called genotypes, with 50 missing markers; its heterozygous-call allele balances are mostly near the assay’s usual pattern. Sample B has 390 heterozygous calls among 990 called genotypes, with 10 missing markers; many heterozygous calls have unusual intermediate read proportions. Sample C has 180 heterozygous calls among 800 called genotypes, with 200 missing markers and poor genotype-quality summaries. Calculate the rates and describe what each pattern suggests.

For Sample A, observed heterozygosity is \(300/950=0.3158\), and missingness is \(50/1000=0.0500\). These values do not suggest an obvious outlier relative to the stated reference, although final assessment depends on the full distribution and marker set.

For Sample B, observed heterozygosity is \(390/990=0.3939\), and missingness is \(10/1000=0.0100\). The high heterozygosity together with atypical allele-balance patterns is consistent with possible contamination or another calling problem. Low missingness does not rule out contamination.

For Sample C, observed heterozygosity is \(180/800=0.2250\), and missingness is \(200/1000=0.2000\). The low rate could be consistent with a biological deficit, but high missingness and poor genotype quality make technical failure a prominent concern. These summaries alone cannot establish inbreeding or identify the particular technical cause.

A Short Justification for the Expected Rate

The benchmark \(2p(1-p)\) follows by considering the two possible allele orders for a heterozygote. Under the stated assumption that each of two allele copies is drawn independently, the probability of the first order is \(p(1-p)\). The probability of the reverse order is \((1-p)p\). These are disjoint events, so their probabilities add:

$$ P(\text{heterozygous}) =P(A\text{ then }a)+P(a\text{ then }A) =p(1-p)+(1-p)p =2p(1-p). $$

The independence assumption is the key to this derivation. The result supplies a reference probability under that model; departures can reflect biology, technical error, or a mismatch between the model and the samples. It does not, on its own, distinguish among those explanations.

Common Mistakes and Practical Interpretation

  • Counting missing genotypes in the denominator as non-heterozygous. This lowers the calculated rate when missingness is high. Divide by called genotypes, and report missingness separately.
  • Calling every high-heterozygosity sample contaminated. Excess heterozygosity is a warning signal, not a diagnosis. Check allele balance, genotype quality, missingness, and comparability to the reference group.
  • Calling every low-heterozygosity sample inbred. Technical failure can create a similar deficit. Consider call quality and missingness before offering a biological explanation.
  • Comparing rates from different marker sets as if they were interchangeable. Different markers can have different expected heterozygosity. Use a consistent, documented set or account for the difference.
  • Treating one threshold as universal. A screening threshold depends on the marker panel, sample composition, and assay. Use the observed distribution and supporting QC evidence rather than interpreting an arbitrary cutoff as proof.
Key takeaway: Observed heterozygosity is a fraction of called genotypes, not a diagnosis. Interpret high or low values against a suitable reference and jointly examine missingness and allele-balance or call-quality evidence before attributing an outlier to contamination, inbreeding, or technical failure.

Check Your Understanding

Answer each question using the definitions and assumptions stated above.

  1. A sample has 24 heterozygous calls, 56 homozygous calls, and 20 missing genotypes among 100 eligible markers. What are its observed heterozygosity and missingness rates?
  2. Why should a missing genotype not be counted as a homozygous call when calculating observed heterozygosity?
  3. At a marker with \(p=0.20\), what expected heterozygous probability follows from independent pairing of alleles?
  4. A sample has high heterozygosity, ordinary missingness, and unusual allele balance across many heterozygous calls. Give a cautious interpretation and name one further QC measure to review.
  5. Why can a low heterozygosity rate together with high missingness not, by itself, establish inbreeding?
Clinical Biostats