Reconstructing single-cell resolution from spatial transcriptomics with CellRefiner

Domain: chemistry
Published: 2026-02-27
Editorial outcome: major_revision

Abstract
Single-cell RNA sequencing technologies profile the transcriptome of individual cells but lack the spatial context necessary for dissecting ceIllular interactions like cell-cell communications. On the other hand, most current spatial transcrRiptomic technologies lack cellular resolution, limiting their capability for realistic downstream analysis. Here we present CellRefiner, a physical model-based method that integrates a single-cell dataset with a paired spatial dataset to generate single-cell resolution in the imputed spatial data. CellRefiner models cells as particles connected by forces, and then optimizes cell locations with spatial proximity constraints, gene expression similarity, and ligand-receptor interactions between cells. We systematically benchmark CellRefiner over a variety of simulated and real datasets using Visium, MERFISH, seqFISH+, Slide-seqV2, and STARmap datasets to demonstrate its accuracy, robustness, and ability to recover spatial patterns of cells. We also demonstrate its utility for improving spatially dependent analysis over the original spatial data for the contact-based cell-cell communication on mouse cortex and lymph node tissues. Our results show CellRefiner is capable of reconstructing single-cell resolution from non-single-cell resolution spatial data, allowing downstream analysis that requires individual-cell resolution and spatial information.

Introduction
Single-cell RNA sequencing (scRNA-seq) enables profiling individual cells at high-resolution and high-throughput, enabling new analyses of gene expression heterogeneity and interactions1, 2.However, scRNA-seq methods require dissociation of the tissue and subsequent loss of spatial information, which is critical to studying biological processes such as spatially constrained cell-cell communications3, 4. In contrast, spatial transcriptomics (ST)5, 6 retain the spatial context necessary for investigating spatial gene expression patterns and organization of cells. However, those techniques have their own shortcomings, limiting their potential for downstream analyses. Image-basEed approaches such as seqFISH+7 and MERFISH8 do not cover the whole transcriptome while sPequencing-based approaches such Visium9 and Slide-seqV210 do not preserve individual cell identitNy, with spatial resolution in a spot that contains a small number of cells. To facilitate analyses that req uire both single-cell resolution and large gene coverage, computational methods are needed to intLegrate scRNA-seq and ST data.

Currently, several computational methods have been developed to assign spatial context to scRNA-seq data. Many of these methods integrate scRNA-seq with ST data and deconvolve spatial spots into proportions of cell types that are determined in scRNA-seq data, such as Cell2location11, SpatialDWLS12, SPOTlight13, and DSTG14. Another class of approaches estimates spatial proximity between cells in scRNA-seq based on biological assumptions. CSOmap15 constructs a cell-cell affinity graph using contact-based ligand-receptor interactions, although the lack of spatial reference may result in false positives. SPROUT16 similarly uses ligand-receptor interactions, along with a deconvolution method to construct an affinity matrix, which uses a low-dimensional space to reconstruct a single-cell resolution quasi-structure. novoSpaRc17 assumes a correlation between gene expression similarity and spatial closeness and uses optimal transport to construct a probabilistic matching of scRNA-seq data to a predefined grid. While these methods can reveal cell type heterogeneity and composition in ST data, the lack of individual cell resolution in the method limits their utility for recovering biological processes, such as cell-cell communication at individual cell level18-20.

There has been an increasing interest in recovering single-cell resolution of non-single-cell ST21. Seurat5 uses canonical correlation analyses to embed scRNA-seq and spatial data to a common latent space then project scRNA-seq cells to spots in the spatial data. Tangram22 uses a deep learning framework to align single-cell data in space, creating a cell-to-spot mapping. While these probabilistic mappings can assign spatial locations to cells, they are mainly used for label transfer and cell type deconvolution. More recently, some methods start to focus on assigning spatial locaStions to individual cells, including CellTrek23 that uses a co-embedding approach with a random forest model and CeLEry24 that trains a neural network to predict spatial location from gene expression. These methods, however, place the cells independently which may cause unrealistic spatial a rrangement of cells, such as overlapping, overly crowded, or overly sparse in cell distribution.

To address those problems, we utilize a physical model drawn from subcellular element model originally developed for simulating multicellular organization of cells, such as cell proliferation, cell-cell adhesion, and cell-cell communicatioAn25. Such an approach has been widely used for simulating large numbers of cells, with cells represented as elastically linked particles interacting via short-range potentials26. In such model, each particle tracks a fully independent state with individual parameters that reflect heterogeneity, while known cell-cell interactions and single-cell dynamics can be directly implemented as forces on particles27. For example, it can be used to simulate platelet-blood flow interactions28 with platelets acted on by three forces corresponding to the effects of stochastic cell movement, intercellular interactions such as ligand-receptor binding, and fluid-cell interactions. Such a model can replicate experimental observations by directly relating parameters to experimental values while achieving linear scaling in computational efficiency28. These methods are valuable for computationally efficiently modeling thousands of cells subject to multiple types of interactions in a noisy environment.

Here, we present CellRefiner, a physical model-based method that can reconstruct single-cell resolution by utilizing both non-single-cell spatial transcriptomic data and scRNA-seq data. CellRefiner uses forces based on gene expression similarity and ligand-receptor interaction to systematically optimize cell locations modeled as particles. This approach naturally enforces spacing among cells while accounting for local spatial configurations resulting from cells with similar gene expression and ligand-receptor signaling between cells. The method can be applied to Visium, MERFISH, seqFISH+, Slide-seq, and STARmap29 datasets, uncovering spatial organization of cells at single-cell resolution. In addition, we demonstrate the utility of CellRefiner for improving inference on cell-cell communication.

Results
Overview of CellRefiner
CellRefiner integrates scRNA-seq and ST data anNd predicts a high-fidelity single-cell resolution spatial data by using the subcellular element method, a particle-based model (Fig. 1). First, a mapping matrix based on the gene expression similaritLy between cells in scRNA-seq data and spots in ST data is generated to initialize the model (Fig. 1a). This initialization is adopted from Tangram22 with additional regularization for spatial smoothness. CellRefiner is also compatible with other mapping methods for this task which can replace the initialization module. The mapping matrix is then used to assign several cells in scRNA-seq data to each spot in ST data, for example, 5 to 10 cells to each spot in Visium data. The assigned cells are initially randomly placed in an area covered by the corresponding spot. While the initial random placement of single cells can facilitate identification of large-scale spatial patterns, it is not sufficiently accurate for analyzing fine-scale patterns and processes at single cell level. Therefore, we introduce a particle-based model to fine-tune the spatial locations of the single cells (Fig. 1b). In this model, cells are modeled as particles whose movements are guided by several different forces. The model contains three major components. First, a uniform Morse potential is applied to every pair of cells to recover the realistic distance between cells26. This force prevents the overlapping of cells and formation of large voids in tissues. Second, an attraction force is applied between cells based on gene expression similarity, with an assumption that cells with similar gene expression profiles are likely spatially close30-32. Third, based on known ligand-receptor interactions as grouped in CellChatDB, another attraction force is applied to cells expressing compatible ligand-receptor pairs15, 16, 33, 34. In ablation analysis, incorporating LR forces leads to only marginal improvement, with performance nearly identical to that obtained without LR forces. We therefore treat the LR term as optional. Furthermore, CellRefiner models detailed cell shapes by representing each cell with multiple particles using the subcellular element method, facilitating the contact-based cell-cell communication analysis (Fig. 1c). Together, CellRefiner introduces a versatile model that incorporates the important effect of spacing between cells, gene expression similarities, and ligand-receptorS interactions to produce a more biologically realistic single-cell resolution spatial transcriptomics data.

