This skill covers differential expression analysis using edgeR, a powerful Bioconductor package that uses empirical Bayes methods to moderate gene-wise dispersion estimates. The quasi-likelihood F-test framework provides robust results even with small sample sizes.
if (!require('BiocManager', quietly = TRUE))
install.packages('BiocManager')
BiocManager::install('edgeR')
Tell your AI agent what you want to do: - "Run edgeR analysis on my count matrix with treated vs control comparison" - "Perform differential expression with edgeR controlling for batch" - "Get top differentially expressed genes with FDR < 0.05"
"Create a DGEList from my count matrix"
"Run the standard edgeR quasi-likelihood workflow"
"Normalize my RNA-seq data with TMM"
"Set up edgeR with multiple comparisons"
"Create contrasts to compare all treatments against control"
"Test for interaction effects between genotype and treatment"
"Get genes with FDR < 0.05 and |logFC| > 1"
"Export edgeR results to CSV"
"Compare edgeR and DESeq2 results"
| Input | Format | Description |
|---|---|---|
| Count matrix | Integer matrix | Genes (rows) x Samples (columns) |
| Group factor | Factor | Sample group assignments |
| Design matrix | Matrix | From model.matrix() |
filterByExpr() for automatic low-count filtering -- skipping it inflates the multiple-testing burden; edgeR has no automatic independent filtering like DESeq2estimateDisp(robust=TRUE) AND glmQLFit(robust=TRUE) -- they propagate Phipson 2016 robust hyperparameter estimation through separate EB stepsglmTreat() tests for log fold changes above a threshold (H0: |LFC| <= threshold), preferred over post-hoc LFC filteringglmQLFit(legacy=FALSE) as the default -- pre-2025 results are reproducible with legacy=TRUE, but the v4 defaults are improvednormLibSizes() is the v4 canonical name (replaces calcNormFactors()); method='TMM' remains the documented default, with method='TMMwsp' as the preferred alternative for sparse / single-cell-pseudobulk datacatchSalmon() / catchKallisto() (Baldoni 2024) instead of standard tximport