Zubair Khalid

Virologist/Molecular Biologist | Veterinarian | Bioinformatician

Conventional & Molecular Virology • Vaccine Development • Computational Biology

Dr. Zubair Khalid is a veterinarian and virologist specializing in conventional and molecular virology, vaccine development, and computational biology. Dedicated to advancing animal health through innovative research and multi-omics approaches.

Dr. Zubair Khalid - Veterinarian, Virologist, and Vaccine Development Researcher specializing in Computational Biology, Multi-omics, Animal Health, and Infectious Disease Research

Section: Infrastructure, Cloud & Policy

Spatial Transcriptomics Data Integration: Aligning and Combining Multiple Datasets

Spatial transcriptomics data integration is the process of combining gene expression measurements from multiple tissue sections, samples, batches, or modalities into a unified coordinate framework that preserves both transcriptional identity and spatial context. For researchers working with datasets generated across different sequencing platforms, experimental batches, or tissue sections, integration enables comparative analysis, cell type annotation transfer, and the construction of three-dimensional tissue models. This article provides a practical workflow for aligning spatial coordinates, correcting batch effects, and integrating spatial transcriptomics data with single-cell RNA sequencing (scRNA-seq) or other omics layers, with concrete tool choices, parameter decisions, quality checks, and escalation criteria.

Why Spatial Transcriptomics Data Integration Matters

Single-cell RNA sequencing identifies cell subpopulations within tissue but does not capture their spatial distribution, nor does it reveal the local networks of intercellular communication acting in situ. Spatial transcriptomics technologies address this gap by localizing RNA within tissue, yet no single method currently provides as complete a scope of the transcriptome as scRNA-seq. This limitation underscores the need for computational approaches that integrate single-cell and spatial data to recover both molecular identity and positional context.

The practical consequence for researchers is that integration is not an optional refinement but a necessary step for most spatial transcriptomics studies. A typical experiment generates multiple tissue sections from the same sample or cohort, each with its own batch effects, sequencing depth, and spatial coordinate system. Without integration, comparisons across sections are confounded by technical variation, and cell type annotations from a reference scRNA-seq dataset cannot be reliably transferred to spatial spots. Integration methods address these problems by learning a shared representation across datasets while preserving biological variation.

Core Principles of Spatial Data Integration

Transcriptional Similarity and Physical Distance

Integration methods for spatial transcriptomics differ from conventional single-cell integration because they must consider both transcriptional similarity and physical distance between spots. Methods that ignore spatial information treat each spot as an independent observation, which discards the spatial autocorrelation inherent in tissue architecture. Methods that rely solely on spatial proximity fail when adjacent sections have different tissue morphologies or when batch effects dominate transcriptional signals.

The probabilistic alignment of ST experiments (PASTE) method formalizes this dual requirement using an optimal transport formulation that models both transcriptional similarity and physical distances between spots. PASTE computes pairwise alignments of slices and can combine pairwise alignments to construct a stacked three-dimensional alignment of a tissue, or alternatively integrate multiple slices into a single consensus slice. This approach demonstrates that using both transcriptional similarity and spatial information improves the identification of cell types and differentially expressed genes compared with approaches that analyze single slices or ignore spatial information.

Batch Correction Versus Biological Variation

A central decision in any integration workflow is distinguishing technical batch effects from genuine biological variation. Batch effects arise from differences in sequencing depth, capture efficiency, reagent lots, sample preparation dates, and platform-specific biases. Biological variation includes genuine differences in cell type composition, disease state, developmental stage, and tissue region.

Integration methods vary in how aggressively they remove technical variation. Some methods, such as Harmony, apply iterative clustering and correction to align datasets in a shared embedding space. Others, such as scVI, use deep generative models that learn a latent representation of gene expression while conditioning on batch identity. The choice depends on the research question. For cell type annotation transfer, aggressive batch correction may be appropriate. For identifying subtle spatial gradients or rare cell states, overly aggressive correction can dilute the signals of interest.

Rare Cell State Preservation

