Nat Comput Sci. 2026 Jul 30. doi: 10.1038/s43588-026-01016-7. Online ahead of print.
ABSTRACT
Understanding gene spatial expression and the organization of multicellular systems is vital for disease diagnosis and studying biological processes. However, existing models often struggle to integrate gene expression data with cellular spatial information effectively. Here we introduce SpatialFormer, a hybrid framework combining convolutional networks and transformers to learn single-cell multimodal and multiscale information in the niche context, including expression data and subcellular gene spatial distribution. Pretrained on 700 million cell pairs from 17 million spatially resolved single cells across 71 Xenium slides, SpatialFormer merges gene spatial expression profiles with cell niche information via the pairwise training strategy. Our findings demonstrate that SpatialFormer distills biological signals across various tasks, including single-cell batch correction, cell-type annotation and co-localization detection. The perturbation analysis identified gene pairs essential for the immune cell-cell communication in pulmonary fibrosis, epithelial-myoepithelial co-localization and tumor transition signals in breast cancer. These advancements enhance our understanding of cellular dynamics and offer additional pathways for applications in biomedical research.
PMID:42533054 | DOI:10.1038/s43588-026-01016-7