Learning Discrete Cell and Niche Codes from Spatial Transcriptomics Using Dual Residual Vector Quantization
Sebastian BirkiD, Arpit MerchantiD, Amirhossein VahidiiD, Fabian Joachim TheisiD, Mohammad LotfollahiiD
Abstract
Spatially-resolved transcriptomics (SRT) measures gene expression at single-cell resolution while preserving each cells spatial location, enabling the joint study of cell identity and cellular niche, the recurring microenvironment that organises tissue function. Existing representation-learning methods typically capture only one of these axes at a time. We present SQUINT, a graph vector-quantized variational autoencoder (VQ-VAE) that learns two disjoint codebooks per cell from a shared architecture: a cell codebook quantising the per-cell embedding before neighbourhood aggregation, biased toward cell-intrinsic identity, and a niche codebook quantising the embedding after graph neural network (GNN) aggregation, biased toward spatial context. Both use residual vector quantization, giving a coarse-to-fine discrete-token hierarchy. SQUINT is trained with per-branch negative-binomial reconstruction objectives and three domain-motivated components that we show are crucial: a within-section cosine adjacency loss that anchors the niche codes in the spatial graph, a cross-section contrastive loss on the cell latents that aligns transcriptomically matched cells, and a decoder section covariate that absorbs batch effects. Across three datasets spanning four spatial assays (STARmap, MERFISH, CosMx, Xenium) and four tasks - niche identification, cell-type identification, cross-section integration, and spatial gene-expression imputation in held-out regions - SQUINT outperforms or is competitive with strong baselines on identification and achieves the most faithful cross-section integration. The resulting discrete vocabulary makes tissues directly consumable by transformer-style foundation models and enables one-step query-to-reference atlas mapping via code-distribution similarity, which we demonstrate on a CosMx human non-small-cell lung cancer cohort.
02 /Specification & Classification
Click any tag to browse matching papers- Citations
- 0
- Organism
- Assay
- Research Focus
- Approach
Reproducibility ledger
Nobody has reported trying to reproduce this paper yet. Did you replicate an experiment or run the code? Your report saves the next lab a week.
Sign in to file a reproducibility report.
Related papers
- Enhanced spatially resolved transcriptomics analysis by matching between expression profiles and spatial topology
Yuxuan Pang, Chunxuan Wang, … Tzong-Yi Lee·bioRxiv·Aug 16, 2024
- Spatial-ID: a cell typing method for spatially resolved transcriptomics via transfer learning and spatial embedding
Rongbo Shen, Lin Liu, … Jianhua Yao·Nature CommunicationsPeer-reviewed·Dec 10, 2022
- SPICEMIX: Integrative single-cell spatial modeling of cell identity
Benjamin Chidester, Tianming Zhou, … Jian Ma·bioRxiv·Nov 29, 2020
- St2cell: Reconstruction of in situ single-cell spatial transcriptomics by integrating high-resolution histological image.
- scVIVA: a probabilistic framework for representation of cells and their environments in spatial transcriptomics
Nathan Levy, Florian Ingelfinger, … Nir Yosef·bioRxiv·Jun 1, 2025
- DTractor enhances cell type deconvolution in spatial transcriptomics by integrating deep neural networks, transfer learning, and matrix factorization
Yong Jin Kweon, Chenyu Liu, … Jun Ding·bioRxiv·Apr 12, 2025