DeSpotX: Identifiability-Based Decontamination for Spatial Transcriptomics
Anonymous authors
ICLR 2027
TL;DR. We introduce DeSpotX, an identifiability-based decontamination method for spatial transcriptomics that uses anchor genes to provably separate native expression from contamination.
Abstract. Spatial transcriptomics (ST) at single-cell resolution profiles gene expression in its native spatial context, but a substantial fraction of transcripts contaminate neighboring cells, compromising downstream biological analyses. Existing decontamination methods either ignore the spatial structure of contamination or aggregate over neighbors without constraining how contamination is separated from native expression, leaving the decomposition ambiguous. To resolve this ambiguity, we introduce DeSpotX, a deep generative model that uses anchor genes, defined as genes not natively expressed in a given cell cluster, to constrain the contamination decomposition. DeSpotX further uses spatial information to estimate contamination locally through a cluster-masked, distance-weighted average over neighboring cells. On spike-in simulations across five datasets and four ST platforms, DeSpotX attains the highest AUROC in 27 of 30 benchmark settings, exceeding the best baseline by up to 0.12, and remains robust to inaccuracies in the cell-cluster annotation and in anchor gene construction. Using matched scRNA-seq as an independent reference for cell-type-specific expression, DeSpotX retains 94% of within-type signal while improving marker-gene specificity. Decontaminated expression also shows greater spatial coherence and yields cell-cell communication networks consistent with known biology. Finally, iterating between decontamination and cell-cluster annotation refines these outcomes, reassigning ligand-receptor signaling to expected source cells in mouse brain and breast cancer tissues.
Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.
Claim this paperedit · history
ICLR 2027
Under review · 3 reviews · OpenReview
Updated 25 Nov 2026, 10:41 UTC.
- Rating
- 3/4(+1)
- Confidence
- 3/4
- Soundness
- 2/3
- Presentation
- 3/3
- Informativeness
- 2/3
Read review
Summary
In this study, the authors introduced DeSpotX, a deep generative model to address contamination in single cell resolution spatial transcriptomics. It integrated anchor genes with spatially informed contamination estimation to distinguish native gene expression from the transcripts from neighboring cells. The authors performed extensive benchmarking across several datasets and technologies, and showed it outperforms existing methods. The authors further show that decontamination improves downstream analysis including marker gene specificity, spatial coherence and inferred cell-cell communication.
Strengths
The method is well designed and novel. Most of the claims are well supported by the experiments.
Weaknesses
- The deep investigation of the anchor gene selection is lacking.
- There is potential circularity in validation.
- The spatial validation in the higher resolution is missing.
- There are some caveats in cell-cell communication analysis.
- The quantitative evaluation for clustering needs more metrics.
Questions for the authors
- About the anchor genes, I wonder if the number of anchor genes should be adjusted by the size of the clusters. Or whether these two are highly correlated? Whether the cluster with a higher number of cells should have a higher number of anchor genes?
- Whether the anchor genes used in the model are overlapped with marker genes which were shown in Figure 3? If overallped, it’s a circularity about the argument. The validation or the conclusion drawn in Figure 3 should be independent of the anchor genes. Or the anchor genes used in the model should be removed for all downstream analysis.
- For clustering shown by UMAP in Figure 3, I wonder if there is a quantitative way to show the separation of clusters after decontamination is better than before.
- Table 10, I wonder if the bold column should be the “anchor” one?
- For Figure 4, the authors showed the expression is spatially coherent, but some panels are full of signals, for example, panels b and d, which makes it hard to visually see. I wonder if the high-resolution cell type or subtype level analysis will be clear to showcase the spatial coherence. For instance, in MERFISH data, there is subtype level annotation for all cell types, the bottom panel could be replaced by some sparse cell subtypes. Overall, the evaluation on the subtypes or high-resolution level annotations would significantly improve the study.
- About the cell-cell communication analysis, I wonder if CellChat analysis used spatial information. If not, I suggest the authors use a spatial-aware method to do the analysis. Additionally, the results of changes between iterations are not convincing to make any conclusions since there is no ground truth to support which one is better or real. For example, in Figure 5e, the interactions on non-neurons are reduced after decontamination, which may be biased by the remaining signals. The authors should provide more analysis to show which interactions are shifted and which interactions keep left in the decontaminated dataset, and look for literature evidence to support the findings if possible. Otherwise, it’s hard to make a solid conclusion from the predicted CCC shift.
- It would be helpful to have some explanation for Figure 1 in the caption.
5 comments
Response to Reviewer fSmo (Part 2/2)
3. Quantitative evaluation of cluster separation (Weakness 5; Question 3)
Thank you for this suggestion. Yes. In addition to the kNN purity shown on the UMAPs (Figure 18), we added five metrics of cluster separation, and all of them improve after DeSpotX.
First, DeSpotX improves every metric on every dataset. We computed kNN purity in PCA space, the silhouette score, the Davies-Bouldin and Calinski-Harabasz indices, and the NMI between Leiden clusters and the published labels (Table R3). DeSpotX is also the best of all methods in 24 of the 25 combinations.
Table R3. Raw counts → DeSpotX with the published labels.
| Metric | Xenium_Breast | MERFISH_Brain | CosMx_NSCLC | Xenium5k_Breast | Stereo-seq_E14 |
|---|---|---|---|---|---|
| kNN purity, PCA ↑ | 0.772 → 0.943 | 0.927 → 0.992 | 0.501 → 0.828 | 0.365 → 0.814 | 0.742 → 0.936 |
| Silhouette ↑ | 0.027 → 0.179 | 0.058 → 0.244 | −0.094 → −0.003 | −0.045 → −0.036 | 0.047 → 0.168 |
| Davies-Bouldin ↓ | 2.574 → 1.667 | 2.034 → 1.427 | 4.427 → 2.554 | 6.975 → 2.659 | 2.561 → 1.665 |
| Calinski-Harabasz ↑ | 1,473 → 3,068 | 1,034 → 2,377 | 549 → 1,359 | 260 → 1,247 | 1,636 → 2,821 |
| Leiden NMI ↑ | 0.596 → 0.795 | 0.683 → 0.806 | 0.437 → 0.739 | 0.079 → 0.432 | 0.581 → 0.780 |
Second, to check that the gain does not come from the labels given to DeSpotX, we added an analysis with finer subtypes that no method receives. kNN purity in PCA space still rises on every dataset, from 0.232-0.832 to 0.429-0.910, and is the highest among all methods.
Details are in the revised Appendix N (Table 17).
4. Bold column of Table 10 (Question 4)
Thank you for catching this. We now bold the anchor column of Table 10 (Table 11 in the revised paper), which has the highest AUROC in every row, as in our other tables. We had bolded the non-anchor column because it tests whether the AUROC could come from the anchor mask alone, and the caption now states this instead.
Details are in the revised Table 11.
5. High-resolution spatial validation in Figure 4 (Weakness 3; Question 5)
Thank you for this suggestion. We replaced Figure 4a-e with subtype-level maps. Each panel now shows three subtypes, each with its marker, so the spatial coherence is much easier to see. The subtypes are the Allen subclasses on MERFISH_Brain, types transferred from reference atlases on CosMx_NSCLC, Xenium5k_Breast and Stereo-seq_E14, and subclusters of the raw counts on Xenium_Breast.
First, DeSpotX clears the marker from the surrounding cells and keeps it in the subtype. The share of the surrounding cells that detect the marker falls from 5.9-35.4% to 0.2-8.8%, while the subtypes keep 85.4-99.5% of their marker counts.
Second, DeSpotX is given only the paper's labels, not these subtypes, so this is an independent validation.
The new Figure 4 is in Section 4.3.2, and the values of each subtype are in Appendix Q (Table 19).
6. Caveats in the cell-cell communication analysis (Weakness 4; Question 6)
Thank you for these suggestions. We replaced CellChat with the spatial-aware CellChat v2 [1], and the conclusions hold (Figure 5d, 5e).
First, we listed which interactions are shifted and which are kept. On MERFISH_Brain, most lost interactions (14 of 18) are OPIOID interactions sent by non-neuronal cells, while neurons keep all of theirs. On Xenium_Breast, PTN interactions from cancer epithelial and endothelial cells are lost, and those from myoepithelial cells are kept.
Second, to see whether these shifts are real, we checked them against dissociated single-cell atlases and literature evidence. The senders that lose interactions barely express the ligand in the atlases, whereas those that keep them express it highly, consistent with neurons being the main source of enkephalin, the product of Penk [2].
Third, we tested whether the reduced interactions on non-neurons in Figure 5e are biased by the remaining signals. In the raw counts alone, their Penk is 17-26 times higher next to striatal neurons than farther away, consistent with contamination from these neurons.
Details are in the revised Section 4.3.3 and Appendix S (Figure 21).
7. Explanation of Figure 1 in the caption (Question 7)
Thank you for this suggestion. The caption of Figure 1 now explains the encoder, the decoder and the output, each with the equation that defines it.
Thank you again for the detailed comments, which have helped us improve the paper. We would be happy to answer any further questions.
Sincerely,
Authors
References
[1] Jin, Suoqin, Maksim V. Plikus, and Qing Nie. "CellChat for systematic analysis of cell–cell communication from single-cell transcriptomics." Nature protocols (2025).
[2] Le Merrer, Julie, et al. "Reward processing by the opioid system in the brain." Physiological reviews (2009).
Happy to clarify any remaining points
Dear Reviewer fSmo,
Thank you again for your detailed and helpful questions, which have improved the paper. We have responded to each of them and revised the paper accordingly.
We understand that this is a busy time. If you have a moment before the discussion period closes, we would be grateful to hear whether our responses address your concerns, and we would be glad to clarify any remaining points.
Best regards,
Authors
- Rating
- 3/4
- Confidence
- 3/4
- Soundness
- 2/3
- Presentation
- 2/3
- Informativeness
- 2/3
Read review
Summary
This paper addresses the ambiguity between endogenous expression and spatially transported contamination in single-cell-resolution spatial transcriptomics. DeSpotX combines a negative-binomial mixture model with cluster-specific anchor genes, defined as genes assumed not to be endogenously expressed in a cluster, and a local contamination profile computed from distance-weighted, cross-cluster neighbors. A GATv2 encoder estimates cell states and contamination fractions, and a cluster-conditioned decoder reconstructs native expression. The paper establishes identifiability when the contamination profile and exact anchor zeros are known, and gives conditional stability bounds for approximate inputs. Across five datasets and six synthetic contamination mechanisms, DeSpotX has the highest AUROC in 27 of 30 settings. Real-data analyses report 94% retention of within-type signal and improvements in marker specificity and spatial patterns.
Strengths
- A clearly defined estimation problem. The decomposition ambiguity is formalized in Eq. (1) and Lemma 1, with explicit assumptions and a constructive anchor-based result in Lemma 2. This provides a useful theoretical framing rather than presenting denoising purely as a network architecture.
- Spatially appropriate contamination modeling. The cross-cluster, distance-weighted profile in Eq. (3) addresses a limitation of global ambient profiles in methods such as SoupX and DecontX. Its integration into a cell-level mixture is a coherent methodological design.
- Broad quantitative evaluation. Five datasets covering several platforms and six injection mechanisms include both an on-model case and five off-model perturbations. AUROC and removal-magnitude relMAE are reported, rather than relying on a single metric (Tables 2, 4 and 5).
Weaknesses
- The identifiability guarantee is narrower than the learned model. Lemma 2 requires a known contamination profile and exact zero-valued anchor expression; the implementation instead estimates the profile from already-contaminated neighbors and imposes a soft anchor penalty. Lemma 4 is conditional on unmeasured errors and non-vanishing anchor mass. Thus the theorem does not establish identifiability of the trained end-to-end model. The paper should state this separation more prominently and empirically measure the conditions that govern its bound.
- The ingredients have substantial precedents, and their new interaction is incompletely isolated. SoupX already uses non-expressed genes to calibrate contamination, while spatial methods such as ResolVI account for neighbor effects. The novelty is their cell-level constrained, locally varying combination, not the individual elements or the elementary inversion theorem. A locally adapted SoupX/anchor estimator and an anchor-augmented spatial baseline under matched tuning would clarify the incremental contribution. Importantly, the Appendix F plug-in estimator reaches AUROC 0.916–0.929 versus DeSpotX 0.922–0.935 in transcript diffusion, although the learned model improves magnitude estimation more substantially.
- Ground-truth recovery on actual tissues remains unverified. The main numerical ground truth comes from contamination injected into real observed counts, which may already contain unknown native contamination. The five off-model simulations are useful but cannot fully cover biological cross-expression, segmentation effects, or genuinely unknown in situ contamination. Orthogonal experimental validation or carefully selected control transcripts would strengthen claims of biological recovery.
Questions for the authors
See the weakness.
3 comments
Response to Reviewer p2Ce (Part 1/2)
We thank you for the careful reading and the concrete suggestions on baselines and validation! We are glad that you found the theoretical framing of the estimation problem useful and the integration of the local contamination profile into a cell-level mixture coherent. Please find our responses to each weakness below.
1. Identifiability of the trained model and the conditions of Lemma 4 (Weakness 1)
Thank you for this suggestion. We agree, and the revised Introduction and Section 3.2 now state this separation explicitly. Lemma 2 guarantees identification when the contamination profile is known and the anchor zeros are exact. Lemma 4 then gives a conditional bound for the trained model, in terms of the deviations from these two conditions and the model fit. We measured these deviations where possible, and their effect on performance is small.
First, we measured the terms of Lemma 4 on the Xenium_Breast and MERFISH_Brain spike-ins at 20% contamination and on the real sections. The measured deviations are small (Table R1), and on all five real datasets at least 99.76% of cells have estimated contamination on their anchors.
Table R1. Terms of Lemma 4 on the trained model.
| Term of Lemma 4 | Measured ↓ | Xenium_Breast, spike-in | Xenium_Breast, real | MERFISH_Brain, spike-in | MERFISH_Brain, real |
|---|---|---|---|---|---|
| Profile error Δ | Error of the contamination mass on the anchors, relative to the true mass | 5.1% | – | 4.9% | – |
| Anchor zeros δ | Fitted native mass on the anchors | 0.024% | 0.055% | 0.016% | 0.034% |
| Anchor mass χ̂_A | Cells with χ̂_A < 0.01 | 1.0% | 0.83% | 2.3% | 0.045% |
| Native anchor expression η | Counts on the anchors, an upper bound | – | 4.6% | – | 3.2% |
Second, the remaining gap to the two conditions of Lemma 2 has little effect on performance. We supplied the true contamination profile or enforced the anchor zeros with a 10 times stronger penalty, and AUROC changes by at most 0.004 and relMAE by at most 0.042.
Details are in the revised Introduction, Section 3.2 and Appendix B.4.
2. Precedents of the ingredients and their interaction (Weakness 2)
Thank you for these concrete suggestions. The revised Section 2 now states that the novelty lies in the cell-level, locally varying combination. We also added the two baselines you suggested and isolated the parts of DeSpotX on the Xenium_Breast and MERFISH_Brain spike-ins.
First, we added a locally adapted SoupX and anchor-augmented ResolVI and SpaceBender. Some of them improve, but all remain well below DeSpotX, which runs at its default settings without per-setting tuning (Table R2).
Table R2. Existing methods with our local profile or anchors, mean ± std.
| Method | Xenium_Breast AUROC ↑ | Xenium_Breast relMAE ↓ | MERFISH_Brain AUROC ↑ | MERFISH_Brain relMAE ↓ |
|---|---|---|---|---|
| DeSpotX | 0.946 ± 0.014 | 0.536 ± 0.062 | 0.939 ± 0.015 | 0.642 ± 0.201 |
| SoupX | 0.667 ± 0.060 | 0.736 ± 0.100 | 0.634 ± 0.011 | 0.836 ± 0.048 |
| SoupX + local profile | 0.677 ± 0.020 | 0.736 ± 0.030 | 0.658 ± 0.019 | 0.782 ± 0.052 |
| ResolVI | 0.840 ± 0.010 | 0.818 ± 0.160 | 0.841 ± 0.025 | 1.312 ± 0.489 |
| ResolVI + anchors | 0.850 ± 0.004 | 0.785 ± 0.156 | 0.822 ± 0.013 | 1.155 ± 0.395 |
| SpaceBender | 0.812 ± 0.018 | 0.691 ± 0.135 | 0.840 ± 0.016 | 1.093 ± 0.461 |
| SpaceBender + anchors | 0.840 ± 0.016 | 0.686 ± 0.155 | 0.854 ± 0.016 | 1.112 ± 0.488 |
Second, we also replaced single parts of DeSpotX on the same spike-ins (Table R3). As you note for the plug-in estimator, replacing the network with the plug-in estimator of Lemma 2 or with EM estimates keeps a similar AUROC but greatly raises relMAE, so the learned model mainly improves magnitude estimation. Replacing the local contamination profile with a global one lowers AUROC and raises relMAE, so the local profile helps both detection and magnitude estimation.
Table R3. DeSpotX with one part replaced, mean ± std.
| Method | Xenium_Breast AUROC ↑ | Xenium_Breast relMAE ↓ | MERFISH_Brain AUROC ↑ | MERFISH_Brain relMAE ↓ |
|---|---|---|---|---|
| DeSpotX | 0.946 ± 0.014 | 0.536 ± 0.062 | 0.939 ± 0.015 | 0.642 ± 0.201 |
| Global contamination profile | 0.935 ± 0.007 | 0.636 ± 0.027 | 0.918 ± 0.007 | 0.661 ± 0.024 |
| EM estimates | 0.942 ± 0.014 | 0.771 ± 0.161 | 0.934 ± 0.014 | 1.212 ± 0.380 |
| Plug-in estimator of Lemma 2 | 0.940 ± 0.013 | 0.806 ± 0.185 | 0.936 ± 0.013 | 1.292 ± 0.473 |
Details are in the revised Section 4.2.2 and Appendix H (Tables 12 and 13).
Response to Reviewer p2Ce (Part 2/2)
3. Ground-truth recovery on actual tissue (Weakness 3)
Thank you for suggesting orthogonal validation and control transcripts. We added both on the real Xenium_Breast section, and a spike-in whose native counts hold no contamination.
First, since the real counts may already contain unknown contamination, we built a spike-in on dissociated scRNA-seq cells. DeSpotX's non-anchor AUROC rises from 0.930 on the paper's spike-in to 0.952, and its relMAE falls from 0.514 to 0.409. It still ranks first among the five methods.
Second, we added an orthogonal validation that also covers segmentation effects and unknown in situ contamination. Xenium records whether each transcript lies inside the nucleus. Since RNA from neighboring cells lands outside the nucleus, a gene with fewer nuclear transcripts than expected in a cell type is likely contaminated. The share of counts that DeSpotX removes correlates best with this signal, with a mean Spearman of 0.61, against 0.58 for SpaceBender, 0.51 for DenoIST, 0.45 for DecontX, 0.41 for SoupX and −0.16 for ResolVI. Where the number of nuclear transcripts is as expected, DeSpotX keeps 87.2% of the counts, against 72.9% for SpaceBender.
Third, to test biological cross-expression, we selected control transcripts. These are genes that the matched scRNA-seq shows are expressed both by a cell type and by a neighboring lineage, such as genes shared by myoepithelial and tumor cells, so their counts in that cell type are largely native and should be kept. DeSpotX keeps 92.0% of these counts overall, and 89.0% even in cells next to that lineage.
Details are in the revised Sections 4.2.2, 4.3.1 and 4.3.2 and Appendices D, E (Table 6) and Q.
We appreciate your comments, which have helped us improve the paper. We would be happy to answer any further questions.
Sincerely,
Authors
Happy to clarify any remaining points
Dear Reviewer p2Ce,
Thank you again for your careful reading and concrete suggestions, which have improved the paper. We have responded to each of them and revised the paper accordingly.
We understand that this is a busy time. If you have a moment before the discussion period closes, we would be grateful to hear whether our responses address your concerns, and we would be glad to clarify any remaining points.
Best regards,
Authors
- Rating
- 2/4(−1)
- Confidence
- 2/4
- Soundness
- 2/3
- Presentation
- 3/3
- Informativeness
- 2/3
Read review
Summary
The paper introduces DeSpotX, a method for removing contamination from single-cell-resolution spatial transcriptomics data. It combines cluster-specific anchor genes, assumed to have no native expression in the corresponding cluster, with a local contamination profile estimated from spatial neighbors belonging to other clusters. A graph attention encoder and a cluster-conditioned decoder are trained using a negative-binomial likelihood and an anchor penalty. The authors establish identifiability when the contamination profile is known and the anchor assumptions hold exactly, then analyze errors arising from approximate inputs and within-cluster contamination. Experiments cover five datasets, four platforms, several count-level contamination mechanisms, transcript-level diffusion, and downstream analyses of real tissues.
Strengths
Contamination in spatial transcriptomics can affect cell annotation, marker specificity, and inferred cell–cell communication. DeSpotX addresses the separation of native and contaminating expression at the count level, making the proposed correction relevant to several downstream workflows. The paper also evaluates both contamination detection and removal magnitude, which are distinct aspects of the problem.
The paper explains why a good fit to observed expression does not uniquely determine the native and contamination components. This provides a clear rationale for introducing anchor constraints. Although the identifiability argument is relatively elementary, it makes the assumptions behind the method easier to examine and gives the architecture a stronger justification than reconstruction performance alone.
Non-expressed genes provide information about contamination, while spatial neighbors provide information about its local composition. DeSpotX combines these complementary sources through cluster-specific anchors and a distance-weighted, cross-cluster contamination estimate. The contribution is primarily this integration into a per-cell model, rather than the use of non-expressed genes in isolation.
The evaluation includes five datasets across four platforms, with substantial variation in panel size and tissue context. DeSpotX achieves the highest or tied-highest mean AUROC in 27 of 30 dataset/mechanism combinations and the lowest relMAE in 27 of 30. The inclusion of mechanisms that depart from the model’s assumptions is valuable, even though these simulations do not eliminate all concerns about benchmark construction.
Weaknesses
Once the contamination profile is known and a valid anchor has nonzero contamination probability, identifying the contamination fraction follows directly from the mixture equation. The result is useful, but it is not a substantial new identifiability technique. Since the paper itself discusses previous use of non-expressed genes in SoupX, the strongest contribution appears to be the spatial formulation, learned estimation, and empirical validation. The presentation should distinguish these contributions from the novelty of the identification principle.
Dependence on cell-cluster labels at input time can be a bottleneck in tissues with ambiguous or novel states; while the iterative loop helps, failure modes when initial labels are severely wrong are not deeply quantified.
Anchor identification uses per-cluster detection thresholds; in tissues with pervasive low-level expression or shared markers, anchors may be sparse or noisy, potentially weakening guarantees.
Questions for the authors
Would the authors distinguish between the identification of components in a mixture that depends on the correct contamination profile and the recovery by the learned estimator with an anchor that is derived from the data? Which of the recoveries are supported by theory and which only by experiments?
Please note the distribution of estimated contamination mass on the anchor set, with a particular reference to cells having zero or very small contamination. Does the single-anchor experiment retain reliable estimates of contamination fraction for these cells or only aggregate AUROC?
Does the current simulation give an indication of the treatment quality of individual cells within homogenous clusters? (Appendix B.2) This would help readers see whether the residual described in Appendix B.2 affects all cells or only a part of them.
Please provide the thresholds and aggregation rules used to define expression presence or absence in the matched scRNA-seq analysis, the calculation underlying the 94% retention result, and the definition of macrophage-state retention.
Beyond stabilization of cluster metrics and interaction counts, is there evidence that iterations improve an independent measure of annotation or expression accuracy?
4 comments
Response to Reviewer joxp (Part 1/3)
Thank you for the thorough review and the helpful questions! We appreciate that you found the rationale for the anchor constraints clear and the inclusion of off-model contamination mechanisms valuable. We address each comment below.
1. Contributions and the identification principle (Weakness 1)
Thank you for this suggestion. The revised Section 2 now distinguishes our contributions from the identification principle. Our main contribution is to apply this principle to each cell, combining anchor constraints with a spatial contamination model and learning the per-cell decomposition from data. To show what the spatial formulation and the learned estimation add, we replaced each part of DeSpotX on the Xenium_Breast and MERFISH_Brain spike-ins (Table R1).
First, the spatial formulation helps both contamination detection and removal magnitude. Replacing the local contamination profile with a global one lowers AUROC and raises relMAE.
Second, the learned estimation is needed for the removal magnitude. Replacing the network with the plug-in estimator of Lemma 2 or with EM estimates keeps a similar AUROC but greatly raises relMAE.
Table R1. DeSpotX with one part replaced, mean ± std.
| Method | Xenium_Breast AUROC ↑ | Xenium_Breast relMAE ↓ | MERFISH_Brain AUROC ↑ | MERFISH_Brain relMAE ↓ |
|---|---|---|---|---|
| DeSpotX | 0.946 ± 0.014 | 0.536 ± 0.062 | 0.939 ± 0.015 | 0.642 ± 0.201 |
| Global contamination profile | 0.935 ± 0.007 | 0.636 ± 0.027 | 0.918 ± 0.007 | 0.661 ± 0.024 |
| EM estimates | 0.942 ± 0.014 | 0.771 ± 0.161 | 0.934 ± 0.014 | 1.212 ± 0.380 |
| Plug-in estimator of Lemma 2 | 0.940 ± 0.013 | 0.806 ± 0.185 | 0.936 ± 0.013 | 1.292 ± 0.473 |
Third, we also added our local profile to SoupX and our anchors to ResolVI and SpaceBender. Some of them improve, but all remain well below DeSpotX (AUROC at most 0.854, against 0.939-0.946 for DeSpotX), so the gain comes from integrating both into one per-cell model.
Details are in the revised Section 4.2.2 and Appendix H (Tables 12 and 13).
2. Dependence on cell-cluster labels (Weakness 2)
Thank you for raising this point. We quantified these failure modes by giving DeSpotX six kinds of wrong labels on the Xenium_Breast and MERFISH_Brain spike-ins.
- Novel state (M1). One cell type is left unannotated and absorbed into its most similar type.
- Ambiguous states (M2-M4). Cell types are merged to half their number (M2), cells are clustered without supervision into about 60 clusters (M3), or 30% of cells are relabeled as their most similar type (M4).
- Severely wrong initial labels (M5, M6). Unsupervised clusters are named by their majority type, leaving 17-38% of cells wrong (M5), or 50% of labels are random and re-annotated after one iteration of the loop (M6).
First, label errors reduce performance only slightly. AUROC drops by at most 0.031 and relMAE rises by at most 0.109 (Table R2). Even in the worst case, relMAE stays below that of SpaceBender, the best baseline without labels (0.642 and 0.965), and that of DecontX even with correct labels (0.749-0.808).
Second, the iterative loop corrects severely wrong initial labels. Starting from 50% random labels, one iteration raises the label accuracy from 50% to 77-94% and lowers relMAE from 0.62-0.64 to 0.54-0.56, close to 0.49-0.56 with correct labels (M6, 20% contamination).
Table R2. DeSpotX with correct and wrong labels at 20% contamination (40% is similar).
| Labels | Xenium_Breast AUROC ↑ | Xenium_Breast relMAE ↓ | MERFISH_Brain AUROC ↑ | MERFISH_Brain relMAE ↓ |
|---|---|---|---|---|
| Correct labels | 0.957 | 0.494 | 0.950 | 0.555 |
| M1 | 0.955 | 0.507 | 0.948 | 0.552 |
| M2 | 0.932 | 0.603 | 0.921 | 0.586 |
| M3 | 0.946 | 0.528 | 0.937 | 0.590 |
| M4 | 0.949 | 0.534 | 0.943 | 0.641 |
| M5 | 0.926 | 0.597 | 0.934 | 0.566 |
| M6 | 0.940 | 0.541 | 0.948 | 0.562 |
Details are in the revised Section 4.2.2 and Appendix I (Table 15).
Response to Reviewer joxp (Part 2/3)
3. Sparse or noisy anchors under shared markers or pervasive low-level expression (Weakness 3)
Thank you for raising these two cases. We added analyses for both, and in all of them every cluster keeps anchors and AUROC on non-anchor entries drops by at most 0.026.
First, we tested shared markers on real sections and spike-ins. We relabeled four real sections into finer subtypes that share markers. Every cluster still keeps at least 132 anchors, and more than 99.8% of cells have an anchor that receives contamination, as Lemma 2 requires. We also built spike-ins in which cells share markers with their neighbors, either by taking up to 50% of their expression from the neighboring type or by natively expressing the genes that contaminate them. After DeSpotX derives its anchors again, every cluster keeps at least 46 anchors. This is because sharing markers with a neighbor removes only those few genes from a cluster's anchors, and most of its anchors are markers of unrelated lineages, which it still does not express.
Second, we built spike-ins in which every gene gains pervasive low-level expression, and let DeSpotX derive its anchors again. Native expression on the new anchors does not increase, the cluster with the fewest anchors keeps 11-64 of them across settings, and DeSpotX keeps 76-86% of the added expression. This is because the per-cluster detection threshold is relative to each gene's highest-expressing cluster, so a gene expressed at a similar low level in every cluster does not become an anchor.
Details are in the revised Section 4.2.2 and Appendix I (Table 14).
4. Identification vs recovery by the learned estimator (Question 1)
Thank you for this question. The revised Introduction and Section 3.2 now distinguish the two. Lemma 2 guarantees identification when the contamination profile is known and the anchor zeros are exact. Lemma 4 then gives a conditional bound for the learned estimator with data-derived anchors, in terms of the deviations from these two conditions and the model fit. We measured these deviations where possible, and their effect on performance is small.
First, we measured the terms of Lemma 4 on the Xenium_Breast and MERFISH_Brain spike-ins at 20% contamination and on the real sections. The measured deviations are small (Table R3).
Table R3. Terms of Lemma 4 on the trained model.
| Term of Lemma 4 | Measured ↓ | Xenium_Breast, spike-in | Xenium_Breast, real | MERFISH_Brain, spike-in | MERFISH_Brain, real |
|---|---|---|---|---|---|
| Profile error Δ | Error of the contamination mass on the anchors, relative to the true mass | 5.1% | – | 4.9% | – |
| Anchor zeros δ | Fitted native mass on the anchors | 0.024% | 0.055% | 0.016% | 0.034% |
| Anchor mass χ̂_A | Cells with χ̂_A < 0.01 | 1.0% | 0.83% | 2.3% | 0.045% |
| Native anchor expression η | Counts on the anchors, an upper bound | – | 4.6% | – | 3.2% |
Second, the remaining gap to the two conditions of Lemma 2 has little effect on performance. We supplied the true contamination profile or enforced the anchor zeros with a 10 times stronger penalty, and AUROC changes by at most 0.004 and relMAE by at most 0.042.
Details are in the revised Introduction, Section 3.2 and Appendix B.4.
5. Contamination mass on the anchor set and the single-anchor experiment (Question 2)
Thank you for this question. With the default anchors, almost every cell receives contamination on its anchors. A stress test with one anchor per cluster leaves a subset of cells without contamination on their anchor. Even for these cells, DeSpotX's per-cell estimates track the injected contamination, not only aggregate AUROC.
First, with the default anchors, 99.76-100% of cells in the five real datasets have an anchor that receives contamination, with a median of 1.1-42.4 counts per cell. Even where a cell carries few such counts, its cluster shares one native profile, and every cluster with at least 10 cells carries at least 307 counts on its anchors.
Second, we built new spike-ins on Xenium_Breast and MERFISH_Brain in which we let the contamination fraction vary across cells, as clean and contaminated patches or as a gradient from 0 to 0.4, and ran DeSpotX with one random anchor per cluster. Here 58-68% of cells receive no contamination on their anchor. For these cells, the estimated injected fraction, the fraction of counts DeSpotX removes beyond what it removes before injection, correlates with the true one (Pearson 0.73-0.90) as well as for cells with contamination on their anchor (0.70-0.88).
Third, in the same spike-ins, DeSpotX correctly estimates near-zero contamination for the uncontaminated cells in the clean patches. 89-90% of them have an estimated injected fraction below 0.05, and this estimate separates clean from contaminated cells with AUROC 0.94-0.98.
Details are in the revised Appendices B.4 and I.
Response to Reviewer joxp (Part 3/3)
6. Treatment quality of individual cells within homogeneous clusters (Question 3)
Thank you for this question. Yes. The residual affects every cell that receives within-cluster contamination, in proportion to that contamination as Lemma 3 predicts, but it is below the sampling noise of the cell's own counts in 92-100% of cells.
First, we measured each cell's residual in the current simulation. In its spike-in where 70% of each cell's contamination comes from its own cluster, we ran DeSpotX twice, once as is and once with this within-cluster part removed. The difference between the two outputs, the within-cluster contamination left in each cell, matches the residual that Lemma 3 predicts for that cell (median ratio 0.99 and 1.01, Spearman 0.97 and 0.92 on Xenium_Breast and MERFISH_Brain).
Second, we built a spike-in in which each cell's contamination comes from its 12 nearest neighbors regardless of type, so cells inside homogeneous clusters receive only within-cluster contamination. For these 1,437 and 1,291 cells, the residual is below sampling noise in 98.5% and 93.0% of them.
Details are in the revised Appendix K.
7. Presence or absence, 94% retention and macrophage-state retention (Question 4)
Thank you for asking for these details. We added all three to the revised paper.
First, presence or absence. For each cell type and gene in the matched scRNA-seq, detection is the fraction of the type's cells with at least one count. The gene is present in the type if detection is above 50% and absent if it is below 1%, and genes in between are not used.
Second, the 94% retention means that DeSpotX keeps 94% of the raw counts of present genes, counting all cells and genes together. For each Xenium cell, we add up the counts of the genes present in its cell type, and divide the total over all cells after DeSpotX by that in the raw data.
Third, macrophage-state retention. The polarization of each macrophage is the mean z-score of eight M2 markers minus that of eight M1 markers. Strongly polarized cells are those whose raw polarization is more than one standard deviation from the mean. Retention is the mean absolute polarization of these cells after decontamination, divided by that of the same cells in the raw data.
Details are in the revised Section 4.3.1 and Appendix P.
8. Independent measures of annotation accuracy (Question 5)
Thank you for this suggestion. We checked the labels against independent references that the iterations never use, and the labels improve against all of them.
First, we compared the labels with the expert labels published with the two datasets [1,2]. From iteration 0 to iteration 5, many more cells change from a wrong to a correct label than the reverse, 2,658 against 438 on MERFISH_Brain and 1,904 against 932 on Xenium_Breast.
Second, we checked the labels with a held-out annotator and with cell types that the brain section should lack (Table R4). We annotated the counts at iteration 0 and iteration 5 with a CellTypist model that the iterations never use, and its labels agree better with the expert labels at iteration 5. The MERFISH_Brain section is registered to the Allen brain coordinates and contains no cerebellum, pons or medulla, so Bergmann glia and glycinergic neurons should be almost absent, and calls of both fall by iteration 5. Removing the same amount of counts at random gains much less, so the improvement comes from which counts DeSpotX removes.
Table R4. Labels at iteration 0 and iteration 5 checked against references outside the iterations.
| Check | Iteration 0 | Iteration 5 | Random removal |
|---|---|---|---|
| Held-out annotator agreement, Xenium_Breast ↑ | 0.500 | 0.547 | 0.511-0.515 |
| Held-out annotator agreement, MERFISH_Brain ↑ | 0.249 | 0.270 | 0.251-0.253 |
| Glycinergic neuron calls, MERFISH_Brain (45 in expert labels) ↓ | 1,258 | 883 | 1,104-1,195 |
| Bergmann glia calls, MERFISH_Brain (0 in expert labels) ↓ | 1,004 | 897 | 975-1,004 |
Third, we used spike-ins with known true labels and contamination. Starting from 50% random labels, one iteration of the loop raises the label accuracy from 50% to 77-94% and lowers relMAE from 0.62-0.64 to 0.54-0.56, close to 0.49-0.56 with correct labels.
Details are in the revised Section 4.3.3 and Appendices S (Table 20) and I (Table 15).
Thank you again for the thoughtful comments, which have helped us improve the paper. We would be happy to answer any further questions.
Sincerely,
Authors
References
[1] Yao, Zizhen, et al. "A high-resolution transcriptomic and spatial atlas of cell types in the whole mouse brain." Nature (2023).
[2] Janesick, Amanda, et al. "High resolution mapping of the tumor microenvironment using integrated single-cell, spatial and in situ analysis." Nature communications (2023).
Question about the rating change
Dear Reviewer joxp,
We noticed that your rating was changed from 3 (weak acceptance) to 2 (weak rejection) on November 16, after our response of November 13, without any comment. We have responded to each of your three weaknesses and five questions, and we would like to address any concern that remains. Could you let us know the reason for the change?
Best regards,
Authors
Comments on the paper
2 comments
Summary of Revisions
Dear Reviewers and ACs,
We thank the reviewers (joxp, p2Ce, fSmo) for their thoughtful and constructive feedback. We are encouraged that they found the theoretical framing and the anchor-based identifiability argument useful (p2Ce, joxp), the method well designed in its integration of anchor constraints with a local contamination profile (fSmo, p2Ce), and the evaluation across platforms and off-model mechanisms valuable (joxp, fSmo).
We have addressed every comment and revised the paper accordingly. All changes are marked in blue. The key revisions are as follows.
- Theory and the trained model (p2Ce, joxp). The Introduction and Section 3.2 now separate the identifiability guarantee of Lemma 2 from the trained model, and Appendix B.4 measures the terms of the conditional bound in Lemma 4.
- Contributions beyond the identification principle (joxp, p2Ce). Section 2 now acknowledges the precedents. We replaced single parts of DeSpotX and added our local profile or anchors to SoupX, ResolVI and SpaceBender (Section 4.2.2, Appendix H, Tables 12 and 13).
- Robustness of anchors and labels (joxp, fSmo). We added structured label errors, shared markers, pervasive low-level expression, cluster size, and a single-anchor test with spatially varying contamination (Appendix I, Tables 14 and 15).
- Validation on real tissue (p2Ce). We added a spike-in built on dissociated scRNA-seq cells (Appendix E, Table 6), an orthogonal validation from the nuclear position of transcripts, and control transcripts shared across lineages (Appendix Q).
- Downstream analyses (fSmo, joxp). We added an analysis of markers that are not anchors (Appendix M, Figure 17), five metrics of cluster separation (Appendix N, Table 17), subtype-level spatial maps (Figure 4, Table 19), spatial CellChat v2 (Figure 5, Appendix S), and independent checks of the iterations (Appendix S, Table 20).
- Clarifications (joxp, fSmo). We added the definitions behind the 94% retention and the macrophage-state retention (Appendix P), a per-cell analysis of the within-cluster residual (Appendix K), and a fuller caption for Figure 1.
We hope these revisions address the reviewers' concerns, and we would be happy to answer any further questions.
Sincerely,
Authors
Invitation for further discussion and questions
Dear Reviewers,
Thank you for the time and care you put into reviewing our paper. We have posted our responses to each of your comments and uploaded the revised paper, with all changes marked in blue.
As the discussion period ends soon, could you let us know whether our responses address your concerns? If any questions remain, we would be glad to clarify or provide further results.
Best regards,
Authors
From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.
Loading the discussion…
Response to Reviewer fSmo (Part 1/2)
Thank you for the many concrete suggestions! We are encouraged that you found the method well designed and novel, and most of the claims well supported by the experiments. We address each question below, together with the weakness it relates to.
1. Anchor gene selection and cluster size (Weakness 1; Question 1)
Thank you for this question. The number of anchor genes does not need to be adjusted by cluster size, since the two are not correlated and larger clusters do not benefit from more anchors. We added three analyses to show this.
First, the number of anchors does not depend on cluster size. Over the 103 clusters with at least 20 cells in the five real datasets, the Spearman correlation between the two is 0.02 (p = 0.86). Cluster sizes vary up to 1,056-fold within a dataset, but anchor counts only 1.6-4.5-fold, since an anchor is selected by the fraction of a cluster's cells that detect a gene, not by their number.
Second, a larger cluster does not need more anchors. We scored the paper's runs with one anchor per cluster (Figure 2c) separately for each cluster. Compared with all anchors, AUROC changes by at most 0.004 in both large and small clusters, including the largest ones, since Lemma 2 needs, for each cell, only one anchor that receives contamination, whatever the size of its cluster.
Third, giving larger clusters more anchors lowers accuracy. To test this directly, we reassigned the paper's anchor counts so that larger clusters receive more anchors and smaller clusters fewer, with the same total, and retrained DeSpotX. At 20% contamination, relMAE rises from 0.494 to 0.526 on Xenium_Breast and from 0.555 to 0.847 on MERFISH_Brain. The extra anchors are genes these clusters express, so they remove native expression.
Details are in the revised Appendix I.
2. Overlap of anchor genes with the Figure 3 markers (Weakness 2; Question 2)
Thank you for raising this possible circularity. We added analyses that leave the anchors out, and the conclusions hold.
First, the overlap is partial. DeSpotX selects anchors from the data as genes that a cell type rarely detects, without using the markers, so some off-target markers are anchors, but no canonical marker in the red boxes is. Among the off-target dots, 58 of 78 are anchors on Xenium_Breast, 11 of 45 on MERFISH_Brain, 38 of 45 on CosMx_NSCLC, 27 of 40 on Stereo-seq_E14 and 46 of 50 on Xenium5k_Breast.
Second, we left the anchors out and repeated the analysis on the off-target dots that are not anchors. DeSpotX still removes a median of 31-55% of their marker counts on the four datasets with enough such dots, against 2-7% for the canonical markers in the red boxes (Table R1).
Table R1. Median percentage of marker counts that DeSpotX removes per Figure 3a dot.
Third, we also left the anchor entries out of the spike-in scoring on all five datasets. DeSpotX still has the highest AUROC on every dataset (Table R2).
Table R2. AUROC ↑ on non-anchor entries, local cross-cluster spike-in, mean ± std across the five contamination levels.
Fourth, we also validated the downstream cell-cell communication analysis independently of the anchors. Using the raw counts and dissociated atlases, we found that the ligands behind the lost OPIOID and PTN interactions, such as Penk from non-neuronal cells in Figure 5e, are consistent with contamination.
Details are in the revised Section 4.3.1 and Appendices G, M (Figure 17) and S.