Tutorials › High-Dimensional Genomic Data Analysis › End-To-End Imputation Workflow

Genotype Imputation · Tutorial 71 of 795

End-To-End Imputation Workflow

Follow a coherent imputation workflow, interpret decisions at each stage, and export dosage data while preserving variant identity and uncertainty.

Intermediate 10 min read

What You'll Learn

  • Organize input, reference-panel, and sample checks before imputation
  • Track variant matching, genome build, and allele alignment through the workflow
  • Explain the roles of phasing and reference-based imputation
  • Convert genotype probabilities to expected allele-count dosages
  • Apply quality filters without treating thresholds as universal
  • Export and document imputed dosages for downstream analysis

From Input Genotypes to an Analysis-Ready Dosage File

An imputation result is only as useful as the chain of decisions that produced it. A variant can be correctly imputed but assigned to the wrong genomic position; a well-matched reference panel can still be paired with incorrectly aligned alleles; and an output file can lose essential uncertainty information if probabilities are replaced by hard genotype calls. An end-to-end workflow makes these dependencies explicit and records what is retained, transformed, or excluded at each step.

The workflow below concerns genotype imputation, not downstream association testing. It assumes that the input is a set of genotype calls for identified samples and that a reference panel provides phased haplotypes with known variant alleles and positions. The general steps are shared across software, but file formats, allowed alleles, panel requirements, and recommended thresholds depend on the particular tool and data.

Definition: A genotype dosage for a specified effect allele is the expected number of copies of that allele, conditional on the observed data and imputation model. For diploid autosomal genotypes, dosage ranges from 0 to 2. A genotype probability is the imputation model's probability assigned to a possible genotype; for a biallelic diploid site, the possible allele counts are 0, 1, and 2.

Before applying the workflow, state its working assumptions. The example procedures assume a consistent genome build, correctly identified samples, correctly represented alleles, and a reference panel that contains relevant haplotype patterns for the study data. For autosomes, they also assume diploid genotypes. Sex chromosomes, ploidy changes, multiallelic variants, and structural variants may need separate handling. Imputation does not repair sample swaps, systematic genotyping errors, or an incorrect genome build.

Workflow and Decision Points

1
Freeze and inspect the inputs.
Record sample identifiers, variant identifiers, genome build, allele coding, genotyping platform, and missingness. Confirm that the genotype file and sample metadata refer to the same individuals and that duplicate identifiers are resolved. Apply prespecified sample and variant quality checks before imputation; do not treat imputation as a substitute for input quality control.
2
Match variants to the reference.
Make the study data and reference panel use the same genome build and allele representation. Identify shared variants using chromosome, position, and alleles rather than relying on variant labels alone. Resolve strand and allele alignment, including ambiguous A/T and C/G sites when the available information cannot establish orientation. Keep a log of matched, mismatched, ambiguous, and excluded variants.
3
Select and prepare the reference panel.
Choose a panel with suitable ancestry and haplotype representation, genomic coverage, build, and variant set. If panels are combined, use a coherent combined reference and verify its allele and sample metadata. A panel's size alone does not guarantee good imputation for every population or variant.
4
Phase the study genotypes.
Estimate which alleles occur together on each chromosome, using the observed genotypes and, where supported, reference haplotypes. Review phasing requirements and output conventions for the chosen software. Phasing uncertainty can affect imputation, especially when informative genotypes are sparse.
5
Impute untyped variants.
Use the phased study haplotypes and reference haplotypes to infer genotypes at unobserved sites. Preserve genotype probabilities or dosages, along with variant identifiers and quality metrics. Check logs for chromosome coverage, unexpected sample or variant losses, and software warnings.
6
Filter, export, and document.
Apply quality criteria chosen for the analysis, inspect retained and excluded variants, and export dosages with a clear effect-allele convention. Record software and panel versions, parameters, build, filters, and counts at every stage so the output can be interpreted and reproduced.

Matching and Harmonizing Inputs

A usable match requires more than a shared rsID or other label. The position must refer to the same genome build, and the alleles must describe the same biological alleles with consistent orientation. The earlier material on genome build matching and allele harmonization establishes these as distinct checks. Operationally, retain a variant only when its coordinate and allele information can be reconciled with the reference; do not silently guess the orientation of an ambiguous site.

