This guide covers controlling error rates when thousands of features are tested simultaneously in genomics discovery. The central decision is which error rate to control: the false discovery rate (FDR) for discovery, where tolerating a small controlled fraction of false positives buys large power, versus the family-wise error rate (FWER) for confirmatory work with a few pre-specified hypotheses. The guide covers Benjamini-Hochberg and its dependence assumptions, the Benjamini-Yekutieli procedure for arbitrary dependence, Storey's q-value with proportion-of-true-nulls estimation, local FDR, covariate-weighted FDR via IHW, the independent-filtering rule, the false-coverage-rate trap when reporting confidence intervals only for selected hits, and the GWAS genome-wide threshold.
# R/Bioconductor
install.packages('BiocManager')
BiocManager::install(c('qvalue', 'IHW'))
# Python
pip install statsmodels scipy
Tell your AI agent what you want to do: - "Apply Benjamini-Hochberg correction to my 20,000 DESeq2 p-values at FDR 0.05" - "Should I use BH, BY, or q-value given my test statistics are correlated?" - "Compute q-values and the proportion of true nulls (pi0)" - "Use IHW with mean expression as the covariate to gain power" - "What genome-wide significance threshold should my GWAS use?"
"I have p-values from DESeq2 for 20,000 genes. Apply Benjamini-Hochberg, report the number of discoveries at FDR 0.05, and also give q-values with pi0."
"My test statistics are strongly correlated across genes. Is BH still valid, or should I use BY?"
"I have mean expression for every gene. Use IHW to weight hypotheses and compare the number of discoveries against plain BH."
"Is it legitimate to filter out low-count genes before testing to gain power?"
"What is the difference between an adjusted p-value, a q-value, and a local FDR?"
"Apply the genome-wide significance threshold to my GWAS summary statistics and explain where it comes from."