Expression Heat Maps with Heatmapper.ca: A Practical Guide

By Dr. Zubair Khalid, DVM, MS, PhD ·

Expression Heat Maps with Heatmapper.ca: A Practical Guide

Introduction to Expression Heat Maps and Heatmapper.ca

What is an Expression Heat Map?

An expression heat map is a two-dimensional graphical representation of quantitative expression data—typically transcript abundances from RNA-seq, microarray intensities, or protein quantification from mass spectrometry—in which individual values are encoded as colors. The matrix layout places genes (or proteins, or metabolites) along one axis and samples (or conditions, time points, or biological replicates) along the other. Each cell's color corresponds to the measured abundance of that gene in that sample, scaled across a defined color gradient.

The utility of a heat map lies not in displaying raw numbers but in revealing structure. When rows and columns are reordered by clustering algorithms, patterns emerge: blocks of genes that rise and fall together across conditions, sample groups that share transcriptional programs, and outliers that break expected trends. This makes the heat map the default visualization for unsupervised exploration of high-dimensional omics data, particularly after differential gene expression analysis DESeq2 or differential gene expression DGE analysis pipelines have identified statistically significant changes.

A well-constructed heat map is a hypothesis-generating instrument. It can reveal co-expression modules that suggest shared regulatory mechanisms, sample clustering that indicates batch effects or unexpected phenotypes, and condition-specific signatures that warrant follow-up validation. The biological interpretation, however, depends entirely on the quality of the underlying data and the appropriateness of the preprocessing steps applied before visualization.

Why Use Heatmapper.ca?

Heatmapper.ca is a free, web-based platform developed at the University of Alberta that generates publication-quality heat maps without requiring programming expertise. Unlike R-based solutions such as pheatmap or ComplexHeatmap—which offer immense flexibility but demand familiarity with scripting—Heatmapper.ca provides a graphical interface that accepts tabular data and produces clustered, annotated heat maps in minutes.

The platform supports multiple input formats, offers several clustering algorithms, and allows fine control over color schemes, scaling, and figure dimensions. It is particularly well suited for researchers who need a reproducible, shareable visualization pipeline without maintaining custom code. For those who later require more advanced customization, the parameters chosen in Heatmapper.ca translate directly to concepts used in differential gene expression analysis in R, so the conceptual groundwork transfers.

This guide walks through the complete workflow: preparing data, uploading and configuring the heat map, understanding the underlying clustering mathematics, interpreting the output, and avoiding common errors.

Preparing Your Expression Data for Heatmapper.ca

Accepted File Formats

Heatmapper.ca accepts tab-delimited text files (.txt), comma-separated values (.csv), and Excel files (.xlsx). The critical requirement is a rectangular matrix where rows represent genes (or other features) and columns represent samples. The first column must contain unique identifiers—gene symbols, Ensembl IDs, or Entrez IDs—and the first row must contain sample names. The intersection of row and column headers defines the data matrix.

A minimal example for three genes and four samples:

Gene    Sample1    Sample2    Sample3    Sample4
TP53    12.4       8.1        15.2       3.9
MYC    45.2       52.7        38.1       61.3
CDKN1A  6.7        11.2        5.4        18.6

Do not include metadata columns (e.g., gene length, chromosome position) in the same file. Heatmapper.ca treats every non-header column as a sample. If you need to annotate genes with additional information, do so after heat map generation or use the label customization features described later.

Data Normalization and Scaling

The single most important preprocessing decision is how to scale your data before visualization. Raw read counts from RNA-seq are not directly comparable across samples because of differences in sequencing depth. Similarly, microarray intensities are subject to systematic technical variation. Heatmapper.ca does not perform normalization—it visualizes the matrix you provide—so normalization must be completed beforehand.

For RNA-seq data, standard practice is to generate normalized counts using DESeq2's median-of-ratios method or edgeR's TMM (trimmed mean of M-values) normalization. These methods produce count values that are comparable across samples and can be log2-transformed to stabilize variance. A typical pipeline: obtain raw counts, run DESeq2 normalization, extract normalized counts, add a pseudocount of 1, and log2-transform. The resulting matrix is suitable for heat map generation.

