A cell's measured gene expression mixes two things: what the cell is (its lineage or type) and where it sits (the neighbors signaling to it, the local oxygen and contacts). Internet architects met the same entanglement when an IP address had to mean both "who this host is" and "where it is attached." Their fix, identifier–locator separation, gives each meaning its own field. Applications bind only to a stable identifier. A changeable locator handles routing. A mapping system translates one into the other. Because the identifier never depends on location, a host can move to a network it has never visited and keep its connections.
We propose to carry that contract, rather than the metaphor, into spatial transcriptomics, the family of assays that measure gene expression while keeping track of where in a tissue slice each measurement came from. The model has a persistent identity code for each cell. It is learned so that it stays the same across tissue locations, and it is anchored to dissociated single-cell RNA sequencing (RNA-seq), where cells are profiled after being separated from the tissue and so have their location stripped away. A separate locator code is computed only from the cell's neighborhood. A low-rank interaction lets the effect of a neighborhood depend on the cell type, without either code leaking into the other. The payoff we test is the networking one. The model should predict how a cell type will express genes in a niche where that type was never observed. A model that does not separate identity from location cannot reliably do this.
Core Claim
Current methods split into two camps, and neither delivers this kind of prediction for unseen cell-type and niche pairings. Deconvolution and alignment tools treat a cell type's profile as fixed everywhere. Stereoscope fits fixed negative-binomial profiles per type and only mixes them across spots (Single-cell and spatial transcriptomics enables probabilistic inference of cell type topography). Tangram aligns dissociated profiles to spatial measurements by cosine similarity, so any niche-induced shift distorts the match (Deep learning and alignment of spatially resolved single-cell transcriptomes with Tangram). Tangram 2, the closest existing work, does separate the two signals. It first maps cells to space, then fits a linear model in which a receiving cell's expression is its baseline plus a weighted tally of neighboring cell types (Inferring cellular communication through mapping cells in space using Tangram 2). Its interaction is additive, it maps first and corrects afterward, and the paper itself flags non-linear dependencies as open. At the other extreme, graph models such as DeepST learn representations that mix spatial position and expression from the start. They cluster well, but they have no stable identity to carry to a new place (DeepST).
Our claim has two parts. First, a strict separation contract with a cell-type-dependent interaction of small rank improves prediction for held-out pairings of identity and niche over both Tangram 2's additive model and unconstrained graph models. Second, mapping cells to locations after subtracting the predicted locator effect, instead of before, improves placement of cells whose expression changes strongly with their niche. Infiltrating immune cells and cells in hypoxic tumor cores are the motivating examples.
The Model
For cell or spot $c$ and gene $g$, we model the mean count $\mu_{cg}$ of a negative-binomial likelihood as
$$ \log \mu_{cg} = s_c + \alpha_g(z_c) + \beta_g(\ell_c) + \sum_{k=1}^{K} u_{gk}(z_c)\, v_k(\ell_c) + \pi_{g,p(c)} . $$
The symbols are as follows. $s_c$ is a size factor. $z_c$ is the identity code. $\ell_c$ is the locator code, a function only of the cell-type composition and distances of the cell's neighbors. $\alpha_g$ and $\beta_g$ are the identity and locator main effects. $u_{gk}$ and $v_k$ form a rank-$K$ interaction, where $u$ sees only identity and $v$ sees only location. $\pi_{g,p}$ is a gene-wise offset for measurement platform $p$.
The contract is enforced in three ways, each borrowed from a networking design.
The identity encoder is trained jointly on dissociated cells, where $\ell_c$ is set to a null "no neighborhood" value, and on spatial cells. Dissociated data therefore pin down what an identifier means. This mirrors ILNP, which anchors transport sessions and security associations to the 64-bit identifier alone (A proposal for unifying mobility with multi-homing, NAT, & security).
An adversarial penalty stops $z_c$ from predicting $\ell_c$. The same penalty, run in the other direction, stops $\ell_c$ from predicting the cell's own type.
The platform term is restricted to a per-gene offset that cannot interact with identity. This is the analogue of ILNP's observation that address translation rewrites locators but leaves identifiers untouched, and of VL2's host-side shim, which hides physical addressing from applications (VL2). We use it to address the cross-platform discrepancy that the large deconvolution benchmark identifies as a confounder affecting every tool it tested (A comprehensive benchmarking with practical guidelines for cellular deconvolution of spatial transcriptomics).
Prediction for an unseen pairing works because $u$ and $v$ are each learned from many pairings. The condition resembles multihoming: each identity must appear in at least two niches, and the graph linking identities to niches must be connected. We will report this condition per dataset rather than assume it holds.
Mapping becomes a resolve-then-route step. A dissociated cell is scored against a candidate location by comparing the observed spatial profile with the model's prediction for that identity at that locator. Its raw profile is not used for the comparison. We alternate between mapping and refitting the locator.
Research Program
We will build the model on top of Tangram 2's evaluation toolkit, Tangram2-evalkit. The toolkit generates synthetic tissues with controlled cell densities, interaction strengths and noise. We will extend it with non-additive, cell-type-specific niche effects whose rank and strength we control. This lets us show where Tangram 2's additive model breaks down, and whether our model's rank $K$ recovers the true structure.
On real data, the central resource is the human tonsil Slide-tags dataset used by Tangram 2. Slide-tags provides single-nucleus profiles with known positions, so the niche effects there have ground truth.
The core analysis is a new evaluation split. We hold out all cells of type $t$ found in niche cluster $n$, for many $(t,n)$ pairs. We then ask each model to predict their expression from the type's behavior elsewhere and the niche's effect on other types. A practical point decides whether this test means anything: niche clusters are defined from neighbor composition only, so a cell's own expression cannot leak into its niche label.
Baselines
The do-nothing reference assigns every held-out cell the mean dissociated profile of its type, with the platform offset. This is stereoscope's assumption that a type is fixed in space. Any model that cannot beat it has learned nothing about niches.
The strongest existing competitor is Tangram 2. It is the only method in our sources that explicitly separates intrinsic identity from neighborhood effects. On Slide-tags it is reported to predict interaction-induced expression correctly for 80% of tested genes (p < 0.01), and to keep a Jaccard score of about 0.8 under substantial noise against ten deconvolution tools (Tangram 2). We will run its released mapping and communication models on identical splits, gene panels and reference data. We give it the same hyperparameter search budget as our model, including the size of its neighborhood matrix. Beating it means two things. On the held-out pairings we must achieve higher gene-wise correlation between predicted and observed niche-induced shifts. At the per-gene criterion of its own Slide-tags test, we must recover a larger fraction of genes than it does on our split. A tie on in-distribution cells with a gain only on held-out pairings would still support the claim.
For mapping quality, Tangram serves as the alignment baseline. It is reported to predict 75% of held-out genes with spatial correlation above 0.4 in leave-one-out tests on MERFISH, an imaging-based spatial assay that measures a few hundred chosen genes per cell, here in mouse motor cortex (Tangram). CARD and Cell2location are included as deconvolution baselines because the 18-tool benchmark ranks them, with Tangram, as the overall top performers (benchmark). For that benchmark we found no single headline number on Lacuna to quote.
Three ablations isolate the key ingredients. Setting $K=0$ reduces our model to an additive identity-plus-locator model, which is Tangram 2's structure fit jointly. Removing the adversarial penalty and the dissociated anchoring leaves the same architecture without the contract. Mapping with raw dissociated profiles, rather than locator-corrected predictions, tests the resolve-then-route step.
Why not just…?
Why not just add pairwise interaction terms to Tangram 2's linear model? This is the most serious threat, and it is close to our $K=0$-plus-features ablation. A full table of cell-type-by-sender-type interactions per gene can fit any pairing it has seen. It has no shared structure for pairings it has not seen, so it should fall back to the additive prediction on held-out pairings. If an enriched linear model matches ours on the held-out split, then the low-rank interaction is unnecessary. We would report that result and keep only the mapping contribution.
Why not just train a graph neural network that predicts each cell's expression from its neighborhood, as DeepST-style models do? Such a model may fit in-distribution cells better than ours, and we expect it to. DeepST's median adjusted Rand index of 0.6 on DLPFC, a human prefrontal-cortex Visium dataset, beat STAGATE at 0.58 and BayesSpace at 0.51 (DeepST). These figures, however, measure clustering of spots that were seen during training. Its spatial smoothing has no identity that stays fixed when the neighborhood changes, so it has nothing to transfer to an unseen pairing. The held-out-pairing split measures exactly this. A graph model that wins there would refute our claim.
Why not just run differential expression of each cell type between niches? Pseudobulk tests per type and per niche do answer "does type $t$ change in niche $n$." They need cells of type $t$ in niche $n$, so they are undefined on held-out pairings. They are also underpowered for rare combinations. We will include them as an upper reference on pairings that have data, not as a competitor on unseen pairings.
Proposed Experiments
The first decisive check uses Tangram2-evalkit synthetic tissues and sweeps interaction rank and strength. The prediction is that our model and Tangram 2 tie when the true effects are additive. Our model should pull ahead as the true interaction rank rises, and its estimate of $K$ should track the true rank.
The second check is the held-out-pairing split on Slide-tags tonsil. Its success criterion is the Tangram 2 comparison described under Baselines. We report separately the pairings that violate the connectivity condition, where we predict failure.
The third check is mapping. On MERFISH mouse motor cortex with its paired single-nucleus RNA-seq, and on Slide-tags, we compare placement accuracy of resolve-then-route against raw-profile mapping. We focus on cell types whose expression shifts most between niches.
The fourth check tests the platform restriction. Across platform pairs from the 50-dataset deconvolution benchmark, we test whether a per-gene offset that cannot interact with identity is enough to absorb platform differences, by measuring cell-type proportion error. If it is not enough, then the analogy to address translation fails for this regime, and we will say so.
References
- Single-cell and spatial transcriptomics enables probabilistic inference of cell type topography
- Deep learning and alignment of spatially resolved single-cell transcriptomes with Tangram
- Inferring cellular communication through mapping cells in space using Tangram 2
- DeepST: A versatile graph contrastive learning framework for spatially informed clustering, integration, and deconvolution of spatial transcriptomics
- A proposal for unifying mobility with multi-homing, NAT, & security
- VL2: a scalable and flexible data center network
- A comprehensive benchmarking with practical guidelines for cellular deconvolution of spatial transcriptomics