Spatial Transcriptomics Alignment and Cellular Neighborhood Analysis
By Dr. Zubair Khalid, DVM, MS, PhD ·

Key Takeaways
- Spatial transcriptomics (ST) preserves the spatial context of gene expression within tissues, enabling the study of cellular microenvironments and intercellular signaling, with applications in veterinary pathology such as avian respiratory epithelium and porcine intestinal mucosa.
- Computational alignment of multiple ST slices is critical for constructing 3D tissue atlases and comparing conditions, with methods like GALA and TA-OT utilizing gene expression and histological image features for accurate registration, even across different platforms and species.
- Cell-type deconvolution addresses the challenge of mixed cell populations within ST spots by integrating single-cell RNA sequencing references or employing reference-free methods like AGED, which infers cell-type proportions directly from ST data.
- Cellular neighborhood analysis identifies functionally interacting cell groups by clustering spots based on spatial adjacency and transcriptional similarity, employing graph neural networks (e.g., SpatialDG) and multi-view clustering (e.g., STCF) to delineate these regions.
- Inferring cell-cell communication networks from ST data involves predicting ligand-receptor interactions between neighboring cells or neighborhoods, with methods like SPADE and directional diffusion models accounting for spatial distribution and signaling directionality.
- Integration of ST data with 3D organoid models, facilitated by tools like stVCR and sc3D, allows for the reconstruction of volumetric gene expression and the study of tissue development and regeneration in a spatially resolved manner.
Introduction
Spatial transcriptomics (ST) has emerged as a transformative technology that preserves the spatial context of gene expression within tissue sections, enabling researchers to map transcriptomic profiles onto their native histological coordinates [<a href="#ref-1">1</a>]. Unlike single-cell RNA sequencing (scRNA-seq), which dissociates cells and loses positional information, ST retains the physical architecture of tissues, allowing the study of cellular microenvironments, intercellular signaling, and tissue organization [<a href="#ref-2">2</a>, <a href="#ref-3">3</a>]. In veterinary medicine, ST has been applied to investigate host-pathogen interactions in tissues such as avian respiratory epithelium, bovine mammary gland, and porcine intestinal mucosa, providing insights into disease pathogenesis at an unprecedented resolution [<a href="#ref-4">4</a>, <a href="#ref-5">5</a>].
The core computational challenges in ST include aligning multiple tissue slices, deconvolving cell types from mixed spots, defining cellular neighborhoods, and inferring cell-cell communication networks [<a href="#ref-6">6</a>, <a href="#ref-7">7</a>]. This article provides an exhaustive technical review of these topics, focusing on alignment algorithms, deconvolution strategies, neighborhood analysis, and integration with three-dimensional organoid models. All methodological descriptions are grounded in the peer-reviewed literature listed in the References section.
Spatial Coordinate Mapping and Alignment
Spatial coordinate mapping is the process of assigning transcriptomic measurements to physical positions within a tissue section. Most ST platforms, such as those based on barcoded bead arrays or in situ sequencing, generate a grid of capture spots, each with a unique spatial barcode [<a href="#ref-6">6</a>]. The raw output consists of a gene expression matrix indexed by spot coordinates, which must be aligned to a reference coordinate system, often derived from a hematoxylin and eosin (H&E) stained histological image [<a href="#ref-8">8</a>, <a href="#ref-9">9</a>].
Alignment of multiple ST slices from the same tissue or from different biological replicates is essential for constructing three-dimensional (3D) tissue atlases and for comparing conditions across disease states [<a href="#ref-10">10</a>, <a href="#ref-11">11</a>]. Several computational frameworks have been developed for this purpose. GALA (a unified landmark-free framework) performs coarse-to-fine spatial alignment across resolutions and modalities without requiring manual landmark selection [<a href="#ref-12">12</a>]. It uses iterative closest point optimization combined with feature matching from histological images to register slices in a common coordinate space. Similarly, topography-aware optimal transport (TA-OT) aligns spatial omics data by preserving the local topographical structure of tissue sections, minimizing distortion due to tissue tearing or folding [<a href="#ref-13">13</a>].
Benchmarking studies have systematically evaluated the performance of alignment methods across different platforms, including array-based and imaging-based ST technologies [<a href="#ref-14">14</a>]. Metrics such as spatial overlap, gene expression correlation, and preservation of tissue morphology are used to assess accuracy. Yan et al. [<a href="#ref-14">14</a>] demonstrated that methods incorporating both gene expression and image features outperform those relying solely on transcriptional data. Wang et al. [<a href="#ref-15">15</a>] extended alignment to cross-disease and cross-platform scenarios, showing that slice integration can reveal conserved spatial domains even when tissues originate from different species or pathological conditions.
Deep learning approaches have further advanced alignment robustness. SPADE uses a deep learning framework for spatial mapping and quantitative cell-cell interaction inference, integrating spatial coordinates with expression profiles to correct for batch effects and tissue distortions [<a href="#ref-2">2</a>]. Holistic Invariant Retracing (HIR) addresses distortion-resilient multi-modal learning by learning invariant representations across ST and histology modalities [<a href="#ref-3">3</a>]. DGAE (Dynamic Graph Convolutional Network) aligns multi-slice ST data by constructing dynamic graphs that capture spatial relationships between spots across slices, enabling joint enhancement of expression signals [<a href="#ref-16">16</a>].
Cell-Type Deconvolution
ST spots typically contain multiple cells, making direct cell-type assignment ambiguous. Cell-type deconvolution aims to estimate the proportion of each cell type within a spot, often by integrating scRNA-seq reference data [<a href="#ref-4">4</a>, <a href="#ref-17">17</a>]. Graph contrastive learning methods, such as those proposed by Dong et al. [<a href="#ref-4">4</a>], leverage single-cell reference data to infer spatial cell composition by learning a shared embedding space between scRNA-seq and ST data. The contrastive objective encourages spots with similar cell-type mixtures to cluster together while separating distinct compositions.
Reference-free deconvolution methods eliminate the need for a matched scRNA-seq dataset. Attention-guided enhanced deconvolution (AGED) uses a self-attention mechanism to identify cell-type-specific gene expression patterns directly from ST data, without requiring external references [<a href="#ref-18">18</a>]. This approach is particularly valuable for veterinary species where comprehensive single-cell atlases may be unavailable. SpaVGMC performs unified representation learning via structural and semantic alignment, combining spatial graph information with gene expression to infer cell-type proportions [<a href="#ref-5">5</a>].
IntegrateRigor is an annotation-free integration optimization method that recovers cell identity by aligning ST and scRNA-seq data without requiring prior cell-type labels [<a href="#ref-17">17</a>]. It uses iterative clustering and correlation-based matching to assign cell identities to spots, revealing cancer-immune interface niches in a veterinary oncology context. PRIME (Atlas-Level Single-Cell and Spatial Transcriptomics Data Integration) extends this concept to atlas-level integration, enabling the mapping of multiple ST datasets onto a common single-cell reference [<a href="#ref-8">8</a>].
Cellular Neighborhood Analysis
Cellular neighborhoods are spatially localized groups of cells that interact functionally, often defined by proximity in physical space and coordinated gene expression [<a href="#ref-19">19</a>, <a href="#ref-20">20</a>]. Neighborhood analysis identifies these regions by clustering spots based on both spatial adjacency and transcriptional similarity. Spatial domain detection methods, such as SpatialDG (dual-graph neural network), use graph neural networks to model spot-spot relationships and assign domain labels [<a href="#ref-21">21</a>]. The dual-graph architecture captures both local spatial dependencies and global expression patterns, improving domain boundary detection.
Graph autoencoders with contrastive learning have been applied to identify batch-integrated domains from ST data [<a href="#ref-10">10</a>]. Mao et al. [<a href="#ref-10">10</a>] augmented the spatial graph with expression-derived edges and used contrastive loss to enforce consistency across batches, enabling robust domain detection in multi-slice experiments. DuaST integrates cross-branch interaction between a spatial branch and an expression branch, fusing information to delineate fine-grained neighborhoods [<a href="#ref-22">22</a>].
Multi-view clustering approaches, such as STCF, combine multiple views of the data (e.g., spatial coordinates, gene expression, histological features) to identify consensus neighborhoods [<a href="#ref-23">23</a>]. This method is particularly effective when tissue architecture is complex, such as in lymphoid organs or tumor microenvironments. The identification of spatially variable genes (SVGs) is a complementary task; MLN2SVG uses a contrastive variational autoencoder with multi-level neighbor search to detect genes whose expression varies significantly across spatial domains [<a href="#ref-24">24</a>].
Cell-Cell Communication Networks
Inferring cell-cell communication from ST data involves predicting ligand-receptor interactions between neighboring cells or neighborhoods [<a href="#ref-2">2</a>, <a href="#ref-25">25</a>]. SPADE quantitatively infers cell-cell interaction strengths by modeling the spatial distribution of ligand and receptor expression, accounting for diffusion gradients [<a href="#ref-2">2</a>]. Directional diffusion models, as described by Wang et al. [<a href="#ref-25">25</a>], incorporate spatial anisotropy to predict signaling directionality, which is critical for understanding polarized tissues such as intestinal epithelium or mammary ducts.
GAMMI (graph-guided contrastive and adversarial integration) integrates single-cell and spatial multi-omics data to infer intercellular communication networks [<a href="#ref-20">20</a>]. By learning a joint embedding of gene expression and protein abundance, GAMMI can identify signaling pathways that are spatially restricted. GR2ST predicts spatial transcriptomics from histology images using graph-enhanced multimodal contrastive learning, enabling the inference of cell-cell interactions even when ST data are not directly available [<a href="#ref-26">26</a>].
Logistic regression models have been adapted to estimate functional effects of spatial interactions [<a href="#ref-19">19</a>]. Barkasi et al. [<a href="#ref-19">19</a>] used logistic regression to identify gene pairs whose co-expression in neighboring spots is associated with functional outcomes, such as cell proliferation or immune activation. This approach provides a statistical framework for testing hypotheses about neighborhood-specific signaling.
Integration with Organoid Structural Models
Organoids are three-dimensional, self-organizing structures that recapitulate aspects of native tissue architecture. Mapping ST data onto organoid models requires alignment of 2D slices to a 3D reference, followed by projection of transcriptomic profiles onto the organoid surface or interior [<a href="#ref-27">27</a>, <a href="#ref-28">28</a>]. stVCR (spatiotemporal dynamics of single cells) reconstructs the spatiotemporal trajectory of cells within developing organoids by combining ST with time-lapse imaging [<a href="#ref-27">27</a>]. This method uses a variational autoencoder to align ST slices from different time points, generating a 4D atlas of gene expression dynamics.
Whole-embryo ST at subcellular resolution has been achieved in model organisms, providing a template for organoid alignment [<a href="#ref-28">28</a>]. Wan et al. [<a href="#ref-28">28</a>] demonstrated that subcellular-resolution ST can resolve nuclear and cytoplasmic transcripts, enabling precise mapping of cell states within developing tissues. sc3D is a comprehensive tool for 3D ST analysis that reconstructs volumetric gene expression from serial sections [<a href="#ref-29">29</a>]. It uses iterative registration and interpolation to fill gaps between slices, producing a continuous 3D expression map that can be overlaid onto organoid structural models.
Viewer-based visualization platforms allow researchers to interactively explore aligned ST data within organoid geometries. These platforms typically support multi-resolution rendering, allowing users to zoom from whole-organoid views to individual cell neighborhoods [<a href="#ref-30">30</a>]. STHELAR provides a multi-tissue dataset linking ST and histology for cell type annotation, which can serve as a reference for organoid alignment [<a href="#ref-30">30</a>].
Computational Workflow
The following Mermaid diagram summarizes a typical computational workflow for spatial transcriptomics alignment and cellular neighborhood analysis.
flowchart TD
A["Raw ST Data: Spot x Gene Matrix + Coordinates"] --> B["Preprocessing: Normalization, QC, Batch Correction"]
B --> C["Histology Image Registration"]
C --> D["Multi-Slice Alignment: GALA, TA-OT, DGAE"]
D --> E["Cell-Type Deconvolution: Graph Contrastive, AGED, PRIME"]
E --> F["Spatial Domain Detection: SpatialDG, DuaST, STCF"]
F --> G["Cellular Neighborhood Identification"]
G --> H["Cell-Cell Communication Inference: SPADE, GAMMI, Directional Diffusion"]
H --> I["3D Organoid Integration: stVCR, sc3D"]
I --> J["Visualization & Interpretation: STHELAR, Viewer Platforms"]
Challenges and Future Directions
Despite rapid progress, several challenges remain. First, the resolution gap between ST platforms (typically 10-100 μm spot diameter) and single-cell dimensions (10-20 μm) limits the accuracy of deconvolution and neighborhood definition [<a href="#ref-6">6</a>, <a href="#ref-18">18</a>]. Emerging near-cellular ST methods, such as Well-ST-seq, use deterministic barcoded bead arrays to achieve higher resolution at reduced cost [<a href="#ref-6">6</a>]. Second, batch effects across different ST experiments complicate integration, although methods like CIPHER (an end-to-end framework for designing optimized aggregated ST experiments) aim to minimize these effects through experimental design [<a href="#ref-7">7</a>].
Third, the computational cost of alignment and neighborhood analysis scales poorly with the number of spots and slices. Efficient graph-based methods, such as those implemented in HisCMCL (cross-modal contrastive learning with hierarchical multi-scale fusion), reduce memory requirements by processing data in hierarchical patches [<a href="#ref-9">9</a>]. Fourth, the lack of ground truth for cell-cell interactions in complex tissues makes validation difficult. Benchmarking datasets with known spatial organization, such as those generated by Yan et al. [<a href="#ref-14">14</a>], are essential for method evaluation.
In veterinary applications, the availability of species-specific reference atlases remains limited. Cross-species alignment methods, such as those benchmarked by Wang et al. [<a href="#ref-15">15</a>], may enable the transfer of knowledge from well-characterized model organisms to livestock and companion animals. Additionally, the integration of ST with other omics layers (e.g., proteomics, metabolomics) will provide a more complete picture of tissue function [<a href="#ref-20">20</a>, <a href="#ref-25">25</a>].
Conclusion
Spatial transcriptomics alignment and cellular neighborhood analysis are foundational computational tasks for understanding tissue organization in health and disease. Advances in deep learning, graph neural networks, and optimal transport have enabled robust alignment across slices and platforms, accurate cell-type deconvolution, and the identification of functionally relevant cellular neighborhoods. The integration of ST data with 3D organoid models further extends the utility of these methods for studying development, host-pathogen interactions, and tissue regeneration in veterinary species. Continued method development, coupled with the generation of high-quality reference datasets, will drive the adoption of ST in veterinary diagnostics and research.