MGHome page

Module 4 · 6 steps

Variant quality control

Filter variants by call rate, missingness, allele frequency and Hardy-Weinberg equilibrium.

GWAS course

Course map

0 of 64 steps done

Start with step 0.1Install R

Saved in this browser only.

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 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

  1. 4.1Variant call rateWe remove variants with a call rate below 98%.
  2. 4.2Differential missingnessWe test whether missing calls differ between cases and controls.
  3. 4.3Allele frequencyWe keep variants with a minor allele frequency of at least 1%.
  4. 4.4Hardy-Weinberg and sample sizeWe run an exact Hardy–Weinberg test in the controls only, using the mid-p version.
  5. 4.5Sex chromosomes, MT and duplicated sitesWe review calls that are impossible for the sex chromosomes X and Y and for mitochondrial DNA (MT).
  6. 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.