Visualizing single-cell data with the neighbor embedding spectrum

Sebastian Damrich, Manuel V. Klockow, Philipp Berens, Fred A. Hamprecht, Dmitry KobakbioRxiv 2024

Abstract

The two-dimensional embedding methods t-SNE and UMAP are ubiquitously used for visualizing single-cell data. Recent theoretical research in machine learning has shown that, despite their very different formulation and implementation, t-SNE and UMAP are closely connected, and a single parameter suffices to interpolate between them. This leads to a whole spectrum of visualization methods that focus on different aspects of the data. Along the spectrum, this focus changes from representing local structures to representing continuous ones. In single-cell context, this leads to a trade-off between highlighting rare cell types or continuous variation, such as developmental trajectories. Visualizing the entire spectrum as an animation can provide a more nuanced understanding of the high-dimensional dataset than individual visualizations with either t-SNE or UMAP.

Introduction

In single-cell transcriptomics, researchers deal with high-dimensional datasets where thousands of genes are measured across millions of cells. To make sense of this complexity, they rely on 2D visualizations, most notably t-SNE and UMAP. However, there has long been a lack of clarity regarding which method is superior. UMAP often produces cleaner, more condensed clusters, while t-SNE is praised for showing finer local detail. This paper addresses this confusion by showing that these methods aren't fundamentally different—they just prioritize different aspects of the data. Choosing one over the other involves a trade-off between local accuracy (seeing distinct cell types) and global structure (seeing how those types relate over time).

Methods: The Neighbor Embedding Spectrum

Building on recent theoretical work, the authors demonstrate that t-SNE and UMAP share a common conceptual framework. The primary difference lies in how they balance two forces: attraction (pulling similar cells together) and repulsion (pushing all cells apart). By varying a single hyperparameter—the attraction strength—one can interpolate between t-SNE, UMAP, and even more global methods like ForceAtlas2.

The authors introduce a Python package, ne-spectrum, which computes this entire spectrum. Rather than a single static plot, they advocate for animations that show the data "morphing" across different levels of attraction. This is analogous to changing a microscope lens: high repulsion (t-SNE) is like a high-power lens focusing on local details, while high attraction (UMAP) is like a wide-angle lens showing the overall landscape.

Results: Insights from Brain Organoid Development

The paper demonstrates these findings using a human brain organoid development dataset ($n = 20,272$ cells). This dataset contains both distinct cell types and a clear temporal trajectory (0 to 120 days).

The neighbor embedding spectrum interpolates between t-SNE and UMAP/ForceAtlas, shifting focus from local clusters to continuous trajectories.

As shown in the spectrum above, high-repulsion embeddings (t-SNE) successfully separate distinct cell types that are often squashed together in high-attraction (UMAP-like) embeddings. Conversely, high-attraction embeddings make the "developmental spine" of the organoid much more visible.

This qualitative shift is underpinned by a fundamental quantitative trade-off. As attraction increases to better preserve global distances (measured by Spearman correlation), local neighbor preservation (measured by kNN recall) inevitably decreases.

Quantitative trade-off between local neighbor preservation (kNN recall) and global distance preservation (Spearman correlation) across the embedding spectrum.

Discussion and Conclusion

All 2D embeddings are inherently distorted and should be used for hypothesis generation rather than definitive proof. However, by viewing the spectrum as an animation, researchers can identify which structures are robust biological features and which are artifacts of specific parameter settings. Moving toward this "spectrum" approach can help the single-cell community move away from relying on a single, potentially misleading static plot and toward a more nuanced understanding of high-dimensional data.

Summary updated

BibTeX
@misc{damrich2024visualizing,
  author = {Sebastian Damrich and Manuel V. Klockow and Philipp Berens and Fred A. Hamprecht and Dmitry Kobak},
  title = {{Visualizing single-cell data with the neighbor embedding spectrum}},
  year = {2024},
  doi = {10.1101/2024.04.26.590867},
  howpublished = {bioRxiv},
}
Figure