This repository contains a fully modular, reproducible RNA‑seq analysis pipeline implemented in R.
It performs end‑to‑end processing of bulk RNA‑seq quantifications (Salmon) through differential expression analysis (DESeq2), quality control, visualization, and result reporting.
The pipeline is designed with clarity, reproducibility, and engineering discipline in mind:
- No global variables
- Each script runs independently
- All intermediate objects saved as RDS
- Config‑driven design
- Helper functions for clean, reusable code
The workflow includes:
- Metadata validation
- Import of Salmon quantifications using tximport
- Gene‑level summarization via
tx2gene - Filtering of samples based on user‑defined conditions
- Filtering low‑count genes
- Normalization
- Model fitting
- Wald test
- Extraction of DEGs at multiple thresholds
- Saving all results and normalized counts
- Variance‑stabilizing transformation (VST)
- Batch‑effect correction (limma)
- Sample distance heatmap
- Outlier detection (distance + correlation)
- Cook’s distance boxplot
- PCA with customizable aesthetics
- Sample labeling and grouping
- DEG heatmaps (padj < 0.1 and padj < 0.05)
- Volcano plot with:
- auto‑detected broken y‑axis
- top‑N gene labeling
- clean color coding
- All intermediate objects saved to
data/processed/ - All figures saved to
results/figures/ - All tables saved to
results/tables/