Tutorials › High-Dimensional Genomic Data Analysis › Switch Errors And Phasing Uncertainty

Genotype Imputation · Tutorial 49 of 795

Switch Errors And Phasing Uncertainty

Learn to interpret switch errors and phase uncertainty, quantify their implications, and diagnose when incorrect phase may mislead imputation at nearby variants.

Intermediate 10 min read

What You'll Learn

  • Define a switch error using the relative phase of adjacent heterozygous variants.
  • Distinguish a true phase error from an arbitrary swap of haplotype labels.
  • Interpret posterior confidence in a phased relationship without treating it as observed accuracy.
  • Calculate switch-error rates and simple probabilities of phase error.
  • Explain how a phase error can change which nearby haplotype pattern informs imputation.
  • Identify diagnostics, limitations, and appropriate comparisons for phase quality.

Why Phase Errors Matter

At a heterozygous variant, a diploid individual carries two different alleles, one on each chromosome copy. The genotype records both alleles but does not, by itself, say which allele lies on which copy. Phasing assigns the alleles to the two haplotypes. If that assignment is wrong at one part of a region, the resulting haplotype pattern can be wrong even though every observed genotype is correct. This matters for imputation because nearby typed variants help identify the local haplotype context used to infer an untyped allele.

A phase assignment has an arbitrary labeling: calling a chromosome copy “haplotype 1” rather than “haplotype 2” carries no biological meaning. Swapping those labels everywhere leaves the phase unchanged in substance. The relevant error is a switch in relative phase between successive heterozygous variants, not a global relabeling.

Definition: Consider successive heterozygous variants \(j-1\) and \(j\). Their relative phase specifies whether the alternate alleles at the two variants lie on the same haplotype or on opposite haplotypes. A switch error occurs when the estimated relative phase for this pair differs from the true relative phase. A switch-error rate is the number of such errors divided by the number of eligible adjacent-heterozygote pairs being evaluated.

The denominator matters. Switch errors are usually evaluated between adjacent heterozygous sites, so a region with few such pairs has a small and potentially unstable denominator. A rate also depends on how the evaluated sites and intervals are defined. It is therefore useful to report the count, denominator, and genomic span or distance covered, rather than a percentage alone.

Representing Relative Phase

For a precise description, encode the phase at heterozygous site \(j\) by \(z_j\), where \(z_j=0\) or \(1\) indicates which allele is assigned to a chosen haplotype label. The particular choice of label is arbitrary. The relative phase across adjacent sites is represented by the exclusive-or operation, written \(\oplus\):

$$ r_j=z_{j-1}\oplus z_j. $$

If both site labels are swapped, both \(z\) values change, but \(r_j\) does not. Thus, \(r_j\) describes the biologically relevant relationship and is unaffected by a global relabeling. Let \(\hat r_j\) denote the estimated relative phase and \(r_j\) the true relative phase. A switch error at this interval is the event \(\hat r_j\ne r_j\).

Worked Example: Counting Switch Errors Rather Than Wrong Labels

Suppose four consecutive heterozygous variants, A through D, have the following true and estimated haplotypes. A 1 denotes the alternate allele and a 0 the other allele.

Phase assignmentHaplotype 1: A, B, C, DHaplotype 2: A, B, C, D
True1, 0, 1, 10, 1, 0, 0
Estimated1, 0, 0, 00, 1, 1, 1

At A and B, the estimated assignments agree with the truth. At C and D, the two haplotype labels are reversed relative to the true assignment. The relative phase is nevertheless correct from C to D: both sites have been reversed together. The only incorrect relative relationship is between B and C, where the assignment changes from matching the truth to being reversed.

There are three eligible adjacent pairs: A–B, B–C, and C–D. One is a switch error, so the switch-error rate is \(1/3=0.333\), or 33.3% for these three pairs. Counting C and D as two independent switch errors would be wrong: the phase remains consistently flipped after the single transition at B–C.

Switch Error and Phasing Uncertainty Are Different

