Lesson 10 of 20

Heatmaps — the decisions you make before colouring a table

Figs. 3A and 6A · row normalisation and ordering

Heatmaps — the decisions you make before colouring a table
A heatmap is only a table turned into colour. But whether you normalise the rows and what order you put them in change it entirely.

A heatmap is simple. Colour each cell of a table according to its value. That is all.

But three decisions come first. All three change the picture completely.

📏
1. Normalise the rows?
genes live on different scales. Without it only the loud genes are visible
🔀
2. What order?
clustered? by value? by name? The order creates the pattern
🎨
3. Which colour map?
diverging for z-scores, sequential for raw values. Exactly as in lesson 6
The left panel answers which genes are abundant; the right answers which genes respond to the condition. The paper wants the right one.
Python Runs in your browser
Toggle normalisation, ordering, colour map and range one at a time, and watch the same table tell different stories.
Loading…

The second decision — ordering — matters more than it looks.

Clustering
groups similar rows together. It can reveal structure you did not know about. But the picture depends on where you rotate the branches of the dendrogram
By value
largest change first. Honest and reproducible. But group structure stays invisible

One important fact: a clustered heatmap always looks beautiful. Feed it noise and it still looks beautiful — you sorted like with like, so of course blocks appear. So “there are blocks in the heatmap” is not evidence of anything.

Clustering makes anything look organised. That is why the blocks in a heatmap cannot be the basis of a conclusion.
Python Runs in your browser
🤔 Check yourself
Genes differ enormously in expression scale. What happens if you skip row z-scoring?
🤔 Check yourself
You cluster a matrix of random numbers and draw it as a heatmap. What do you see?
🤔 Check yourself
Why does the phrase 'normalized expression' in the Fig. 6A legend matter?