Module 7 · Plots and reporting · step 4 of 8
7.4Multiple-testing thresholds
Commands tested on Windows
In short
We compare three rules for multiple testing, which means allowing for the many chances to obtain a false result. We count p-values below 5 × 10⁻⁸ (0.00000005), p-values below 0.05 divided by the number of valid tests, and Benjamini-Hochberg adjusted p-values below 0.05. The third rule controls the expected share of false results among those called significant.
Do this
- Paste in the RStudio ConsoleThe R command in the Command section below
You should see: There are 236,815 finite tests, so the Bonferroni threshold for this scan is approximately 2.11e-7.
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.
1stats <- guided_summary_stats(cfg)2p <- stats$p_value[valid_p(stats$p_value)]3threshold <- data.frame(rule = c("Conventional GWAS", "Bonferroni for this scan", "BH adjusted p at 0.05"), threshold = c(5e-8, 0.05 / length(p), 0.05), discoveries = c(sum(p < 5e-8), sum(p < 0.05 / length(p)), sum(p.adjust(p, method = "BH") < 0.05)))print(threshold)4guided_write(threshold, guided_path(cfg, "7.4", "thresholds.tsv"))- Note 1: Read the saved association summary table.
- Note 2: Keep only valid p-values.
- Note 3: Compare three rules for deciding which results are convincing enough.
- Note 4: Save the threshold comparison table.
You need
The valid additive results from the summary statistics file made at step 6.8. Do not replace p-values that failed with other values.
What we do
Compare three ways to decide which p-values are small enough to call a result: the usual GWAS threshold, a Bonferroni threshold for this scan and a false-discovery-rate adjustment.
Why
Running many tests at once is called multiple testing (opens in a new tab). Every test has a small chance of a false positive, so many tests give many chances. The Bonferroni correction (opens in a new tab) handles this simply. We choose an error rate alpha, for example 0.05. We divide it by the number of tests. The result is the p-value threshold. This keeps the chance of even one false positive at or below alpha, also when the tests are correlated.
The usual GWAS threshold is 5e-8, which means 0.00000005. It is called genome-wide significance (opens in a new tab). It is about 0.05 divided by one million common-variant tests. It is a convention. It is not a guarantee for every ancestry, every study design or every set of tests.
The Benjamini-Hochberg (BH) method controls a different quantity. This quantity is the false discovery rate (opens in a new tab), the expected share of false results among the results that we call significant. Decide which tests belong to the family before you look at the results.
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
There are 236,815 finite tests, so the Bonferroni threshold for this scan is approximately 2.11e-7. The usual threshold gives eight discoveries. BH answers a different question about errors, so it can return more.
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
Does a false discovery rate of 5% mean that each reported variant has a 5% chance of being false?
Show the answer
No. The rate describes the whole set of discoveries on average. It is not a probability for each single variant.
Files created
s7-4_thresholds.tsv.