A switch error compares an estimate with the true phase. In most applications, the true phase is not known, so the actual switch-error rate cannot be calculated for each sample directly. Instead, a phasing method may report uncertainty, such as a posterior probability that a pair of sites has a particular relative phase. That probability describes uncertainty given the data and model; it is not a direct observation of whether the phase is correct.

A site-level phase confidence and an interval-level confidence also answer different questions. Confidence about the allele assignment at one site does not alone determine confidence in the relationship between two sites. Conversely, a local phase relationship can be clear even though the choice of which haplotype receives label 1 is arbitrary.

Worked Example: Interpreting Uncertain Relative Phase

Imagine a hypothetical region with three consecutive heterozygous sites. A phasing analysis assigns probability 0.92 to the reported relative phase for the first interval and probability 0.75 to the reported relative phase for the second interval. For this calculation only, suppose the two interval-phase events are independent.

The probability that both reported relationships are correct is \(0.92\times0.75=0.690\). Therefore, the probability that at least one relationship is wrong is \(1-0.690=0.310\), or 31.0%.

The expected number of incorrect relationships across the two intervals is \((1-0.92)+(1-0.75)=0.08+0.25=0.33\). Dividing by two gives an expected error fraction of \(0.33/2=0.165\), or 16.5%, under this simple probability model. This is an expectation based on reported uncertainty, not an observed switch-error rate. Without the independence assumption, the two probabilities alone do not determine the probability that at least one interval is wrong.

How Uncertain Site Assignments Relate to Switch Risk

A short derivation clarifies why adjacent phase uncertainty is not simply the uncertainty at one site. Let \(e_j=1\) if the estimated orientation at site \(j\) is reversed relative to truth, and \(e_j=0\) otherwise. Reversing the orientation at exactly one endpoint changes the relative phase; reversing both endpoints, or neither, preserves it. Therefore, a switch error occurs exactly when \(e_{j-1}\oplus e_j=1\).

$$ P(\text{switch at }j) =P(e_{j-1}=1,e_j=0)+P(e_{j-1}=0,e_j=1). $$

If the endpoint error events are independent, and their probabilities are \(p_{j-1}\) and \(p_j\), this becomes \(p_{j-1}(1-p_j)+(1-p_{j-1})p_j\). For example, if the endpoint error probabilities are 0.10 and 0.20, the interval switch probability under independence is \(0.10(0.80)+0.90(0.20)=0.26\). Without independence, the joint probabilities are needed. This calculation is a justification for the relationship between endpoint uncertainty and relative-phase uncertainty, not a substitute for the interval probabilities a phasing method may provide directly.

How a Switch Can Affect Nearby-Variant Imputation

Imputation uses observed information and a reference of haplotypes to infer alleles at untyped variants. The key point here is limited but important: phase determines which observed alleles are treated as belonging together on a chromosome copy. A switch can assign a segment’s alleles to the wrong local haplotype pattern. If the untyped allele is associated with one pattern more often than another, using the wrong pattern can change the inferred probability for that allele. The genotype calls at the typed sites need not be wrong for this to happen.

Worked Example: A Phase Switch Changes a Toy Imputation Probability

Consider a hypothetical reference summary with two local haplotype patterns, A and B, at typed markers near an untyped target variant. Suppose the alternate allele at the target is observed on 90% of reference haplotypes with pattern A and 10% with pattern B. For a sample whose target allele is missing, a simple illustrative model assigns probability 0.90 to the alternate allele if the sample’s phased markers indicate pattern A, and 0.10 if they indicate pattern B.

Assume the sample’s other chromosome copy has target-allele probability 0.20. If the first copy is correctly assigned pattern A, the expected number of alternate alleles across the two copies is \(0.90+0.20=1.10\). If a switch instead assigns that copy pattern B, the corresponding expectation is \(0.10+0.20=0.30\). The difference is \(1.10-0.30=0.80\) expected alternate alleles.

These values are for a deliberately simple hypothetical calculation, not a general imputation algorithm. They show why a wrong phase can matter most when nearby haplotype patterns have substantially different target-allele frequencies. If the patterns predict similar probabilities, the same switch may have little effect on the imputed result.