Multi-sample analyses present a specific challenge for rare cell discovery because batch correction can dilute rare-cell-specific signals. Methods that rely on homophily-based cell-cell similarity can merge rare cells into dominant populations and mask their subtle transcriptional signatures. Approaches that construct cell-gene heterogeneous graphs, where highly specific marker genes serve as informational bridges, can preserve rare-cell features by embedding them directly into the graph topology instead of inferring them from global neighbors. This design provides a biological rationale for rare-cell recovery, as low-abundance cells can remain connected through shared high-specificity genes even when local cell-cell neighborhoods are sparse.

At a Glance: Integration Method Categories

Method Category Representative Tools Primary Use Case Key Considerations
Spatial slice alignment PASTE, PRECAST Aligning adjacent tissue sections into 3D or consensus slices Requires spatial coordinates, optimal transport or probabilistic embedding, benchmark performance varies by tissue complexity
Single-cell reference mapping Seurat, scVI Transferring cell type labels from scRNA-seq to spatial spots Requires high-quality reference, label transfer quality depends on reference coverage and batch correction
Multi-omics integration SIMO, SpaGCN Combining spatial transcriptomics with chromatin accessibility, methylation, or proteomics Limited to modalities with matched spatial profiling, probabilistic alignment expands beyond RNA
Graph-based integration scFormer, SpaGCN Preserving rare cell states and spatial neighborhoods during integration Graph construction parameters affect results, Z-score-guided gene selection improves specificity

Practical Workflow for Integrating Spatial Transcriptomics Datasets

Step 1: Data Preparation and Quality Control

Before any integration, each dataset must pass independent quality control. For spatial transcriptomics data, this includes assessing the number of unique molecular identifiers (UMIs) per spot, the number of genes detected per spot, the fraction of mitochondrial reads, and the spatial distribution of low-quality spots. Spots with low UMI counts or high mitochondrial fractions often represent tissue edges, damaged regions, or empty capture locations and should be filtered before integration.

For scRNA-seq reference datasets, standard quality control includes filtering cells by UMI count, gene count, and mitochondrial fraction, followed by normalization and identification of highly variable genes. The choice of highly variable genes matters for integration because these genes drive the alignment. Methods that incorporate highly variable genes in annotating various technologies aim to obtain biologically relevant information aligned with the intended purpose.

Record for each dataset: the platform, tissue type, number of spots or cells, median UMIs per spot or cell, median genes detected, and the fraction of spots or cells passing quality filters. These records support reproducibility and help diagnose integration failures.

Step 2: Normalization and Feature Selection

Normalization across datasets is a prerequisite for integration. Common approaches include log-normalization, scran-based normalization, and SCTransform. The choice of normalization method affects the downstream integration because it determines the variance structure of the data.

For spatial transcriptomics data, normalization must account for spot-to-spot differences in sequencing depth that arise from capture efficiency variations across the tissue section. For multi-slice integration, normalization should be applied consistently across all slices before alignment.

Feature selection for integration typically uses highly variable genes, but the number of genes selected affects the balance between capturing biological signal and amplifying technical noise. Benchmarking studies of spatial transcriptomics integration methods have shown that the choice of feature set interacts with the integration method, and no single feature selection strategy dominates across all methods and datasets.

Step 3: Spatial Coordinate Alignment

For datasets from adjacent tissue sections, spatial coordinate alignment is the first integration step. The goal is to find a transformation that maps spots from one section to their corresponding positions in another section. This transformation can be rigid, accounting for translation and rotation, or non-rigid, accounting for tissue deformation during sectioning and mounting.

PASTE uses an optimal transport formulation that models both transcriptional similarity and physical distances between spots. The method computes pairwise alignments of slices and can combine pairwise alignments to construct a stacked three-dimensional alignment of a tissue. Alternatively, PASTE can integrate multiple slices into a single consensus slice, which improves the identification of cell types and differentially expressed genes compared with analyzing single slices.

PRECAST provides a probabilistic embedding, clustering, and alignment approach that simultaneously learns a shared latent space and aligns spatial coordinates. This joint optimization can be more robust than sequential alignment followed by clustering, but it requires careful parameter tuning.

Step 4: Batch Correction and Dataset Integration

After spatial alignment, batch correction integrates the transcriptional profiles across datasets. The choice of batch correction method depends on the number of datasets, the expected batch effects, and the downstream analysis goals.

Harmony applies an iterative clustering and correction procedure that aligns datasets in a shared embedding space. It is computationally efficient and works well for large numbers of datasets, but it does not explicitly model spatial information. For spatial transcriptomics data, Harmony can be applied to the gene expression matrix after spatial alignment, or it can be applied to the latent representation learned by a deep generative model.