For microarray data, RMA (Robust Multi-array Average) or quantile normalization is standard. For protein quantification from mass spectrometry, normalize by total ion current or use label-free quantification algorithms that output normalized intensities.

After normalization, consider whether to scale each gene's values across samples (row scaling) or each sample's values across genes (column scaling). Row scaling—converting each gene's expression profile to a z-score (subtract the row mean, divide by the row standard deviation)—is the most common choice for expression heat maps. This emphasizes the pattern of expression change relative to that gene's own baseline, rather than absolute abundance. Without row scaling, highly expressed genes (e.g., ACTB, GAPDH) dominate the color scale and obscure subtle but biologically meaningful variation in low-abundance transcripts.

Handling Missing Values

Heatmapper.ca requires a complete matrix. Missing values—whether from genes with zero counts in some samples or failed measurements—must be addressed before upload. The simplest approach is to filter out genes with any missing values, but this can discard informative data.

Alternatives include imputation: replace missing values with the row mean, the column mean, or a k-nearest-neighbors estimate. For RNA-seq data where zeros arise from dropout, a common strategy is to add a small pseudocount (e.g., 1) before log transformation, which compresses the dynamic range of zeros relative to expressed genes. However, be aware that imputation introduces assumptions. If a gene is genuinely absent in a condition, imputing a value will obscure that biological fact. When in doubt, filter genes with excessive missingness (e.g., >20% of samples) and impute the remainder conservatively.

Uploading and Configuring Your Heat Map

Uploading Data Files

Navigate to Heatmapper.ca and select the "Heat Map" module. Upload your prepared file using the file picker. The interface will display a preview of your data matrix, showing the first few rows and columns. Verify that the dimensions match your expectation: the number of rows should equal your gene count, and the number of columns should equal your sample count.

Heatmapper.ca will ask you to confirm which column contains row labels (gene identifiers) and which row contains column labels (sample names). By default, it assumes the first column and first row serve these roles. If your data has a different structure, adjust the settings accordingly.

Choosing Clustering Methods

After upload, you will select clustering options. Heatmapper.ca offers two primary clustering approaches: hierarchical and k-means. The choice depends on your analytical goal.

Hierarchical clustering builds a tree (dendrogram) that groups genes or samples based on pairwise similarity of their expression profiles. It is agglomerative: each gene starts as its own cluster, and the two most similar clusters are merged iteratively until one cluster remains. The result is a nested hierarchy that reveals relationships at multiple scales. This is the default and most informative choice for exploratory analysis.

K-means clustering partitions genes into a user-specified number of clusters (k) by minimizing within-cluster variance. It requires you to choose k in advance, which is often unknown. K-means is faster for very large matrices and produces flat, non-hierarchical clusters that are easier to summarize, but it does not reveal relationships between clusters.

For both methods, you must select a distance metric and a linkage criterion. The distance metric defines how similarity between two expression profiles is calculated. Euclidean distance is the default and works well for z-scored data. Correlation-based distances (Pearson or Spearman) are more robust to differences in scale and are preferable when absolute magnitudes vary widely between genes. The linkage criterion defines how distances between clusters are computed from distances between individual members: complete linkage (maximum distance), average linkage (mean distance), or Ward's method (minimum increase in total within-cluster variance). Ward's method tends to produce compact, well-separated clusters and is a good default for expression data.

Selecting Color Palettes

The color scheme maps numerical values to colors. Heatmapper.ca provides several built-in palettes. The most common for expression data is a diverging scheme with three anchor points: blue for low expression, white for intermediate, and red for high expression. This "blue-white-red" scheme is intuitive and works well with z-scored data centered at zero.