The effect is local in the sense that a switch changes the assignment of alleles across an interval, but its consequences can extend to multiple nearby untyped variants. The size and direction of the effect depend on the pattern of linkage in the reference data, the location of the switch, the available typed markers, and the uncertainty in phase. A switch error does not guarantee an incorrect imputed genotype: different phase configurations can imply similar target probabilities, and imputation may remain uncertain rather than making a confident wrong prediction.

Diagnostics and Comparisons

When true phase is available for a validation set, switch-error counts and rates directly assess relative-phase accuracy on the evaluated intervals. When it is unavailable, posterior phase uncertainty is a useful diagnostic, but it should not be presented as an observed error rate. In either setting, assess whether the summary matches the purpose of the analysis and the amount of information in the region.

  • Check the denominator. Report how many adjacent heterozygous pairs were evaluated. A rate from a few pairs is imprecise and can change sharply with one additional error.
  • Locate the errors. A single switch can reverse the apparent phase of several subsequent sites until another switch occurs. A regional average can conceal such a segment.
  • Consider interval length. The same number of errors can have different implications across short and long genomic spans. State whether intervals are based on adjacent sites, physical distance, or another defined scale.
  • Compare to available truth carefully. Pedigree, long-read, or other benchmark phase can support an empirical error calculation, but the benchmark itself may be incomplete or uncertain. Align sites and allele coding before comparing assignments.
  • Inspect uncertainty calibration where possible. If intervals assigned similar confidence are repeatedly evaluated against truth, their empirical accuracy should broadly agree with their stated confidence. A mismatch may indicate overconfidence or a validation mismatch.

Switch-error rate is not the only useful summary. Per-site phase accuracy can count incorrect site orientations, but it can overcount a single persistent flip and is sensitive to arbitrary haplotype labels unless orientation is aligned. Genotype concordance assesses whether the two alleles at a site were called correctly, but does not establish which allele lies on which chromosome copy. Posterior phase probabilities describe model uncertainty, whereas switch-error rates describe agreement with known truth. These measures are complementary rather than interchangeable.

Common Pitfall and Limitations

Common mistake: “The estimated haplotypes use the opposite labels after site C, so every site from C onward is a switch error.”

Correction: A global relabeling has no effect, and a persistent reversal after one transition generally represents one switch error between the correctly oriented and reversed segments. Evaluate relative phase at each eligible adjacent pair, not the raw haplotype labels at each site.

A second pitfall is treating high reported confidence as proof of correct phase. Confidence is conditional on the method, data, and assumptions; systematic problems or limited information can produce confident errors. Sparse heterozygous sites, long intervals, rare variants, and differences between a study sample and its reference can all make phase less reliable. The uncertainty summary may also fail to reflect dependencies between neighboring intervals.

Switch rate is an average over evaluated pairs and does not by itself identify which imputed variants are affected. Nor does it establish that a phase error caused an observed imputation error. To make that claim requires appropriate validation and attention to other sources of error. Phase uncertainty is best treated as one component of imputation reliability, interpreted alongside the local marker information and the evidence available for validation.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. Why does swapping haplotype labels at every site leave relative phase unchanged?
  2. A region has 24 eligible adjacent-heterozygote pairs and 3 observed switch errors. What is the switch-error rate?
  3. Two interval-phase events have probabilities 0.80 and 0.90 of being correct. Under independence, what is the probability that at least one is wrong?
  4. Why can genotype concordance be high even when switch errors occur?

Solutions. (1) Swapping both endpoint labels leaves their exclusive-or, and hence their relative phase, unchanged. (2) The rate is \(3/24=0.125\), or 12.5%. (3) The probability both are correct is \(0.80\times0.90=0.72\), so the probability at least one is wrong is \(1-0.72=0.28\), or 28.0%. (4) Genotype concordance checks whether the alleles present at each site are correct; a switch can assign those correct alleles to the wrong chromosome copies while leaving every unphased genotype unchanged.

Clinical Biostats