scVI uses a variational autoencoder to learn a latent representation of gene expression while conditioning on batch identity. This approach can capture nonlinear batch effects and is particularly useful when batch effects are complex or when the number of genes is large. scVI also provides uncertainty estimates for the latent representation, which can be useful for downstream analyses.

For multi-omics integration, SIMO extends the probabilistic alignment approach beyond RNA to integrate spatial transcriptomics with chromatin accessibility and DNA methylation. This capability is important because these modalities have not been co-profiled spatially before, and integration enables the detection of topological patterns of cells and their regulatory modes across multiple omics layers.

Step 5: Cell Type Annotation and Deconvolution

A common downstream goal of integration is transferring cell type labels from a scRNA-seq reference to spatial spots. This process, called label transfer or deconvolution, assigns each spatial spot a cell type composition based on the transcriptional similarity between the spot and reference cells.

Seurat provides a label transfer workflow that uses canonical correlation analysis or mutual nearest neighbors to align the spatial and single-cell datasets, followed by label prediction based on the aligned representation. The original Seurat approach was developed to infer cellular localization by integrating single-cell RNA-seq data with in situ RNA patterns, and it successfully mapped rare subpopulations in zebrafish embryos.

For spatial transcriptomics data with multiple cells per spot, deconvolution methods estimate the proportion of each cell type within each spot. These methods require a high-quality reference with well-defined cell types and sufficient marker gene coverage. Benchmarking studies have shown that deconvolution accuracy varies substantially across methods and depends on the reference quality, the number of cell types, and the spatial resolution of the platform.

Step 6: Quality Assessment of Integrated Data

After integration, several quality checks are essential before proceeding to downstream analyses.

First, assess the alignment accuracy by examining the spatial distribution of spots from different batches or sections. In a well-integrated dataset, spots from different sections should intermingle in regions of similar tissue architecture, and the spatial coordinates should form a coherent tissue structure.

Second, assess batch effect removal by comparing the distribution of gene expression across batches before and after integration. Metrics such as the batch entropy, the k-nearest neighbor batch consistency, and the silhouette score can quantify the degree of batch mixing. However, these metrics must be interpreted with caution because excessive batch mixing can indicate over-correction that removes biological variation.

Third, assess biological preservation by checking that known cell type markers remain differentially expressed across cell types or spatial domains after integration. If known markers are no longer cell type specific after integration, the batch correction was too aggressive.

Fourth, assess the stability of the integration by running the method with different random seeds or parameter values. Integration methods that rely on stochastic optimization can produce different results across runs, and the variability should be quantified and reported.

Tools and Tradeoffs

PASTE for Slice Alignment

PASTE is designed specifically for aligning and integrating spatial transcriptomics data from multiple adjacent tissue slices. Its optimal transport formulation models both transcriptional similarity and physical distances between spots, which distinguishes it from methods that use only one of these signals. PASTE can produce either a stacked three-dimensional alignment or a consensus slice, and the choice depends on the downstream analysis. For three-dimensional tissue reconstruction, the stacked alignment is appropriate. For differential expression analysis across conditions, the consensus slice may be more useful because it provides a single integrated representation.

The main limitation of PASTE is that it assumes adjacent slices have similar tissue morphology. If slices are from different regions of a tissue or from different individuals, the alignment may fail or produce biologically meaningless results.

Harmony for Batch Correction

Harmony is a widely used batch correction method that operates in a low-dimensional embedding space. It iteratively clusters cells or spots, computes batch-specific centroids, and corrects the embedding to align the centroids. Harmony is computationally efficient and scales to large datasets, making it suitable for atlas-level integration.

The main limitation of Harmony is that it does not explicitly model spatial information. When applied to spatial transcriptomics data, Harmony corrects the gene expression or embedding without considering the spatial coordinates. This can be appropriate when the goal is to integrate datasets from the same tissue type across batches, but it may not preserve spatial gradients that are biologically meaningful.

scVI for Deep Generative Integration

