Missing Context in Single-Cell Data

Single-cell RNA sequencing has transformed biology by showing which genes are active in individual cells. However, this approach requires cells to be removed from their natural environment, erasing information about their position and neighbors. Spatial transcriptomics preserves this context but is technically more limited and harder to scale. Researchers have long lacked a way to study cell identity and tissue organization together.

AI Model Reveals Hidden Tissue Structures

Nicheformer overcomes this barrier by learning from both dissociated and spatial data. It can “transfer” spatial context back onto cells that were previously studied in isolation – essentially reconstructing how they fit into the bigger picture of a tissue. To make this possible, the research team created SpatialCorpus-110M, one of the largest curated resources of single-cell and spatial data to date. In their study published in Nature Methods, the model consistently outperformed existing approaches and showed that spatial patterns leave measurable traces in gene expression, even when cells are dissociated. Beyond performance, the researchers also explored interpretability, revealing that the model identifies biologically meaningful patterns in its internal layers – offering a new window into how AI learns from biology.

“With Nicheformer we can now transfer spatial information onto dissociated single-cell data at scale,” says Alejandro Tejada-Lapuerta, PhD student at Helmholtz Munich and TUM and co-first author of the study together with Anna Schaar. “This opens up many possibilities to study tissue organization and cellular neighborhoods without additional experiments.”

Nicheformer, a foundation model for spatial transcriptomics

Fig. 1

a, Nicheformer is pretrained on the SpatialCorpus-110M, a large data collection of over 110 million cells measured with dissociated and image-based spatial transcriptomics technologies. The SpatialCorpus-110M collection comprises single-cell data from Homo Sapiens and Mus Musculus across 17 distinct organs and 18 cell lines, and additional single-cell data from other anatomical systems and junctions. Shown is an exemplary uniform manifold approximation and projection (UMAP) visualization of a random 1% subset of the entire pretraining dataset (n = 1,108,759 cells) of the non-integrated log1p-transformed normalized SpatialCorpus-110M colored by modality. b, Nicheformer includes a novel set of downstream tasks, ranging from spatial cell-type, niche and region label prediction to neighborhood cell density and neighborhood composition prediction. We test our approach on large-scale, high-quality spatial transcriptomics data from the brain (mouse, MERFISH), liver (CosMx, human), lung (CosMx, human; Xenium, human) and colon (Xenium, human). Visualized are example slices of the respective datasets colored by niche labels (brain, liver and lung) and cell density (lung and colon). c, The SpatialCorpus-110M is harmonized and mapped to orthologous gene names, as well as human and mouse-specific genes, to create the input for Nicheformer pretraining. We harmonized metadata information across all datasets, capturing species, modality and assay. d, Each cell’s gene expression profile and metadata are fed into a gene-rank tokenizer to obtain a tokenized representation for each cell. The tokenized cells serve as input for the Nicheformer transformer block to predict masked tokens. Finally, the Nicheformer embedding is generated by aggregating the gene tokens. e, The pretrained Nicheformer embedding is visualized as UMAP colored by modality. The UMAP shows a random 5% subsample of the entire Nicheformer embedding (n = 4,903,086). NA, not applicable.

The study connects to the emerging idea of a “Virtual Cell”, a computational representation of how cells behave and interact within their native environments. While this concept is gaining momentum across biology and AI, previous models have largely treated cells as isolated entities, without reasoning their spatial relationships. Nicheformer is the first foundation model to learn directly from spatial organization, offering a way to reconstruct how cells sense and influence their neighbors. Beyond introducing this new capability, the researchers also present an entire suite of spatial benchmarking tasks that challenge future models to capture tissue architecture and collective cellular behavior – an essential step toward biologically realistic AI systems.

Info Box: Single-Cell Analysis vs. Spatial Transcriptomics

  • Single-cell analysis: Measures the molecular profile (e.g., gene activity) of individual cells, but cells are studied outside their original tissue context.
  • Spatial transcriptomics: Measures gene activity directly in tissue slices, keeping the spatial arrangement of cells intact.
  • Nicheformer combines both approaches, projecting the spatial context back onto dissociated single-cell data.

Next Steps

“With Nicheformer we are taking the first steps toward building general-purpose AI models that represent cells in their natural context – the foundation of a Virtual Cell and Tissue model,” says Prof. Fabian Theis, Director of the Computational Health Center at Helmholtz Munich and Professor at TUM. “Such models will transform how we study health and disease and could ultimately guide the development of new therapies.”

In their next project, the team aims to develop a “tissue foundation model” that also learns the physical relationships between cells. Such a model could help analyze tumor microenvironments and other complex structures in the body with direct relevance for diseases such as cancer, diabetes, and chronic inflammation.

Availability – All models described here are implemented in a Python package available at https://github.com/theislab/nicheformer/.

Source – Helmholtz Munich (Helmholtz Zentrum München Deutsches Forschungszentrum für Gesundheit und Umwelt (GmbH))

Tejada-Lapuerta A, Schaar A.C., Gutgesell R., Palla G., Halle L., Minaeva M., Vornholz L., Dony L., Drummer F., Richter T., Bahrami M., Theis F.J. (2025) Nicheformer: a foundation model for single-cell and spatial omics. Nature Methods [Epub ahead of print]. [article]

Missing Context in Single-Cell Data

