Module A · 10 steps
Genotype imputation
Prepare the target files, read the imputation quality and test the imputed dosages around locus L4.
In this module
- Before you start
- You need the full checkpoint at step 6.3. The first code chunk checks the files that this module needs.
- Where the module ends
- Nothing changes in your main analysis. Go back to the main path at step 6.4.
The notebook is a Quarto file (.qmd). Open it in RStudio from the project folder.
Module data
This module needs its own data package, in the folder data/course/module_a of your project.
An R command downloads and extracts the data, and you need the module A password: request it on the data access page.
At a glance
What you will do. A genotyping array measures a few hundred thousand DNA sites. The human genome has tens of millions of variable sites. Imputation (opens in a new tab) fills the gap: it predicts the genotypes at sites that the array did not measure. You will learn how it works, which reference panels and servers exist, and what the law says about uploading genetic data. Then you will prepare the input files from your own data, read the quality of an imputation of two regions, and test the imputed variants for association.
What you will learn.
- Why alleles at nearby sites can be predicted from each other: haplotypes (opens in a new tab) and LD (opens in a new tab).
- The two stages of the process: phasing (opens in a new tab), then imputation.
- How to choose a reference panel (opens in a new tab) and an imputation server.
- What the General Data Protection Regulation (GDPR) means for genetic data.
- How to read the imputation quality (opens in a new tab) of each variant, and why it can be too optimistic for rare variants.
- How to test imputed dosages (opens in a new tab) for association.
How long it takes. About 2 hours. Steps A.1 to A.6 and A.10 are reading. The slowest code step is A.8, about two minutes.
What you need. Your files at step 6.3: the final cohort of 1,811 samples from step 5.7 and the covariates from step 6.3. You also need the module A data, a separate data release. Step A.1 gives the R command that downloads them, checks them and puts them in the folder data/course/module_a. Do not extract the ZIP file by hand. The data also hold R/imputation.R, the R functions of this module. Do not copy it into your project: the first chunk of the module notebook loads it from the data folder. You do not need a server account.
The data of this module. The course data are simulated. Each study genome is a mosaic of short segments copied from genomes of the 1000 Genomes Project, the "donors". A reference panel that contains the donors would contain the study haplotypes themselves. Imputation would then look far better than it can be with real data. The 1000 Genomes panels of the imputation servers contain the donors. So does the HRC panel, which includes the 1000 Genomes Phase 3 samples (McCarthy et al. 2016 (opens in a new tab)). So the course examples do not use the servers.
Instead, the module uses its own panel: 1,521 people of the 1000 Genomes high-coverage (30x) data set (Byrska-Bishop et al. 2022 (opens in a new tab)) who are not donors and not related to anyone in the data set. It covers two regions of 2.5 Mb on GRCh38: chromosome 18 from 36,792,715 to 39,292,715, around the simulated risk locus L4, and chromosome 22 from 35,000,000 to 37,500,000. The author ran the imputation (Eagle2 and Minimac4) for the 1,811 samples of the course cohort. The module A data contain the panel, the genetic map, the imputed output and the true genotypes of chromosome 22. Only a simulation can give true genotypes: they let you measure how good the imputation really is.
Your progress: 0 of 10 steps done
Saved in this browser only. Nothing is sent anywhere.
Steps
- A.1Why imputation works: haplotypesReading, about 4 minutes.
- A.2Phasing, then imputationReading, about 3 minutes.
- A.3Reference panelsReading, about 3 minutes.
- A.4Imputation serversReading, about 3 minutes.
- A.5Genetic data and the lawReading, about 2 minutes.
- A.6Reading the classic reviewReading, about 5 minutes.
- A.7Prepare the input filesWrite the measured genotypes of the two regions as one VCF file per region, ready for phasing and imputation.
- A.8Is the imputed variant good?Read the quality measures of the imputed output on chromosome 22.
- A.9Test imputed variants for associationTest the imputed variants of the region around locus L4 for association, with the model of the main analysis.
- A.10What can go wrongCollect the common problems of imputation in one table.
Recap
- Imputation predicts unmeasured sites from haplotypes shared with a reference panel.
- It runs in two stages, phasing and imputation, and gives probabilities and dosages, not certain genotypes.
- The panel decides what can be imputed: its size, its ancestry and its genome build matter.
- Before an upload, check the server, the location of the data and your legal basis.
- You prepared the input files with checked REF alleles and plain line ends.
- R2 tracks the true quality well for common variants and overestimates it for rare ones.
- An imputed hit needs its R2, a look at the measured neighbours and confirmation.
Next: module A is an additional module. Return to the main path at any time.