Bioinformatics · JapaLingo.jp

Choosing a plot: heatmaps, Venn diagrams, and UpSet

A figure is an argument. The same table can be honest as a heatmap, misleading as a three-circle Venn, or clearer as an UpSet matrix. Learn the question first; the software is only the pen.

Heatmap

Use it when you have a numeric matrix — genes × samples, taxa × sites, residues × properties — and you care about pattern, not a single p-value.

  • Say what was scaled (row z-score vs raw counts).
  • Say how rows and columns were ordered (clustered vs biological order).
  • A pretty block structure can be a batch effect. Check the sample sheet.
Venn (≤ 3 sets)

Use it when you have two or three named lists and the intersection is the claim: shared DE genes, shared taxa, primers that hit both genomes.

  • Always print the counts, not only the shapes.
  • Four sets in a Venn become a puzzle, not a figure.
  • Overlaps are not evidence of a pathway by themselves.
UpSet (many sets)

Use it when you have more than three sets and you need intersection sizes that a Venn cannot hold.

  • The bar is the count; the dots say which sets participate.
  • Sort by combination size or by a set you care about — and say which.
  • Empty intersections can be the result. Do not hide them.
A classroom workflow
  1. Write the claim in one sentence (“these five treatments share twelve genes after filtering”).
  2. Choose the geometry that can carry that sentence.
  3. Build the figure from a small CSV you can open in a text editor. If you cannot rebuild it, you do not understand it.
  4. Caption: what the colour or bar means, how the lists were made, and what you excluded.

R packages such as pheatmap, ComplexHeatmap, and UpSetR, and Python libraries such as seaborn and matplotlib-venn, are the usual lab stack. For a first figure from a tiny teaching CSV, Heatmap Creator, Venn Diagram by Japality, and UpSet Plot can draw the same three geometries. The grade is the caption, not the programme.

When the plot is the wrong tool
  • You have one number. Use a sentence.
  • You have compositions that sum to 1. A stacked bar or a compositional method may be safer than a raw heatmap.
  • You have a phylogenetic claim. A tree is the argument; a Venn of “shared genes” is supporting evidence at best.
  • You are showing amino-acid properties. A table or flashcards may teach faster than a rainbow matrix. The NCBI residue table or Amino Acids OTG can drill the twenty residues before you colour them.
Caption checklist
  • What is a row? What is a column?
  • How were values transformed?
  • How were sets defined (thresholds, database, date)?
  • What would change the picture if you repeated the analysis?

Use this page after RNA-seq or Metagenomics, when you finally have a table that wants a figure.