← Bioinformatics Series

Dimensionality Reduction

Twenty thousand genes per cell is invisible. The 2D scatter plot is a compression, and a lie.

A single-cell RNA-seq experiment measures ~20,000 genes across tens of thousands of cells. Each cell is a point in 20,000-dimensional space, which can't be plotted directly. Dimensionality reduction produces 2D coordinates such that similar cells land close together on the page.

From a matrix to a scatter

Every point in a UMAP is a row in a cell × gene matrix. The marks in the matrix are an expression signature; the 2D position summarises that signature's similarity to everyone else's.

Figure 1. 40 cells × 24 highly variable genes on the left, the UMAP of the same cells on the right. Hover either side — the same cell highlights in both. The 2D coordinates have no intrinsic axis meaning; they encode high-dimensional proximity only.

When linear methods fail

Principal component analysis (PCA) projects onto directions of maximum variance: exact, fast, linear. It is often the first denoising step before a single-cell UMAP or t-SNE, but it can miss a curved signal when higher-variance directions come from batch effects, technical noise, or biology unrelated to the question. UMAP and t-SNE optimise neighbourhood relationships instead. They can reveal non-linear structure, but they are visual summaries, not measurements of distance, density, or cluster area.

Nonlinear panel:
UMAP keeps a little more of the moon ordering in this synthetic example.

Figure 2. 200 cells arranged as two interlocking half-moons in 2D, then embedded in 12D by adding 10 higher-variance noise dimensions. The PCA panel follows the highest-variance directions, which are not the moon coordinates here. UMAP and t-SNE recover local neighbours, but the apparent spacing between the two islands is a layout choice. Hover any point; it highlights in all three panels.

PCA is the right tool when the interesting axes are approximately linear, and it remains useful as a preprocessing representation. Non-linear embeddings are usually better as maps for exploration. Treat them as a prompt to ask which genes, samples, or neighbours explain the shape.

Reading the embedding

A UMAP is a coordinate system with no intrinsic meaning. Cluster identity comes from marker-gene overlays: if the group of cells that lights up for CD3D is the same group that lights up for IL7R, it is a T-cell cluster. The inter-cluster distance on the page is not a meaningful measurement, UMAP optimises local neighbourhoods at the expense of global geometry. Two clusters that sit far apart may be biologically similar; two that abut may be quite different.

Color by:
Hover a cell to see its high-dimensional nearest neighbours.

Figure 3. 200 cells across five cell types. Cluster colouring is the default; click a gene button to recolour by expression. Hovering draws high-dimensional neighbour edges (green = same annotated type, red = different annotated type). Selective markers like CD3D light one cluster; pan-leukocyte PTPRC glows everywhere. The slider changes how strict the local neighbourhood question is.

A UMAP alone tells you almost nothing; a UMAP plus a curated marker panel is one of the most information-dense plots in single-cell biology.