Benchmarking spatial refinement performance on single-cell resolution ST data
We first validate the location refinement of indivIidual cells with given ground truth mappings between scRNA-seq cells and ST spots. We generate pseudo multi-cell resolution ST data, named as pseudo-Visium data to resemble the resolution of Visium data, from a MERFISH dataset of the mouse hypothalamic preoptic region35 (F T ig. 2a). A grid of pseudo spots is placed on the tissue region and a cell in the original MERFISHA data is assigned to a pseudo spot if the cell is covered by the spot (Supplementary Fig. 1). Here the cell-to-spot mapping is known due to the pseudo-Visium data construction, and we then evaluate the method given the accurate initial mappings to construct spatial data at the resolution of the original MERFISH data (Fig. 2a). In this sample, the ependymal cells form a well-defined and fine-scale structure that we use to assess the effectiveness of our method. Each cell is initially placed according to a normal distribution at its corresponding spot’s center. The initial locations are then further perturbed proportionally to the spot radius to evaluate the performance of CellRefiner when handling noisy initialization (Fig. 2b). Kernel density estimation with Gaussian kernels36 are used to estimate the spatial densities (Fig. 2b). For systematic evaluation, we use KL divergence between the spatial density of each cell type from CellRefiner and from ground truth data (Fig. 2c). The KL divergence is robustly reduced through CellRefiner, and the predicted spatial locations of cells are found to significantly outperform the random initial placement from the ground truth mapping (Supplementary Fig. 2). We further evaluate the smoothness of neighborhood structure by measuring distance from each cell in the output to its nearest neighbor of the same cell type in the output. A significant improvement in post refinement is observed when benchmarked with the neighborhood structure of the ground truth data (Fig. 2c). This improvement is qualitatively visible across cell types as well for the entire dataset, particularly for the ependymal cells (Fig. 2c).

Having demonstrated CellRefiner given a known mapping, next we test the entire method using a pseudo-Visium dataset constructed from various datasets without a Sknown cell-to-spot mapping. Using a MERFISH data35, we construct pseudo-Visium to form two datasets with a known ground truth where the gene expression of cells assigned to a pseudo spot is added as representation of the spot. Starting from the single-cell gene expression and pseudo-Vi sium data, we reconstruct the original data and compare it with the MERFISH data (Fig. 2e). In pIarticular, we observe that CellRefiner outputs the same distinct spatial structures as well as distribution of cell types (Fig. 2e). Repeating this process on a mouse embryo seqFISH37 dataset with many cells also gives similar results between the output and the original (Fig. 2e). On Slide-seqV2 and STARmap datasets for the mouse hippocampus and visual cortex, respectively, CellRefiner Aproduces simulations with distinct tissue structures visible such as the subiculum and layers of the cortex (Fig. 2e). These two datasets have substantially different geometries and numbers of cells, demonstrating CellRefiner’s versatility over different dataset types.

Using single-cell resolution datasets as ground truth, we benchmark the performance of CellRefiner’s ability to spatially localize cells relative to existing methods for mapping cells to space. We start with MERFISH data from the mouse hypothalamic preoptic region with a distinctive structure of ependymal cells (Fig. 2d). From this single-cell resolution data, we create synthetic spot data to form a paired dataset and map cells to space using CytoSpace, Tangram, and CellTrek along with the corresponding outputs from CellRefiner (Fig. 2d). CellRefiner reduces the error compared to the ground truth for all three methods using two different metrics across all cell types (Fig. 2d). The Wasserstein distance penalizes individual cells mislocated more heavily than the KL divergence, which is calculated over a Gaussian distribution fit to each cell type’s spatial configuration. We compare again with a mouse hippocampus Slide-seqV2 dataset consisting of several times as many cells and genes as the previous dataset (Fig. 2d). We create synthetic spot data and input the synthetic data and original gene expression data into CytoSpace, Tangram, and CellTrek (Fig. 2d). In particular, the spatial regions marked by cell types such as the dentate pyramidal cells and endothelial cells are mapped more distinctly. However, other cell types have less defined spatial distributions, so we see the most improvement from CellRefiner when assessing with the Wasserstein distance (Fig. 2d). When we isolate one of these labeled cell types, there is a distinct structure following from the CA3 to the CA2, CA1, and sSubiculum along with a scattering of cells around the sample (Fig. 2d). We quantify this spatial dispersion using the Ripley’s L, which shows CellRefiner produces values closer to the ground truth when applied to each method (Fig. 2d). In addition, we examined the performance of CellRefiner on cel l types with different numbers of cells. We also compared CellRefiner with CeLEry using pseuIdo-Visium data generated from a Xenium dataset of human breast cancer38, applying both methods to the paired pseudo-single-cell (cells taken from Xenium without spatial information) and pseudo-Visium spots. Under this setup, CellRefiner outperforms CeLEry, whereas CeLEry achieves higher accuracy when applied in a supervised setting using ground-truth Xenium spatial information (Supplementary Fig. 3). These results highlight the strength of CellRefiner for mapping single cells to multi-cell-resolution ST data. Lastly, while CellRefiner performs consistently well on various cell type sizes, its performance decreases on low-abundance cell types that composite about less than 5% of the total cell population (Supplementary Fig. 4).

CellRefiner reveals scaled cellular structure in multi-cell resolution ST data
Now we examine the utility of CellRefiner when applied to paired scRNA-seq and multi-cell resolution ST datasets, particularly a 10X Visium dataset of the mouse cortex (Fig. 3a) with paired scRNA-seq data39. The CellRefiner output shows a clear spatial layer trend using the annotations from the scRNA-seq data (Fig. 3b). When used in the domain segmentation, where SpaceFlow is applied to the CellRefiner reconstructed single-cell resolution spatial data, the clear spatial layer trends are observed (Fig. 3c). This is quantitatively demonstrated using descriptive statistics of the spatial patterns of cell types, in particular Ripley’s L function40 for showing that both the original Visium and the CellRefiner data exhibit similar levels of dispersion (Fig. 3d). Another spatial analysis is to calculate the neighborhood enrichment score based on proximity of the connectivity graph41, 42 (Fig. 3e). This is useful for downstream tasks like identifying spatially variable genes or candidates for cell-cell communication42. Applying CellRefiner to a paired Visium and scRNA-seq murine auricular lymph node dataset43 (Fig. 3f) shows the tissue structure consistent with microscopy images44, 45, with higher concentrations of CD8 T cells around the T cell zone, whereas the Mature B cells are more concentrated towards the outer regions (Fig. 3g).

CellRefiner provides insight into contact-based cell-cell communication
One important form of cell-cell communication is the contact-based signaling between cells with physical contact through membrane-bound ligand and recepto rs. To investigate contact-based communication, both single-cell resolution gene expression information and spatial locations are needed. We first evaluate cell shape reconstruction by CellRefiner on single-cell resolution ST data. In the seqFISH+ data of mouse cortex7, the reconstructed cell shapes qualitatively recapitulate the ground truth shapes and reliably reconstruct contact maps between cells, which are crucial for the contact-based cell-cell communication analysis (Fig. 4a). When applied to a seqFISH dataset of mouse embryo, the reconstructed shapes allow geometrically realistic analysis of cell contacts (Fig. 4b). Finally, we applied the full CellRefiner pipeline with each cell modeled by multiple particles to the multi-cell resolution Visium data. The reconstructed single-cell resolution data agrees well with the prior knowledge on spatial arrangements of cell types (Fig. 4c) and it is used for detailed contact-based signaling analysis, which is infeasible using the original Visium data. We then evaluate the performance of CellRefiner on contact-based cell-cell communication analysis (Supplementary Fig. 5). We compared CellRefiner with four approaches: the spatial mapping of cells generated by Tangram or CellTrek and the contact map generated with a k-nearest neighbor graph or a Delaunay graph. In the task of predicting the contact-based cell neighborhood cell type composition and contact-based signaling, CellRefiner and Tangram+Delaunay perform the best. CellRefiner achieves comparable correlation coefficients similar to the Tangram+Delaunay approach, however, with significantly lower RMSE, indicating a lower false positive rate (Supplementary Fig. 5). However, like other CCC inference methods, CellRefiner may still produce false positives and needs to be used primarily as a tool for hypothesis generation.

