Inferensys

Glossary

Spatial Autocorrelation

A statistical measure of the degree to which a variable's values at nearby locations in a tissue are more similar than expected by random chance.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
SPATIAL STATISTICS

What is Spatial Autocorrelation?

Spatial autocorrelation is a fundamental statistical measure quantifying the degree to which a variable's values at nearby locations in a tissue are more similar than expected by random chance, violating the assumption of independence in classical statistics.

Spatial autocorrelation measures the correlation of a variable with itself through space. In spatial transcriptomics, it tests whether the expression level of a gene at one spot is systematically dependent on the expression levels at neighboring spots. Positive spatial autocorrelation indicates clustering—high values near high values, or low values near low values—while negative spatial autocorrelation signifies a dispersed, checkerboard-like pattern where high values are adjacent to low values.

The most common metric is Moran's I, which produces a single summary statistic ranging from -1 (perfect dispersion) to +1 (perfect clustering), with 0 indicating a random spatial pattern. Statistical significance is assessed via a spatial permutation test, which randomly shuffles spatial labels to generate a null distribution. This concept is foundational for identifying spatially variable genes (SVGs) and defining tissue domains.

SPATIAL AUTOCORRELATION

Key Statistical Properties

Spatial autocorrelation quantifies the degree to which a variable's values at nearby locations in a tissue are more similar than expected by random chance. It is the foundational statistical concept underpinning the identification of spatially variable genes and tissue domains.

01

Moran's I

A global spatial autocorrelation statistic that measures the overall clustering of a gene expression pattern across a tissue. Values range from -1 (perfect dispersion) to +1 (perfect clustering), with 0 indicating random spatial distribution. It is computed as a weighted correlation between a variable and its spatial lag.

  • Null hypothesis: Expression is randomly distributed across spatial locations.
  • Spatial weights matrix: Defines the neighborhood structure (e.g., k-nearest neighbors, distance-based).
  • Interpretation: A significant positive Moran's I identifies spatially variable genes (SVGs) that define tissue architecture.
-1 to +1
Value Range
02

Geary's C

An alternative global measure of spatial autocorrelation that is more sensitive to local differences between neighboring values than Moran's I. Geary's C ranges from 0 (strong positive autocorrelation) to 2 (strong negative autocorrelation), with 1 indicating no spatial autocorrelation.

  • Formula basis: Uses squared differences between neighboring values rather than cross-products.
  • Sensitivity: Outperforms Moran's I for detecting abrupt transitions or sharp boundaries between tissue domains.
  • Use case: Identifying tissue segmentation boundaries where gene expression changes sharply over short distances.
0 to 2
Value Range
03

Local Indicators of Spatial Association (LISA)

A family of local statistics, including Local Moran's I, that decompose global autocorrelation into per-location contributions. LISA identifies spatial hotspots (high-high clusters) and coldspots (low-low clusters), as well as spatial outliers (high-low or low-high).

  • Output: A significance map showing where clustering occurs, not just if it occurs globally.
  • Application: Pinpointing specific anatomical subregions where a gene is locally enriched.
  • Visualization: Often displayed as a Moran scatterplot with quadrant classifications.
Per-spot
Resolution
04

Spatial Weights Matrix

A mathematical representation of the spatial relationships between all locations in a tissue. This N × N matrix defines which spots or cells are considered neighbors for autocorrelation calculations. The choice of weighting scheme directly impacts all downstream spatial statistics.

  • Binary contiguity: Neighbors = 1, non-neighbors = 0.
  • Distance-based: Weights decay with Euclidean distance (e.g., inverse distance weighting).
  • k-Nearest Neighbors: Each location is connected to its k closest neighbors, ensuring consistent graph degree across irregular tissue geometries.
N × N
Matrix Dimensions
05

Spatial Permutation Test

A non-parametric statistical procedure that generates a null distribution for spatial autocorrelation statistics by randomly shuffling gene expression values across spatial locations. The observed statistic is compared against this null distribution to compute an empirical p-value.

  • Process: Randomly permute expression labels n times (typically 1,000–10,000), recalculating the statistic each time.
  • Advantage: Does not assume a specific parametric distribution of the test statistic.
  • Output: A p-value indicating the probability of observing the measured autocorrelation under spatial randomness.
1,000–10,000
Typical Permutations
06

Variogram Analysis

A geostatistical tool that quantifies spatial dependence as a function of distance. The empirical variogram plots the average squared difference between pairs of observations against their separation distance, revealing the range (distance at which spatial correlation decays) and sill (variance at which correlation plateaus).

  • Nugget: The non-zero variance at zero distance, representing measurement error or microscale variation.
  • Range: The distance beyond which observations are effectively independent.
  • Application: Determining the optimal neighborhood radius for spatial graph construction in transcriptomics.
Distance-dependent
Correlation Scale
SPATIAL AUTOCORRELATION

Frequently Asked Questions

Clear, technically precise answers to the most common questions about spatial autocorrelation in spatial transcriptomics, covering mechanisms, key statistics, and practical interpretation.

Spatial autocorrelation is a statistical measure of the degree to which a gene's expression values at nearby locations in a tissue are more similar (or dissimilar) than expected by random chance. It quantifies the departure from spatial randomness, capturing the fundamental biological principle that cells in close physical proximity often share functional states. In spatial transcriptomics, a positive spatial autocorrelation indicates that a gene's expression is clustered—high values are near other high values, and low values are near other low values—forming distinct spatial domains. A negative spatial autocorrelation indicates a dispersed, checkerboard-like pattern where high and low values alternate. The measure is foundational for identifying spatially variable genes (SVGs) and delineating tissue architecture.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.