Single-cell RNA sequencing has transformed biology by showing which genes are active in individual cells. However, this approach requires cells to be removed from their natural environment, erasing information about their position and neighbors. Spatial transcriptomics preserves this context but is technically more limited and harder to scale. Researchers have long lacked a way to study cell identity and tissue organization together.

AI Model Reveals Hidden Tissue Structures

Nicheformer overcomes this barrier by learning from both dissociated and spatial data. It can “transfer” spatial context back onto cells that were previously studied in isolation – essentially reconstructing how they fit into the bigger picture of a tissue. To make this possible, the research team created SpatialCorpus-110M, one of the largest curated resources of single-cell and spatial data to date. In their study published in Nature Methods, the model consistently outperformed existing approaches and showed that spatial patterns leave measurable traces in gene expression, even when cells are dissociated. Beyond performance, the researchers also explored interpretability, revealing that the model identifies biologically meaningful patterns in its internal layers – offering a new window into how AI learns from biology.

“With Nicheformer we can now transfer spatial information onto dissociated single-cell data at scale,” says Alejandro Tejada-Lapuerta, PhD student at Helmholtz Munich and TUM and co-first author of the study together with Anna Schaar. “This opens up many possibilities to study tissue organization and cellular neighborhoods without additional experiments.”

Nicheformer, a foundation model for spatial transcriptomics

Fig. 1

a, Nicheformer is pretrained on the SpatialCorpus-110M, a large data collection of over 110 million cells measured with dissociated and image-based spatial transcriptomics technologies. The SpatialCorpus-110M collection comprises single-cell data from Homo Sapiens and Mus Musculus across 17 distinct organs and 18 cell lines, and additional single-cell data from other anatomical systems and junctions. Shown is an exemplary uniform manifold approximation and projection (UMAP) visualization of a random 1% subset of the entire pretraining dataset (n = 1,108,759 cells) of the non-integrated log1p-transformed normalized SpatialCorpus-110M colored by modality. b, Nicheformer includes a novel set of downstream tasks, ranging from spatial cell-type, niche and region label prediction to neighborhood cell density and neighborhood composition prediction. We test our approach on large-scale, high-quality spatial transcriptomics data from the brain (mouse, MERFISH), liver (CosMx, human), lung (CosMx, human; Xenium, human) and colon (Xenium, human). Visualized are example slices of the respective datasets colored by niche labels (brain, liver and lung) and cell density (lung and colon). c, The SpatialCorpus-110M is harmonized and mapped to orthologous gene names, as well as human and mouse-specific genes, to create the input for Nicheformer pretraining. We harmonized metadata information across all datasets, capturing species, modality and assay. d, Each cell’s gene expression profile and metadata are fed into a gene-rank tokenizer to obtain a tokenized representation for each cell. The tokenized cells serve as input for the Nicheformer transformer block to predict masked tokens. Finally, the Nicheformer embedding is generated by aggregating the gene tokens. e, The pretrained Nicheformer embedding is visualized as UMAP colored by modality. The UMAP shows a random 5% subsample of the entire Nicheformer embedding (n = 4,903,086). NA, not applicable.

The study connects to the emerging idea of a “Virtual Cell”, a computational representation of how cells behave and interact within their native environments. While this concept is gaining momentum across biology and AI, previous models have largely treated cells as isolated entities, without reasoning their spatial relationships. Nicheformer is the first foundation model to learn directly from spatial organization, offering a way to reconstruct how cells sense and influence their neighbors. Beyond introducing this new capability, the researchers also present an entire suite of spatial benchmarking tasks that challenge future models to capture tissue architecture and collective cellular behavior – an essential step toward biologically realistic AI systems.

Info Box: Single-Cell Analysis vs. Spatial Transcriptomics

  • Single-cell analysis: Measures the molecular profile (e.g., gene activity) of individual cells, but cells are studied outside their original tissue context.
  • Spatial transcriptomics: Measures gene activity directly in tissue slices, keeping the spatial arrangement of cells intact.
  • Nicheformer combines both approaches, projecting the spatial context back onto dissociated single-cell data.

Next Steps

“With Nicheformer we are taking the first steps toward building general-purpose AI models that represent cells in their natural context – the foundation of a Virtual Cell and Tissue model,” says Prof. Fabian Theis, Director of the Computational Health Center at Helmholtz Munich and Professor at TUM. “Such models will transform how we study health and disease and could ultimately guide the development of new therapies.”

In their next project, the team aims to develop a “tissue foundation model” that also learns the physical relationships between cells. Such a model could help analyze tumor microenvironments and other complex structures in the body with direct relevance for diseases such as cancer, diabetes, and chronic inflammation.

Availability – All models described here are implemented in a Python package available at https://github.com/theislab/nicheformer/.

Source – Helmholtz Munich (Helmholtz Zentrum München Deutsches Forschungszentrum für Gesundheit und Umwelt (GmbH))

Tejada-Lapuerta A, Schaar A.C., Gutgesell R., Palla G., Halle L., Minaeva M., Vornholz L., Dony L., Drummer F., Richter T., Bahrami M., Theis F.J. (2025) Nicheformer: a foundation model for single-cell and spatial omics. Nature Methods [Epub ahead of print]. [article]

Submit a Post to the Blog

SUBMIT CONTENT

Subscribe to the RNA-Seq Blog

RNA-Seq Products & Services