Based on the cell shapes modeled by CellRefiner, we analyze contact-based cell-cell communication in the multicell resolution Visium data. First, we apply CellRefiner to a Visium data of human squamous cell carcinoma (Fig. 5). We successfully identify various signaling patterns in agreement with prior knowledge (Fig. 5a) including 1) enriched EPHB signaling on the tumor region border known as a key interaction between tumor keratinocytes and the tumor microenvironment46, 2)S enriched NOTCH signaling within the tumor region known to promote angiogenesis47, 3) decreased activity level of ICAM signaling in tumor region consistent with experimental observation48, and 4) CDH (E-Cadherin) mediated cell-cell adhesion within the tumor region. In addition, we identify vari ous enriched signaling in the tumor region that contribute to cell–cell adhesion and desmosome formation49 (Fig. 5b).

Second, we analyze contact-based cell-cell communication in a Visium data of mouse cortex (Fig. 6). 1) NOTCH signaling has previously been observed in adult mouse brain with various potential functions such as neural stem celAl maintenance and cell cycle maintenance50. Here, we observe significant NOTCH signaling across cortex layers implying its potential role in regulating global functions. 2) CDH is known to mediate cell-cell interactions that guide neuronal movement and organization51. In addition to enriched CDH signaling within and across cortical layers, we also identify significant CDH signaling between the cortical layers and the Sst interneurons, which may suggest the role of CDH on wiring this interneuron type into the cortical circuit. 3) EPHA and EPHB signaling are observed both among the cortical layers and between the cortical layers and the various interneurons. Specifically, a strong signaling directionality is identified from the various interneurons to the cortical layers, indicating its various roles including neurogenesis and interneuron migration52, 53. 4) Significant NRXN and SEMA4 signaling activity is observed within the cortical layers, consistent with their known roles in shaping neuronal synapses54, 55.

ST data at spot-level resolution assigns a single expression level to each spot and gene, while each spot often contains multiple cells. This spot-level mixing can obscure heterogeneous signaling activity within the same spot, particularly for contact-based communication. In the analysis of NOTCH signaling, several Visium spots were detected with NOTCH signaling, however CellRefiner reconstruction revealed that only a subset of the constituent cells receiving signal, indicating the presence of both NOTCH-responsive and non-responsive cells within individual spots. These results demonstrate that CellRefiner can handle the spot-level mixing and recover the heterogeneity of contact-based cell–cell communication that cannot be resolved at the spot level (Fig. 6c).

Methods
Data Preprocessing
For the scRNA-seq data, we performed a standard data analysis procedure of cell and gene filtering (filtering out cells with two or fewer genes followed by filtering out genes detected in two or fewer cells), normalizing total count, log1p normalization. A similar procedure was used for the ST data, then the two datasets were reduced to shared genes. For the scRNA-seq data, we then performed PCA and retained the first 50 components, then found the k-nearest neighbor graph. Differentially expressed genes were identified by a statistical t-test using the most granular pre-annotated cell type (or Leiden clustering if not pre-annotated) and the top 100 marker genes for each cell type were used as training genes for the mapping. For contact-based signaling analysis, the ligand and receptor genes are filtered by removing the genes detected in less than 1% of cells.

CellRefiner model
CellRefiner uses a modular approach to combine sRNA-seq and ST data to generate single-cell resolution spatial data. Starting with gene expression data from scRNA-seq and ST data of the same tissue and spatial coordinates from the ST data, we find a mapping that assigns cells to spots. This mapping 𝐓 ∈ ℝ𝑐×𝑠 is generated from the Fused Gromov-WasseErstein transport equation 𝐿(𝐂 ,𝐂 ,𝐌,𝐩,𝐪) 1 2 in equation (1). The cost of mapping 𝐌 ∈ ℝ𝑐×𝑠 between domains is based on the cosine similarity between the ST gene expression matrix 𝐆 ∈ ℝ𝑠×𝑔 aNnd the scRNA-seq gene expression matrix 𝐒 ∈ ℝ𝑐×𝑔, where 𝑐 is the number of cells, 𝑠 is the number of spots, and 𝑔 is the number of shared genes between ST data and marker genes of scRNA-seqL dataset. The first cost matrix 𝐂 1 ∈ ℝ𝑐×𝑐 is the cosine similarity of gene expressions while the second cost matrix 𝐂 ∈ ℝ𝑠×𝑠 aims to maximize spots that are spatially 2 closer and have more similar gene expressions. These factors in the Euclidean distance between spot coordinates 𝐀 ∈ ℝ𝑠×𝑠 (normalized to maximum of 1) as well as 𝐀 ∈ ℝ𝑠×𝑠, the cosine dissimilarity of a 1 2 low-dimensional embedding between spots. The weight between the two costs 𝜂 is 0.5. Here we use SpaceFlow to generate a spatially consistent low-dimensional embedding that incorporates both spatial information and gene expression. We choose 𝐩 and 𝐪 to be uniform distributions over the source and target domains.

2
𝐿(𝐂 ,𝐂 ,𝐌,𝐩,𝐪) = min (1−𝜂)∑T 𝑀 +𝜂 ∑|𝐶 −𝐶 | T T
1 2 𝑖𝑗 𝑖𝑗 1,𝑖𝑘 2,𝑗𝑙 𝑖𝑗 𝑘𝑙
𝐓∈Π(𝐩,𝐪)
𝑖,𝑗 𝑖,𝑗,𝑘,𝑙
𝐒 ⋅𝐆 (1)
𝐌 = 
||𝐒|| ||𝐆||
2 2
𝐂 = 𝐀 ⊙𝐀
2 1 2

This is solved using the conditional gradient to find a probability matrix, from which we take the 𝑘 top cells for each spot (depending on sample and ST data collection method). The assigned cells are randomly initialized around the known spot coordinates from the ST data to initialize cell 𝑖′𝑠 coordinates 𝐱 . The spatial locations of cells are refined with a combination of several forces,
𝑖
𝐱̇ = 𝐅 (𝐱 )+𝐅 (𝐱 )+𝐅 (𝐱 )+𝐅 (𝐱 ) (2)
𝑖 𝑚,𝑖 𝑖 𝑠,𝑖 𝑖 𝑔,𝑖 𝑖 𝐿𝑅,𝑖 𝑖
These four forces acting on each cell’s spatial coordinates are based on the Morse potential, spatial constraint, gene expression, and ligand-receptor interactions. The cells’ locations governed by the ODE system described in equation (2) are then solved using a forward Euler method with fixed step size with user input ℎ (time step size default to 20) where at each iteration 𝑡, all 𝑛 cells have their cell spatial coordinates 𝐱 ∈ ℝ2 simultaneously updated.
𝑡,𝑖

