Tutorials › High-Dimensional Genomic Data Analysis › Allele Harmonization Before Imputation

Genotype Imputation · Tutorial 57 of 795

Allele Harmonization Before Imputation

You will learn to check allele labels and strand, recode dosages correctly, and decide when ambiguous SNPs should be resolved with frequency evidence or excluded.

Intermediate 11 min read

What You'll Learn

  • Distinguish strand complements from swaps in allele order.
  • Map genotype and dosage coding to the same counted allele.
  • Apply the dosage transformation required when the counted allele changes.
  • Recognize why A/T and C/G SNPs are strand-ambiguous.
  • Use allele-frequency comparisons cautiously when resolving ambiguous variants.
  • Identify mismatches that require investigation or exclusion rather than guessing.

Why Allele Harmonization Matters

Imputation uses the study genotypes as inputs and matches them to variants in a reference panel. For a match to be meaningful, the study and panel must refer to the same variant and represent its alleles consistently. A variant can have the correct identifier and still have incompatible allele labels or dosage coding. If those differences go unnoticed, the software may interpret one allele as the other, or fail to match the variant at all.

This tutorial assumes that study and panel records have already been brought to the same genomic build and that the positions being compared identify the same biological locus. The focus here is allele representation, not establishing that positional match. The examples use diploid, biallelic single-nucleotide polymorphisms (SNPs). Indels and multiallelic variants need additional representation checks; a simple strand complement or dosage flip is not enough to establish that they match.

Definition: Allele harmonization is the process of making sure a study variant and its reference-panel counterpart represent the same locus and that their allele labels, strand orientation, and genotype or dosage coding refer to corresponding alleles. For a biallelic SNP, the allele complement exchanges A with T and C with G. A swap changes which of the two alleles is counted or designated first; a swap may require recoding genotypes even when the allele pair itself is unchanged.

For clarity, write a study genotype as a dosage \(d\) of a specified counted allele. In diploid data, \(d\) is 0, 1, or 2 for a hard call, and an imputed dosage can take any value from 0 to 2. The allele whose dosage is recorded must be identified from the data format; do not assume that it is the first allele in a text field or the panel's REF allele. REF and ALT are labels tied to a reference sequence and data convention, not universal names for the allele being counted.

Three Checks Before Recode

A safe comparison separates three questions. First, do the records identify the same locus? Second, do the allele pairs correspond, possibly after complementing one strand? Third, does the study dosage count the allele required by the harmonized output? An answer to one question does not settle the others. For example, complementary allele labels can establish a strand correspondence but say nothing by themselves about which allele a dosage counts.

1
Verify the candidate locus.
Compare the variant identifiers and coordinates under the already-matched build, and check that the records are plausible counterparts. An identifier alone is not proof of a match.
2
Compare allele pairs.
Test direct equality and, for SNPs, equality after complementing one pair. Record whether the match is direct, complementary, swapped, or unresolved.
3
Align the counted allele.
Identify the allele represented by each dosage. If the study dosage counts the opposite allele from the target dosage, transform it before use.
4
Handle ambiguity conservatively.
For a palindromic pair, use reliable allele-frequency evidence only when appropriate; otherwise retain an unresolved status and exclude the variant from the harmonized set.

For a non-palindromic SNP such as A/C, the complement is T/G, so the allele labels can help distinguish direct from complementary representations. By contrast, A/T complements to A/T, and C/G complements to C/G. These are palindromic SNPs: the allele pair alone cannot tell whether one record is on the opposite strand. A frequency comparison can sometimes help, but population frequency differences and sampling variation mean it is evidence, not proof.

Worked Examples

Worked Example: Complementing a Non-Palindromic SNP

Suppose a study record at an already-verified locus lists A/G and reports dosage of G. The reference panel lists C/T and its target dosage is for C. Assume these are biallelic SNP records for the same locus, with the only representation difference being strand orientation.

Complementing the study pair gives A \(\rightarrow\) T and G \(\rightarrow\) C, so the study pair A/G corresponds to the panel pair T/C. The study's counted allele G maps to panel allele C. Therefore, the study dosage already counts the target allele; it does not need a dosage flip. The order in which the pair is written has no effect on this conclusion.

For example, if three study samples have G dosages 0, 1, and 2, their C dosages in the panel's orientation are also 0, 1, and 2. Complementing allele labels is not the same operation as replacing a dosage \(d\) with \(2-d\).

Worked Example: Swapping the Counted Allele

At another verified biallelic locus, suppose the study pair is A/G and the study dosage counts A, while the harmonized output is to count G. The study dosages for ten hypothetical samples are 0, 0, 1, 1, 0, 1, 0, 2, 1, and 0. Assume these calls are valid diploid dosages and the two records refer to the same locus.

Here the allele pair is already the same, but the counted allele differs. A dosage of A is not a dosage of G. For each diploid genotype, the two allele counts sum to 2, so the G dosage is \(2-d\), where \(d\) is the A dosage. Applying that transformation gives 2, 2, 1, 1, 2, 1, 2, 0, 1, and 2.

The original dosage sum is \(0+0+1+1+0+1+0+2+1+0=6\), so the mean A dosage is \(6/10=0.6\). The transformed sum is \(14\), and the mean G dosage is \(14/10=1.4\). These means add to 2, as expected for complementary allele dosages in diploid samples. Leaving the dosages unchanged would incorrectly label A counts as G counts.

Worked Example: Frequency Evidence for a Palindromic SNP

A study and reference panel both report an A/T SNP at a verified locus. The study dosage is for A, and the dosage sum across 20 hypothetical diploid samples is 3. The panel reports an A-allele frequency of 0.080. Suppose the samples are believed to have similar ancestry and the study frequency estimate is considered usable.

