Site icon Ampersand Tutorials

Volcano Plots and Heatmaps for RNA-Seq Results: A Practical Tutorial

Quick answer: A volcano plot puts fold-change on the x-axis and statistical significance on the y-axis so that the genes worth caring about — big change, small p-value — rise to the top corners of the picture. A heatmap shows expression across samples for a chosen gene set, usually after variance-stabilizing transformation and row scaling. Both are two-line jobs in R or Python once your table is in the right shape; the craft is in what you scale, what you threshold, and which genes you choose to display — because those three choices decide whether the figure is evidence or decoration.

Companion to the bulk RNA-seq analysis guide on this blog — this is the visualization step that sits at the end of that pipeline.

What a volcano plot is actually encoding

Take your differential-expression table with three columns per gene: log2 fold-change, p-value (or adjusted p), and gene ID. The plot maps log2FC to x and −log10(p) to y. The shape explains the name: statistically strong but biologically trivial genes hug the top centre, large-but-noisy changes drift along the bottom corners, and the genes you want sit high and far out — the eruption.

Design decisions, in order of impact:

The ready-made route in R is EnhancedVolcano from Bioconductor:

library(EnhancedVolcano)
EnhancedVolcano(res,           # DESeq2/edgeR result table
    lab = res$gene,
    x = 'log2FoldChange', y = 'pvalue',
    pCutoff = 0.05, FCcutoff = 1,
    title = 'Treatment vs control')

Or draw it yourself with ggplot2 when you want full control — ggplot(res, aes(log2FoldChange, -log10(padj))) + geom_point(aes(colour = sig), alpha = 0.4) + geom_vline(xintercept = c(-1, 1), linetype = 2) + geom_hline(yintercept = -log10(0.05), linetype = 2). The same construction in matplotlib works for Python users: ax.scatter(lfc, -np.log10(padj)) with threshold lines added as ax.axvline.

Labeling without turning it into spaghetti

Only annotate the genes a reader would ask about: the top 5–10 by adjusted p, a short named list (marker genes for your condition), or manual geom_text_repel labels for a handful. Labeling every point below 0.05 makes the figure unreadable and argues nothing.

The heatmap: transformation first, aesthetics second

Raw counts are a trap for heatmaps. Their variance grows with their mean, so a clustering built on raw counts groups genes by abundance rather than by behaviour, and the highest-expression genes dominate the colour scale. The standard order of operations:

In R:

library(pheatmap)
top <- head(rownames(res[order(res$padj), ]), 500)
mat <- vst(dds, blind = FALSE)[top, ]           # variance-stabilized counts
pheatmap(assay(mat), scale = 'row',            # one row = one gene, z-scored
         annotation_col = coldata,              # condition/batch side bars
         show_rownames = FALSE, clustering_method = 'ward.D2')

Python equivalents exist (seaborn.clustermap with z_score=1 for row scaling) and behave the same way.

The mistakes that make reviewers twitch

From figure to report

Export at vector resolution (PDF or SVG for journals, PNG ≥ 300 dpi for slides) with the thresholds, transform, and gene-count visible in the caption. A caption that reads “Genes with |log2FC| > 1, FDR < 0.05, n = 1,204; heatmap of the 500 most variable genes after VST, row-scaled” answers every question a reviewer will ask in eighteen words.

Key takeaways

Challenge

Take a public differential-expression table (GEO or the supplement of any RNA-seq paper) and produce both figures in one script: a volcano with FDR-based thresholds and five labeled genes, plus a row-scaled heatmap of the top 500 variable genes with sample-group annotations. Then repeat the heatmap on raw counts and compare — the difference between “clusters by condition” and “clusters by abundance” is the lesson you will remember.

Want guided practice turning expression tables into defensible figures? Ampersand Academy offers one-to-one mentoring in bioinformatics — part of Mahadhi, a development and digital marketing company.

FAQ

Should the volcano plot use p-value or adjusted p-value?

Adjusted (FDR) p-value. With tens of thousands of tests, raw p-values deliver large false-positive sets at any conventional cutoff, and most journals now expect the adjusted value stated in the caption.

What are the standard fold-change and significance cutoffs?

The common default is absolute log2 fold-change above 1 (twofold) with adjusted p below 0.05. They are conventions: tighten them for small, well-powered studies and treat them as exploratory flags when power is low.

Why does my volcano plot have no genes in the top corners?

Usually weak statistical power rather than a plotting bug — check depth, dispersion, batch effects, and whether the contrast is biologically real. A cloud hugging the axis can also come from using raw p-values on a very noisy table.

Should I plot raw counts or normalized counts in a heatmap?

Neither directly: use a variance-stabilizing transform (VST, rlog) or log2 CPM. Raw-count heatmaps cluster genes by abundance because variance rises with the mean, which drowns the condition pattern.

Do I need to scale rows in the heatmap?

Row scaling converts each gene’s values to z-scores relative to its own mean, so colour shows per-gene change instead of absolute expression. For comparing patterns across genes it is essentially required; for showing absolute abundance it is wrong.

How many genes should the heatmap include?

Typically 500 to 2,000 — the most variable rows or the significant set from your test. Beyond a few thousand rows the plot becomes a texture, and clustering stability on noisy low-expression genes adds nothing.

Is it circular to select genes by significance and then show them in a heatmap?

Not for exploration or illustration, as long as you describe it as such. It becomes a problem only if the same selection is presented as independent evidence for the result that produced it.

Exit mobile version