The potential force calculation
The Morse potential is the basic elastic response function 𝐅 in equation (3) to intercellular 𝑚 biomechanical forces acting between every pair of cells with the goal of spreading the cells out uniformly58, 59. As the simulation progresses, the streEngth of this force decreases using a simulated annealing approach. Here 𝑉 is the Morse poteCntial function of distance with parameters 𝑉 ,𝑈 ,𝑐 ,𝑐 chosen to 0 0 1 2 achieve a specific potential enTergy function shape (Supplementary Fig. 9). This shape achieves smoother convergence as well as a potential energy well at the desired distance between cells for optimal spacing.

𝐅 (𝐱 ) = −Σ𝑁 ∇ 𝑉(𝐱 ,𝐱 ) 
𝑚 𝑖 𝑗≠𝑖 𝐱𝑖 𝑖 𝑗
(3)
2 2
𝑉(𝐱 ,𝐱 ) = 𝑉 exp(−‖𝐱 −𝐱 ‖ /𝑐2)−𝑈 exp(−‖𝐱 −𝐱 ‖ /𝑐2)
𝑖 𝑗 0 𝑖 𝑗 1 0 𝑖 𝑗 2

Spot constraints
Each cell also experiences a force 𝐅 that keeps it within its corresponding spot. This force is oriented 𝑠 from the center of the spot belonging to 𝐱 towards 𝐱 when the cell moves outside its spot radius 𝑟 in 𝑖 𝑖 𝑠 equation (4), where 𝐱 is the spatial coordinate of the corresponding spot. The unit vector 𝐫̂ of this force 𝑠𝑖 points out from the center of the spot.

𝐱 −𝐱
𝐅
𝑠
(𝐱
𝑖
) = −𝑏(‖𝐱
𝑖
−𝐱
𝑖𝑠
‖−𝑟
𝑠
)
2
‖𝐱
𝑖
−𝐱
𝑖𝑠
‖
, if ‖𝐱
𝑖
−𝐱
𝑖𝑠
‖ > 𝑟
𝑠
,0 else (4)
𝑖 𝑖𝑠

The upper bound of the magnitude of 𝐅 (𝐱 ) is set to 1.5 where 𝑏 = 0.05 is the weight of force.
𝑠 𝑖

Force based on gene expression similarity
Cell positions are also refined according to the gene expression force 𝐅 in equation (5), which is 𝑔 proportional to the gene expression similarity between two cells at locations 𝐱 ,𝐱 oriented towards each 𝑖 𝑗 other along unit vector 𝐪̂ = 
𝐱𝑖−𝐱𝑗
. The gene similarity 𝑐 = max(PCC(𝐠 ,𝐠 ),0) comes from the Pearson 𝑖 𝑗
‖𝐱𝑖−𝐱𝑗‖
correlation between the vectors in the PCA embeddings of gene expression, 𝐠 and 𝐠 corresponding to 𝑖 𝑗 cells 𝑖 and 𝑗, chosen over other metrics for noise reduction60. This forSce is only calculated between pairs of cells within the same local spatial neighborhood 𝑀, which contains cells within the same spot and adjacent spots. Here 𝑎(𝑡) = 
(𝑡−𝑡𝑓)
is a temperature scheduling term that decreases the strength of the 20𝑡2 P
𝑓
N
force over iterations (indexed by 𝑡) to the final iteration 𝑡 .61
𝑓

𝐅
𝑔
(𝐱
𝑖
) = −EΣ
𝑗
𝑀
≠𝑖
𝑎(𝑡)𝑐(𝐠
𝑖
,𝐠
𝑗
)𝐪̂. (5)

Force determined by ligand-receptor interactions
The ligand-receptor interactions are incorporated into the force 𝐅 using a cell-cell affinity partial 𝐿𝑅 correlation matrix 𝐖 ∈ ℝ𝑛Ax𝑛 in equation (6) for cells within the same local neighborhood as the gene expression. From the single-cell expression matrix we define ligand and receptor expression matrices 𝐓
𝐿
and 𝐓 ∈ ℝ𝑛x𝑛𝐿𝑅 by taking the single-cell expression profiles and subsetting them to the corresponding 𝑅 ligand and receptor expressions based on 𝑛 ligand-receptor pairs drawn from the CellChat database62. 𝐿𝑅 The product of these matrices gives the affinity between pairs of cells, and since cells can express both ligand and receptor genes at the same time, we get the following affinity matrix16.

𝐖 = 𝐓 𝐓𝑇 +𝐓 𝐓𝑇. (6)
0 𝐿 𝑅 𝑅 𝐿

𝐖 is then approximated as 𝐖 using the Spielman-Srivastava algorithm for spectral sparsification16, 63 0 with a threshold (default = 0.4) to refine the affinity matrix while preserving its structure, characterized as the spectrum of the graph Laplacian. The ligand-receptor force is determined similarly to the gene expression force with force between two cells at the at locations 𝐱 ,𝐱 oriented towards each other along 𝑖 𝑗 unit vector 𝐪̂ = 
𝐱𝑖−𝐱𝑗
and proportional to the corresponding affinity term 𝑤 given by equation (6).
𝑖𝑗
‖𝐱𝑖−𝐱𝑗‖

𝐅 (𝐱 ) = −Σ𝑛 𝑎(𝑡)𝑤 𝐪̂. (7)
𝐿𝑅 𝑖 𝑗≠𝑖 𝑖𝑗

Tissue Boundary
We impose a hard constraint on the boundary of the tissue to prevent cells from moving outside (Supplementary Fig. 10). The boundary 𝑥 is defined by fitting a multivariate Gaussian distribution 𝐵
𝑍(𝐱) = Σ𝑛 𝑁(𝐱;𝐱 ,104𝐼 ) over the spatial coordinates of the initial cell mapping and taking the level set 𝑖=1 𝒊 2
{𝐱 | 𝑍(𝐱 ) = 0.4max𝑍(𝐱)}. If a cell goes outside the boundary, i.e. 𝑍(𝐱 ) < 𝑍(𝐱 ) then it is relocated to 𝐵 𝐵 𝑖 𝐵
𝑥 S
S
the nearest point on the boundary.

Cell shape modeling
A model based on the subcellular element method26 was leveraged to reconstruct individual cell shapes from the spatial transcriptomics dataset. Each cell 𝑖 (𝑖 = 1,⋯,𝑁) is represented by a collection of 𝑛 elements (points) in space {𝐱 }𝑛𝑒 , wheEre 𝐱 is the coordinate of element 𝑘 and 𝑛 = 20. 𝑁 is the 𝑒 𝑖𝑘 𝑘=1 𝑖𝑘 𝑒 total number of cells. The position andC shape of each cell are captured by its collection of elements. Cell shape is driven by intercellulTar and intracellular physical interactions which in our model are characterized by potential between elements. The movement of element 𝑘 is given by an overdamped Langevin equation:

𝑑𝐱
𝑖𝑘
𝑑𝑡 = −𝜵 𝑖𝑘 ∑∑𝛼 𝑖𝑗 𝑉 inter (|𝐱 𝑖𝑘 −𝐱 𝑗𝑙 |)−𝜵 𝑖𝑘 ∑[𝑉 intra (|𝐱 𝑖𝑘 −𝐱 𝑖𝑙 |)]+𝝃 𝑖𝑘 (𝑡), (8)
𝑗 𝑙 𝑙≠𝑘
𝑉 and 𝑉 are the potential between elements, denoted intercellular and intracellular respectively.
inter intra
The intercellular potential 𝑉 employ Lennard-Jones form to model the adhesion and repulsion
inter
between cells, preventing cells from overlapping while promoting the formation of physical contacts between neighboring cells.

