Table of Contents
Fetching ...

RAFT-UP: Robust Alignment for Spatial Transcriptomics with Explicit Control of Spatial Distortion

Yaqi Wu, Jingfeng Wang, Xin Maizie Zhou, Yanxiang Zhao, Zixuan Cang

Abstract

Spatial transcriptomics (ST) profiles gene expression across a tissue section while preserving the spatial coordinates. Because current ST technologies typically profile two-dimensional tissue slices, integrating and aligning slices from different regions of the same three-dimensional tissue or from samples under different conditions enables analyses that reveal 3D organization and condition-associated spatial patterns. Two major challenges remain. First, interpretable and flexible control over spatial distortion is needed because rigid transformations can be overly restrictive, whereas highly deformable mappings may arbitrarily distort spatial proximity. Second, biologically plausible matching is also needed, especially when the slices overlap partially. Here, we introduce RAFT-UP, a tool for robust ST alignment that provides explicit control over spatial distance preservation through a fused supervised Gromov-Wasserstein (FsGW) optimal transport framework. FsGW combines expression and spatial information, incorporates spot-wise constraints to discourage biologically implausible matches, and enforces a pairwise distance-consistency constraint that prevents mapping two pairs of spots when their spatial distances differ beyond a specified tolerance. We demonstrate that RAFT-UP accurately aligns slices from different regions of the same tissue and slices from different samples. Benchmarking shows that RAFT-UP improves spatial distance preservation while achieving spot label matching accuracy comparable to state-of-the-art methods. Finally, we demonstrate RAFT-UP on two spatially constrained downstream applications, including spatiotemporal mapping of developing mouse midbrain and comparative cross-slice analysis of cell-cell communication. RAFT-UP is available as open-source software.

RAFT-UP: Robust Alignment for Spatial Transcriptomics with Explicit Control of Spatial Distortion

Abstract

Spatial transcriptomics (ST) profiles gene expression across a tissue section while preserving the spatial coordinates. Because current ST technologies typically profile two-dimensional tissue slices, integrating and aligning slices from different regions of the same three-dimensional tissue or from samples under different conditions enables analyses that reveal 3D organization and condition-associated spatial patterns. Two major challenges remain. First, interpretable and flexible control over spatial distortion is needed because rigid transformations can be overly restrictive, whereas highly deformable mappings may arbitrarily distort spatial proximity. Second, biologically plausible matching is also needed, especially when the slices overlap partially. Here, we introduce RAFT-UP, a tool for robust ST alignment that provides explicit control over spatial distance preservation through a fused supervised Gromov-Wasserstein (FsGW) optimal transport framework. FsGW combines expression and spatial information, incorporates spot-wise constraints to discourage biologically implausible matches, and enforces a pairwise distance-consistency constraint that prevents mapping two pairs of spots when their spatial distances differ beyond a specified tolerance. We demonstrate that RAFT-UP accurately aligns slices from different regions of the same tissue and slices from different samples. Benchmarking shows that RAFT-UP improves spatial distance preservation while achieving spot label matching accuracy comparable to state-of-the-art methods. Finally, we demonstrate RAFT-UP on two spatially constrained downstream applications, including spatiotemporal mapping of developing mouse midbrain and comparative cross-slice analysis of cell-cell communication. RAFT-UP is available as open-source software.
Paper Structure (19 sections, 19 equations, 6 figures)

This paper contains 19 sections, 19 equations, 6 figures.

Figures (6)

  • Figure 1: Overview of RAFT-UP.a, An inter-dataset cost matrix that capture gene expression dissimilarity between spots and their spatial neighborhoods is obtained from a Deep Graph Infomax model trained alternately on the two datasets. The two intra-dataset cost matrices are obtained from the spatial distances between the spots within each slice. b, An optimal probabilistic mapping between the two slices is obtained by solving a Fused supervised Gromov-Wasserstein optimal transport, which takes the costs defined in (a) and enforces element-wise and second-order constraints on the transport plan. c, To handle large ST datasets, RAFT-UP uses a downsampling and lifting strategy. An initial mapping is first obtained across geometrically uniform downsampling of the two slices. A full alignment is then recovered by solving a supervised optimal transport problem with a cost based on the distance of each spots to the anchor points in the initial mapping.
  • Figure 2: Benchmarking alignment on human DLPFC Visium slices.a, Performance on adjacent DLPFC section pairs. Left: alignment accuracy for RAFT-UP and other methods. Right: geometric preservation rate (GPR) as a function of neighborhood radius, comparing RAFT-UP, PASTE2, PASTE, and moscot. SPACEL is evaluated under its native, label-informed configuration and the remaining methods are evaluated without label information. The accuracy of PRECAST, STalign, DeepST, SPIRAL, and GPSA are taken from a recent benchmark hu2024benchmarking. b, Representative RAFT-UP alignments of three adjacent pairs. Spots are colored by annotated cortical layer and line segments indicate the computed spot-level correspondence between slices. c, Performance on non adjacent DLPFC pairs. Left: Accuracy for each pair comparing RAFT-UP, PASTE2, and PASTE. Right GPR versus neighborhood radius for far pairs. d, Representative RAFT-UP alignments for three far pairs. In the boxplots, boxes indicate the interquartile range (25th-75th percentiles) with the median as the center line, whiskers extend to the most extreme values within 1.5×IQR, and black diamonds denote the mean.
  • Figure 3: Benchmarking alignment on MERFISH sections.a, Label matching accuracy for MERFISH data for adjacent pairs (left) and far pairs (right). SPACEL is evaluated under its native label-informed configuration and other methods are evaluated without access to label information. b, Representative RAFT-UP alignments for an adjacent pair (top) and a far pair (bottom) showing both alignment of all cells (left) and alignment of ependymal cells (right) highlighting its performance on aligning fine structures. c, Geometric preservation rate (GPR) as a function of neighborhood radius comparing RAFT-UP, PASTE2, PASTE, and moscot on adjacent pairs (top) and far pairs (bottom).
  • Figure 4: Evaluation of RAFT-UP under partial overlap.a, b, Partially overlapping windows extracted from the same DLPFC slice. RAFT-UP alignment only contain alignment in the truly overlapping region while traditional full OT alignment forces full matching of the two partially overlapping windows. c, Partially overlapping regions with different geometry and cell-type composition across an adjacent DLPFC pair. d, A MERFISH example with a similar geometry but different anatomical region compositions. RAFT-UP aligns cells from anatomical regions present in both windows, while leaving cells from regions absent in one slice largely unmapped.
  • Figure 5: Spatiotemporal analysis of mouse midbrain development.a, Alignment of the Stereo-seq data of mouse midbrain from E12.5 to E14.5 and from E14.5 to E16.5. Cells are colored by the expert annotations from original study: RGC, radial glia cell; GlioB, glioblast; NeuB, neuroblast. b, The disturbance of the relative location of cells on the Caudal to Rostral axis through alignment. The median values of the box plots are 0.0793, 0.0542, 0.0596, 0.0325, from left to right respectively. Cell correspondences with a change of the relative coordinate greater than 0.1 are shown. c, The counts and visualization of correspondences in the alignments that are inconsistent with the dominant trajectory patterns which are RGC to GlioB, RGC to NeuB, or unchanging.
  • ...and 1 more figures