Enhanced Volcano Plot
Overview
A volcano plot is the standard one-glance summary of a differential-expression
(DE) result: each gene is a point with the effect size (log2 fold-change) on the
x-axis and the statistical significance (-log10 of a p-value or adjusted
p-value) on the y-axis. The shape of the resulting "volcano" makes it trivial
to read off three things at once — how many genes move, how strong those moves
are, and how robust they are statistically. This skill wraps the canonical
Bioconductor package EnhancedVolcano
into a single runnable Rscript template, and offers a Python/matplotlib
fallback for environments where R is unavailable.
When to Use This Skill
- You have a DE table from DESeq2, edgeR, limma-voom, Seurat
FindMarkers,
scanpy rank_genes_groups, or any pipeline that produces a per-gene
log2FoldChange + p-value / padj column pair.
- You want a publication-ready figure (PDF or 300-dpi PNG) with labelled top
genes, threshold guide-lines, and a DEG-count caption.
- You want consistent styling across many comparisons (cluster vs cluster,
treatment vs control, time-point vs baseline).
Not for: pathway/GSEA visualisations (use a barplot / dotplot of normalized
enrichment scores instead), MA-plots (different convention: log2FC vs mean
expression), or QC of raw counts (use a PCA / dispersion plot).
Prerequisites
EnhancedVolcano lives on Bioconductor; ggrepel and optparse live on CRAN.
The template guards each library() call with a requireNamespace() check
and installs the missing pieces, so this block is documentation rather than a
hard prerequisite — but installing once up-front avoids the install overhead
during plotting:
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
if (!requireNamespace("EnhancedVolcano", quietly = TRUE))
BiocManager::install("EnhancedVolcano", update = FALSE, ask = FALSE)
if (!requireNamespace("ggrepel", quietly = TRUE))
install.packages("ggrepel")
if (!requireNamespace("optparse", quietly = TRUE))
install.packages("optparse")
if (!requireNamespace("magrittr", quietly = TRUE))
install.packages("magrittr")
R ≥ 4.1 is recommended (matches current Bioconductor). The template is
single-threaded and runs in seconds on tables of up to ~100k genes.
Input Format
A delimited text file with at least three columns:
| role | typical names |
| ------------- | ---------------------------------------------------------- |
| gene name | gene, gene_name, symbol, Gene, rowname |
| effect size | log2FoldChange (DESeq2), logFC (edgeR/limma), avg_log2FC (Seurat) |
| significance | padj (DESeq2), FDR (edgeR), adj.P.Val (limma), p_val_adj (Seurat), or raw pvalue |
The template auto-detects the file type from the extension:
.csv→read.csv.tsv/.txt→read.delim
You pick which columns to use via --gene-col, --x-col, --y-col.
The default is gene / log2FoldChange / padj, which matches a tidied
DESeq2 result.
Quick Start — R
Rscript assets/enhanced_volcano_template.R \
--input results/treated_vs_control.tsv \
--output figures/volcano_treated_vs_control.pdf \
--gene-col gene \
--x-col log2FoldChange \
--y-col padj \
--p-cutoff 0.05 \
--fc-cutoff 1.0 \
--label-top-n 20 \
--title "Treated vs Control" \
--subtitle "DESeq2, padj < 0.05, |log2FC| > 1"
Or, equivalently, edit the CONFIGURATION block at the top of
assets/enhanced_volcano_template.R and run with no flags:
Rscript assets/enhanced_volcano_template.R
Quick Start — Python
The R path is the primary, recommended one — EnhancedVolcano handles label
collision avoidance and threshold annotation in a polished way that is hard
to match in matplotlib. If R is genuinely unavailable, build the plot directly