Module 4 · Variant quality control · step 6 of 6
4.6Variant QC summary and checkpoint
Commands tested on Windows
In short
We save a complete checked starting point for module 5. We check the saved files and counts so we can restart from the same data later.
Do this
- Paste in the RStudio ConsoleThe R command in the Command section below
You should see: The full module 4 checkpoint has 1,844 samples and 238,513 variants.
Command
Module setup, needed before this step
R: module setup
source("R/guided.R")cfg <- guided_init()R command
Type or paste into the RStudio console.
# Course bookkeeping: records the counts for the next step. Do not change.1guided_snapshot(cfg, "4.6", guided_path(cfg, "4.5"), 1844, 238513, parent = "4.5")check_step("4.6", data_dir = cfg$out, work_dir = cfg$out)- Note 1: Save the complete dataset and check the saved files and counts.
You need
The dataset from step 4.5, which we call state 4.5, and the records of the earlier exclusions.
What we do
We save the complete dataset after variant QC. Then we review what the filters did.
Why
Every QC threshold is a trade. We keep more information, or we lower the technical risk. Record the counts, the software, the genome build, the exclusions and the known limits. Then another reader can rebuild the same state.
The final set is ready for the study of population structure. It is not automatically free from confounding. Confounding means that another factor, such as ancestry, creates a false association between a variant and the disease.
PLINK terminal equivalent. Optional: you do not need it for the course.
Not applicable: this step needs no PLINK command. The R chunk is the complete command.
R reads or calculates the displayed values without changing the genotype files.
Expected result
Show the expected result
The full module 4 checkpoint has 1,844 samples and 238,513 variants. The counts and the SHA-256 checksums agree with the saved snapshot. A checksum is a short code that proves a file was not changed.
The tested PLINK version is defined in config.R and recorded in
software_versions.txt. Validation: executable chunks and the expected counts passed on Windows.
If something goes wrong
If something goes wrong
Stop at the first error. Check the input file named in the error message, and check the previous step. Keep your command and the console messages. Do not use files from a different version of the dataset. See troubleshooting (opens in a new tab).
Quick check
Which other source of bias must we still check before the association test?
Show the answer
Population structure, which means differences in ancestry between cases and controls.
Files created
s4-6_state.*, the full checkpoints/4.6/state.*, the updated replay index and the count table.