Module 4 · 6 steps
Variant quality control
Filter variants by call rate, missingness, allele frequency and Hardy-Weinberg equilibrium.
In this module
- Before you start
- You need the full checkpoint at step 3.8. The first code chunk checks the files that this module needs.
- Where the module ends
- The checkpoint at step 4.6.
The notebook is a Quarto file (.qmd). Open it in RStudio from the project folder.
At a glance
What you will do. In this module you check each variant (opens in a new tab), not each person. A variant is a place in the DNA where people can carry different versions, called alleles (opens in a new tab). You remove variants that were measured badly or that are too rare to analyse. You also remove duplicated variants. At the end you save the cleaned dataset.
What you will learn.
- How to find variants with a low call rate (opens in a new tab), which means too many failed results.
- Why failed results must not differ between cases and controls (opens in a new tab), which is called differential missingness (opens in a new tab).
- Why very rare variants are left out, using minor allele frequency (opens in a new tab).
- How the Hardy–Weinberg (opens in a new tab) test finds genotyping errors, and why its threshold depends on sample size.
- How to check the X, Y and mitochondrial variants and how to merge duplicated variants.
How long it takes. About 45 minutes. Step 4.5 is the slowest, because it runs three commands and reads a large table.
A sample (opens in a new tab) is the DNA of one person measured on the array. Every step in this module removes variants, so the number of samples stays the same.
Your progress: 0 of 6 steps done
Saved in this browser only. Nothing is sent anywhere.
Steps
- 4.1Variant call rateWe remove variants with a call rate below 98%.
- 4.2Differential missingnessWe test whether missing calls differ between cases and controls.
- 4.3Allele frequencyWe keep variants with a minor allele frequency of at least 1%.
- 4.4Hardy-Weinberg and sample sizeWe run an exact Hardy–Weinberg test in the controls only, using the mid-p version.
- 4.5Sex chromosomes, MT and duplicated sitesWe review calls that are impossible for the sex chromosomes X and Y and for mitochondrial DNA (MT).
- 4.6Variant QC summary and checkpointWe save the complete dataset after variant QC.
Recap
- Step 4.1 removed 801 variants with a call rate below 98%.
- Step 4.2 removed 120 variants whose missing calls differed between cases and controls.
- Step 4.3 removed 56,420 variants with a minor allele frequency below 1%.
- Step 4.4 removed 167 variants that failed the Hardy–Weinberg test in the controls.
- Step 4.5 removed 33 variants with impossible calls on X, Y or MT, and 306 duplicate entries.
- You saved the module 4 checkpoint: 1,844 samples and 238,513 variants.
Next: Module 5 studies population structure, to check that cases and controls have similar ancestry.