Matching also determines which observed variants can inform phasing and imputation. If a variant is absent from the chosen panel, it cannot serve as a shared anchor in that panel-based workflow, even if it is a valid study variant. Conversely, the imputation output may include many variants not directly genotyped in the study. Maintain separate counts for input variants, successfully matched variants, and imputed output variants; these numbers answer different questions.

Worked Example: Tracking Variant Retention

Suppose a hypothetical study begins with 100,000 biallelic autosomal variants. A build check leaves 98,400 with valid positions on the panel's build. Allele harmonization identifies 96,800 variants whose alleles can be aligned unambiguously. Of those, 93,500 are present in the selected reference panel and retained as shared markers for imputation.

The corresponding retention fractions, each relative to the preceding stage, are:

$$ \frac{98{,}400}{100{,}000}=0.984,\qquad \frac{96{,}800}{98{,}400}=0.9837,\qquad \frac{93{,}500}{96{,}800}=0.9669. $$

Thus, 98.4% pass the position check, 98.37% of those pass allele harmonization, and 96.69% of the harmonized variants are represented in the panel. The final count is not a measure of imputation quality: it is a count of shared markers available to anchor the analysis. The 6,500 variants not in the final shared-marker set should be accounted for by reason, rather than lumped together as one unexplained loss.

Suppose, separately, that sample A has 97.4% nonmissing genotypes and a prespecified sample call-rate threshold of 98%, while sample B has 99.2%. Under that stated rule, sample A fails and sample B passes. This decision concerns input completeness, not the eventual quality of imputed variants.

Phasing, Imputation, and Dosage

Phasing represents an individual's alleles as two haplotypes rather than only as an unordered genotype. For example, a heterozygous genotype at each of two sites does not by itself tell whether the alternate alleles lie together on one chromosome or on opposite chromosomes. Phasing estimates that arrangement. Imputation then uses the resulting haplotype patterns to identify similar patterns in the reference panel and infer alleles at untyped sites. Both are model-based inferences; inferred genotypes are not equivalent to directly observed calls.

For a biallelic diploid variant, let \(P(G=0)\), \(P(G=1)\), and \(P(G=2)\) be the probabilities of carrying 0, 1, or 2 copies of the specified allele. The dosage is the expected allele count under those probabilities. This definition explains why dosage preserves uncertainty rather than selecting only the most likely genotype.

Result: For genotype count \(G\in\{0,1,2\}\), the dosage is \(D=E(G)=P(G=1)+2P(G=2)\). It is measured in expected copies of the specified allele per individual, and lies between 0 and 2 when the probabilities are valid and sum to 1.

The formula follows from the definition of expectation for a discrete random variable: multiply each possible count by its probability and sum. The uncertainty can also be described by \(Var(G)=E(G^2)-[E(G)]^2\). Since \(G^2\) equals 0, 1, or 4 at counts 0, 1, or 2, respectively, \(E(G^2)=P(G=1)+4P(G=2)\). This uncertainty is one reason to retain dosage or probabilities rather than converting every result to a hard call.

Worked Example: Converting Probabilities to Dosage

For one hypothetical individual at a biallelic autosomal site, suppose the imputation output gives \(P(G=0)=0.10\), \(P(G=1)=0.60\), and \(P(G=2)=0.30\), where \(G\) counts copies of the alternate allele. The probabilities sum to \(0.10+0.60+0.30=1.00\), as required.

The dosage is:

$$ D=0(0.10)+1(0.60)+2(0.30)=0+0.60+0.60=1.20 $$

The expected alternate-allele count is 1.20 copies per individual. The most probable genotype is \(G=1\), with probability 0.60, so a hard call would report one copy. That hard call discards the 0.10 probability of zero copies and the 0.30 probability of two copies; it is not the same quantity as the dosage.

For these probabilities, \(E(G^2)=0(0.10)+1(0.60)+4(0.30)=1.80\), and \(Var(G)=1.80-(1.20)^2=0.36\) allele-count-squared. This calculation illustrates that a dosage alone does not fully describe the uncertainty, even though dosage is often the required analysis input.

Quality Filtering and Export

After imputation, inspect variant-level quality metrics and apply filters appropriate to the intended analysis. The earlier material on imputation quality metrics, INFO scores, dosage \(R^2\), allele-frequency effects, and filtering variants provides the definitions and interpretation of these measures. In an end-to-end workflow, the practical task is to state which metric and threshold were used, apply them consistently, and report how many variants remain. A threshold is a decision rule, not a universal boundary between true and false genotypes.