scVI uses a variational autoencoder to model gene expression as a function of latent cell state and batch identity. The model learns a latent representation that is batch-invariant while preserving biological variation. scVI provides several advantages over simpler methods: it can model count data with negative binomial or Poisson distributions, it can incorporate covariates such as sequencing depth, and it provides uncertainty estimates.

The main limitation of scVI is computational cost. Training a variational autoencoder on large spatial transcriptomics datasets requires GPU resources and careful hyperparameter tuning. Additionally, scVI does not explicitly model spatial coordinates, so spatial information must be incorporated separately or through a spatial-aware extension.

SIMO for Multi-Omics Integration

SIMO is designed for the spatial integration of multi-omics datasets through probabilistic alignment. Unlike tools that integrate only spatial transcriptomics with scRNA-seq, SIMO expands beyond RNA to enable integration across multiple single-cell modalities, such as chromatin accessibility and DNA methylation. This capability is important for studies that aim to understand spatial gene regulation, where the relationship between chromatin state and gene expression varies across tissue regions.

The main limitation of SIMO is that it requires matched or co-profiled modalities. If chromatin accessibility and gene expression are measured in different cells or different tissue sections, the integration must account for the lack of direct correspondence between measurements.

SpaGCN for Graph-Based Integration

SpaGCN uses a graph convolutional network to integrate gene expression with spatial coordinates and histology images. The method constructs a graph where nodes are spots and edges connect spatially adjacent spots, then uses the graph to learn a representation that captures both transcriptional and spatial information. SpaGCN can also incorporate histology image features, which can improve the identification of spatial domains that correspond to morphological structures.

The main limitation of SpaGCN is that it requires histology images for full functionality, and the quality of the image segmentation affects the results. For datasets without matched histology images, SpaGCN can still use spatial coordinates alone, but the performance may be reduced.

Observations and Measurements for Integration Quality

Alignment Accuracy Metrics

For slice alignment, the accuracy can be measured by the fraction of spots that are correctly matched to their corresponding spots in an adjacent slice. In simulated data, where the true alignment is known, this metric can be computed directly. In real data, the accuracy can be assessed by comparing the expression profiles of aligned spots or by examining the spatial continuity of known anatomical structures.

Layer-wise and spot-to-spot alignment accuracy are two metrics used in benchmarking studies. Layer-wise accuracy assesses whether spots from the same anatomical layer are aligned across slices, while spot-to-spot accuracy assesses whether individual spots are correctly matched. These metrics capture different aspects of alignment quality, and both should be reported.

Batch Mixing Metrics

Batch mixing can be quantified using the average silhouette width across batches, the entropy of batch labels in local neighborhoods, or the k-nearest neighbor batch consistency. These metrics range from zero to one, with higher values indicating better batch mixing. However, these metrics do not distinguish between technical batch removal and biological variation removal, so they must be interpreted alongside biological preservation metrics.

Biological Preservation Metrics

Biological preservation can be assessed by the differential expression of known cell type markers, the clustering consistency before and after integration, and the correlation between integrated representations and known biological annotations. For spatial transcriptomics data, the preservation of spatial gradients can be assessed by examining whether known spatial marker genes retain their spatial patterns after integration.

Reproducibility Metrics

Integration methods that use stochastic optimization should be run multiple times with different random seeds to assess reproducibility. The variability in the integrated representation, the clustering results, and the downstream analyses should be quantified and reported. High variability across runs indicates that the integration is sensitive to initialization or optimization details, and the results should be interpreted with caution.

Common Failure Patterns and Troubleshooting

Failure Pattern 1: Over-Correction Removing Biological Variation

When batch correction is too aggressive, genuine biological differences between samples or conditions are removed along with technical variation. This failure is often detected when known cell type markers lose their specificity after integration or when samples from different conditions become indistinguishable.

Troubleshooting steps: reduce the number of Harmony iterations, increase the regularization parameter in scVI, or use a less aggressive integration method. Alternatively, perform integration separately for each major cell type or tissue region to avoid forcing alignment across biologically distinct populations.

Failure Pattern 2: Under-Correction Leaving Batch Effects

When batch correction is insufficient, spots or cells from the same batch cluster together in the integrated representation, and differential expression analyses identify batch-specific genes instead of biologically meaningful genes.

Troubleshooting steps: increase the number of Harmony iterations, increase the number of scVI training epochs, or use a more aggressive integration method. Check that the normalization was applied consistently across all datasets before integration.