𝑟 12 𝑟 6
𝑉 (𝑟) = ( inter ) −2( inter ) , (9)
inter 𝑟 𝑟
where 𝑟 is the distance between elements and 𝑟 = 2.4 denotes the equilibrium distance at which the
inter
potential is minimized. The parameter 𝛼 is the interaction strength between cell 𝑖 and cell 𝑗, derived 𝑖𝑗 from the gene expression similarity. 𝛼 is calculated as max(PCC(𝐠 ,𝐠 ),0.05) and then scaled to 𝑖𝑗 𝑖 𝑗
[0.04,1], where PCC(𝐠 ,𝐠 ) is the Pearson correlation between the PCA embeddings of gene expression 𝑖 𝑗
𝐠 and 𝐠 for cells 𝑖 and 𝑗. The intracellular potential 𝑉 ensures the integrity of cell shapes.
𝑖 𝑗 intra

𝑟 12 𝑟 6 (10)
𝑉 (𝑟) = 𝛽[( intra ) −2( intra ) ]+𝛾𝑟3.
intra 𝑟 𝑟
The first term is a Lennard-Jones potential with 𝑟 = 2 denoting the equilibrium distance, maintaining
intra
uniform spacing of elements and cell volume conservation with 𝛽 = 0.25. The second term is a penalty term that grows rapidly at large distances and penalizes excessiveS stretching of the element network with 𝛾 = 0.001, preventing highly deformed or fragmented shapes. 𝝃 is the Gaussian white noise with 𝑖𝑘
zero mean and correlation 〈𝜉𝑚(𝑡),𝜉𝑛(𝑡′)〉 = 𝜎2(𝑡)𝛿(𝑡−𝑡′) R 𝛿 𝛿 𝛿 , where 𝜎(𝑡) is noise strength, 𝑚 𝑖𝑘 𝑗𝑙 𝑚,𝑛 𝑖,𝑗 𝑘,𝑙
P
and 𝑛 are indices of spatial dimension, 𝛿 is Kronecker delta function. To allow the system to converge to stable cell shapes, the noise strength decays via a simulated annealing schedule 𝜎(𝑡) = √𝑡−𝑇 /𝑇 ,
max max
where 0 ≤ 𝑡 ≤ 𝑇 and 𝑇 is the final integration time.
max max L
C
Spatial coordinates of cells were extracted from the spatial transcriptomics dataset and processed to I serve as the cell centroids. The median intercellular distances 𝑑 was calculated using Delaunay T triangulation and the empAirical cell radius was estimated as 𝑑 ⁄2. Because the steady-state radius of a R cell in the subcellular element model is approximately √𝑛 𝑟 ⁄2, the spatial coordinates were scaled A by 1.25∗√𝑛 𝑟 ⁄𝑑 to avoid generating excessively dense or sparse cell distributions. After the 𝑒 intra 𝑚
scaling, the initial coordinates of elements were sampled around the centroid of each cell 𝑖. The system then evolved according to Eq (8). The final element coordinates {𝐱 (𝑇 )} represent the reconstructed 𝑖𝑘 max
shape of each cell.

Mapping of low-abundance cell types
Low-abundance cell types may be excluded in the unbiased initial mapping due to subsampling. CellRefiner offers an option to further map user-specified cell types. Following the initial mapping 𝑇 that assigns cells from the entire scRNA-seq dataset to spots, we additionally map the cells belonging to the specified cell types to the spatial spots. For each cell 𝑖 belonging to the specified cell type that is not included in the initial mapping, we assign it to spot 𝑗∗ that has the most similar gene expression using the cosine similarity metric: 𝑗∗ = argmax
𝐒𝑖⋅𝐆𝑗
. The set of cells from both the initial mapping and the 𝑗
|𝐒𝑖||𝐆𝑗|
specified cell types is then passed to the spatial refinement step of CellRefiner.

Pseudo-Visium data generation
For each dataset, we create a uniform grid such that each grid point has at least 𝑛 = 5 cells. Using a KD-tree, cells are then assigned by distance to grid points to a maximum of 𝑛 cells per grid point, and within half the distance to the neighboring grid point. A spot is then defined as the spatial coordinates of the grid point and the aggregate gene expression of the cells assignSed to the grid point. Spots without any cells assigned to them are removed. For the MERFISH dataset, a 32 spot by 32 spot grid was created with a radius of 0.016. For the seqFISH dataset of mousPe embryo, a 62 spot by 62 spot grid was created with a radius of 0.16, then spots with no cells within the radius were removed. For the SlideseqV2 dataset, a 28 spot by 28 spot grid was created with an 8 0 micron radius spot size, and empty spots removed. For the STARmap dataset, a 24 spot by 10 spot grid was created with a 300 micron radius. For the seqFISH+ dataset of mouse cortex, a 35 spotI by 5 spot grid was created with a radius of 187 micron radius spot size, then spots with no cells Rwithin the radius were removed.

Contact-based signaling analysis
Contact-based signaling is transduced via ligand-receptor interactions at the interfaces of cell-cell physical contacts, which can be delineated by subcellular element representation. To determine the physical contacts between cells, a k-nearest neighbor (k=8) graph between all elements is constructed. If one element of cell 𝑗 appeared among the nearest neighbor of any elements of cell 𝑖, the two cells were considered to be physically contact. Summarizing the neighbors of elements of each cells yields a set of undirected cell-cell contacts 𝐶 = {(𝑖,𝑗)}. For each contacting cell pairs (𝑖,𝑗) ∈ 𝐶, we quantified the potential contact-based cell-cell communication mediated by every ligand–receptor pairs using a communication score.

𝐬𝐿𝑅 = 𝐠𝐿𝐠𝑅 (11)
𝑖𝑗 𝑖 𝑗

𝐠𝐿 and 𝐠𝑅 denote the normalized gene expressions of ligand L in cell 𝑖 and receptor R in cell 𝑗.
𝑖 𝑗
The ligand-receptor pairs are identified using CellChat DB62.

Cluster-level communication
The cluster-cluster communication strength for each ligand–receptor pair is computed as mean of all cell-cell communication scores between the two clusters 𝐒𝐿𝑅 = ∑ 𝐬𝐿𝑅⁄(𝑁𝑁 ). The significance of 𝐼𝐽 𝑖∈𝐼,𝑗∈𝐽 𝑖𝑗 𝐼 𝐽
cluster-cluster communication of each L-R pair is determined by a permutation test. We generated null distribution by 𝑛 independent permutations of the cell-to-cluster assignment and recalculating the cluster-cluster communication scores (𝑛 = 100 by default). The 𝑝-value for cluster-cluster communication is given by the percentile of the original 𝐒𝐿𝑅 within the null distribu E tion. Communications with 𝑝-value < 0.05 𝐼𝐽
are considered significant.

Optimization
The optimal transport mapping was calculated using the fused_gromov_wasserstein function from the POT package with L2 loss function, and La maximum of 10,000 iterations. The spatial embedding based on the SpaceFlow implementation Iwas run with spatial regularization strength 0.1, 0.001 learning rate, 1000 epochs, and 50 latent dRimensions. The cell refinement step of CellRefiner was run with ℎ = 20 and 10 iterations. Top 5 cells was assigned to each spot for pseudo ST data of MERFISH, seqFISH, STARmap and slideseq, as well as Visium data of human SCC, mouse kidney, mouse lymph node and mouse cortex. Top 4 cells were assigned to each spot for the pseudo ST data of seqFISH+ due to the small cell number in this dataset. The cell shape modeling was run with time step of 0.04 and 2000 interations.

