SpatialMap: A Scalable Deep Learning Method for Cell Typing in Subcellular Spatial Transcriptomics

Pengzhen Jia, Yahui Long, Yichao Zhao, Ning Zhang, Zhaoyu Fang, Siqi Chen, Min LibioRxiv 2025

TL;DR

SpatialMap is a novel deep learning framework that accurately annotates cell types in subcellular spatial transcriptomics data. It leverages graph neural networks and transfer learning to achieve state-of-the-art performance, even identifying novel cell types and enabling cross-omics analysis.

What Problem Does This Paper Address?

Spatial transcriptomics (ST) technologies have revolutionized biology by providing gene expression data with spatial context. Subcellular ST, in particular, offers unprecedented resolution, allowing us to see gene expression at the level of individual cellular components. However, accurately identifying cell types within this high-resolution data remains a significant challenge. Existing methods often struggle with:

  • Scalability: Handling the massive datasets generated by modern ST technologies.
  • Robustness: Performing consistently across diverse tissue types and experimental platforms (e.g., NanoString CosMx, MERFISH, 10x Genomics Xenium).
  • Novel Cell Type Discovery: Identifying cell types that are not present in the reference datasets used for training.
  • Complex Tissues: Accurately annotating cells in intricate tissue structures, especially in disease contexts like cancer.
  • Cross-Omics Integration: Extending cell typing capabilities to other molecular data types like proteomics.

Methods

SpatialMap employs a two-stage deep learning approach:

  1. Pre-training:
    • Reference Data Training: The model is first trained on well-annotated single-cell RNA sequencing (scRNA-seq) data.
  2. Reconstruction and Classification Loss: This stage uses both gene expression reconstruction loss (to learn intrinsic expression patterns) and classification loss (to learn cell type-specific features).
  3. Generative Adversarial Module (for Novel Cell Type Discovery): An optional GAN-based module is incorporated to generate synthetic gene expression profiles, allowing the discriminator to learn to distinguish between known and novel cell types.
  4. Transfer Learning:
    • Preliminary Annotation: The pre-trained model is applied to the target spatial transcriptomics (ST) data to generate initial cell type predictions.
  5. High-Confidence Filtering (Pseudo-labeling): An adaptive cell-type-wise filtering strategy is used to select high-confidence predictions as "pseudo-labels." This helps mitigate noise and biases from the initial predictions.
  6. Graph Neural Network (GNN) for Spatial Context: A GraphSAGE GNN is used to encode the spatial relationships between cells. It takes gene expression and spatial coordinates as input to learn latent cell representations that capture neighborhood information.
  7. Weakly-Supervised Annotation: The GNN-based encoder and an annotator are trained in a weakly-supervised manner using the generated pseudo-labels to annotate the entire ST dataset.

Datasets

The authors evaluated SpatialMap on a variety of simulated and real-world datasets:

  • Simulated Datasets: Generated from a Stereo-seq mouse brain sagittal section.
  • Real-World ST Datasets:
    • Human NSCLC (Non-Small Cell Lung Cancer) dataset (NanoString CosMx).
  • Mouse brain datasets (MERFISH).
  • Mouse primary motor cortex (MOP) dataset (MERFISH).
  • Mouse hypothalamic preoptic region dataset (MERFISH).
  • Human pancreas cancer dataset (10x Genomics Xenium).
  • Reference Datasets:
    • Various scRNA-seq datasets for different tissues (e.g., mouse brain, human lung, human liver, human pancreas).
  • Single-nucleus RNA sequencing (snRNA-seq) data.
  • Single-cell proteomics datasets (CyTOF, N2, nanoPOTS).

Key Insights and Ideas

  • Bridging the Gap: SpatialMap effectively bridges the gap between high-resolution subcellular ST data and the need for accurate cell type annotation, a critical bottleneck in the field.
  • The Power of Two Stages: The combination of pre-training on reference data and then fine-tuning with weakly supervised learning on ST data is crucial for achieving high performance and robustness.
  • Spatial Context is Key: The integration of spatial coordinates through GNNs is vital for capturing cellular neighborhood relationships and improving annotation accuracy, especially in complex tissues.
  • Novel Cell Type Discovery is Achievable: The inclusion of a generative adversarial module demonstrates a promising approach to identifying cell types not present in existing reference datasets, a significant advancement.
  • Versatility Beyond Transcriptomics: SpatialMap's architecture is flexible enough to be extended to cross-omics analyses, such as transcriptome-to-proteome and proteome-to-proteome cell typing, highlighting its broad applicability.

Key Results

  • State-of-the-Art Performance: SpatialMap consistently outperformed eight competing methods across six simulated and real-world ST datasets in terms of various metrics (ACC, ARI, NMI, F1, AMI, V-measure, Homogeneity).
  • Novel Cell Type Identification: In the mouse primary motor cortex dataset, SpatialMap successfully identified novel cell populations (Micro, L4/5 IT, and L6 IT Car3) that were absent from the reference data.
  • Malignant Cell Identification: SpatialMap accurately annotated malignant cells in human liver cancer samples, showing strong agreement with known malignant cell marker genes.
  • Scalability and Robustness: The method demonstrated strong scalability across diverse tissue types and platforms (NanoString CosMx, MERFISH, 10x Genomics Xenium).
  • Cross-Omics Success: SpatialMap achieved high annotation accuracy in transcriptome-to-proteome and proteome-to-proteome cell typing tasks.
  • Computational Efficiency: The largest dataset tested (over 100,000 cells) required only 2 minutes of wall-clock time on a server, indicating good computational efficiency.

Limitations and Future Work

  • Class Imbalance: The authors acknowledge that class imbalance can degrade classification performance and addressed this using focal loss. However, this remains a general challenge in cell typing.
  • Reference Data Dependency: While SpatialMap excels at transfer learning, its initial pre-training stage still relies on well-annotated reference single-cell data.
  • Future Work: The authors plan to extend SpatialMap to accommodate the advent of subcellular-resolution spatial multi-omics technologies and anticipate its use as a powerful tool for analyzing current and future spatial omics data. The framework's design also suggests potential for further integration with other omics modalities and more complex biological questions.

Summary updated

Abstract

Subcellular imaging transcriptomics has offered unprecedented resolution of spatial mapping of gene expressions at subcellular level. However, accurate and robust cell type annotation at cellular level remains a challenge. Here we present SpatialMap, a deep weakly supervised cell typing framework that combines graph neural networks (GNN) with transfer learning to annotate cellular identities in subcellular spatial transcriptomics (ST). SpatialMap consistently outperforms state-of-the-art annotation methods on both simulated and real-world ST datasets. It demonstrates strong scalability across diverse tissue types and platforms, including NanoString CosMx, MERFISH and 10x Genomics Xenium. When applied to a mouse primary motor cortex dataset, SpatialMap successfully identified Micro, L4/5 IT, and L6 IT Car3 absent from the reference data, showcasing its capability to discover novel cell types. Furthermore, SpatialMap accurately annotated malignant cells in human liver cancer samples. Its design also enables seamless extension to cross-omics cell typing and cross-platform annotation within proteomics.
BibTeX
@misc{jia2025spatialmap,
  author = {Pengzhen Jia and Yahui Long and Yichao Zhao and Ning Zhang and Zhaoyu Fang and Siqi Chen and Min Li},
  title = {{SpatialMap: A Scalable Deep Learning Method for Cell Typing in Subcellular Spatial Transcriptomics}},
  year = {2025},
  doi = {10.1101/2025.07.03.662904},
  howpublished = {bioRxiv},
}
Figure