Failure Pattern 3: Spatial Misalignment of Adjacent Slices

When adjacent slices have different tissue morphologies or when the tissue was deformed during sectioning, spatial alignment may fail. This failure is often detected when the aligned slices show discontinuities in anatomical structures or when spots from different slices do not intermingle in regions of similar tissue architecture.

Troubleshooting steps: use a non-rigid alignment method, increase the weight on spatial distance in PASTE, or manually identify anatomical landmarks to guide the alignment. If the slices are from different tissue regions, consider analyzing them separately.

Failure Pattern 4: Rare Cell State Loss During Integration

When integration methods rely on global cell-cell similarity, rare cell populations can be merged into dominant populations, and their subtle transcriptional signatures can be lost. This failure is particularly problematic in multi-sample analyses where batch correction can dilute rare-cell-specific signals.

Troubleshooting steps: use a graph-based integration method that preserves rare cell features through high-specificity marker genes, or perform integration separately for rare and abundant cell populations. Validate the preservation of rare cell states by checking known rare cell markers before and after integration.

Failure Pattern 5: Computational Resource Exhaustion

Deep generative methods such as scVI and graph-based methods such as SpaGCN require substantial computational resources, particularly for large spatial transcriptomics datasets. Memory exhaustion or excessive runtime can prevent the integration from completing.

Troubleshooting steps: reduce the number of highly variable genes, use a smaller batch size during training, or use a more computationally efficient method such as Harmony. For very large datasets, consider integrating in a hierarchical manner, first within batches and then across batches.

Limitations and Interpretation Boundaries

Platform-Specific Biases

Spatial transcriptomics platforms differ in resolution, sensitivity, and throughput. Sequencing-based platforms such as 10x Visium capture RNA from spots containing multiple cells, while imaging-based platforms such as seqFISH detect individual transcripts at single-cell resolution. Integration across platforms must account for these differences, and the integrated representation should be interpreted as a common latent space instead of a direct comparison of raw measurements.

Reference Quality Dependence

The quality of cell type annotation and deconvolution depends heavily on the quality of the scRNA-seq reference. If the reference lacks rare cell types, has poor marker gene coverage, or contains batch effects, the label transfer will be inaccurate. Researchers should assess reference quality before integration and consider using multiple references or a curated reference atlas.

Spatial Resolution Limits

Integration cannot recover spatial information that was not captured by the experimental platform. If the spatial resolution is too coarse to distinguish adjacent cell types, integration will not resolve them. Similarly, if the tissue section does not include the region of interest, integration cannot infer the missing spatial context.

Multi-Omics Integration Constraints

Integrating spatial transcriptomics with other omics modalities, such as chromatin accessibility or DNA methylation, requires that the modalities are measured in matched or co-profiled samples. When modalities are measured in different cells or different tissue sections, the integration must account for the lack of direct correspondence, and the results should be interpreted as probabilistic alignments instead of definitive mappings.

Benchmarking Limitations

Benchmarking studies of spatial transcriptomics integration methods have shown that performance varies substantially across datasets, technologies, and species. No single method dominates across all scenarios, and the choice of method should be guided by the specific research question, the data characteristics, and the available computational resources. Benchmarking results should be used as a starting point for method selection, not as a definitive ranking.

Regulatory and Data Sharing Context

Genomic Data Sharing

Spatial transcriptomics data derived from human samples are subject to genomic data sharing policies. Researchers should review the applicable data sharing requirements before integrating datasets from multiple sources, particularly when the data include individual-level genomic information. Data sharing policies may require de-identification, controlled access, or specific data use limitations.

FAIR Data Principles

Spatial transcriptomics integration results should be managed according to the FAIR Guiding Principles, which emphasize findability, accessibility, interoperability, and reusability. This includes depositing raw data in public repositories, providing metadata that describes the experimental and computational methods, and using standard file formats for integrated data.

Data Repositories

Public data repositories such as those maintained by the European Bioinformatics Institute and the National Center for Biotechnology Information provide infrastructure for depositing and accessing spatial transcriptomics data. Researchers should deposit both raw and processed data, along with the code and parameters used for integration, to support reproducibility and reuse.

Professional Escalation Criteria

