Module 7 · Plots and reporting · step 5 of 8
7.5Clump correlated results
Commands tested on Windows
In short
We group nearby variants whose DNA patterns are correlated, meaning they tend to vary together across people. We use the final cohort to measure this similarity and check that the significant results form three groups.
Do this
- Paste in the RStudio ConsoleThe R command in the Command section below
You should see: There are three clumps.
Command
Module setup, needed before this step
R: module setup
source("R/guided.R")cfg <- guided_init()Blue: PLINK option · Orange: value you can change · Green: file name
R command
Type or paste into the RStudio console.
1report <- guided_path(cfg, "7.5", "clump")2run_plink(cfg, c("--pfile", guided_path(cfg, "5.7"), "--clump", paste0(guided_path(cfg, "6.4", "association"), ".Disease.glm.logistic.hybrid"), "--clump-id-field", "ID", "--clump-p-field", "P", "--clump-p1", "5e-8", "--clump-p2", "1e-5", "--clump-r2", "0.1", "--clump-kb", "250", "--clump-unphased", "--out", report))3clumps <- guided_table(paste0(report, ".clumps"))print(clumps)stopifnot(nrow(clumps) == 3L)- Note 1: Choose the name for the grouped association results.
- Note 2: Group nearby correlated variants using the final cohort.
- Note 3: Read the groups and check that there are three.
You need
The full genotype set from step 5.7 and the PLINK association report from step 6.4, unchanged. This step still reads the PLINK report and not the summary statistics file. The reason is that the --clump option of PLINK expects the format of its own report.
What we do
Group significant variants that are correlated into clumps. Each clump has one top variant. We measure the correlation in our own cohort.
Why
Clumping (opens in a new tab) starts with the variant that has the smallest p-value. This is the lead variant (opens in a new tab), also called the index variant. PLINK adds the nearby variants that are correlated with it. Then PLINK takes the next smallest p-value that is still free and repeats the process. The result is a list of regions that are approximately independent. The settings for the distance and the correlation decide what counts as a region.
Clumping is not fine-mapping (opens in a new tab). It does not show causes, and it does not prove one causal effect in each clump. Measure the correlation in the cohort that you analysed, not in an external population that does not match.
What each option does
| Option or modifier | What it does |
|---|---|
| --pfile | Reads s5-7_state.pgen, s5-7_state.pvar and s5-7_state.psam, which hold the final cohort's DNA calls, variant information and sample information. |
| --clump | Reads s6-4_association.Disease.glm.logistic.hybrid and groups nearby association results whose DNA patterns are correlated across samples. |
| --clump-id-field | Uses the ID column of the association report to identify variants. |
| --clump-p-field | Uses the P column of the association report for p-values, which measure how unusual each result would be without an effect. |
| --clump-p1 | Allows a variant to lead a group when its p-value is at most 5 × 10⁻⁸ (0.00000005). |
| --clump-p2 | Lists other variants in a group when their p-values are at most 1 × 10⁻⁵ (0.00001). |
| --clump-r2 | Adds variants whose squared correlation with the group's lead variant exceeds 0.1. |
| --clump-kb | Limits each group to variants within 250 kilobases, or 250,000 DNA positions, on either side of its lead variant. |
| --clump-unphased | Calculates correlation from the number of copies of a DNA version at each variant, without assigning those copies to individual chromosomes. |
| --out | Starts output file names with s7-5_clump, including the grouped results in s7-5_clump.clumps. |
Every command also uses --threads 2 (PLINK runs at most two tasks at the same time) and --memory 2048 (PLINK uses at most about 2 GB of memory).
PLINK terminal equivalent. Optional: you do not need it for the course.
Blue: PLINK option · Orange: value you can change · Green: file name
Terminal equivalent: plain PLINK 2
Select any option to see what it does. Do not paste terminal commands into the R console.
bin/plink2
No option selected. Each underlined part of the command is an option you can open.
Use bin\plink2.exe on Windows.
Expected result
Show the expected result
There are three clumps. They describe the regions with very small p-values on chromosomes 3, 9 and 12. The report gives the ID and the p-value of each lead variant. This does not show that there are three causal variants.
The tested PLINK version is set in config.R and recorded in
software_versions.txt. Validation: the executable chunks, the comparisons with the expected results and the final plot checks passed on Windows.
If something goes wrong
If something goes wrong
Stop at the first error. Check the input file that R names and the previous step. Keep the command and the messages from the console. Do not use files from a different version of the dataset. See troubleshooting (opens in a new tab).
Quick check
If we change the LD threshold or the distance, can the clumps change even though the association scan stays the same?
Show the answer
Yes. The clumps depend on these settings and on the samples used to measure LD.
Files created
s7-5_clump.clumps and the log files.