The study frequency estimate is \(3/(2\times20)=0.075\). If study A corresponds to panel A, the frequency difference is \(|0.075-0.080|=0.005\). If study A instead corresponds to panel T, its frequency compared with panel A would be \(1-0.075=0.925\), giving a difference of \(|0.925-0.080|=0.845\). Under the stated similarity assumption, the first orientation is much more compatible with the observed frequencies.

This supports aligning study A with panel A, but does not prove it. The frequency estimate is based on only 40 chromosomes, and genuine differences between sample and panel populations can also cause discrepancies. A defensible decision would follow a pre-specified frequency tolerance and quality policy, check other available evidence, and document the decision. If the frequency evidence is too imprecise or population comparability is doubtful, leave the SNP unresolved and exclude it rather than force an orientation.

Why a Dosage Flip Is \(2-d\)

For a diploid biallelic genotype, each individual has two copies of one allele or the other. If \(d\) copies are of the allele currently counted, then the other allele has \(2-d\) copies. The same identity applies to an expected dosage: if the posterior probabilities for the three possible genotypes are \(P(0)\), \(P(1)\), and \(P(2)\) copies of the counted allele, then the expected dosage is \(d=0P(0)+1P(1)+2P(2)\). For the other allele, the corresponding dosage is \((2-0)P(0)+(2-1)P(1)+(2-2)P(2)=2-d\), because the genotype probabilities sum to 1.

$$ d_{\text{other}} = 2-d $$

This identity assumes diploidy and a biallelic locus. It is not a general rule for sex chromosomes, polyploid data, or multiallelic variants. It also does not justify flipping a dosage merely because REF and ALT appear in a different order: first establish which allele the dosage actually counts.

Decisions, Diagnostics, and Failure Modes

A harmonization record should preserve enough information to audit the decision: the locus, original allele labels, the mapping applied, the allele counted before and after recoding, and whether the decision was direct, complementary, frequency-supported, or unresolved. For ambiguous variants, record the frequency estimates and the policy used rather than recording only a final orientation.

Observed situationReasonable actionImportant caution
Allele pairs match and counted alleles matchKeep the dosage unchanged after checking locus identity.Matching labels do not establish that coordinates identify the same variant.
Non-palindromic pairs match after complementingMap each allele through the complement and then check the counted allele.Complementing labels alone does not tell you whether dosage needs a flip.
Allele pair matches but counted alleles differUse \(2-d\) for diploid biallelic dosage.Verify the input dosage allele from the file specification.
Palindromic pair, frequency evidence is uninformativeMark unresolved and exclude from the harmonized set.Do not choose an orientation from allele labels alone.
Allele pairs cannot be matched directly or by SNP complementInvestigate the record; exclude if the mismatch remains unresolved.Do not force a match based solely on a shared identifier.

Frequency checks are most informative when the compared populations are reasonably similar and the frequency estimates are reliable. Near frequency 0.5, flipping an allele produces a frequency close to 0.5 as well, so the comparison may not distinguish orientations. Rare alleles can also have imprecise frequency estimates in small samples. A large frequency discrepancy can signal a coding mismatch, but it can also reflect population differences, genotyping errors, or an incorrect candidate match. Use frequency as a diagnostic, not as a substitute for checking the records.

Common signs that harmonization has gone wrong include unexpected allele-frequency differences after alignment, allele labels that do not match after the documented mapping, and dosage summaries that contradict the stated counted allele. These checks can expose mistakes, but a plausible frequency or dosage summary does not prove that a locus match is correct. For unresolved variants, exclusion is preferable to silently guessing because a wrong allele mapping can produce misleading downstream results.

Common Mistake and Practical Limits

Wrong reasoning: “The study says A/T and the panel says A/T, so the strands match and I can keep the dosage.” The allele pair is palindromic, so those labels do not establish strand orientation. If the study dosage counts the allele corresponding to panel T rather than panel A, leaving it unchanged reverses the meaning of the dosage. Correction: determine the counted allele, use suitable frequency or other independent evidence when available, and exclude the variant if its orientation remains uncertain.

Another frequent error is to treat a strand complement as a dosage flip. A complement changes allele labels between strands; it does not automatically change which physical allele is counted. The dosage changes to \(2-d\) only when the counted allele changes. This procedure also has limits: it does not resolve whether two records at different coordinates are the same locus, and it does not normalize indels or reconcile multiallelic representations. Those cases require appropriate additional checks before imputation.

Key takeaway: Establish locus correspondence, map allele labels (including strand complements where applicable), and then align the counted allele. For diploid biallelic data, change a dosage to \(2-d\) only when switching to the other allele. Treat palindromic variants as unresolved unless independent evidence supports an orientation.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. A study reports C/T and counts C; a matching panel record is G/A and counts G. What strand mapping applies, and should the dosage be flipped?
  2. A diploid biallelic study dosage for the counted allele is 0.35. What is the dosage for the other allele?
  3. A palindromic C/G SNP has similar study and panel allele frequencies, both close to 0.50. Does that comparison reliably establish orientation?
  4. A study and panel share a variant identifier, but their allele pairs cannot be matched directly or by complement. What is the safe action?

Solutions. (1) Complementing C/T gives G/A, so the pairs correspond on opposite strands. Study C maps to panel G, the counted allele is the same, and no dosage flip is needed. (2) The other-allele dosage is \(2-0.35=1.65\). (3) No. At a frequency near 0.50, the frequency and its complement are also near 0.50, so the comparison is not discriminating; seek independent evidence or leave the SNP unresolved. (4) Investigate the candidate match and its representation. If the mismatch cannot be resolved, exclude the variant rather than forcing a harmonization based on the identifier alone.

Clinical Biostats