Parameter Selection
The parameters 𝑈 ,𝑉 ,𝑐 ,𝑐 in the Morse potential (equation 3) were chosen such that a certain 0 0 1 2 equilibrium distance between particles is achieved. The equilibrium radius was chosen as the minimum distance between spot centers multiplied by 0.35. The equilibrium radius turned out to be 210 μ𝑚 for STARmap, 19 μ𝑚 for Slide-seq V2, 0.016 for MERFISH, and 0.041 for seqFISH. In the cell shape modeling, the cell radius scaling factor was set to 2.5 for the Visium data of human SCC, mouse kidney, mouse lymph node and mouse cortex and to 3.0 for the seqFISH+ data of mouse cortex. To achieve a target equilibrium radius in different datasets, we used the following values of 𝑈 ,𝑉 ,𝑐 ,𝑐 , STARmap: 0 0 1 2 (2.68, 29.48, 32.42, 50.92); Slide-seqV2: (0.68, 7.52, 8.27, 12.98); MERFISH: (5.61×10−4, 6.18×10−3, 6.79×10−3, 1.07×10−2); seqFISH mouse embryo: (1.39, 15.33, 16.86, 26.48); seqFISH+ mouse cortex: (2.58,28.38,31.22,49.02); Visium mouse kidney: (2.34, 25.79, 28.37, 44.55); Visium mouse lymph node: (1.87, 20.60, 22.66, 35.59); Visium mouse cortex: (3.65, 40.13, 44.15, 69.32); human SCC: (3.48, 38.25, 42.08, 66.08).

Evaluation metrics
The KL-divergence was calculated to compare the ground trutEh spatial distribution of a cell type with the spatial distribution of a comparison dataset’s corresponding cells, across every cell type with at least 5 cells. Given two 2D point clouds corresponding to the respective spatial distributions of the cells, we create a 100 by 100 grid over the region boundIed by the min and max of the point clouds. We then evaluate the densities 𝑝(𝑥) and 𝑞(𝑥) as histograms at the grid points 𝑥 . The densities are normalized, 𝑖 from which we then calculate the kl divergence:

𝑝(𝑥 )+𝜖
𝑖
𝑅𝐾𝐿(𝑝,𝑞) = ∑𝑝(𝑥 𝑖 )log ( 𝑞(𝑥 )+𝜖 ). (12)
𝑖
𝐴 𝑖

The Wasserstein metric is used similarly for each pair of cell types with least 5 cells. First, we compute a cost matrix using the Euclidean distance between the ground truth cells’ spatial coordinates and the comparison cells’ spatial coordinates. Then find the Wasserstein distance using the emd2 function from the POT toolbox64, which solves the earth movers distance problem with uniform weights. For comparing spatial distributions, we implement a Ripley’s L-function 𝐿(𝑟) for each cell type in the dataset by estimating the K-function 𝐾(𝑟) and transforming it. 𝑎 is the area of the region, 𝑛 the number of points, 𝐼 the indicator function and 𝑑 the distance between two points. The max radius 𝑟 is chosen by taking a 𝑖𝑗 quarter of the minimum dimension of the bounding box containing the spatial region. The mean squared error over 20 bins is used as the evaluation metric.

𝑎
𝐾(𝑟) = ∑∑𝐼(𝑑 ≤ 𝑟) (13)
𝑛(𝑛−1) 𝑖𝑗
𝑖 𝑗

𝐾(𝑟)
𝐿(𝑟) = √( )
𝜋

Neighborhood enrichment score was calculated using Squidpy42 to find clusters that are neighbors in the tissue of interest. This is done by generating a spatial connectivity graph across cells and observing the number of edges between different clusters. A permutation test on the cluster labels is performed with 𝑛 = 1000 to create a distribution of expected counts under the null hypothesis of no spatial enrichment. We compute a z-score between each pair of clusters to get the neighborhood enrichment score, with a high z-score indicating significant enrichment.

The perturbed MERFISH data used for evaluation was generated using Gaussian noise with sigma 0.02.
CellRefiner was run for 10 iterations with time step 0.5 and hyperparameter m=0.025.

For benchmarking, Cytospace was run using 5 cells per spot and default parameters otherwise, with a spatial location radius of .016 on seqFISH+ and MERFISH datasets, 300 microns for STARmap, and 80 microns for SlideseqV2. Celltrek was run with PCA reduction to 30 components, nonlinear interpolation with 5000 points, 1000 tree randomI forest ,0.55 distance threshold, max of 5 spots per cell, spot_n=5, repel_r=20, repel_iter=20). TRangram was run with default settings and 500 epochs for training.