Quality is not uniform across variants. It can differ with allele frequency, reference-panel representation, marker density, and the informativeness of nearby observed genotypes. Inspect quality distributions and variant counts by relevant groups, including allele-frequency ranges, rather than relying only on a single overall summary. Very low frequency variants warrant particular care: a high-looking overall metric or a large reference panel does not automatically establish reliable inference for every rare allele.

Worked Example: Applying a Stated Quality Rule and Exporting Dosages

Consider a hypothetical analysis with 1,000 individuals and an explicitly chosen screening rule that retains biallelic variants with INFO at least 0.80 and alternate-allele frequency at least 0.01. This rule is an example for the workflow, not a recommendation for every study. Variant A has INFO \(=0.92\) and frequency \(=0.12\), so it passes both conditions. Variant B has INFO \(=0.67\) and frequency \(=0.04\); it fails the INFO condition and is excluded under this rule. Variant C has INFO \(=0.88\) and frequency \(=0.006\); it fails the frequency condition and is excluded.

Suppose the retained variant A has the following alternate-allele dosages for three hypothetical individuals: 0.03, 1.14, and 1.82. Each is between 0 and 2 and is expressed as expected alternate-allele copies per individual. In a dosage export, the variant's chromosome, position, build, reference and alternate alleles, quality metric, and dosage values should remain linked. The export must identify which allele each dosage counts; otherwise, a downstream user could interpret the same values in the opposite direction.

If a tool exports genotype probabilities instead, retain their mapping to genotype counts and confirm that probabilities sum to approximately 1 for each sample-variant pair, allowing only documented rounding error. Do not replace uncertain probabilities with hard calls merely to simplify the file unless the analysis specifically requires that transformation and its consequences are understood.

Diagnostics, Alternatives, and Limitations

A sound workflow checks whether each stage behaved as expected, not just whether the software completed. Useful diagnostics include sample and variant counts before and after each filter; distributions of missingness and imputation quality; allele-frequency comparisons between study observations and the reference; chromosome coverage; and inspection of a small set of variants with known allele orientation. Large unexplained count changes, implausible frequency discrepancies, unexpected allele labels, or dosage values outside the valid range are reasons to stop and investigate.

Common warning signs include build mismatches, strand errors, sample-order errors, inappropriate reference-panel representation, and overaggressive filtering. An apparent increase in variant count after imputation is expected because untyped sites are added, but it does not demonstrate that those sites are reliable. Similarly, a high imputation quality summary does not validate sample identity or resolve an allele coding error.

Imputation is not the only way to handle untyped genotypes. Analyses can be restricted to directly genotyped variants, or a study can use sequencing or another assay to observe more genotypes directly. These alternatives may reduce dependence on reference-panel inference, but they have different costs, coverage, and measurement properties. Imputation is useful because it can improve variant coverage and enable more consistent variant sets across studies; it remains limited by reference haplotypes, input data quality, and model uncertainty. The earlier material on masking validation describes a direct way to evaluate performance in a dataset with observed genotypes.

Common pitfall: “The imputation software finished, so every output genotype is valid.” Completion only indicates that the program ran. The correction is to verify matching and allele orientation, review logs and quality metrics, apply stated filters, and preserve dosage uncertainty and allele labels in the export.

Check Your Understanding

Answer each question, then compare with the brief solutions below.

  1. Why should a workflow distinguish the number of input variants from the number of shared markers and the number of imputed output variants?
  2. For probabilities \(P(G=0)=0.25\), \(P(G=1)=0.50\), and \(P(G=2)=0.25\), calculate the dosage for the counted allele.
  3. A variant has INFO \(=0.78\) and allele frequency \(=0.10\). Does it pass the example rule in this tutorial?
  4. Name two checks that can detect a problem before or during imputation.
  5. What must be recorded so that a dosage can be interpreted correctly after export?

Solutions. (1) The counts describe different stages: input data, variants that can anchor the reference-based procedure, and the imputed output; keeping them separate makes losses and additions auditable. (2) \(D=0(0.25)+1(0.50)+2(0.25)=1.00\) expected copies. (3) No. It meets the frequency condition of at least 0.01 but fails the INFO condition of at least 0.80. (4) Examples include checking genome build and allele alignment, confirming sample identifiers and order, reviewing variant-count logs, and comparing observed allele frequencies with the panel. (5) At minimum, preserve the dosage's counted allele, variant identity and position, genome build, and the relevant quality information.

Clinical Biostats