1. Deconstruct the User's Request:
* Topic: Spatial Transcriptomics (ST) Analysis.
* Key Components to Explain:
* Capture Chemistry (How RNA is grabbed).
* Spot/Cell Alignment (Locating the data).
* Normalization/Deconvolution (Cleaning and resolving the data).
* Differential Expression (Finding statistically significant genes).
* Spatial Enrichment Tests (Finding patterns).
* Constraint: Include QC (Quality Control) pitfalls for these steps.
-
Target Audience: Likely a bioinformatician, computational biologist, or biologist moving into spatial analysis. The tone should be technical but accessible, structured, and comprehensive.
-
Drafting Content - Section by Section:
-
Introduction: Briefly define ST (bridging morphology and expression).
-
1. Capture Chemistry (The "How"):
- Concept: How do we get RNA onto a slide?
- Mechanisms:
- Poly-dT primers: Standard mRNA capture (3' end mostly). Mention Visium/10x.
- In situ sequencing (ISS): Padlock probes, rolling circle amplification (e.g., Xenium, CosMX).
- In situ Hybridization (ISH): Fluorescent probes (e.g., MERFISH, Vizgen).
- QC Pitfalls: Tissue permeabilization time (over/under), diffusion of RNA (gravity bias), background noise from the slide.
-
2. Spot/Cell Alignment (The "Where"):
- Concept: Mapping sequencing reads to spatial coordinates.
- Spot-based (Visium): Rigid grid alignment. H&E image needs to align with the grid fiducials.
- Cell-based (Xenium/MERFISH): DAPI/Cell boundary segmentation.
- QC Pitfalls: Tissue tearing/folding, misalignment during registration (manual vs. automatic), "Cells" vs. "Spots" (multiple cells per spot vs. segmentation errors).
-
3. Normalization & Deconvolution (The "Math"):
- Normalization: Removing technical noise.
- Library size: CPM, Scran pooling.
- Mitochondrial/Ribosomal genes: High % indicates dead cells, but in ST, high mito might just be metabolically active tissue.
- Deconvolution: This is crucial for spot-based data. A spot isn't a cell.
- Methods: Cell2location, RCTD, SPOTlight. Uses a scRNA-seq reference to map cell types to spots.
- QC Pitfalls: Batch effects (multiple sections), "Benchmark" reference mismatch (deconvolution fails if cell types in scRNA-seq don't match ST), ambient RNA contamination.
-
4. Differential Expression (DE) (The "Significance"):
- Concept: Comparing Gene A vs. Gene B in Region X vs. Region Y.
- Complexity: Spatial autocorrelation violates independence assumptions of standard t-tests.
- Methods: SPARK, SpatialDE, Squidpy. Models that handle coordinates.
- QC Pitfalls: The "Cheerios effect" (spatial clustering of artifacts), confounding cell type density (is Gene X upregulated, or are there just more of Cell Type Y there?).
-
5. Spatial Enrichment Tests (The "Patterns"):
- Concept: Are specific cell types or gene programs grouped together?
- Methods:
- Moran's I / Geary's C: Global clustering.
- Local Indicators of Spatial Association (LISA): Hotspots.
- Ligand-Receptor Analysis: CellChat, NicheNet (spatial context).
- Co-location: Cell type A is always near Cell type B.
- QC Pitfalls: Edge effects (cells at boundary have fewer neighbors), resolution limits, false positives due to tissue curvature.
-
Review and Refine:
- Structure: Use clear headings.
- Terminology: Ensure terms like "UMI," "Fiducials," "Segmentation," and "Autocorrelation" are used correctly.
- QC Section: Make sure the pitfalls are specific and actionable, not generic. For example, distinguishing between "bad RNA" and "bad alignment."
-
Self-Correction Example during drafting:
- Initial thought: Treat all technologies the same.
- Correction: Must distinguish between Sequencing-based (Visium - spots) and Imaging-based (Xenium/MERFISH - subcellular). The analysis pipelines differ significantly regarding deconvolution (needed for Visium, not really for Xenium if segmentation is good). I need to highlight this distinction.
-
Final Polish: Check formatting (bullet points, bold text) for readability. (This leads to the final output structure provided previously.)
Spatial transcriptomics (ST) is a hybrid methodology that combines histological imaging with high-throughput RNA sequencing. It allows researchers to measure gene expression while preserving the spatial context of the tissue microenvironment.
The analysis pipeline generally progresses from raw data processing to biological interpretation. Here is an explanation of the key stages: Capture Chemistry, Alignment, Normalization/Deconvolution, Differential Expression, and Spatial Enrichment, including specific Quality Control (QC) pitfalls.
1. Capture Chemistry (The Physics of Data Acquisition)
This refers to the molecular mechanism by which mRNA is captured from the tissue and linked to a spatial coordinate.
- Poly-dT Capture (Sequencing-based): In platforms like 10x Genomics Visium, the slide contains an array of "spots." Each spot contains millions of oligonucleotides with two key components: a spatial barcode (unique to that coordinate) and a poly-dT sequence. When tissue is placed on the slide and permeabilized, mRNA leaks out and the poly-dT arms capture the Poly-A tails of the mRNA.
- In Situ Hybridization/Sequencing (Imaging-based): Platforms like Xenium, CosMX, or MERFISH use fluorescent probes that bind to specific target genes directly inside the cell. Through multiple rounds of hybridization and imaging, the identity of the transcript is determined pixel-by-pixel.
- Pads vs. Nanoballs: Older technologies (ST, Visium) use circular "spots" (55um–100um). Newer high-res technologies use hexagonal "pads" or non-grid "nanoballs" (sub-cellular resolution).
QC Pitfalls:
- Permeabilization Optimization: If the tissue is permeabilized too little, mRNA stays trapped in the cell; too much, and it diffuses away into the buffer.
- Check: Look at the total UMI (Unique Molecular Identifier) counts. Low counts often indicate failed permeabilization.
- Tissue Thickness: Uneven sectioning leads to uneven capture.
- Background Binding: Some chemistries have non-specific binding. High mitochondrial or Ribosomal RNA percentages may indicate background noise rather than biological stress.
2. Spot/Cell Alignment (Image Registration)
This step links the sequencing data (the "Fasta" files) to the microscopy image (the "TIFF" files).
- Fiducial Alignment: The slide contains "fiducial markers" (non-biological markers visible in the image). The analysis software aligns the grid of spots (digital coordinates) to these markers in the tissue image.
- Tissue Boundary Detection: The software creates a mask to determine which spots lie under the tissue and which are on the empty background.
- Cell Segmentation (High-res): In sub-cellular platforms, transcripts are assigned to cells using a nucleus stain (DAPI) and membrane stains to draw boundaries.
QC Pitfalls:
- The "Gravity Effect": On some slides, tissue detaches or folds during processing. The image taken before sequencing may not match the tissue state after sequencing.
- Manual Curation: Automated alignment is rarely perfect. You must manually inspect the H&E image overlay to ensure spot boundaries match tissue morphology. Misalignment leads to assigning "tumor" gene expression to a "stroma" spot.
- Segmentation Errors: If using imaging-based data, DAPI staining is not enough. If two cells are close together without a clear membrane boundary, transcripts from Cell A might be assigned to Cell B.
3. Normalization & Deconvolution
Raw count data is confounded by technical factors (sequencing depth, capture efficiency). Furthermore, in spot-based data (e.g., Visium), one spot often contains multiple cells (a mixture).
- Normalization:
- Library Size: Normalizing for the total reads per spot (e.g., CPM or Scran pooling).
- Variance Stabilization: Log-transformation or SCTransform is used to reduce the influence of highly expressed genes.
- Mitochondrial Filtering: Unlike single-cell RNA-seq, high mitochondrial percentage in ST is not always a sign of cell death; it can be biologically relevant (metabolically active tissue like muscle).
- Deconvolution (Disambiguation): Since a 55µm spot may contain 1–10 cells, we use computational methods to infer the cell types within.
- Reference-based: Uses a scRNA-seq dataset as a reference to "unlock" the mixture (e.g., RCTD, Cell2location).
- Reference-free: Clusters spots based on assumed ratios (rarely used now).
QC Pitfalls:
- The "Missing Cell Type" Error: If your scRNA-seq reference does not contain a specific cell type present in the tissue (e.g., a rare neuron type), the deconvolution algorithm will force that signal into a "closest match," creating false biological conclusions.
- Ambient RNA: Free-floating RNA can contaminate spots, leading algorithms to detect cell types that aren't actually there (e.g., blood markers in parenchyma).
- Scaling Artifacts: Over-normalizing can wash out real biological variation between tissue layers (e.g., skin vs. fat).
4. Differential Expression (DE)
Identifying genes that are expressed differently between spatial regions (e.g., Tumor core vs. Tumor edge).
- Spatially Variable Genes (SVGs): Instead of comparing two arbitrary groups, ST-specific methods (like SPARK or SpatialDE) look for genes whose expression changes smoothly across space or forms specific patterns (rings, hotspots).
- Pseudobulk: Often, individual spots are too noisy. Aggregating spots into larger regions (Pseudobulking) allows for more robust statistical testing using traditional bulk RNA-seq tools (DESeq2, EdgeR).
QC Pitfalls:
- Spatial Autocorrelation: Standard statistical tests assume data points are independent. In spatial data, neighboring spots are highly correlated. Using a standard t-test creates false positives. You must use spatial statistics models.
- Composition Bias: If Region A has more T-cells than Region B, a gene marker for T-cells will appear differentially expressed. However, this is a change in cell composition, not a change in the gene expression of the T-cells themselves. Deconvolution is required to distinguish these.
5. Spatial Enrichment Tests
This is the final biological interpretation—identifying interactions and patterns.
- Cell-Cell Interaction: Calculating if Cell Type A is physically closer to Cell Type B than expected by random chance (e.g., Ligand-Receptor analysis like CellChat or NicheNet applied to space).
- Hot Spot Analysis: Using metrics like Moran’s I (global clustering) or Getis-Ord Gi* (local hotspots) to see if a gene is spatially clustered.
- Neighborhood Analysis: Defining "tissue neighborhoods" or "microenvironments" (e.g., an immune exclusion zone).
QC Pitfalls:
- The "Edge Effect": Spots at the edge of the tissue have fewer neighbors. If you do not correct for edge effects, enrichment scores at the tissue periphery will be artificially low.
- Resolution Mismatch: Trying to find cell-cell interactions on 55µm spots is impossible because the interactions happen at a 1–5µm scale. You can infer interactions between populations of spots, but not individual cells unless using high-res platforms.
- Reference Atlas Projection: When projecting a reference atlas (e.g., brain map) onto your tissue, misalignment can cause false enrichment of region-specific markers.