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.
Glossary
Spatial Autocorrelation

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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Core statistical measures and computational frameworks used to quantify and model the non-random organization of gene expression across tissue architecture.
Moran's I
A foundational global spatial autocorrelation statistic that measures the overall degree of clustering in a gene's expression pattern. It produces a single value ranging from -1 (perfect dispersion) to +1 (perfect clustering), with 0 indicating random spatial distribution. The statistic is calculated by comparing the similarity of expression values at neighboring locations against the global mean.
- Positive Moran's I: Neighboring spots have similar expression (e.g., a gene confined to a tumor region)
- Negative Moran's I: Neighboring spots are dissimilar (e.g., a checkerboard pattern)
- Statistical significance is assessed via a spatial permutation test against a null hypothesis of complete spatial randomness
Geary's C
An alternative global measure of spatial autocorrelation that is more sensitive to local differences between neighboring observations than Moran's I. Geary's C uses squared differences between adjacent values, making it particularly responsive to abrupt boundaries between tissue domains.
- C < 1: Positive spatial autocorrelation (clustering)
- C = 1: Spatial randomness
- C > 1: Negative spatial autocorrelation (dispersion)
- Often used alongside Moran's I to provide a complementary view of spatial structure, as it captures different aspects of the spatial covariance function
Local Indicators of Spatial Association (LISA)
A family of local spatial statistics that decompose global autocorrelation metrics to identify specific spatial hotspots and coldspots within a tissue. Unlike global measures that produce a single summary value, LISA statistics generate a map where each spatial location receives its own score and significance value.
- High-High clusters: A location with high expression surrounded by high-expression neighbors (e.g., a gene expression hotspot)
- Low-Low clusters: A location with low expression surrounded by low-expression neighbors
- Spatial outliers: High-Low or Low-High combinations indicating sharp expression boundaries
- Critical for identifying spatially variable genes with localized rather than global patterns
Spatial Weight Matrix
A mathematical representation of the spatial relationships between all locations in a tissue sample, encoded as an N×N matrix where N is the number of spots or cells. Each element defines the spatial influence of one location on another, serving as the computational backbone for nearly all spatial autocorrelation analyses.
- Binary adjacency: 1 if locations share a border, 0 otherwise
- Distance-based: Inverse distance or distance-decay functions (e.g., Gaussian kernel)
- K-nearest neighbors: Connects each location to its K closest neighbors
- Radius-based: Connects all locations within a specified distance threshold
- The choice of weight matrix fundamentally shapes the detected spatial patterns and must reflect the biological scale of the expected interactions
Spatial Permutation Test
A non-parametric statistical method for assessing the significance of observed spatial autocorrelation by generating an empirical null distribution. The test randomly shuffles gene expression values across spatial locations while preserving the tissue's spatial structure, then recalculates the autocorrelation statistic for each permutation.
- Null hypothesis: The observed spatial pattern is consistent with random assignment of expression values to locations
- P-value calculation: The proportion of permuted statistics that are more extreme than the observed value
- Accounts for the inherent spatial constraints of tissue architecture without assuming a parametric distribution
- Essential for identifying spatially variable genes with statistical confidence
Variogram Analysis
A geostatistical tool adapted for spatial transcriptomics that characterizes spatial dependence as a function of distance. The variogram plots the average squared difference in gene expression between all pairs of locations against their separation distance, revealing the spatial scale at which expression values become decorrelated.
- Nugget: The variance at zero distance, representing measurement noise and biological variability at sub-resolution scales
- Sill: The variance at which spatial dependence plateaus, indicating the total population variance
- Range: The distance at which the sill is reached, defining the characteristic length scale of spatial autocorrelation for a gene
- Particularly useful for comparing spatial organization across different genes and determining optimal spatial resolution requirements

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us