For data that is not centered (e.g., raw normalized counts), a sequential palette from light to dark (e.g., yellow to red, or white to dark blue) is more appropriate. Avoid rainbow palettes, which introduce perceptual artifacts and make quantitative comparisons difficult. The human visual system does not perceive color differences uniformly across the rainbow spectrum, so adjacent colors in the palette may appear more or less similar than the underlying data values.

Heatmapper.ca allows you to set the minimum, midpoint, and maximum values of the color scale. For z-scored data, setting these to -2, 0, and +2 (or -3, 0, +3) ensures that extreme values saturate and intermediate values remain distinguishable. For log2-transformed counts, set the range based on the actual distribution of your data.

Understanding Clustering Algorithms in Heatmapper.ca

Hierarchical Clustering

Hierarchical clustering in Heatmapper.ca proceeds as follows. Given a matrix of n genes and m samples, each gene's expression profile is treated as a point in m-dimensional space. The distance between every pair of genes is computed using the selected metric. For Euclidean distance, this is the straight-line distance between the two points. For Pearson correlation, the distance is 1 minus the correlation coefficient, so genes with highly correlated profiles (r close to 1) have small distances.

The linkage criterion then determines how clusters are merged. With Ward's method, the algorithm at each step merges the two clusters whose combination yields the smallest increase in the total within-cluster variance. This tends to produce clusters of roughly equal size and is computationally efficient. Average linkage merges clusters with the smallest mean pairwise distance, which is more robust to outliers but can produce chains of loosely related genes.

The output is a dendrogram: a tree whose leaves are individual genes and whose internal nodes represent clusters. The height of each node is proportional to the distance between the merged clusters. Cutting the dendrogram at a given height produces a flat clustering; the number of clusters depends on where you cut.

K-Means Clustering

K-means clustering partitions genes into k clusters. The algorithm initializes k centroids (randomly or using a heuristic), assigns each gene to the nearest centroid, recomputes the centroids as the mean of assigned genes, and repeats until assignments stabilize. The result minimizes the sum of squared distances from each gene to its assigned centroid.

The choice of k is critical. Too few clusters merge distinct expression programs; too many fragment coherent modules. Heuristics include the elbow method (plot within-cluster variance against k and look for a bend) and the silhouette score (measure how similar each gene is to its own cluster versus the nearest other cluster). In practice, for exploratory analysis, hierarchical clustering is often preferable because it does not require specifying k and reveals the full hierarchy of relationships.

Interpreting Dendrograms

The dendrogram is not merely decorative; it encodes the similarity structure of your data. Genes that branch close together (low node height) have similar expression profiles. The order of leaves along the axis is determined by the clustering and reflects this similarity. When you see a block of red in the heat map corresponding to a clade of the dendrogram, that clade represents a set of co-expressed genes.

Sample dendrograms (usually shown along the top of the heat map) are interpreted identically. Samples that cluster together share global expression patterns, which may reflect biological condition, batch, or technical artifact. A sample dendrogram that separates treated from untreated samples is evidence that the treatment has a dominant transcriptional effect. A sample dendrogram that separates by sequencing batch instead of biological condition indicates a batch effect that should be addressed statistically before interpretation.

Interpreting Expression Heat Maps: Patterns and Biological Meaning

Identifying Co-Expression Modules

The primary interpretive task is identifying co-expression modules: sets of genes whose expression profiles are similar across the sampled conditions. These modules often correspond to shared regulatory programs. For example, genes controlled by the same transcription factor, members of the same protein complex, or components of the same metabolic pathway frequently show coordinated expression.

To identify modules, examine the heat map for contiguous blocks of consistent color. With hierarchical clustering and row scaling, a module appears as a rectangle of similar color spanning a subset of samples. For instance, in a time-course experiment of the yeast cell cycle, you would expect to see blocks of genes peaking at specific phases: G1 cyclins (CLN1, CLN2) in one block, S-phase histones (HTA1, HTB1) in another, and M-phase regulators (CDC20, BUB1) in a third.

