Spatially Variable Genes (SVG) are genes whose expression is statistically dependent on spatial coordinates within a tissue section, rejecting the null hypothesis of random spatial distribution. Detection relies on spatial autocorrelation metrics like Moran's I or Gaussian process regression to quantify the degree of expression clustering. Identifying SVGs is the foundational computational step in spatial transcriptomics, distinguishing biologically meaningful regional patterns from ubiquitous background expression.
Glossary
Spatially Variable Genes (SVG)

What is Spatially Variable Genes (SVG)?
Spatially Variable Genes are transcripts whose expression levels exhibit a statistically significant dependence on physical location within a tissue, indicating non-random spatial patterning rather than uniform distribution.
SVG detection methods are broadly categorized by their statistical framework: spatial permutation tests shuffle location labels to generate null distributions, while spatial point process models treat individual mRNA molecules as events. Downstream, SVGs serve as inputs for spatial domain detection and spatial trajectory inference, enabling the reconstruction of tissue architecture and dynamic biological gradients directly from spatially resolved expression data.
Key Characteristics of Spatially Variable Genes
Spatially Variable Genes (SVGs) are the fundamental units of spatial transcriptomic analysis, representing transcripts whose expression is non-randomly distributed across a tissue. Their identification relies on a convergence of statistical rigor and biological context.
Statistical Definition of Spatial Dependence
An SVG is formally defined by a statistically significant departure from Complete Spatial Randomness (CSR) . This is not merely a difference in expression between arbitrary regions, but a quantifiable dependence on spatial coordinates. Detection relies on rejecting a null hypothesis where expression values are equally likely to be observed at any location, independent of their neighbors. Key statistical frameworks include:
- Spatial Autocorrelation Metrics: Statistics like Moran's I quantify the degree of clustering or dispersion.
- Gaussian Process Regression: Models expression as a continuous function over spatial coordinates to identify genes with non-zero spatial length scales.
- Permutation Tests: Randomly shuffling spatial labels to generate an empirical null distribution, against which the observed spatial pattern is tested.
Distinction from General Differential Expression
SVGs are fundamentally distinct from Differentially Expressed Genes (DEGs) . A DEG is defined by a change in mean expression between pre-annotated groups (e.g., tumor vs. normal). An SVG is defined by its spatial pattern, which can manifest as a gradient, a patch, or a punctate distribution, often without requiring prior histological annotation. A gene can be an SVG without being a DEG, and vice versa. For example, a gene forming a sharp gradient across a histologically uniform tissue section is an SVG but not a DEG, as no discrete groups exist to compare. This makes SVG analysis a powerful tool for unsupervised tissue structure discovery.
Expression Patterns and Biological Interpretation
SVGs are categorized by their spatial expression patterns, each with distinct biological implications:
- Clustered/Patchy Patterns: Indicate expression confined to specific cell types or anatomical microenvironments, such as a gene expressed only in a lymphoid follicle.
- Gradient Patterns: Reveal continuous morphogen-like signaling or developmental trajectories, such as a gene whose expression increases linearly from the outer cortex to the inner medulla of an organ.
- Punctate/Dispersed Patterns: Often signify expression in rare, scattered cells like infiltrating immune cells or specific neuronal subtypes.
- Laminar Patterns: Common in brain and retinal tissues, where expression aligns with defined anatomical layers.
Computational Detection Methods
A suite of computational tools has been developed to identify SVGs, each with different statistical assumptions:
- SpatialDE: Uses Gaussian process regression to decompose expression variance into spatial and non-spatial components.
- SPARK-X: A rapid, non-parametric method that directly tests the dependence of expression on spatial location using a generalized spatial covariance test, without assuming a specific expression distribution.
- trendsceek: Identifies SVGs by testing for significant spatial trends using marked point process statistics, such as Ripley's K function.
- Moran's I-based methods: Directly compute the spatial autocorrelation statistic for each gene, often using a spatial neighborhood graph to define proximity.
Role in Tissue Niche and Microenvironment Discovery
SVGs are the primary input for defining spatial domains and cellular niches. By clustering genes with similar spatial patterns, or by clustering spatial locations based on their SVG expression profiles, researchers can identify functionally coherent tissue regions de novo. This process, often implemented with Spatial Graph Neural Networks or Spatial Hidden Markov Models, reveals the tissue's functional architecture. For instance, co-expression of a set of immune-related SVGs can define an area of active inflammation, while a different set of SVGs defines a fibrotic capsule, all without prior knowledge of these structures.
Relationship to Spatial Resolution and Technology
The definition and detection of an SVG are intrinsically linked to the spatial resolution of the assay. A gene may appear as an SVG at single-cell resolution but not at a multi-cellular spot level where its signal is averaged out. Conversely, a gene with a broad, tissue-level gradient is best detected by lower-resolution, capture-based technologies like Visium. High-resolution techniques like MERFISH or Xenium are required to identify SVGs with subcellular or rare-cell punctate patterns. Therefore, an SVG is not an absolute property of a gene but a property of a gene measured at a specific spatial scale.
Frequently Asked Questions
Clear, technically precise answers to the most common questions about identifying and interpreting spatially variable genes in transcriptomic data.
A spatially variable gene (SVG) is a gene whose expression level exhibits a statistically significant dependence on spatial location within a tissue, indicating a non-random distribution pattern. This definition is operationalized by testing against a null hypothesis of complete spatial randomness. Formally, an SVG is identified when the observed spatial pattern of transcript abundance—whether clustered, gradient-like, or region-specific—cannot be explained by random chance alone. Detection relies on quantifying the relationship between a gene's expression vector and a spatial neighborhood graph, where nodes represent cells or capture spots and edges encode physical proximity. Key statistical frameworks include Moran's I for global autocorrelation, Gaussian process regression for continuous spatial trends, and spatial permutation tests that shuffle location labels to generate empirical null distributions. The threshold for significance is typically set at a false discovery rate (FDR) below 0.05 after multiple testing correction across thousands of genes.
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 frameworks and computational methods that underpin the identification and analysis of Spatially Variable Genes (SVG).
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. It is the foundational concept behind SVG detection.
- Positive autocorrelation: Similar expression levels cluster together.
- Negative autocorrelation: Dissimilar values are adjacent (rare in biology).
- Zero autocorrelation: A random spatial pattern with no spatial dependency.
SVG detection methods are essentially formal tests for the presence and strength of spatial autocorrelation in gene expression vectors.
Moran's I
A global spatial autocorrelation statistic that measures the overall clustering of a gene expression pattern across a tissue. It produces a single summary value ranging from -1 (dispersed) to +1 (highly clustered), with 0 indicating randomness.
- Compares the expression at each spot to the weighted average of its neighbors.
- Requires a pre-defined spatial weights matrix defining adjacency.
- Statistical significance is assessed via a permutation test.
Moran's I is one of the oldest and most interpretable methods for identifying SVGs, though it assumes stationarity across the tissue.
Spatial Permutation Test
A non-parametric statistical test that randomly shuffles spatial labels to generate a null distribution for assessing the significance of observed spatial patterns.
- Null hypothesis: The observed spatial pattern is no different from random assignment.
- Procedure: Gene expression values are randomly reassigned to spatial locations thousands of times, and the test statistic is recalculated each time.
- The observed statistic is compared to this null distribution to compute an empirical p-value.
This approach makes no assumptions about the underlying data distribution and is the gold standard for significance testing in SVG detection.
Ripley's K Function
A spatial point pattern analysis tool used to determine if cells or molecular events are clustered, dispersed, or randomly distributed across multiple distance scales simultaneously.
- Unlike Moran's I, it evaluates spatial dependency as a function of distance r.
- K(r) > expected: Clustering at distance r.
- K(r) < expected: Dispersion at distance r.
- The Besag L-function is a variance-stabilized transformation commonly used for visualization.
This multi-scale property makes it particularly valuable for identifying SVGs that exhibit distinct patterns at different spatial resolutions.
Spatial Neighborhood Graph
A data structure where each spatial location is a node, and edges connect neighboring locations based on a distance threshold or k-nearest neighbors. It is the computational backbone for most SVG detection algorithms.
- Delaunay triangulation: Connects spots based on spatial tessellation.
- k-Nearest Neighbors (kNN): Each spot connects to its k closest spots.
- Radius-based: All spots within a fixed distance d are connected.
The graph enables efficient computation of spatial lag vectors and is required input for spatial graph neural networks and Gaussian process models.
Spatial Hidden Markov Model
A probabilistic model that infers unobserved spatial domains by assuming that the observed gene expression at each location depends on a hidden state with spatial dependencies.
- Hidden states: Represent distinct tissue regions or functional zones.
- Transition probabilities: Govern the likelihood of moving between states across adjacent spots.
- Emission probabilities: Model the gene expression distribution given a state.
Spatial HMMs go beyond simple autocorrelation by segmenting tissue into coherent regions, making them powerful for identifying SVGs that define anatomical boundaries rather than smooth gradients.

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