Spatial Transcriptomics Pipeline

Spatially-resolved gene expression analysis

Overview

Spatial transcriptomics preserves the spatial context of gene expression, enabling analysis of tissue architecture and microenvironments.

flowchart LR
    subgraph Visium
        A1[Raw Data] --> B1[Space Ranger]
        B1 --> C1[Seurat/Scanpy]
    end
    
    subgraph Xenium
        A2[Raw Data] --> B2[Xenium Ranger]
        B2 --> C2[Analysis]
    end
    
    C1 --> D[Spatial Analysis]
    C2 --> D
    D --> E[Visualization]
    D --> F[Integration]
    
    style A1 fill:#e74c3c,color:white
    style A2 fill:#e74c3c,color:white
    style B1 fill:#f39c12,color:white
    style B2 fill:#f39c12,color:white
    style D fill:#27ae60,color:white

Platforms Covered

10x Genomics Visium

View Workflow →

Capture areas with ~5,000 spots, each containing 1-10 cells. Genome-wide gene expression with spatial coordinates.

Space Ranger Seurat 55µm spots

10x Genomics Xenium

View Workflow →

In situ hybridization-based platform with subcellular resolution. Targeted panel of genes (~300-5000).

Xenium Ranger Single-cell Subcellular

Key Analysis Concepts

Spot Deconvolution (Visium)

Since Visium spots contain multiple cells, deconvolution estimates cell type composition:

  • RCTD (Robust Cell Type Decomposition)
  • SPOTlight
  • Cell2location
  • Tangram

Spatial Domains

Identify spatially coherent regions:

  • BayesSpace - Bayesian clustering with spatial priors
  • SpaGCN - Graph convolutional network approach
  • STAGATE - Graph attention network

Spatially Variable Genes

Find genes with spatial expression patterns:

  • SpatialDE - Gaussian process regression
  • SPARK - Spatial pattern recognition
  • Trendsceek - Marked point process

Quick Start

Visium with Seurat

library(Seurat)

# Load Space Ranger output
spatial_data <- Load10X_Spatial("spaceranger_output/outs/")

# Basic processing
spatial_data <- SCTransform(spatial_data, assay = "Spatial")
spatial_data <- RunPCA(spatial_data)
spatial_data <- FindNeighbors(spatial_data, dims = 1:30)
spatial_data <- FindClusters(spatial_data, resolution = 0.8)
spatial_data <- RunUMAP(spatial_data, dims = 1:30)

# Spatial visualization
SpatialDimPlot(spatial_data, label = TRUE)
SpatialFeaturePlot(spatial_data, features = c("EPCAM", "VIM"))

Visium with Scanpy/Squidpy

import scanpy as sc
import squidpy as sq

# Load data
adata = sc.read_visium("spaceranger_output/outs/")

# Basic processing
sc.pp.filter_genes(adata, min_cells=10)
sc.pp.normalize_total(adata)
sc.pp.log1p(adata)
sc.pp.highly_variable_genes(adata, n_top_genes=2000)

# Dimensionality reduction
sc.pp.pca(adata)
sc.pp.neighbors(adata)
sc.tl.umap(adata)
sc.tl.leiden(adata)

# Spatial visualization
sq.pl.spatial_scatter(adata, color="leiden")

Applications

Application Methods Platform
Tumor microenvironment Deconvolution, spatial neighborhoods Both
Tissue architecture Spatial clustering, domain detection Both
Cell-cell interactions Ligand-receptor analysis Both
Marker mapping Spatially variable genes Both
Single-cell resolution Cell segmentation Xenium

Resources