Once you identify a candidate module, extract the gene list and test for functional enrichment. Tools such as DAVID, Enrichr, or g:Profiler can assess whether the module is enriched for Gene Ontology terms, KEGG pathways, or transcription factor binding motifs. This connects the unsupervised clustering to biological mechanism.

Correlating with Phenotypes

The sample dendrogram and the color patterns across samples allow you to correlate expression modules with phenotypes. If samples cluster into two major groups and a specific gene module is high in one group and low in the other, that module is a candidate driver of the phenotypic difference.

For example, in a comparison of drug-sensitive and drug-resistant cancer cell lines, a module of drug-metabolism genes (CYP3A4, ABCB1, GSTP1) might be uniformly high in resistant lines. This pattern suggests that the module contributes to resistance, generating a hypothesis testable by knockdown or overexpression experiments.

When interpreting, remember that correlation is not causation. Co-expression may reflect shared regulation rather than direct interaction. A module that correlates with a phenotype may be a downstream consequence rather than a driver. The heat map generates hypotheses; validation requires perturbation.

Customizing and Exporting Your Heat Map

Adjusting Labels and Annotations

Heatmapper.ca allows you to modify row and column labels. For publication, gene symbols are preferred over Ensembl IDs. If your data uses identifiers, you can map them to symbols before upload or edit the labels in the output.

The platform also supports sample annotations: colored bars above the heat map that indicate group membership (e.g., treatment vs. control, or tissue type). These annotations help readers map sample clusters to experimental conditions. To add annotations, you must provide a separate annotation file or use the built-in editor to assign colors to sample groups.

Font sizes for row and column labels are adjustable. For large gene sets (thousands of rows), individual gene labels are illegible; in such cases, suppress row labels and rely on the dendrogram structure, or display labels only for genes of interest.

Exporting for Publication

Heatmapper.ca exports heat maps as PNG, SVG, or PDF files. For print publication, SVG or PDF is preferred because they are vector formats that scale without loss of resolution. PNG is acceptable for presentations or online use but should be exported at high resolution (300 dpi or higher).

Set the figure dimensions explicitly. A common mistake is exporting a square image for a matrix with thousands of rows and a dozen columns. The aspect ratio should reflect the data: tall and narrow for many genes and few samples, wide and short for few genes and many samples. Adjust the width and height parameters in the export dialog to achieve the desired proportions.

Before export, verify that the color scale legend is included and clearly labeled. The legend should indicate what the colors represent (e.g., "Row z-score") and the numerical range. Heatmapper.ca includes this by default, but you may need to adjust its position or size.

Common Pitfalls and Troubleshooting in Heatmapper.ca

Data Format Errors

The most frequent error is a misformatted input file. Common issues include: extra blank rows or columns, non-numeric characters in the data matrix, duplicate gene identifiers, and inconsistent column counts across rows. Heatmapper.ca will often fail to parse such files or produce a heat map with missing rows.

Solution: validate your file before upload. Open it in a spreadsheet program and confirm that every row has the same number of columns, that all data cells are numeric, and that gene identifiers are unique. Remove any trailing spaces or invisible characters. If you have duplicate gene symbols, aggregate them (e.g., by taking the mean) before upload.

Misleading Color Scales

A poorly chosen color scale can obscure or exaggerate patterns. If the color range is too narrow, most cells will appear saturated and differences will be invisible. If too wide, subtle variation will be amplified into apparent structure.

Solution: examine the distribution of your data before setting the color scale. For z-scored data, check the range of z-scores; if most values fall between -1 and 1, set the color scale limits to -2 and 2 to avoid saturation. For log2-transformed counts, plot a histogram of values and set the color limits to cover the central 95% of the distribution.

Another common issue is using a sequential palette for data that is centered at zero. If your data contains both positive and negative values (e.g., log2 fold changes), a diverging palette with a neutral midpoint is essential. Using a sequential palette will make negative values indistinguishable from zero.

Overinterpretation of Clusters

Hierarchical clustering always produces a dendrogram, even for random data. The presence of clusters in the heat map does not guarantee that they are statistically meaningful. This is particularly dangerous when the number of samples is small, as clustering can be driven by a single outlier.

