Single-cell RNA sequencing measures which genes each cell expresses, but it first grinds the tissue into a suspension, so every cell loses its address. A standing problem is to put cells back where they came from, using spatial transcriptomics reference slices that keep gene expression tied to $(x, y)$ positions. Current approaches treat this as recovering absolute coordinates on a flat sheet. They either keep distances in a learned expression space proportional to physical distances, or regress coordinates directly. Navigation neuroscience offers a different view of how to estimate position inside a bounded space. Animals do not store absolute coordinates. They store distances and bearings to the walls, and their position estimates are sharp near walls and blur with distance from them. This proposal carries that idea over to tissue. A cell's transcriptome is treated as noisy evidence about its distance to each anatomical boundary, such as the pial surface, the white-matter border, or the tissue edge. The uncertainty of each distance estimate is allowed to grow with the distance itself. Position is then decoded by combining that evidence with the known shape of the target section.
The practical payoff has two parts. First, boundary-relative evidence should transfer to sections with a different size, curvature, or outline, where absolute-coordinate models misplace cells. Second, the method returns an honest uncertainty region per cell instead of a single point. The central empirical question is also a scientific one: does the positional information in a transcriptome actually decay with distance from anatomical boundaries? If it does not, the approach fails cleanly, and we will know that too.
Core Claim
Mapping dissociated cells into tissue works better, and gives better-calibrated uncertainty, when the model predicts distances to annotated anatomical boundaries with a variance that scales with distance, and then decodes position against the target section's geometry. Predicting absolute coordinates under a global distance-preservation constraint works less well.
The mechanism comes from two modeling lines. Burgess et al. and Barry model boundary vector cells, which are units tuned to a wall at a given distance and bearing. Their radial tuning widens with distance, and place fields arise as a thresholded sum of these units. Madl et al. recast this as Bayesian cue combination in which positional uncertainty grows in proportion to boundary distance, following Weber's law. That model explained 85% of the variance in rat place-field sizes on a linear track. We reuse the likelihood form, not the neuroscience claim.
Concretely, for boundary $b$ a network maps a cell's expression profile $g$ to a predicted distance $\mu_b(g)$. The likelihood of a candidate location $x$ inside the target section is
$$ p(g \mid x) \propto \prod_{b} \mathcal{N}\big(d_b(x);\ \mu_b(g),\ (\sigma_0 + k\,\mu_b(g))^2\big), $$
where $d_b(x)$ is the geometric distance from $x$ to boundary $b$, $\sigma_0$ is a floor noise level, and $k$ is a learned Weber fraction. The posterior over $x$ is this likelihood evaluated on a grid restricted to the section mask. It plays the role of a place field built from boundary units. If $k$ is learned to be near zero, the model reduces to ordinary constant-variance regression, so the data themselves decide whether the Weber structure is real.
Research Program
The work has three parts.
Training the distance model. On reference slices with boundary annotations, we fit the distance network jointly with $\sigma_0$ and $k$ by maximizing the likelihood above at each spot's true location. The network is a small expression encoder. We keep it simple on purpose, so that gains are attributable to the output geometry rather than to capacity.
Adding bearings. We add optional bearing terms for boundaries that are not convex. Only a distance can be read from a transcriptome, but along a curved pial surface the nearest-point direction varies. Including a von Mises bearing term on the local boundary normal tests whether direction adds anything beyond distance. This is where the boundary-vector framing either earns its keep or collapses to scalar distance regression.
Decoding and warping analysis. We decode on held-out sections whose outline and boundary annotations are known but whose expression-to-position pairing is hidden. This mirrors a realistic setting in which a histology image of the section exists but the cells were sequenced after dissociation. We also study where absolute-coordinate methods fail. The trapezoid experiments of Bellmund et al. and the calibration results of Strauß et al. show that non-rectangular enclosures distort metric representations that lack boundary anchoring. Our tissue analogue is sections cut to different widths and curved cortical ribbons of varying thickness.
The closest prior work, and the direct competitor, is dp-VAE (Zhou & Du, journal version). It trains a variational autoencoder whose latent distances between cells must stay within bi-Lipschitz bounds of their physical distances, and it recovers coordinates by a constrained scaling step. It has no notion of an enclosure, and its error model is the same everywhere in the section. We keep its task and its evaluation, and change the representation of position.
Several other methods motivate the work but do not solve this task. SToFM builds rotation- and translation-invariant embeddings from pairwise cell distances. BG-TRIPLEX uses image edges as attention keys to predict expression from histology. Both use space, but neither maps dissociated cells, and neither has a boundary-relative uncertainty model. Domain-clustering results show that expression alone resolves cortical layers reasonably well on the dorsolateral prefrontal cortex (DLPFC) benchmark. PROST reports an average adjusted Rand index (ARI) of 0.474, and SAINT reports 0.75, up from a previous best of 0.64. This is indirect evidence that distance to pia and white matter is recoverable from expression.
Baselines
Nearest-neighbor transfer (naive reference). Each query cell is matched in expression space, by cosine distance on log-normalized highly variable genes, to its k nearest spots in the training reference slices. It inherits their boundary distances, which are decoded with our same posterior machinery but with a variance fitted as a single constant. A version that inherits raw coordinates is also reported. We tune only k, on validation slices. Our method must beat this clearly on median position error, or the learned model is not justified.
dp-VAE (strongest existing method). We run the published method on identical train and held-out splits. It receives the same gene set, the same training slices, and a hyperparameter budget equal to ours, measured in trials on validation slices. Its coordinates are rigidly aligned to the held-out section, because it has no knowledge of the outline. The paper's Procrustes metric is reported alongside our metrics. Its reported results are qualitative: significant expression-proximity correlation in 23 of 27 mouse-brain Visium datasets, and out-of-sample Procrustes distance better than a vanilla VAE. No reported result was found on Lacuna for dp-VAE's absolute Procrustes value. We will therefore produce the number ourselves. Beating dp-VAE means lower Procrustes distance and lower median position error on held-out slices, with the gap widening on sections whose shape differs from the training slices.
Frozen foundation-model embeddings. SToFM embeddings from the released SToFM code, with spatial context removed so the setting matches dissociated input, are fed into the same distance head. This checks whether a stronger encoder, not the geometry, drives any gain.
Ablations isolating the key ingredient. First, the same model with $k$ fixed at zero, which gives constant-variance distance regression. Second, a model with the same heteroscedastic loss that predicts absolute coordinates instead of boundary distances. Third, single-boundary and multi-boundary versions. Fourth, versions with and without the bearing term. The claim survives only if the full model beats the first two ablations on held-out-geometry slices.
Why not just…?
Why not just regress distance-to-pia (cortical depth) directly? This is the most serious alternative, and it is contained in our model as the $k = 0$, single-boundary, no-bearing ablation. If that ablation matches the full model on both position error and coverage, the Weber scaling and multi-boundary decoding add nothing, and we will report that. We expect a gain mainly in calibration, since a constant variance must be too wide near boundaries or too narrow far from them if uncertainty really grows with distance. This is exactly what the coverage-by-distance-bin analysis will reveal.
Why not just use dp-VAE, which already reconstructs coordinates from expression? Its global distance constraint has no enclosure. When the query section is narrower, curved, or cropped differently from the training slices, absolute or relative Euclidean layouts have no mechanism to bend to that outline. This is the tissue counterpart of the trapezoid distortions in Bellmund et al.. The shape-shift experiment below tests this directly. If dp-VAE degrades no more than our method under shape shift, the argument fails.
Why not just use a graph network or foundation-model embedding with a coordinate head? Graph smoothing needs spatial neighbors, which dissociated cells do not have. Evidence from Bering also shows that isotropic neighborhood graphs struggle with elongated morphology. Still, a stronger encoder is a real threat to attribution. The frozen-SToFM baseline, combined with the absolute-coordinate ablation, separates "better features" from "better output geometry."
Decisive Experiments
DLPFC. The primary benchmark is the 12-slice human DLPFC Visium dataset, whose manual layer annotations give the pial surface and the white-matter border as boundaries. The outer tissue perimeter is computed from the spot mask. We use leave-one-donor-out splits, so that held-out slices come from unseen individuals. We report median position error in spot-spacing units, Procrustes distance, the coverage and area of 90% credible regions, and the slope of error against distance to the nearest boundary.
Mouse brain. The secondary benchmark is the 27 mouse-brain Visium datasets used by dp-VAE, with the tissue perimeter and ventricles as boundaries. This tests whether anything learned on the cortical ribbon generalizes to whole-section geometry.
Test one: is position information distance-scaled? The first decisive check asks whether the learned Weber fraction $k$ is reliably positive, and whether empirical error actually rises with boundary distance. A flat error profile would falsify the central premise.
Test two: shape shift. The second check crops held-out slices into narrow strips, wide blocks, and curved sub-regions, then compares how much each method's error grows relative to uncropped slices. Boundary-relative decoding should degrade least.
Test three: calibration. The third check requires that nominal 90% regions contain about 90% of cells in every distance bin, not just on average. Constant-variance ablations should under-cover in some bins and over-cover in others.
If all three checks favor the full model over dp-VAE and the $k = 0$ ablation, the navigation-derived likelihood is doing real work. If only the first holds, the lasting contribution is the finding itself: transcriptomic positional information decays with distance from anatomical boundaries.
References
- Orientational and Geometric Determinants of Place and Head-direction
- Neural Mechanisms of Self-Location
- Bayesian Integration of Information in Hippocampal Place Cells
- Deforming the metric of cognitive maps distorts memory
- Modeling Grid Cell Distortions with a Grid Cell Calibration Mechanism
- Distance-Preserving Representations for Genomic Spatial Reconstruction
- SToFM: a Multi-scale Foundation Model for Spatial Transcriptomics
- Boundary-Guided Learning for Gene Expression Prediction in Spatial Transcriptomics
- PROST: quantitative identification of spatially variable genes and domain detection in spatial transcriptomics
- SAINT: Sequence-Aware Integration for Spatial Transcriptomics Multi-View Clustering
- Bering: joint cell segmentation and annotation for spatial transcriptomics with transferred graph embeddings