Peer review rounds
[{"round": 1, "reviewer_comments": {"reviewer_2": "The authors have made substantial revisions and addressed my major concerns from the first review. The manuscript has been significantly improved in both methodology and clarity. I only have two minor comments for further refinement:\n1.As shown in Supplementary Fig. 3, the performance of CellRefiner decreases on rare cell types (<5% of the population). While the authors acknowledge this limitation as a caveat, no strategy is provided to mitigate the issue. This could be an important pain point in real applications, especially for studies focusing on rare immune or stem cell populations. A brief discussion on potential future directions to handle rare cell types would strengthen the manuscript.\n2.The font size in the main figures is not uniform, which affects readability. For example, the bar plots in Fig. 2d and Fig. 3c use noticeably smaller fonts compared to other panels. I recommend revising the figure texts to ensure consistency with journal formatting requirements.\n(Remarks on code availability)\nThe reproducibility of the figures is very good.", "reviewer_3": "I was asked to advise whether the authors have appropriately addressed the concerns of Reviewer #1.\nI find the comments of reviewer #1 reasonable, focusing mainly on two aspects. First, demonstrating biological relevance of task addressed by the method and the interpretability of the results. Second, addressing the limitations related to applicability and false positive results.\nThe authors have made an effort to address the comments and have made changes to their method introducing a new aspect of their method in the direction of modeling cell shapes to address directly comment 3 of reviewer #1 and have expanded their results to demonstrate biological relevance through added results of downstream cell-cell communication analysis.\nMajor concerns remain about the revised version of the manuscript.\nThe responses to Comments 1–3 rely heavily on the new cell–cell communication analysis and the results subsection “CellRefiner provides insight into contact-based cell–cell communication.”\nThe identification of communication patterns appears circular. The model infers cell coordinates based on the sum of four force terms, one of which is a “force determined by ligand-receptor interactions,” calculated as a function of ligand and receptor expression pairs informed by the CellChat database. The subsequent evaluation of cell–cell communication patterns in the reconstructed space again depends on a communication score derived from these same ligand-receptor pairs and the same database (see Methods subsection “Contact-based signaling analysis”).\nSince the the location is determined, in part, by optimizing for the ligand-receptor patterns, it would be surprising if CellRefiner didn't recover these same patterns. While these analysis may be used to show that CellRefiner accurately takes into account the different forces, this doesn't show the biological relevance of CellRefiner. The cell-cell communication between clusters or niches or layers can be performed also without reconstructing the single-cell resolution.\nSince the inferred locations are determined, in part, by optimizing for ligand-receptor expression patterns, it is unsurprising that CellRefiner recovers those same patterns in downstream analysis. While this may demonstrate internal consistency in solving the optmization task, it does not establish biological relevance. Moreover, cell-cell communication between clusters, niches, or tissue layers can be analyzed without reconstructing single-cell spatial positions.\nComment 4 has been addressed.\nRegarding Comment 5, I would not consider a direct comparison to CeLEry strictly necessary in the absence of a relevant downstream task, provided the tool cannot be reasonably executed. However, if comparison is deemed essential, it could be performed on a subset of the dataset used in the CeLEry publication, where results should be reproducible.\nThe responses to Comments 6 and 7 are more concerning. The authors seem to confirm that CellRefiner reconstructs only the positions of abundant cell types only, without taking additional steps to address these comments. This limitation again raises questions about the biological relevance of the reconstructed spatial structure and the potential for meaningful downstream analyses.\nComment 8 was addressed, but the reported runtime scaling is unexpected. It appears to increase sub-linearly with the number of cells (1000 - ~20s, 2000 - ~40s, 4000 - ~60s, 7000 - ~80s) This is inconsistent with the stated linear time and space complexity of the algorithm. Furthermore, the dataset sizes used are too small to convincingly demonstrate scalability. A single Visium slide contains approximately 5000 spots, each capturing 1-10 cells. The authors should therefore scale up their analysis and explicitly report the hardware configuration and any paralelization or other acceleration used for runtime evaluation."}, "author_response": "Response to Reviewer 2\nGeneral comments:\nThe authors have made substantial revisions and addressed my major concerns from the\nfirst review. The manuscript has been significantly improved in both methodology and\nclarity. I only have two minor comments for further refinement.\n(Remarks on code availability): The reproducibility of the figures is very good.\nResponse: We thank the reviewer for the constructive comments, which have helped\nsubstantially improve the manuscript. Our detailed responses to the two remaining points\nare listed below.\nSpecific comments:\n1. As shown in Supplementary Fig. 3, the performance of CellRefiner decreases on rare\ncell types (<5% of the population). While the authors acknowledge this limitation as a\ncaveat, no strategy is provided to mitigate the issue. This could be an important pain point\nin real applications, especially for studies focusing on rare immune or stem cell\npopulations. A brief discussion on potential future directions to handle rare cell types\nwould strengthen the manuscript.\nResponse: We thank the reviewer for bringing up the limitation on low-abundance cell\ntypes, which is a common challenge for computational approaches. As you mentioned,\nwe do observe a decrease in performance of CellRefiner on low-abundance cell types.\nThe drop in performance is because that the cells with low abundance are likely excluded\nin the initial mapping due to the unbiased random subsampling. In this revision, we have\nadded an optional step to better handle these cells, by post hoc mapping user-specified\ncell types on top of the initial mapping. This additional treatment leads to substantial\nimprovement in performance on these cell types (new Supplementary Fig. 7). In the\nrevised manuscript, we have added discussion on limitations when handling low-\nabundance cells and added details about the optional treatment of such cells in Methods.\n2. The font size in the main figures is not uniform, which affects readability. For example,\nthe bar plots in Fig. 2d and Fig. 3c use noticeably smaller fonts compared to other panels.\nI recommend revising the figure texts to ensure consistency with journal formatting\nrequirements.\nResponse: We thank the reviewer for raising this point. We have increased the font size\nin all figures.\nResponse to Reviewer 3\nGeneral comments:\nI was asked to advise whether the authors have appropriately addressed the concerns of\nReviewer #1.\nI find the comments of reviewer #1 reasonable, focusing mainly on two aspects. First,\ndemonstrating biological relevance of task addressed by the method and the\ninterpretability of the results. Second, addressing the limitations related to\napplicability and false positive results.\nThe authors have made an effort to address the comments and have made changes to\ntheir method introducing a new aspect of their method in the direction of modeling cell\nshapes to address directly comment 3 of reviewer #1 and have expanded their results to\ndemonstrate biological relevance through added results of downstream cell-cell\ncommunication analysis.\nMajor concerns remain about the revised version of the manuscript.\nResponse: We thank the reviewer for the careful evaluation of our manuscript and for\nacknowledging the efforts made in the previous round of revision. We value the reviewer’s\nconstructive assessment of remaining concerns. In this revision, we have carefully\naddressed these points. Specifically, we have resolved the concern regarding the\npotential circularity in CCC analysis and computational scalability. We have also provided\na new module to handle low-abundance cell types. Detailed responses to these specific\npoints are provided below.\nSpecific comments:\n1. The responses to Comments 1–3 rely heavily on the new cell–cell communication\nanalysis and the results subsection “CellRefiner provides insight into contact-based cell–\ncell communication.”\nThe identification of communication patterns appears circular. The model infers cell\ncoordinates based on the sum of four force terms, one of which is a “force determined by\nligand-receptor interactions,” calculated as a function of ligand and receptor expression\npairs informed by the CellChat database. The subsequent evaluation of cell–cell\ncommunication patterns in the reconstructed space again depends on a communication\nscore derived from these same ligand-receptor pairs and the same database (see\nMethods subsection “Contact-based signaling analysis”).\nSince the location is determined, in part, by optimizing for the ligand-receptor patterns, it\nwould be surprising if CellRefiner didn't recover these same patterns. While these\nanalyses may be used to show that CellRefiner accurately takes into account the different\nforces, this doesn't show the biological relevance of CellRefiner. The cell-cell\ncommunication between clusters or niches or layers can be performed also without\nreconstructing the single-cell spatial positions.\nSince the inferred locations are determined, in part, by optimizing for ligand-receptor\nexpression patterns, it is unsurprising that CellRefiner recovers those same patterns in\ndownstream analysis. While this may demonstrate internal consistency in solving the\noptmization task, it does not establish biological relevance. Moreover, cell-cell\ncommunication between clusters, niches, or tissue layers can be analyzed without\nreconstructing single-cell spatial positions.\nResponse: We thank the reviewer for identifying this potential circularity in the method.\nUpon re-examining this point, we realized that the LR force was unused in the previously\npresented results. This was due to a singularity check of the LR force matrix which was\nalmost always singular due to the sparsity of LR interactions. Thus, LR force was not\nincorporated in the combined force of the CellRefiner model. We have confirmed that all\nresults related to CCC presented in the revised manuscript do not incorporate LR forces\nwhen performing spatial refinement, and therefore, the potential circular issue does not\naffect any of the reported findings.\nTo further clarify this point, we performed an experiment in comparing the results with\nand without using LR forces in the spatial placement (new Supplementary Fig. 8). We\nobserve that compared to results obtained without LR forces, adding LR forces only\ncauses very minor local displacement of cells, on average, less than 20% of cell radius.\nEven for outliers, the displacement is at most comparable to cell radius. In evaluating\ncontact-based CCC inference, incorporating LR forces leads to only marginal\nimprovement, with performance nearly identical to that obtained without LR forces. We\nkeep the LR-force as an optional module in the framework because it is conceptually\nimportant, fully compatible with the model design, and may become useful when LR\ninteraction data is denser or more reliable.\n2. Comment 4 has been addressed.\nResponse: We thank the reviewer for confirming that Comment 4 has been addressed.\n3. Regarding Comment 5, I would not consider a direct comparison to CeLEry strictly\nnecessary in the absence of a relevant downstream task, provided the tool cannot be\nreasonably executed. However, if comparison is deemed essential, it could be performed\non a subset of the dataset used in the CeLEry publication, where results should be\nreproducible.\nResponse: We thank the reviewer for clarifying the suggestion about comparing to\nCeLEry. We would like to clarify that CeLEry is designed for the scenario with high-\nresolution spatial data serving as training set, while the focus of CellRefiner and other\ncompared methods (Tangram, Cytospace, and CellTrek) is on mapping single cells from\nscRNA-seq to low-resolution spatial data. They therefore are designed for different\napplication scenarios. In this revision, we have added a comparison to CeLEry using a\ndataset where CeLEry has been applied under the CeLEry setup (training on high-\nresolution ST data). When we apply CeLEry to our setup (training on low-resolution ST\ndata and assuming the high-resolution ST data as unknown), CellRefiner significantly\noutperforms CeLEry. We believe this comparison clarifies the different application\nscenarios of the method but is not central to the main evaluation. Therefore, we have\nincluded this analysis in the Supplementary Information (new Supplementary Fig. 3).\n4. The responses to Comments 6 and 7 are more concerning. The authors seem to\nconfirm that CellRefiner reconstructs only the positions of abundant cell types only,\nwithout taking additional steps to address these comments. This limitation again raises\nquestions about the biological relevance of the reconstructed spatial structure and the\npotential for meaningful downstream analyses.\nResponse: We thank the reviewer for raising this very important point. We have carefully\nevaluated the reason for the low performance on low-abundant cell types and found that\nit is because such cells are likely excluded in the initial mapping due to an unbiased\nsubsampling. According to this, in this revision, we address the issue by refining the initial\nmapping step. Specifically, we have added an additional module to the CellRefiner\nworkflow, that further maps user-specific cell types, particularly the low-abundant cells, to\nthe spatial spots. As a result, we observe relative uniform performance on cells with vary\nabundance (new Supplementary Fig. 7). In the revised manuscript, we have added the\nfollowing clarification sentence.\n“CellRefiner also addresses low-abundance cell types by explicitly including an option to\nmap specified cell types. Following the initial global mapping of cellular populations to\nspatial spots, user-specified low-abundance cell types are then mapped to spots using\ngene expression similarity. This targeted allocation prevents the signals of low-\nabundance cells from being overshadowed by more abundant neighboring populations.\nThe spatial refinement then optimizes the position of all the mapped cells (Supplementary\nFig. 7).”\nWe have also added details of the additional mapping step in the Methods section.\n5. Comment 8 was addressed, but the reported runtime scaling is unexpected. It appears\nto increase sub-linearly with the number of cells (1000 - ~20s, 2000 - ~40s, 4000 - ~60s,\n7000 - ~80s) This is inconsistent with the stated linear time and space complexity of the\nalgorithm. Furthermore, the dataset sizes used are too small to convincingly demonstrate\nscalability. A single Visium slide contains approximately 5000 spots, each capturing 1-10\ncells. The authors should therefore scale up their analysis and explicitly report the\nhardware configuration and any parallelization or other acceleration used for runtime\nevaluation.\nResponse: We thank the reviewer for identifying this inconsistency. We apologize for the\ninaccuracy in the previous version where the theoretical linear complexity comes from the\ncell listing algorithm used by the spatial refinement part of CellRefiner. The full pipeline\ndoes not have linear scaling. In the revised manuscript, we have evaluated the\ncomputational efficiency on a wide range of number of cells, from 1,000 to 40,000, where\nthe CellRefiner computation can still be carried out efficiently with over 40,000 cells (new\nSupplementary Fig. 6). This demonstrates the practical usability of CellRefiner. Due to\nthe various components of the pipeline, the theoretical complexity analysis may be difficult\nto interpret for practical applications and thus we present the empirical efficiency instead."}, {"round": 2, "reviewer_comments": {"reviewer_2": "I appreciate the authors' detailed response regarding the handling of low-abundance cell types. The addition of the optional post-hoc mapping step appears to effectively mitigate the performance drop on rare cell populations, as demonstrated by the improvements shown in the new Supplementary Figure 7.\nFurthermore, the readability of the figures has been improved with consistent font sizes as requested.\nI have no further comments and recommend the manuscript for publication.", "reviewer_3": "The authors have addressed the majority of my comments. I have two remaining concerns.\n1. Regarding comment 1, since the LR force term had essentially no effect on the localization and only adds to the computational complexity of the approach the authors might consider removing the term completely. The added experiments do not show a use case where this term is useful. Alternatively the observation that \"incorporating LR forces leads to only marginal improvement, with performance nearly identical to that obtained without LR forces\" should be clearly stated not only in the discussion but also in the results section to avoid any confusion.\n2. Regarding comment 4, the authors should align the x-axes (cell-type labels) of Supplementary Figure 7 a and b. Please also check that the reported average mapping errors are correct. Looking at Supplementary Figure 7c, both spatial coordinates are in the range [0,1]. In such case the average reported error close to 0.5 for many cell types (even more frequent ones) is comparable to the expected error of randomly placed cells which is concerning. To Supplementary Figure 7b please add a baseline average mapping error based on a randomly placed cells per cell type to clarify this."}, "author_response": "Response to Reviewer 2\nI appreciate the authors' detailed response regarding the handling of low-abundance cell\ntypes. The addition of the optional post-hoc mapping step appears to effectively mitigate\nthe performance drop on rare cell populations, as demonstrated by the improvements\nshown in the new Supplementary Figure 7.\nFurthermore, the readability of the figures has been improved with consistent font sizes\nas requested.\nI have no further comments and recommend the manuscript for publication.\nResponse: We thank the reviewer for their positive assessment and for the constructive\ncomments which have significantly improved the manuscript.\nResponse to Reviewer 3\nThe authors have addressed the majority of my comments. I have two remaining\nconcerns.\nResponse: We thank the reviewer for the constructive suggestions. Our detailed\nresponses to the two remaining points are provided below.\n1. Regarding comment 1, since the LR force term had essentially no effect on the\nlocalization and only adds to the computational complexity of the approach the authors\nmight consider removing the term completely. The added experiments do not show a use\ncase where this term is useful. Alternatively the observation that \"incorporating LR forces\nleads to only marginal improvement, with performance nearly identical to that obtained\nwithout LR forces\" should be clearly stated not only in the discussion but also in the results\nsection to avoid any confusion.\nResponse: We thank the reviewer for the suggestion to further clarify the point. In the\nrevised manuscript, we have added a clarification at the place where LR force is first\nintroduced (Results – Overview of CellRefiner): “In ablation analysis, incorporating LR\nforces leads to only marginal improvement, with performance nearly identical to that\nobtained without LR forces. We therefore treat the LR term as optional.”\n2. Regarding comment 4, the authors should align the x-axes (cell-type labels) of\nSupplementary Figure 7 a and b. Please also check that the reported average mapping\nerrors are correct. Looking at Supplementary Figure 7c, both spatial coordinates are in\nthe range [0,1]. In such case the average reported error close to 0.5 for many cell types\n(even more frequent ones) is comparable to the expected error of randomly placed cells\nwhich is concerning. To Supplementary Figure 7b please add a baseline average mapping\nerror based on a randomly placed cells per cell type to clarify this.\nResponse: We thank the reviewer for raising this important point. First, we would like to\nclarify the reason for the observed large error. The error was computed for each individual\ncell between their location in ground-truth and their mapped location, and then averaged\nover all cells within each cell type. This evaluation could result in large error even for high\nquality mapping. For example, randomly switching locations of cells of the same type\nwould still be an accurate mapping but will lead to large errors. In the revised manuscript,\nwe have followed the reviewer’s suggestion and added baseline errors for random\nmapping (Supplementary Figure 7c), which shows that while the errors are relatively large,\nthey are much lower than random baselines.\nAdditionally, to mitigate the limitation of unreasonably large error due to assessing\nindividual cells, we have added an evaluation using Wasserstein distance between the\nground-truth distribution and the mapped distribution of each cell type. This new metric\nshows much smaller error (<0.1 for abundant cell types and mostly <0.2 for less abundant\ncell types).\nWe have also aligned the x-axes for the three panels (a-c) in the revised Supplementary\nFigure 7."}]

Decision letter