Researchers should escalate to a bioinformatics specialist or computational biology collaborator when any of the following conditions are met:

  • The integration results are highly variable across random seeds or parameter values, and the variability cannot be resolved by parameter tuning.
  • The integrated data show evidence of over-correction or under-correction that persists across multiple methods and parameter settings.
  • The spatial alignment fails for adjacent slices, and manual landmark identification does not resolve the misalignment.
  • The integration of multi-omics data produces inconsistent results across modalities, and the source of the inconsistency cannot be identified.
  • The computational resources required for integration exceed the available infrastructure, and a more efficient approach cannot be identified.
  • The downstream analyses produce biologically implausible results that cannot be explained by known tissue biology.

Frequently Asked Questions

What is the difference between spatial alignment and batch correction in spatial transcriptomics integration?

Spatial alignment maps spots from different tissue sections into a common coordinate framework, using both transcriptional similarity and physical distances between spots. Batch correction adjusts gene expression values to remove technical variation across datasets, such as differences in sequencing depth or reagent lots. Spatial alignment is typically performed first for adjacent sections, followed by batch correction to integrate the transcriptional profiles. Some methods, such as PRECAST, perform both steps jointly.

How do I choose between PASTE and PRECAST for integrating multiple tissue slices?

PASTE uses an optimal transport formulation that models both transcriptional similarity and physical distances between spots, and it can produce either a stacked three-dimensional alignment or a consensus slice. PRECAST uses a probabilistic embedding, clustering, and alignment approach that simultaneously learns a shared latent space and aligns spatial coordinates. Choose PASTE when the primary goal is spatial alignment of adjacent slices, and choose PRECAST when the primary goal is joint clustering and alignment with uncertainty estimates.

Can I integrate spatial transcriptomics data with scRNA-seq data from a different tissue or species?

Integration across tissues or species is possible but requires careful consideration of biological differences. The reference scRNA-seq dataset should contain the cell types expected in the spatial tissue, and the integration should be interpreted as a mapping of shared cell states instead of a direct comparison of gene expression. Cross-species integration requires orthologous gene mapping and may be less accurate than within-species integration.

What is the minimum number of highly variable genes needed for spatial transcriptomics integration?

There is no universal minimum number of highly variable genes for integration. The optimal number depends on the integration method, the complexity of the tissue, and the expected batch effects. Benchmarking studies have shown that the choice of feature set interacts with the integration method, and no single feature selection strategy dominates across all methods and datasets. Researchers should test multiple feature set sizes and assess the impact on integration quality.

How do I assess whether batch correction has removed too much biological variation?

Assess biological preservation by checking that known cell type markers remain differentially expressed across cell types or spatial domains after integration. If known markers are no longer cell type specific after integration, the batch correction was too aggressive. Additionally, compare the integrated representation with known biological annotations, such as anatomical regions or disease status, to verify that biologically meaningful differences are preserved.

What should I do if my spatial transcriptomics datasets have very different sequencing depths?

Normalize each dataset independently before integration, using methods that account for differences in sequencing depth, such as log-normalization or SCTransform. After normalization, verify that the distribution of gene expression is similar across datasets before proceeding with integration. If the sequencing depth differences are extreme, consider downsampling the higher-depth dataset to match the lower-depth dataset.

Can spatial transcriptomics integration methods handle data from different platforms, such as 10x Visium and seqFISH?

Integration across platforms is possible but requires accounting for platform-specific differences in resolution, sensitivity, and throughput. Sequencing-based platforms capture RNA from spots containing multiple cells, while imaging-based platforms detect individual transcripts at single-cell resolution. Integration methods that model count data, such as scVI, can accommodate platform differences, but the integrated representation should be interpreted as a common latent space instead of a direct comparison of raw measurements.

How do I report spatial transcriptomics integration methods and parameters in a publication?

Report the integration method, the version of the software, the key parameters used, and the rationale for parameter choices. Include the number of highly variable genes, the normalization method, the batch correction settings, and the random seed if the method uses stochastic optimization. Deposit the code and processed data in a public repository to support reproducibility. Describe the quality assessment metrics used to evaluate the integration, including alignment accuracy, batch mixing, and biological preservation.

Related Bioinformatics Guides

References and Further Reading

This article is educational and does not replace validated analysis plans, institutional policy, clinical interpretation, or specialist review.