Statistics · Intermediate
Interpret heatmaps and volcano plots in large datasets
Explain matrix scaling and the relationship between feature effect sizes and adjusted evidence.
11 min read · Oct 26, 2026
Key points
- Define heatmap values and selection.
- Label volcano axes and thresholds.
- Preserve the biological or experimental unit.
Contents
Explain matrix scaling and the relationship between feature effect sizes and adjusted evidence.
Heatmaps and volcano plots compress many measurements into a small space. That makes them useful in molecular science, surveys, materials research and computational benchmarking. It also makes them easy to overinterpret. A striking pattern may result from scaling, feature selection or an unsuitable statistical model rather than a robust scientific difference.
This tutorial explains what the displays encode, how to construct them transparently and how to connect them to defensible manuscript claims. You do not need to understand every specialised analysis to read a plot critically, but you must identify the input, transformation, unit of inference and selection rules.
Define the matrix before making a heatmap
A matrix is a rectangular arrangement of values. A heatmap maps each value to a colour. Rows might represent genes, survey items, materials or algorithms. Columns might represent samples, participants, conditions or evaluation scenarios. The colour key must state what quantity is encoded and on what scale.
Begin with four questions:
- What does each row represent?
- What does each column represent?
- What calculation produced each cell?
- Are all cells directly comparable on the same scale?
A heatmap of mean test scores across school subjects differs from a heatmap of correlations among those subjects. The former contains scores; the latter contains dimensionless associations bounded between negative one and one. A correlation matrix also requires attention to missingness: if different cells use different subsets of students, apparent differences may partly reflect changing samples.
In an engineering comparison, do not mix raw runtime in seconds, accuracy percentages and energy in joules in a single undifferentiated colour scale. Separate panels, justified standardisation or explicit performance ratios may be needed. The choice should preserve the quantity readers need to compare.
Understand row standardisation with a calculation
A z score expresses a value relative to a mean and standard deviation. For a row, subtract that row's mean from each value and divide by that row's SD. This makes relative within row patterns easier to compare but removes absolute scale information.
Consider two hypothetical rows:
| Row | Sample 1 | Sample 2 | Sample 3 | Row mean | Sample SD |
|---|---|---|---|---|---|
| Feature A | 10 | 20 | 30 | 20 | 10 |
| Feature B | 100 | 200 | 300 | 200 | 100 |
After row standardisation, both rows become negative one, zero and positive one. They therefore receive the same colours even though Feature B's raw values are ten times larger. A red Feature A cell does not necessarily exceed a blue Feature B cell in the original units.
Rows with no variability have SD zero, so this calculation is undefined. State whether constant rows were removed, shown separately or handled through another documented rule. Missing values also require explicit treatment. A missing measurement must not silently receive the same colour as zero.
Software defaults can alter the result. R's heatmap documentation exposes row, column and no scaling options along with clustering controls. Check the setting you actually used and report it rather than writing only “a heatmap was generated”. S408
Choose colour scales that match meaning
Use a sequential scale for an ordered magnitude, such as increasing concentration. Use a diverging scale when a scientifically meaningful central value separates directions, such as zero for a signed effect or one for a ratio after an appropriate transformation. Label the colour bar with its units or transformation.
A colour limit can conceal extremes if values beyond it are clipped to the same shade. If clipping is needed to show the bulk of the matrix, state the limits and make the underlying values available. Use the same limits across panels intended for direct comparison.
Do not make missing values look like a neutral biological state. For example, a grey cell could represent missing data, while a central white cell represents a standardised value of zero. Explain both. Avoid interpreting sudden colour transitions as biological boundaries when the palette itself creates those transitions.
Report ordering and clustering
The arrangement of rows and columns affects what a reader notices. A prespecified order may preserve time, dose or a conceptual grouping. Clustering instead groups items according to a numerical similarity or dissimilarity rule. A distance metric defines how different two items are, and a linkage method defines how clusters are joined in hierarchical clustering.
Record the input features, transformation, distance, linkage and any manual reordering. A dendrogram, the branching tree often beside a heatmap, summarises the chosen algorithm's grouping. Its presence is not a significance test or proof that the groups are natural categories.
Suppose, hypothetically, a survey team clusters students using items about school belonging. Students may separate because of a broad response tendency, missing data patterns or language comprehension, rather than distinct psychological types. The appropriate next step is to inspect these alternatives and validate any proposed grouping with suitable evidence.
Likewise, clustering samples after selecting only genes that differ between treatment groups will often reveal the treatment grouping. That display can summarise the selected findings, but it cannot independently validate the same difference. Be explicit about whether the features were prespecified, selected by variability or selected from the tested contrast.
Decode both axes of a volcano plot
A volcano plot commonly places an effect estimate on the horizontal axis and a transformed p value on the vertical axis. In gene expression studies, the effect is often log base 2 fold change. The vertical axis is often negative log base 10 of a raw or adjusted p value. The exact choice must appear on the axis and in the legend.
A log₂ fold change of 1 represents a ratio of 2. A value of negative 1 represents a ratio of one half. A value of 0 represents a ratio of 1. Define the numerator and denominator, such as treatment divided by control. Reversing the comparison reverses the horizontal direction.
The vertical transformation makes small p values appear high. A p value of 0.01 has a negative log₁₀ value of 2. A p value of 0.001 gives 3. These heights are not effect sizes or probabilities that a hypothesis is correct. A point far to the right can have a large estimated effect with weak precision, while a point near the centre can have a small effect estimated very precisely.
The supplied illustration uses constructed values. Its vertical volcano axis specifically uses BH adjusted p values. Do not describe it as a raw p value plot when reusing the image.
Distinguish raw p values, adjusted p values and FDR
When many features are tested, multiple testing affects the interpretation of a collection of discoveries. The Benjamini and Hochberg procedure addresses the false discovery rate, or FDR, under appropriate assumptions. FDR concerns the expected proportion of false rejections among all rejections, with a defined convention when there are none. It does not assign a posterior probability of being false to each highlighted feature.
State the family of tests and adjustment method. The official R p.adjust documentation distinguishes several adjustment procedures and their error control goals. The detailed interpretation belongs in Article 16. S16
Do not select visually attractive points first and then adjust only their p values. A filtering rule can be legitimate in a suitable statistical workflow, but its rationale, timing and assumptions must be described. Filtering on the same significance evidence one later claims to control can invalidate the intended interpretation.
If the vertical axis uses raw p values but colour uses adjusted p values, explicitly state both. Readers should not have to infer a complicated colour rule from the shape of the plot. A displayed threshold is a reporting choice, not a natural boundary between true and false biology.
Examine effect thresholds and estimate stability
A hypothetical analysis colours features when the adjusted p value is below 0.05 and the absolute log₂ fold change is at least 1. That selects estimated ratios of at least 2 or at most one half together with a specified statistical criterion. It does not show that the true effects exceed the threshold, unless the testing procedure actually addresses that hypothesis.
A separate post hoc effect filter is not interchangeable with a test against a minimum effect. Explain which analysis was performed. Justify the practical threshold from the scientific context rather than choosing it because it produces a pleasing number of coloured points.
For molecular count data, low counts can produce unstable fold change estimates. Appropriate models and estimation procedures matter. Love, Huber and Anders introduced DESeq2 with dispersion and fold change estimation methods designed for sequencing count data; this is a specific analysis framework, not a universal recipe for every heatmap or volcano plot. S406
A shrinkage estimate moves unstable estimates toward a reference according to a model. If plotted effects are shrunken but p values come from another stage of the analysis, describe the workflow accurately. Preserve the complete numerical results, including uncertainty and the software version, rather than treating the image as the entire analysis.
Protect the unit of inference
Large datasets often contain many measurements within few independent units. Thousands of cells from several donors do not automatically provide thousands of independent donors. Many simulation runs using the same trained model may likewise represent repeated evaluation rather than independently trained systems.
Choose a statistical model or aggregation strategy appropriate to the experimental design before plotting. State how batches, repeated observations and relevant covariates were handled. A volcano plot with tiny p values can look convincing while reflecting an analysis that ignored clustering.
Do not add an arbitrary constant merely to allow logarithms or exaggerate ratios. Explain how zeros, below detection measurements, missing values and untestable features were handled. If an extremely small p value is numerically returned as zero, preserve the analytical output and disclose a display floor for the log axis. A plotted maximum height is not an exact zero probability.
Write an interpretation without overstating validation
Consider this weak hypothetical result:
The heatmap confirmed two biological types, and the volcano plot identified the genes that cause the phenotype.
Neither conclusion follows from the graphics alone. A more defensible report is:
Among the prespecified features included in the constructed example, row standardisation highlights differences in relative profiles across samples. The heatmap is descriptive and does not establish distinct biological types. The volcano plot displays the estimated treatment versus control effects and BH adjusted p values for the full analysis family. Coloured features meet the stated statistical and estimated effect criteria. These candidates would require independent evidence before any mechanistic role could be claimed.
A real result paragraph should replace the generic descriptions with actual feature counts, effect estimates, uncertainty and design details. The example deliberately uses no invented biological discovery.
A useful heatmap legend identifies rows, columns, transformation, colour limits, missing values, selection and ordering. A useful volcano legend identifies the effect direction, test, adjustment family, colour rule, label selection and omitted or capped values. Use Template 11 to record those decisions.
Practice and model answer
Task: Two rows have identical red to blue patterns after row standardisation. Can you conclude that their raw abundances are equal?
Model answer: No. Standardisation removes each row's mean and scale. The rows may have very different raw values, as the tenfold example above demonstrates. Examine the appropriate unstandardised summaries before making an abundance comparison.
Task: A feature has log₂ fold change 2 and adjusted p value 0.20. Another has log₂ fold change 0.10 and adjusted p value 0.001. Which is more important?
Model answer: The graphic does not determine importance. The first has a larger estimated ratio, fourfold, with less evidence against the tested null under the model. The second has a smaller estimated effect with stronger statistical evidence. Evaluate uncertainty, measurement reliability, practical relevance and independent support. Avoid equating either extreme with scientific importance.
Sources
Downloads
- Synthetic teaching data: synthetic_heatmap_raw.csv (2 KB)
- Synthetic teaching data: synthetic_volcano.csv (16 KB)
- Python script that reproduces the examples: reproduce_examples.py (3 KB)
- Calculation record: computation_environment.json (1 KB)
- About the teaching data: README.txt (8 KB)
Sign in to download these files.