Polyomino reconstructs spatial transcriptomic profiles with single-cell resolution via a region-allocation method

  1. Jiekai Chen1,4,5,6
  1. 1Center for Biomedical Digital Science, Guangdong Provincial Key Laboratory of Stem Cell and Regenerative Medicine, Guangdong-Hong Kong Joint Laboratory for Stem Cell and Regenerative Medicine, Guangzhou Institutes of Biomedicine and Health, Chinese Academy of Sciences, Guangzhou 510530, China;
  2. 2University of Chinese Academy of Sciences, Beijing 100049, China;
  3. 3Guangdong University of Education, School of Mathematics, Guangzhou 510310, China;
  4. 4Joint School of Life Sciences, Guangzhou Institutes of Biomedicine and Health, Chinese Academy of Sciences, Guangzhou 510530, China;
  5. 5Guangzhou Medical University, Guangzhou 511436, China;
  6. 6Centre for Regenerative Medicine and Health, Hong Kong Institute of Science and Innovation, Chinese Academy of Sciences, Hong Kong 999077, China
  1. 7 These authors contributed equally to this work.

  • Corresponding authors: chen_jiekai{at}gibh.ac.cn, lin_lihui{at}gibh.ac.cn
  • Abstract

    Integration of single-cell and spatial transcriptomes represents a fundamental strategy to enhance spatial data quality. However, existing methods for mapping single-cell data to spatial coordinates struggle with large-scale data sets comprising millions of cells. Here, we introduce Polyomino, an intelligent region-allocation method inspired by the region-of-interest (ROI) concept from image processing. By using gradient descent, Polyomino allocates cells to structured spatial regions that match the most significant biological information, optimizing the integration of data and improving speed and accuracy. Polyomino excels in integrating data even in the presence of various sequencing artifacts, such as cell segmentation errors and imbalanced cell-type representations. Polyomino outperforms state-of-the-art methods by 10 to 1000 times in speed, and it is the only approach capable of integrating data sets containing millions of cells in a single run. As a result, Polyomino uncovers originally hidden gene expression patterns in brain sections and offers new insights into organogenesis and tumor microenvironments, all with exceptional efficiency and accuracy.

    Cells in a multicellular organism must be able to signal and respond to both internal and external spatial cues. Understanding how the cellular blueprint unfolds into tissues and organs is key to revealing how cells differentiate, communicate, and organize (Liao et al. 2021; Rao et al. 2021). Even though high-resolution spatial transcriptome technologies have been developed, such technologies show significantly lower cell segmentation resolution and the number of detected genes compared with single-cell transcriptome data. Therefore, integrating single-cell and spatial transcriptomic data is important for deciphering the spatial information of tissues (Longo et al. 2021).

    Current integration methods allow scRNA-seq data to acquire spatial coordinates while increasing the number of detected genes in the spatial space (Zeng et al. 2022; Du et al. 2023; Li et al. 2024) and has improved the resolution of analyzing spatial-cell heterogeneity and niche in developmental and disease tissues (Dries et al. 2021; Moses and Pachter 2022; Yang et al. 2024). However, the mismatch in single-cell and spatial data caused by sequencing noise and sampling bias hinders accurate spatial mapping. For example, cell segmentation errors can lead to distortion of spatial-cell gene expression and confound cell identity (Fu et al. 2024). Even for spatial transcriptome and single-cell sequencing data from the same tissue source, the proportions of cell types are not the same (Choi et al. 2023; Garrido-Trigo et al. 2023).

    To address these challenges, we developed Polyomino, a robust and efficient framework that incorporates multilayer regionalization constraints to improve spatial mapping. This method aims to enhance mapping accuracy under noise, support large-scale data sets, and achieve single-cell-level mapping, enabling direct downstream analyses at single-cell resolution. Unlike traditional deconvolution-based methods that infer cell-type proportions per spatial spot, Polyomino explicitly maps each single cell to spatial coordinates. This design empowers researchers to apply downstream single-cell analytic tools directly within the spatial context, such as clustering, pseudotime analysis, and spatial neighborhood modeling. Such capability enables more precise characterization of spatial heterogeneity and cellular interactions.

    Results

    The Polyomino algorithm

    Polyomino begins by creating square (or hexagon) bins that tile the entire spatial profile containing capture area; each bin contains several spatial voxels. By leveraging the tissue architecture, spatial gene expression, or virtual generated structure, the bins are organized into diverse layers of regionalization, for example, virtually generated horizontal stripes and vertical stripes, or spatial clustering domains. Polyomino first maps cells to bins. In this process, the different regionalization layers are used to jointly constrain the spatial localization of single cells, and each cell is assigned to the bins with the highest mapping probability. Given the significantly lower number of bins compared to spatial voxels, this approach reduces the computational parameters necessary for calculating the cell–cell mapping probability. Consequently, Polyomino is effective for integrating large data sets. Next, within each bin, Polyomino pairs the single cell and the spatial cell with the highest similarity, and the spatial voxels are replaced by single cells for downstream analysis (Fig. 1A).

    Figure 1.

    Schematic overview of Polyomino. (A) Polyomino is designed to accurately assign single-cell locations. Starting with spatial region expression formed from gridding the original ST data and single-cell seq data (left), Polyomino uses multilayer regional constraints to optimize the distribution of each cell in each grid (middle) and finally determine the precise location of cells within each grid through min cosine similarity cost (right). (B) Computation time of different methods when integrating 5000 single cells with varying voxel numbers. (C) Peak memory of different methods when integrating 5000 single cells with varying voxel numbers.

    We used seqFISH+ data of cerebral cortex (Eng et al. 2019) to illustrate the advantage of multilayer spatial constraints on mapping spatial location of cells. The data set contains 10,000 detected genes and 523 spatial cells. We simulated single-cell data by adding Poisson noise at varying levels to the expression profiles of spatial cells. We then used Polyomino to integrate spatial cells and simulated single cells. The known spatial localization at a cellular level in the seqFISH+ data serves as the ground truth for predicting the spatial localization of individual cells. Applying a single layer of constraint resulted in few exact-matched cells. Two layers of constraints improved the exact-match ratio to ∼50%. When three layers of constraints were applied, the exact-match ratio increases and reaches 100% (Supplemental Fig. S1A,B). Furthermore, we systematically evaluated the robustness of Polyomino under different levels of Poisson noise and found that it maintained stable and accurate mapping performance across a wide range of perturbation magnitudes (Supplemental Fig. S2). These results highlight significant improvement by importing additional spatial context to localize single cells and demonstrate the resilience of Polyomino to noise in simulated data.

    To further evaluate Polyomino's ability to refine spatial gene expression profiles, we performed simulation experiments using the STARMAP data set. We first selected 11 representative cell-type marker genes. To mimic sparse expression, we randomly removed 98% of the counts for each marker gene across the spatial locations. After applying Polyomino for single-cell-to-space mapping, we assessed the recovery of these genes by calculating the Pearson correlation coefficient (PCC) between the original and reconstructed expression values. We also visualized the spatial expression patterns for each marker gene before dropout, after dropout, and after recovery. The results demonstrate that Polyomino can effectively reconstruct spatial gene expression from sparse input, significantly improving gene expression accuracy and spatial coherence (Supplemental Fig. S3). These findings provide further support for the use of Polyomino to enhance the resolution and completeness of spatial transcriptomic data.

    Because of the algorithmic design of Polyomino, it demonstrates advantages in runtime and memory usage. We fixed the number of spatial cells and showed that the cost of time increased by the number of single cells for Polyomino and five compared methods (Tangram, scSpace, SpaTrio, CytoSPACE, and CelEry). The time consumption of Polyomino is well controlled for data set size of both single cells and spatial cells, with the task of integrating 15,000 cells and 19,230 spots taking only 141 sec to complete. Tangram takes >0.4 h to complete this task, whereas other methods require hundreds of times longer, with CytoSPACE being unable to complete the task (Fig. 1B). Even when the cell and spot numbers are reduced to 5000 and 7829, respectively, CytoSPACE still takes >2.4 h to finish (Fig. 1B; Supplemental Table S1). In addition, the memory usage of Polyomino, CelEry, and Tangram is comparable and much smaller than that of others (Fig. 1C; Supplemental Table S1). Polyomino accurately mapped single cells to the organ regions such as the brain, lung, and kidney (Supplemental Fig. S4) while maintaining high computational efficiency. To further test scalability, we applied Polyomino to a large-scale Visium HD data set consisting of more than 300,000 spatial bins (bin size: 8 µm). Despite the increased data size, Polyomino successfully completed the mapping task with reasonable runtime and memory usage, demonstrating its robustness on ultra-high-resolution platforms such as Visium HD (Supplemental Fig. S5). To evaluate the robustness of Polyomino in handling spatial transcriptomic data with limited sequencing depth, we focused on low-quality bins (fewer than 200 detected genes) in the Stereo-seq data set (bin50). Following Polyomino mapping, a marked increase in the number of detected genes was observed within these low-quality bins, with the median gene count rising from 126 to 4023. This substantial improvement led to significantly more informative and complete spatial gene expression profiles. These results demonstrate Polyomino's capacity to compensate for low spatial transcriptomic coverage by effectively leveraging the resolution and completeness of single-cell data, accurately reconstructing gene expression in undersequenced spatial regions (Supplemental Fig. S6). These results highlight the exceptional efficiency and scalability of Polyomino, making it a robust choice for integrating large-scale spatial and single-cell transcriptomic data sets.

    Benchmarking analysis with adjacent section data sets

    To benchmarking the performance of Polyomino in cell spatial reconstruction, we utilized single-cell-resolution mouse embryo data generated by SeqFISH. The data set includes two sections from distinct tissue layers of the same E8.5 mouse embryo, (designated as L1 and L2). We used the L1 layer (containing 10,150 cells) as the reference spatial data set and the L2 layer as the single-cell data set (Fig. 2A). We compared five mapping methods using evaluation metrics such as the mean absolute error (MAE) of location loss between the true and reconstructed coordinates, the spatial distribution similarity of different cell types between the true spatial data and reconstructed single-cell data, and the number of true neighbors among the k-nearest neighbors for each cell.

    Figure 2.

    Benchmarking analysis of cell reconstruction and robustness to segmentation noise. (A) Schematic diagram of cell reconstruction using adjacent slices. Cells from two consecutive spatial layers (embryo1 L1 and L2) are shown, in which the goal is to reconstruct cell positions by mapping cells across layers. (B) Evaluation of spatial distribution similarity of cell types using different methods, measured by the correlation between predicted and actual cell-type proportions across spatial locations. Polyomino achieves the highest correlation. (C) Evaluation of spatial neighbor preservation. For each cell, the number of correctly identified neighbors (mean hit number) is calculated by comparing the top k-nearest neighbors in the reconstructed layer with ground truth. (D) Evaluation of spatial distribution similarity for five major cell types (brain, spinal cord, gut tube, cardiomyocytes, presomitic mesoderm). Polyomino consistently outperforms other methods in maintaining cell-type spatial correlation. (E) Schematic diagram for generating simulated single-cell spatial data. Using seqFISH+ and matched single-cell data, shared cell types are identified. For each spatial cell, the most similar single cell (based on Pearson's correlation of gene expression) is selected and used as a substitute to simulate realistic mapping conditions. (F) Illustration of segmentation error. The left panel shows ground-truth boundaries, and the right panel demonstrates how incorrect segmentation merges or splits cells improperly, affecting downstream mapping. (G) Mapping error under segmentation noise. Location error (measured as spatial distance between the predicted and true positions) is compared across methods. Polyomino and Tangram show the lowest error, whereas CelEry performs inconsistently. (H) Cell-type distribution correlation under segmentation errors. Polyomino and Tangram maintain high correlations, whereas scSpace shows a dramatic drop in performance. (I) Neighbor hit count under segmentation errors. Polyomino achieves the highest average number of correctly identified neighbors across different k-values, demonstrating strong robustness.

    Our method demonstrated superior performance across multiple evaluation metrics (Fig. 2B,C; Supplemental Fig. S7A), achieving the highest spatial distribution similarity and the highest count of true neighbor hits. In terms of the spatial distribution similarity of cell types, our method, along with Tangram and CytoSPACE, outperformed other methods. Notably, for key cell types, our method significantly outperformed Tangram and CytoSPACE (Fig. 2D; Supplemental Fig. S7B). When k = 50, the number of true neighbors identified by our method far exceeded that of the other five methods, showcasing Polyomino's ability to accurately reconstruct spatial relationships (Fig. 2C).

    We repeated this test on another spatial profiling technology (STARMAP) using two sections of mouse brain tissue and applied the same methods for mapping. Consistent results were obtained, further validating Polyomino's robustness and precision in spatial reconstruction (Supplemental Fig. S8).

    To further broaden this analysis, we systematically evaluated the performance of Polyomino in reconstructing spatial transcriptomic profiles in comparison with deconvolution-based approaches such as cell2location (Kleshchevnikov et al. 2022) and RCTD (Cable et al. 2022). Based on the high-resolution seqFISH+ data set, we simulated spatial spot data by aggregating gene expression profiles from neighboring single cells, thereby generating pseudospots that mimic the lower spatial resolution of Visium while retaining ground-truth expression and cell-type information.

    Using these synthetic pseudospots as spatial input, we applied Polyomino, Tangram (cluster-based), cell2location, and RCTD to recover the underlying spatial distributions. To quantify the accuracy of reconstruction, we compared the predicted gene expression patterns against the ground-truth aggregated profiles by calculating PCCs across genes. In addition, we evaluated cell-type composition recovery by comparing the predicted cell-type proportions within each pseudospot to their known true compositions derived from the original single-cell labels. Polyomino consistently outperformed the deconvolution-based methods in both gene-level and cell-type-level reconstruction accuracy under this simulation framework (Supplemental Fig. S9).

    Polyomino is robust against spatial data noise

    To validate the noise tolerance of Polyomino, we simulated ground-truth ST data by substituting each spatial cell of seqFISH+ data by the single cell from snRNA-seq data of the same tissue (Fig. 2E; Tasic et al. 2018). Stringent comparison was performed between Polyomino and the state-of-the-art (SOTA) algorithms by integrating the simulated spatial cells and the corresponding single cells. Because the spatial position of each cell was known, we evaluated integration accuracy by computing the average Euclidean distance between the mapped and true spatial coordinates of the cells. Additionally, we assessed the accuracy of microenvironment reconstruction after mapping by measuring the similarity of spatial distributions across different cell types and evaluating the hit number (true neighbors identified) among the predicted k-nearest neighbors.

    We tested the impact of cell segmentation noise on integration. In tissues in which cells are interconnected, cell boundaries are difficult to distinguish with limited staining, making segmentation errors a common noise source (Fu et al. 2024). For instance, different algorithms (Schmidt et al. 2018; Gamarra et al. 2019) recognized macrophage boundaries differently (Supplemental Fig. S10A). In some scenarios, even human recognition is difficult to accurately distinguish cell boundaries. To simulate cell segmentation noise, we distributed gene expression from each spatial cell into several parts and randomly allocated them to two adjacent cells (Fig. 2F). Before perturbation, the UMAP visualization showed clear separation between distinct cell types. However, after perturbation, the intercellular distances decreased, causing different cell types to cluster together (Supplemental Fig. S10B). Additionally, each cell type exhibited varying levels of false-positive gene expression (Supplemental Fig. S5C). The simulation results were consistent with the recent reports of spatial transcriptomic studies (Fu et al. 2024). Notably, segmentation noise significantly impaired the performance of CytoSPACE, and both CelEry and scSpace showed substantial decreases in the number of true neighbors identified. In contrast, Polyomino and Tangram were largely unaffected (Fig. 2G–I). We also investigate the impact of imbalanced cell-type proportion on the integration (Supplemental Fig. S11). These findings demonstrate the advantage of Polyomino in resisting cell segmentation noise and highlight its robust adaptability for real-world data integration.

    Application of Polyomino to real world data

    We now test the accuracy of Polyomino by integrating real world data sets. We collected STARMAP spatial sequencing data set (Fig. 3A,B; Wang et al. 2018) and a snRNA-seq data set (Fig. 3C; Tasic et al. 2018) from the same cerebral cortex. The two data sets share the same cell types, including excitatory neuron of layers 2–6, inhibitory neurons, astrocytes, oligodendrocytes, etc.

    Figure 3.

    Evaluation in cerebral cortex data. (A) Tissue sections from cerebral cortex were used to generate spatial data (STARMAP) and snRNA data. (B) Spatial location of main cell types in the STARMAP data. (C) UMAP visualization of main cell types of the snRNA data. (D) Quantitative comparison of spatial reconstruction accuracy across six methods. Similarity was measured by correlating predicted cell-type distributions with the spatial ground truth. (E) Spatial mapping results from Polyomino and other representative methods. Polyomino achieves higher spatial concordance and sharper boundary definition of the cell types across cortical layers. (F) Comparison of reconstructed gene expression patterns. Polyomino better recapitulates the original spatial expression, demonstrating higher fidelity in gene-level reconstruction.

    To evaluate the accuracy of data integration, we measured the spatial distribution patterns of cell types between real spatial transcriptomic data and spatially reconstructed single-cell data. Notably, Polyomino shows the highest similarity compared with other methods, indicating the highest mapping accuracy (Fig. 3D). The spatial distribution and proportions of the cell types reconstructed using Polyomino resemble the ground truth, as evidenced by the clearly defined hierarchical structures of the cortex (Fig. 3E; Supplemental Figs. S12, S13). We also tested the impact of grid size on the results and found that Polyomino performed best and outperformed other methods when the average number of cells per bin was between five and 14. This range appears to strike a balance between preserving spatial resolution and providing sufficient local context for robust mapping. When the bin size is too small (fewer than five cells per bin), the spatial signal becomes sparse and noisy, compromising voxel-level assignment accuracy. Conversely, larger bins (more than 14 cells per bin) reduce spatial resolution and may obscure fine-grained anatomical features, such as the laminar organization of the cortex.

    Notably, the optimal bin size may be tissue dependent: Highly structured or compact tissues may require smaller bins to preserve spatial detail, whereas more diffuse or heterogeneous tissues may permit or even benefit from larger bin sizes to enhance signal stability and mapping robustness. Gene coverage is usually limited in ST data owing to the probe number in the hybridization method or RNA capture efficiency. To test if Polyomino can improve spatial gene expression, we used AllenISH tissue staining data as a standard reference (Fig. 3F; Supplemental Fig. S13A; (http://atlas.brain-map.org/atlas?atlas=1). We first examined the genes common to STARMAP and AllenISH; Polyomino successfully predicted the expression of Cux2 in the bottom layer neurons, Rorb in the intermediate layer neurons, and Foxp2 in the top layer neurons.

    We also showed that Polyomino is powerful in correcting the spatial gene expression. For example, STARMAP failed to present the expression patterns of Rspo1, Foxp2, Ccn3, and Fezf2, although their probes were designed (Supplemental Fig. S13A). Polyomino corrected these gene expression and showed a consistent pattern with the AllenISH data. Moreover, Polyomino shows ability to recover the gene expression not detected by STARMAP, such as Nectin3, Agmat, Col5a1, and Cldn11. By such strategy, Polyomino increases the spatial genes from 981 (from STARmap data) to 34,041 (from snRNA-seq data). For comparison, the expression patterns reconstructed by other methods are not apparent for all these example genes. These results suggest that accurate cellular localization contributes to a more accurate reconstruction of spatial gene expression.

    To further validate the effectiveness of Polyomino in reconstructing gene expression, we assessed the concordance of gene-level expression between Polyomino-reconstructed data and the original STARMAP spatial measurements. Specifically, we calculated the PCC for each gene. Polyomino achieves consistently high PCCs across genes, indicating that it accurately preserves spatial gene expression in addition to cell-type mapping (Supplemental Fig. S13C). This quantitative evidence supports Polyomino's ability to reconstruct expression patterns that are highly concordant with experimentally measured spatial data.

    Polyomino enhances the reliability of cell–cell interaction inference

    Precision spatial alignment is the prerequisite of accurately identifying intercellular communication, a process critical for delineating proximity-dependent signaling events and understanding the developmental and immune microenvironment for tissue organization. We utilized a seqFISH data set (Lohoff et al. 2022) alongside scRNA-seq (Pijuan-Sala et al. 2019) data obtained from the 10x Chromium platform to investigate intercellular communication events in a mouse E8.5 embryo (Fig. 4A,B). The seqFISH data set detected only 351 genes across 19,416 cells, whereas the scRNA-seq data set captured 116,312 cells and 29,452 genes. This significant imbalance between the two data sets introduces noise, including disproportional cell-type distribution, posing challenges for spatial integration and complicating the interpretation of intercellular communication. Consistent with the previous analyses, Tangram is more sensitive to uneven cell-type distributions compared with Polyomino, as the distance between Tangram-mapped single-cell coordinates to their nearest spatial cells of the same cell type is much larger (Fig. 4C). As displayed by cell-type distribution and their correspondence to ground truth, Polyomino accurately recapitulates true cell-type distribution, whereas Tangram incorrectly predicts a significant portion of cells as erythroid (Fig. 4D–F). The prediction bias generated largely impacts the subsequent ligand–receptor interaction analysis. Erythroid, the cell type with fewest ligand and receptor counts in the ground truth and Polyomino, is considered as the signaling hub by Tangram.

    Figure 4.

    Analysis of mouse embryo data at E8.5. (A) Major tissue zones of the mouse embryo at E8.5 using seqFISH. (B) UMAP visualization of main cell types annotated by Pijuan-Sala et al. (2019). (C) Compared cell reconstructed distances of Polyomino and Tangram (x-axis). We calculated cell reconstructed distances between the mapped cells and spatial voxels of the same cell type. (D) Spatial distribution of single-cell types after reconstruction by Polyomino and Tangram. (E) Analysis of spatial neighboring cell proportions of original seqFISH, Polyomino, and Tangram. (F) Number of ligand–receptor pair analyses with original seqFISH data and Polyomino- and Tangram-reconstructed data, with circle size indicating cell counts. (G) Ligand–receptor interactions between the surface ectoderm and other cell types.

    At E8.5, surface ectoderm serves as a Wnt ligand provider for several biological processes, such as neural crest development (García-Castro et al. 2002) and optic cup morphogenesis (Kobayashi et al. 2020). These intercellular communication events are accurately captured by seqFISH and Polyomino, showcasing Polyomino's capability to restore precise intracellular communication (Fig. 4G). To exemplify, Wnt3a secreted by surface ectoderm induces neural crest fate determination in the presence of Fzd2. In contrast, Tangram struggles to identify these ligand–receptor interactions, likely owing to spatial mapping errors caused by disproportionate cell types during mismatched data integration.

    Polyomino reveals cellular spatial heterogeneity in colorectal cancer–derived liver metastatic tumors

    Precise spatial reconstruction is also crucial for tumor microenvironment. Here we applied Polyomino to repurpose a 10x Genomics Visium data set (Wang et al. 2023) and its corresponding scRNA-seq data of colorectal cancer–derived liver metastatic tumor (Wang et al. 2023). The spatial data are composed of tumor (T) and paratumor (PT) regions based on the pathological evidence of the tissue (Fig. 5A). Instead of relying on probabilistic deconvolution frameworks (e.g., RCTD, cell2location), Polyomino employs a voxel-based binning strategy guided by spatial constraints to assign single cells into fine-grained spatial units. Specifically, we constructed a multilayered spatial constraint model based on the Visium spot grid layout: three directional layers (0°, 60°, and 120°) and one clustering layer reflecting spatial spot communities. This region-aware spatial allocation enables Polyomino to resolve cellular heterogeneity within Visium spots by leveraging structural priors and expression profiles, without requiring parametric assumptions.

    Figure 5.

    Analysis in colorectal cancer liver metastasis data. (A) Spatial transcriptomics sequencing data (Visium) of colorectal cancer liver metastasis (zones defined by pathology) and UMAP visualization of main cell types of scRNA data. (B) Spatial distribution preference of different cell types at paratumor (PT) and tumor (T) zones calculated using Milo. (C) Differential genes of conventional dendritic cell (cDC) subtypes distributed at different zones. (D) Spatial distribution density of different cDC subtypes at PT and T zones. (E) GO pathway enrichment of differential genes in different cDC subtypes, showing that pathways in CD163+ cDCs are potentially related to angiogenesis. (F) Number of ligand–receptor pairs between endothelial cells and different cDC subtypes. (G) UMAP representation of healthy liver tissue and the expression of CD163. (H) Proportion of CD163 gene expression in cDCs within liver cancer samples and healthy liver tissue.

    To assess Polyomino's effectiveness in distributing single cells to these spots, we utilized the Milo algorithm to compute spatial bias scores (SBSs) for single cells under T and PT regions. High, low, and medium SBSs differentiate three single-cell statuses: T, PT, and neutrality, respectively (Fig. 5B; Supplemental Fig. S14A). For instance, the heterogeneous CD8A subpopulations have distinct gene expression profiles (Supplemental Fig. S14B), with the upregulated genes in CD8A+ PTs enriching T cell activation terms (Supplemental Fig. S14C), indicative of immune activation in PT regions.

    Meanwhile, conventional dendritic cells (cDCs) and macrophages contain the most spatial-specific and upregulated genes in a PT status (Fig. 5B; Supplemental Fig. S14A). In recent years, cDCs have been found to play an important role in the regulation of immune response and antitumor immunity (Cheng et al. 2021; Meiser et al. 2023). However, the spatial heterogeneity and function of cDCs in metastatic colorectal cancer tissues are not clear. CD163+ and CD52+ are defined as differentially expressed genes in the T and PT cDC populations, correspondingly (Fig. 5C). The CD163+ and CD52+ density plots reveal the heterogeneity of cDC spatial subtypes (Fig. 5D). To further dissect the role of cDC spatial subtypes in regulating immune response, we performed GO enrichment analysis. Genes highly expressed in CD163+ cDCs are significantly enriched in angiogenesis pathways (Fig. 5E), suggesting CD163+ cDCs could promote blood vessel growth and provide nutrients to tumors. The spatial assignment of single cells across cell types (Supplemental Fig. S14D) facilitates the identification of cDC spatial subtypes in regulating tumor microenvironment. The ligand–receptor interaction analysis shows that CD163+ cDCs have the highest number of interactions with endothelial cells (Fig. 5F). cDCss specifically express ligand signals related to endothelial genesis, such as NAMPT, SPRED1, PTEN, VEGFA, interacting with endothelial-specific receptors (Supplemental Fig. S14E,F). Notably, this CD163+ spatial subtype consisting of ∼30% of cDCs in tumor tissue occupies only 7% of cDCs in healthy liver tissue (Guilliams et al. 2022), illustrating how Polyomino's region-aware assignment can uncover spatially restricted immune phenotypes (Fig. 5G,H) even within coarse Visium spots.

    Discussion

    To address the challenges in spatial transcriptome integration, we developed Polyomino, a framework that leverages multiple layers of regionalization constraints for robust cell localization with high noise tolerance and computational efficiency. Polyomino accurately reconstructs spatial gene expression patterns, enhances classification of spatial data, and improves inference of intercellular interactions. The success of Polyomino is attributed to the strategy of cell localization based on multiple regionalization constraints. A region could contain several to hundreds of cells. We claim that the signal-to-noise ratio of a region is higher than that of voxel. This improvement arises because cellular segmentation noise primarily affects the cells in the edge of the region, whereas the noise among cells within the region tends to cancel out. The joint use of multiple regionalization strategies further enhances the mapping accuracy and the robustness. Consequently, Polyomino performed well on data sets from the cerebral cortex, mouse embryos, and tumors.

    Polyomino offers a flexible framework that allows users to input customized spatial regionalization information, such as spatial clustering outcomes and histological and pathological structures. An increase in the number of layers of spatial regionalization will increase computation time. It is important to note that the division of spatial areas should be meaningful because randomized regionalization may degrade the algorithm's performance. We suggest using SOTA algorithms to obtain spatial regionalization information as input for Polyomino.

    Importantly, because Polyomino assigns individual cells to spatial positions, it inherently supports single-cell resolution in spatial reconstructions. This distinguishes Polyomino from conventional deconvolution tools and allows users to harness the full analytical power of single-cell techniques, such as trajectory inference, spatial clustering, or cell–cell communication analysis within spatial transcriptomic data sets. This level of granularity is critical for resolving fine-scale tissue architecture and cellular dynamics.

    As sequencing technology matures and costs decrease, the throughput and resolution of single-cell and spatial data are increasing. Large-scale single-cell atlas studies have become a trend in biological research. When integrating single-cell and spatial data, we require not only high accuracy but also high efficiency of computation. However, existing mapping algorithms cannot efficiently handle millions of cells. Polyomino first maps single cells to spatial bins instead of voxels, and the number of cell-to-voxel relationships for calculation is much fewer than that of other methods. Therefore, Polyomino greatly reduces the cost of computation. At the same time, Polyomino uses the PyTorch framework for algorithm optimization and supports GPU acceleration to further improve computation efficiency. Polyomino provides the ability to reconstruct large-scale integrated atlas for single-cell and spatial data, which would help us to study development, disease, and aging processes from a holistic perspective.

    Methods

    Polyomino algorithm overview

    Given a single-cell gene expression profile S with the dimensions ncells × ngenes and a ST gene expression T profile with the dimensions nvoxels × ngenes, the goal of Polyomino is to map cells in scRNA-seq data to spatial voxels in ST data. The voxels could be spatial cells predicted by image segmentation, circular spots, or bins composed of spots. The algorithm can be used for both imaging-based and sequencing-based ST data. Both S and T should be nonnormalized count matrices for the calculation, such that Sik is the expression count of gene k in cell i, and Tvk is the expression count of gene k in voxel v. The data integration process consists of four steps.

    Gridding

    The integration begins by gridding the ST data, which is divided into a number of bins of equal-sized squares (or hexagons), in which the bins are connected edge-to-edge. Each spatial cell is assigned to a bin based on the position of its nucleus coordinate, and the expression values of the cells within each bin are summed to form matrix G of dimensions ngrids × ngenes, where Gqk is the expression level of gene k in grid q. One of advantages of gridding is to improve the signal-to-noise ratio of ST data. Cell segmentation errors are likely to occur within a tissue with a large number of tightly connected cells. In this scenario, the predicted boundaries of each cell differ from their actual boundaries. This discrepancy results in differences between the spatial gene expression and true gene expression of cells. However, when we group neighboring cells together by gridding, the effects of segmentation errors only influence the cells at the edges of the bin, without impacting the cells inside the bin. This principle remains applicable when aggregating multiple bins into larger spatial regions. The other advantage of gridding is to reduce the cost of mapping calculation. Polyomino first maps cells to bins followed by voxels within each bin, instead of mapping cells to all voxels directly. Because the number of bins is much fewer than the number of spatial voxels, this strategy enables the algorithm to integrate large-scale data. We suggest that users adjust the size of the bin to cover three to 15 voxels (specifically, one voxel for 10x Genomics Visium); Polyomino provides a bar plot to count the number of cells in the grids. Within this range, different bin sizes have little impact on the results of data integration.

    Spatial regionalization

    Polyomino combines the bins into horizontal and vertical stripes, representing two default layers of regionalization. Similarly, for ST data like Visium, each spot is considered as a hexagon, which can be combined into three direction stripes with a 60° angle, representing three layers of regionalization. The combination of these stripes enables the positioning of all bins. Polyomino also uses the SpaGCN (Hu et al. 2021) algorithm to cluster bins, generating another layer of regionalization. Polyomino is a flexible framework that allows users to input custom layers of regionalization, such as physiological and pathological regions defined by tissue imaging or such as clusters generated by other clustering methods.

    For a layer l of regionalization, we define a nregions × nbins one-hot encoding matrix P(l) to represent the region label of all bins, where Formula denotes the bin q belonging to region r. We define region gene expression matrix R(l) with dimension of nregions × ngenes, where Formula is the sum expression of all the spatial voxels in region r.

    Mapping cells to bins

    We aim to solve the mapping matrix M with dimension ncells × nbins by minimizing the dissimilarity between the sum expression of single cells assigned to each region and the sum expression of spatial voxels in each region. The object function is formulated as follows:Formula (1) where cossim is the cosine similarity function Formula, L is the total number of layers, and λl is the weight of each layer, by default λl = 1 for all layers. The mapping matrix M is converted to a probability matrix using the softmax function:Formula (2) The softmax function ensures that 0 ≤ Miq ≤ 1 and Formula.

    The optimal M is obtained by Adam gradient descent algorithm in the PyTorch library. Polyomino then filters out cells with mapping probabilities less than threshold t; we set t = 0.1 as the default value. Each of the remaining cells can be assigned to one or more bins.

    Generally, as the number of regionalization layers L increases, the constraints on cell localization become more accurate, and the computation time will also increase. In our experiments, we found that utilizing only three to four layer constraints is enough to achieve highly accurate cell localization.

    Mapping cells to voxels

    Within each bin, Polyomino calculates the cosine similarity between spatial voxels and single cells. The cell with the maximum cosine similarity value is selected for each voxel. In this process, a single cell can be assigned to multiple voxels. We also provide the filtering parameter c to remove cell mappings with low similarity.

    Platform-specific preprocessing steps, voxel size recommendations, and usage instructions for applying Polyomino to Visium, Stereo-seq, and STARMAP data are provided in the GitHub repository (see Software availability).

    Benchmarking analysis with real adjacent sections data sets

    To evaluate the performance of Polyomino, we conducted benchmarking analysis using single-cell resolution data from adjacent sections of an E8.5 mouse embryo (Lohoff et al. 2022) generated through the SeqFISH technique. The data were obtained from two sections of the same embryo, spaced 12 mm apart (labeled as L1 and L2). L1 data (10,150 cells) were used as the spatial data set, whereas L2 data (7656 cells) were used as the single-cell data set for spatial reconstruction.

    Similarly, we evaluated another spatial transcriptomics technique, STARMAP (Zeng et al. 2023), using mouse cortical data obtained from two adjacent sections. One section (8506 cells) was used as the spatial data set, whereas the other (9803 cells) served as the single-cell data set for reconstruction. This allowed us to benchmark Polyomino's performance across different spatial transcriptomic platforms and data sets.

    Metrics for benchmarking performance

    To quantitatively evaluate the performance of spatial reconstruction, we employed the following metrics, each assessing a specific aspect of accuracy or similarity between the true and predicted data.

    Location error

    We calculated the mean absolute error (MAE) of reconstructed spatial coordinates to measure spatial accuracy. For each cell, the Euclidean distance between its true and predicted coordinates was computed. The MAE for each cell type was then derived asFormula where Formula and Formula are the true and predicted coordinates of cell i, and N is the total number of cells of a given type.

    Hit number (neighborhood overlap)

    We evaluated local spatial consistency using the overlap of nearest neighbors between the true and reconstructed coordinates. For each cell, we identified its k-nearest neighbors (k = 5, 10, …, 50) in both data sets and computed the intersection of these neighbor sets. The mean hit number for each k is given byFormula where Formula and Formula are the sets of true and predicted neighbors for cell i.

    We utilized PCC-voxel to study the similarity in spatial distribution patterns of cell types between real spatial transcriptomic data and spatially reconstructed single-cell data. To achieve this, we encoded a binary variable (zero or one) for each real spatial location, indicating whether the location is occupied by a specified cell type. The PCC for the cell-type distributions between the real and reconstructed data was calculated. Otherwise, to evaluate spatial alignment across the data set, we divided the spatial domain into grids of fixed size. For each grid, the frequency of cells of each type was calculated. We then compared these frequencies between the true and predicted data using Pearson's correlation:

    Simulation-based evaluation of spatial reconstruction accuracy

    To benchmark Polyomino against deconvolution-based spatial mapping methods, we constructed a simulation framework based on the STARMAP data set, which provides single-cell-resolution spatial transcriptomic data from the mouse brain. Spatial locations and gene expression profiles were obtained for individual cells after standard quality control and filtering.

    To mimic lower-resolution spatial transcriptomic platforms, we simulated 189 spatial pseudospots by aggregating transcriptomes of spatially adjacent single cells. For each pseudospot, the aggregated expression profile was computed as the sum of expression counts from all constituent cells, and the corresponding cell-type composition was recorded based on known cell-type annotations.

    The simulated pseudospot data set served as the spatial input, whereas the original single-cell data set was used as the reference. Polyomino, Tangram (cluster-based mode), cell2location, and RCTD were applied for spatial mapping. Tangram was run using cell-type cluster means derived from Leiden clustering on the reference data. Cell2location and RCTD were run using the recommended preprocessing steps and default model parameters, with the same cell-type labels provided for consistency across methods.

    For each method, the reconstructed spatial gene expression matrix and predicted cell-type proportions were extracted. These were compared with the known ground truths aggregated from the original single-cell data for subsequent evaluation.

    Simulations of spatial detection noise

    For cell segmentation noise, we simulated ground-truth ST data with real single cells. Each spatial cell in the seqFISH+ data (Eng et al. 2019) was replaced by a single cell from the snRNA-seq data set (Tasic et al. 2018) derived from the same tissue. Let Formula represent the overlapping genes between the two data sets. For each cell type c present in the ST data, subsets Formula and Formula were created, ensuring that Formula. If Formula and the ST subset was randomly downsampled to size Formula. To compute cell similarity, the cosine distance Formula was calculated for each pair of expression profiles Formula and Formula, resulting in the distance matrix D. The Hungarian algorithm was applied to D to find the optimal one-to-one mapping of spatial cells to single cells, producing a set of matches, G = {(i, j)}. Spatial coordinates from the ST data were then assigned to the matched single-cell data, generating a single-cell data, Asc, that preserved the spatial structure of the original ST data while incorporating segmentation noise. Next, variability in the simulated ST data was introduced by randomly splitting and redistributing gene expression profiles across neighboring cells. For each cell k, its expression ek was divided into n ∈ {2, 3, 4} bins based on normalized percentages Formula, resulting in the bins bi = pi × ek. Neighboring cells N(k) were identified based on spatial proximity, defined by a maximum spatial distance dmax; the default was 250. Expression bins were redistributed to one to two randomly selected cells jN(k), ensuring ej + bi ≥ 0. If Formula, redistribution for k was skipped. This process introduced controlled noise and variability into the data, enabling robust testing of spatial transcriptomic algorithms under simulated conditions.

    Simulations of cell proportions

    We simulated three different scenarios of cell proportion interference. In scenario 1, we used seqFISH+ data (Eng et al. 2019) as the ground truth for spatial transcriptomics and obtained simulated single-cell data with different cell-type proportions by randomly sampling these data. In scenario 2, we used seqFISH+ data as the ground truth for spatial transcriptomics and obtained simulated single-cell data with different cell-type proportions, excluding the ExcitatoryL2and3 cell type, by randomly sampling the data. In scenario 3, we used seqFISH+ data with the ExcitatoryL2and3 cell type removed as the ground truth for spatial transcriptomics and obtained simulated single-cell data with different cell-type proportions, including one additional cell type compared with the spatial data, by randomly sampling the original data. We evaluated the results using the Euclidean distance between the true spatial locations of the cells and their positions after allocating with the algorithm.

    Mapping single-cell data to in situ sequencing spatial data

    For STARMAP data (Wang et al. 2018), we performed spatial mapping of processed Smart-seq2 snRNA-seq data (Tasic et al. 2018), consisting of 14,249 cells and 34,041 genes, onto 1523 spatial cells. Because STARMAP detected only 981 genes, we used the shared genes for mapping.

    We evaluated the accuracy of the mapping method by calculating spatial distribution similarity of cell types between the real spatial transcriptomic data and the reconstructed single-cell data. Additionally, we compared the cell-type proportions of the reconstructed cells with the proportions measured by STARMAP. The algorithm integrates three layers of information: two layers of regular horizontal and vertical regionalization, as well as one layer of spatial grid clustering information. The Polyomino algorithm converged after 500 epochs with default parameters.

    Mapping single-cell data to smFISH-based spatial data

    For seqFISH data (Lohoff et al. 2022), we performed spatial mapping of processed 10x Genomics v2 scRNA-seq data (Lohoff et al. 2022) consisting of 116,312 cells and 29,452 genes onto 19,416 spatial cells. Because seqFISH detected only 351 genes, we used the shared genes for mapping. We evaluated the accuracy of the mapping method by calculating ST-NNED. The algorithm integrates three layers of information: two layers of regular horizontal and vertical regional segmentation, as well as one layer of spatial grid clustering information. The Polyomino algorithm converged after 500 epochs with default parameters.

    Mapping single-cell data to Visium data

    We used processed data of colorectal cancer–derived liver metastatic tumor (Wang et al. 2023) from the BD Rhapsody Single-Cell Whole Transcriptome platform, sequencing a total of 115,818 cells across 16,478 genes, which were then mapped to Visium data of same cancer tissue, consisting of 4672 spots and 17,934 genes. For mapping onto the Visium data, we integrated information from four layers: three directional layers at regular angles (0°, 60°, and 120°) for regional segmentation, as well as one layer containing the spatial clustering information of the Visium spots. The Polyomino algorithm converged after 500 epochs with default parameters. Because the Visium data do not have single-cell resolution, after mapping cells to spots, we assigned each cell to the spot with the highest mapping probability. To visually represent this, we added random jitter to each cell's coordinates based on the spot's coordinates, confined within the spot's radius, to account for multiple cells within the same spot. We used the Milo package to assess the distribution tendency of single cells between the PT and T zones, using an absolute log fold change greater than two as the threshold to distinguish cells that prefer different zones. These cells were then subjected to differential analysis.

    Mapping single-cell data to Stereo-seq data

    We used processed 10x Genomics v3 scRNA-seq data of an E16.5 mouse embryo, consisting of 169,307 cells and 55,450 genes, mapped to processed Stereo-seq data from MOSTA (Chen et al. 2022). The spatial data used in this study originated from E16.5 mouse embryo samples, which were divided into five sections. We used the results from section 3 for demonstration. This section contained 155,741 spots and 28,579 genes.

    The algorithm employed a spatial grid with a width of five for computation, in which each grid unit corresponds to a grouping of five consecutive bin50 units. This grid was used in conjunction with three layers of regional constraints: regular horizontal and vertical regional information and grid clustering information. Convergence was achieved after 500 epochs. To accelerate computation, we randomly split the single-cell data into five subsets based on the cell types and performed mapping on each subset separately.

    Compared methods

    We compared Polyomino with seven SOTA methods: Tangram (version 1.0.4) (Biancalani et al. 2021), scSpace (version 1.0.0) (Qian et al. 2023), SpaTrio (version 1.0.0) (Yang et al. 2023), CytoSPACE (version 1.0.6a0) (Vahid et al. 2023), CelEry (version 1.2.1) (Zhang et al. 2023), RCTD (version 1.2.0), and cell2location (version 0.1.3).

    Tangram optimally maps single cells to spatial voxels primarily by minimizing the cosine distance between the reconstructed single-cell data and spatial voxels. It achieves high performance in aligning single-cell data with spatial transcriptomics, as demonstrated in a previous benchmark study, ensuring a detailed and contextually relevant representation of cellular distributions. We used all genes for calculations and set the parameters to default.

    scSpace employs transfer learning with transfer component analysis to coembed scRNA-seq and spatial transcriptomic data into a shared latent space. It reconstructs a pseudospace for scRNA-seq data by training a multilayer perceptron on spatial coordinates derived from spatial transcriptomics. Additionally, scSpace introduces spatially informed clustering to identify spatially heterogeneous cell subpopulations. We ran scSpace with its default parameters.

    SpaTrio integrates single-cell multiomics and spatial transcriptomic data through fused Gromov–Wasserstein optimal transport. By leveraging gene expression and spatial topology, it reconstructs multimodal tissue maps and identifies spatial coexpression patterns. SpaTrio provides probabilistic cell-spot alignments, enabling accurate mapping of cellular modalities in complex tissues. We used SpaTrio with its default parameters for all analyses.

    CytoSPACE estimates cell types in spatial data through deconvolution before linearly assigning cells to voxels to maximize the PCC. In this study, we ran CytoSPACE with the following parameters: cytospace -sc -sp ./sc_exp.tsv -ctp ./sc_anno.tsv -stp ./st_exp.tsv -cp ./st_coor.tsv -nop 4 -noss 1000 -sm lap_CSPR.

    CelEry applies a supervised deep learning framework to recover spatial origins of cells in scRNA-seq data by learning gene expression spatial location relationships from spatial transcriptomics. It includes an optional data augmentation step using variational autoencoders, enhancing robustness and reducing noise in single-cell data. For CelEry, we set num_workers=10 and used default values for all other parameters.

    RCTD is a probabilistic method that models spatial transcriptomic spots as mixtures of reference cell types. It uses a Poisson-log normal model and maximum likelihood estimation to deconvolve spatial spots based on reference single-cell expression profiles. RCTD provides cell-type proportions per spot and confidence estimates. We ran RCTD in its “doublet” mode to accommodate complex mixtures and used the recommended preprocessing steps for reference and spatial data.

    cell2location is a Bayesian model that integrates single-cell reference data with spatial transcriptomics to infer spatially resolved cell-type abundance maps. It models technical variation and gene-specific sensitivity, enabling robust deconvolution even in sparse spatial data. For our analysis, we followed the official tutorial pipeline using scvi-tools for the scRNA-seq reference model and default hyperparameters for spatial mapping.

    Computation time and resource analysis

    We evaluated the computation time and resource usage using Stereo-seq data and corresponding single-cell data. Both the Stereo-seq and single-cell data were randomly downsampled to generate spatial data and single-cell data with varying numbers of spots, and we used 25,059 shared genes. We then performed mapping using Polyomino (default parameters, width of five, three layers of region information constraints), Tangram (default parameters, cells mode), CytoSPACE (default parameters, sc mode, noss set to 1000, solver using lap_CSPR), scSpace (default parameters), SpaTrio (default parameters), and CelEry (default parameters, with num_workers set to 10). The computation time and resource usage for each method were recorded.

    All calculations were tested on the same system, equipped with an Intel E5-2650 v3 (2.3 GHz base and 3.0 GHz max frequencies, 40 cores, and 128 GB RAM) and a 24 GB NVIDIA GeForce RTX 3090. In particular, to evaluate the scalability of our method on large-scale spatial data sets, we additionally tested the reconstruction of more than 300,000 spatial spots on an NVIDIA A800 GPU with 80 GB memory.

    Data sets

    The seqFISH+ spatial transcriptomic data were obtained from GitHub (https://github.com/CaiGroup/seqFISH-PLUS). The STARMAP scRNA-seq data from mouse cortex data were obtained from the NCBI Gene Expression Omnibus (GEO; https://www.ncbi.nlm.nih.gov/geo/) under accession number GSE115746, and spatial transcriptomic data were obtained from Figshare (https://figshare.com/articles/dataset/wang2018three_STATmap/19786456).

    The STARMAP spatial transcriptomic data from the mouse model of Alzheimer's disease were obtained from https://singlecell.broadinstitute.org/single_cell/study/SCP1375.

    The seqFISH scRNA-seq data were obtained from GitHub (https://github.com/MarioniLab/EmbryoTimecourse2018), and spatial transcriptomic data were obtained from https://marionilab.cruk.cam.ac.uk/SpatialMouseAtlas/.

    The Visium scRNA-seq and spatial transcriptomic data were obtained from the GEO under accession number GSE225857. The Stereo-seq spatial transcriptomic data were obtained from the Spatial Transcript Omics DataBase (STOmics DB; https://db.cngb.org/stomics/) under the data set ID STDS0000058. The processed 10x Genomics v3 scRNA-seq data from E16.5 mouse embryo were obtained from the Genome Sequence Archive (GSA; https://ngdc.cncb.ac.cn/gsa) at the National Genomics Data Center, Beijing Institute of Genomics (China National Center for Bioinformation), Chinese Academy of Sciences, under accession number CRA003171. The corresponding raw sequencing data are also accessible under accession number CRA003171.The Visium HD data set used in this study is publicly available and can be downloaded from the 10x Genomics website (https://www.10xgenomics.com/).

    Software availability

    Polyomino is available at GitHub (https://github.com/JiekaiLab/Polyomino) and as Supplemental Code.

    Competing interest statement

    The authors declare no competing interests.

    Acknowledgments

    This work was financially supported by the National Key R&D Program of China (2023YFF1204701, 2024YFA1802300), the National Natural Science Foundation of China (32225012, 32200662), a Major Project of Guangzhou National Laboratory (GZNL2023A02005), the Science and Technology Planning Project of Guangdong Province, China (2023B1212060050, 2023B1212120009), and the Health@InnoHK program launched by the Innovation Technology Commission of the Hong Kong SAR, P.R. China.

    Author contributions: Q.C. and L.L. conceived and designed the study. Q.C. developed the algorithm, implemented the software, and performed the computational analyses. X.L. contributed to the mathematical formulation. J.C. supervised the project and provided critical guidance on biological interpretation. L.L. and J.C. jointly directed the overall research. Q.C., L.L., and X.L. prepared the figures and wrote the manuscript. All authors contributed to the discussion of results and approved the final version of the manuscript.

    Footnotes

    • [Supplemental material is available for this article.]

    • Article published online before print. Article, supplemental material, and publication date are at https://www.genome.org/cgi/doi/10.1101/gr.280532.125.

    • Freely available online through the Genome Research Open Access option.

    • Received February 11, 2025.
    • Accepted September 18, 2025.

    This article, published in Genome Research, is available under a Creative Commons License (Attribution-NonCommercial 4.0 International), as described at http://creativecommons.org/licenses/by-nc/4.0/.

    References

    | Table of Contents
    OPEN ACCESS ARTICLE

    Preprint Server