Solution: assess cluster stability. One approach is to run the clustering on bootstrap resamples of the data and check whether the same clusters appear. Another is to use the silhouette score to quantify how well each gene fits its assigned cluster. If clusters are unstable or have low silhouette scores, treat them with caution.

Additionally, be wary of overinterpreting the order of leaves in the dendrogram. The order within a cluster is arbitrary and can change with minor perturbations of the data. Only the cluster membership and the branching structure at higher levels are meaningful.

Frequently Asked Questions

What file formats does Heatmapper.ca accept for expression data?

Heatmapper.ca accepts tab-delimited text files (.txt), comma-separated values (.csv), and Excel files (.xlsx). The file must be a rectangular matrix with gene identifiers in the first column and sample names in the first row. All data cells must be numeric. Do not include metadata columns or extra annotation rows.

How do I normalize my expression data before creating a heat map?

Normalization must be performed before upload. For RNA-seq data, use DESeq2's median-of-ratios or edgeR's TMM normalization, then add a pseudocount of 1 and log2-transform. For microarray data, use RMA or quantile normalization. After normalization, consider row scaling (z-score transformation) to emphasize expression patterns rather than absolute abundance.

What is the difference between clustering genes and clustering samples in a heat map?

Clustering genes (rows) groups genes with similar expression profiles across all samples, revealing co-expression modules that may share regulatory mechanisms. Clustering samples (columns) groups samples with similar global expression patterns, revealing biological conditions, batch effects, or technical artifacts. Both are performed simultaneously in a standard heat map, and both dendrograms should be interpreted.

How do I choose the right color scheme for my heat map?

Use a diverging palette (e.g., blue-white-red) for data centered at zero, such as z-scores or log2 fold changes. Use a sequential palette (e.g., light to dark) for data that is all positive, such as normalized counts. Avoid rainbow palettes. Set the color scale limits to match the central distribution of your data to avoid saturation.

Why does my heat map look different from what I expected?

Common causes include: improper normalization (raw counts instead of normalized values), failure to scale rows (absolute abundance dominating the color scale), incorrect color scale limits, and clustering artifacts from outliers. Check your preprocessing steps and re-examine the data distribution. If samples cluster by batch rather than condition, a batch effect may be present.

Can I export a high-resolution heat map from Heatmapper.ca for publication?

Yes. Heatmapper.ca exports PNG, SVG, and PDF formats. For print, use SVG or PDF (vector formats). For PNG, set the resolution to at least 300 dpi. Adjust the figure dimensions to match the aspect ratio of your data matrix before export.

How do I interpret the dendrogram in a heat map?

The dendrogram shows the hierarchical relationships between genes (or samples) based on their expression profile similarity. Genes that branch close together have similar profiles. The height of a branch indicates the distance between the merged clusters. Cutting the dendrogram at a given height produces a flat clustering, and the resulting clusters correspond to the blocks of color visible in the heat map.

Key Takeaways

  • Expression heat maps are powerful tools for visualizing structure in high-dimensional omics data, but their output quality depends entirely on proper data preprocessing.
  • Normalize your data (DESeq2, TMM, RMA) and apply row z-score scaling before generating a heat map to emphasize expression patterns over absolute abundance.
  • Heatmapper.ca accepts tab-delimited, CSV, or Excel files and requires a complete numeric matrix with unique row identifiers and sample names in the header.
  • Hierarchical clustering with Ward's linkage and Euclidean or correlation distance is the default choice for exploratory analysis; k-means requires specifying the number of clusters in advance.
  • Interpret heat maps by identifying co-expression modules and correlating them with sample phenotypes, but validate cluster stability before drawing biological conclusions.
  • Use diverging color palettes for centered data and sequential palettes for positive data; set color limits to match the data distribution to avoid saturation.
  • Export heat maps as SVG or PDF for publication, and always include a clearly labeled color scale legend.

Related Clinical & Scientific Guides