- Spatially variable gene (SVG) detection is an important computational approach in spatial transcriptomics and spatial omics. It identifies genes whose expression levels change systematically across different locations within a tissue. Unlike conventional differential expression analysis, which generally compares gene expression between experimental groups or cell populations, spatially variable gene analysis investigates how gene expression is organized across physical tissue coordinates. It helps researchers identify genes associated with anatomical regions, tissue compartments, cellular neighbourhoods, developmental gradients, tumour microenvironments, and other spatially organized biological processes.
- In biological tissues, gene expression is rarely distributed uniformly. Different regions contain distinct cell populations and perform different physiological functions. For example, the brain contains specialized anatomical regions with different neuronal and glial populations, while the liver contains spatially organized zones with different metabolic activities. Tumours may contain regions with different levels of oxygen availability, immune-cell infiltration, blood supply, and cellular proliferation. These differences produce spatial patterns of gene expression that can be identified through spatial transcriptomics and computational analysis.
- Spatially variable genes are genes whose expression is associated with tissue location or spatial organization. Their expression may increase or decrease gradually across a tissue, form localized expression regions, follow anatomical boundaries, or occur in repeated spatial structures. Some genes may be highly expressed in a particular tissue compartment but weakly expressed elsewhere, while others may show continuous spatial gradients. Detecting these patterns helps reveal the molecular characteristics of different tissue regions and provides information about biological processes occurring within them.
- Spatially variable gene detection begins with a spatial gene-expression dataset. Depending on the technology, observations may represent capture spots, individual cells, or subcellular measurements. Each observation contains gene-expression values and corresponding spatial coordinates. For sequencing-based platforms such as 10x Genomics Visium, Visium HD, and Slide-seq, the data generally consist of gene-count matrices associated with spatial capture locations. Imaging-based platforms such as Xenium, CosMx, MERFISH, and seqFISH provide transcript measurements with spatial coordinates and, in suitable workflows, cell assignments. The resolution and structure of the dataset influence the statistical methods used for SVG detection.
- Before spatially variable genes are identified, the data undergo quality control and preprocessing. Low-quality spots or cells, unreliable molecular measurements, background signals, and incorrect spatial coordinates may affect the analysis. Expression counts are generally normalized to account for differences in sequencing depth, capture efficiency, or the number of detected molecules. Genes with extremely low expression may be filtered because they provide insufficient information for reliable spatial modelling. However, filtering must be performed carefully so that biologically meaningful rare or spatially restricted genes are not unnecessarily removed.
- A central challenge in spatial transcriptomics is that nearby observations are often more similar to each other than distant observations. This phenomenon is known as spatial autocorrelation. Spatial autocorrelation describes the degree to which a gene’s expression at one location is related to its expression at neighbouring locations. Positive spatial autocorrelation occurs when nearby observations have similar expression values, while negative spatial autocorrelation indicates that neighbouring locations tend to have dissimilar values. SVG detection methods use spatial coordinates and statistical models to identify expression patterns that are unlikely to arise from random spatial distributions.
- One widely used measure of spatial autocorrelation is Moran’s I. It evaluates whether a variable is spatially clustered, dispersed, or randomly distributed across a set of locations. A simplified expression for Moran’s I is:
- [
I = \frac{n}{W}
\frac{\sum_i\sum_j w_{ij}(x_i-\bar{x})(x_j-\bar{x})}
{\sum_i(x_i-\bar{x})^2}
] - Copyable formula:
- I = (n / W) × [Σi Σj wij (xi − x̄)(xj − x̄)] / [Σi (xi − x̄)²]
- Here, (n) is the number of spatial observations, (x_i) and (x_j) represent the expression values at locations (i) and (j), (\bar{x}) is the mean expression, (w_{ij}) represents the spatial weight connecting two locations, and (W) is the sum of all spatial weights. Positive values generally indicate spatial clustering of similar expression values, negative values indicate spatial dispersion, and values near the expected value under spatial randomness suggest little spatial autocorrelation. Statistical significance is assessed using an appropriate null model or permutation procedure.
- Another measure used in spatial analysis is Geary’s C, which evaluates differences between expression values at neighbouring locations. It is more sensitive to local differences than Moran’s I in some settings. Both measures can be used to assess spatial autocorrelation, although their suitability depends on the spatial structure, data distribution, and analytical objective. They provide useful statistical summaries but do not necessarily describe the complete spatial pattern of a gene.
- Several specialized computational methods have been developed for detecting spatially variable genes. SpatialDE uses statistical modelling to identify genes whose expression is associated with spatial variation. It models spatial expression patterns using Gaussian processes and compares spatial models with non-spatial alternatives. SpatialDE is useful for identifying genes with smooth spatial patterns and gradients. SPARK uses generalized linear spatial models to identify spatially expressed genes while accounting for the characteristics of count-based transcriptomic data. SPARK-X provides a scalable non-parametric approach that can be applied to large spatial transcriptomics datasets. These methods are widely used in spatial gene-expression analysis, although their assumptions and computational requirements differ.
- Other methods provide additional approaches to SVG detection. Trendsceek identifies genes with spatial expression patterns using spatial statistics and permutation-based testing. nnSVG uses nearest-neighbour Gaussian processes to improve computational efficiency when analysing large spatial datasets. SpatialDM is designed to investigate spatially informed molecular interactions and can complement spatial expression analysis. Squidpy provides spatial statistics and analysis functions, including spatial autocorrelation measures and neighbourhood analysis. Giotto also provides tools for spatial expression analysis and identification of spatially structured genes. The selection of a method depends on dataset size, spatial resolution, expression distribution, and the type of spatial pattern being investigated.
- Spatially variable gene detection commonly involves statistical hypothesis testing. For each gene, the analysis evaluates whether its expression is associated with spatial coordinates more strongly than expected under a suitable null model. A null hypothesis generally assumes that the gene does not exhibit meaningful spatial variation under the statistical model. Alternative hypotheses allow spatially structured expression. Methods may use likelihood comparisons, Gaussian processes, spatial covariance models, permutation tests, or other statistical approaches. Because thousands of genes are tested simultaneously, multiple-testing correction is necessary to control false-positive discoveries.
- The false discovery rate (FDR) is commonly controlled using the Benjamini–Hochberg procedure. This adjusts the significance values obtained from individual gene tests to account for the large number of comparisons. Genes with adjusted p-values below a predefined threshold may be considered statistically significant spatially variable genes. However, statistical significance does not necessarily indicate a strong biological effect. Researchers should also examine expression magnitude, spatial distribution, detection frequency, and biological relevance.
- The spatial patterns of identified genes are generally visualized using tissue maps and spatial expression plots. These visualizations show where each gene is expressed and how its expression changes across tissue regions. Heatmaps, spatial feature plots, contour maps, and spatial expression gradients can reveal localized expression, anatomical boundaries, and continuous molecular transitions. Tools such as Seurat, Scanpy, Squidpy, Giotto, and SpatialExperiment support spatial visualization and downstream analysis. Spatial plots are important because a statistically significant result should also be examined to determine whether its pattern is biologically interpretable.
- Spatially variable gene detection is different from conventional differential expression analysis. Differential expression analysis identifies genes whose expression differs between predefined groups, such as healthy and diseased samples, treated and untreated tissues, or two cell types. Spatially variable gene analysis identifies genes whose expression changes according to spatial location, even when no predefined groups exist. The two approaches can complement each other. For example, researchers may first identify spatially variable genes within a tumour and then compare their expression between tumour regions or experimental conditions.
- An important application is the identification of anatomical and functional tissue regions. Spatially variable genes can reveal molecular boundaries between tissue compartments and identify genes associated with specialized cellular environments. In the brain, they can help characterize gene-expression gradients across neuronal layers and anatomical regions. In the liver, they can identify genes associated with different metabolic zones. In developing tissues, spatial expression patterns can reveal molecular gradients involved in cell differentiation, tissue formation, and organ development.
- In cancer research, spatially variable gene detection helps identify molecular differences between tumour regions, stromal compartments, immune-cell-rich areas, and regions affected by hypoxia or abnormal blood supply. These patterns may reveal genes associated with tumour progression, immune suppression, invasion, and treatment resistance. In immunology, spatially variable genes can help characterize localized immune responses and inflammatory environments. In neuroscience, they can identify molecular differences between brain regions and cellular layers. In developmental biology, they can reveal spatially regulated genes involved in embryonic development and tissue organization.
- Spatially variable gene detection can also be integrated with cell-type mapping and spatial clustering. Once spatial domains have been identified, researchers can investigate which genes characterize each region and whether their expression patterns are associated with specific cell populations. Reference-based mapping and spatial deconvolution methods, such as RCTD, cell2location, SPOTlight, stereoscope, DestVI, and Tangram, can help interpret the cellular composition of spot-based measurements. Combining SVG detection with cell-type information helps distinguish spatial patterns caused by changes in cellular composition from those caused by changes in gene expression within particular cell populations.
- Another important extension is the integration of spatial transcriptomics with single-cell RNA sequencing and other omics technologies. Single-cell RNA sequencing provides detailed cellular expression profiles but generally loses the original tissue coordinates. Spatial transcriptomics retains tissue location information but may have lower gene coverage or mixed-cell measurements, depending on the platform. Integrating these datasets can help identify which cell types express spatially variable genes and where those cells are located. Spatial proteomics, epigenomics, and metabolomics can provide complementary information about protein distribution, chromatin regulation, and metabolic activity.
- In animal genomics and breeding research, spatially variable gene detection can help investigate tissue-specific molecular organization in livestock and other animal species. It may reveal genes associated with muscle-fibre development, skeletal muscle growth, mammary gland function, reproductive tissue organization, liver metabolism, and immune responses. Comparisons between breeds, developmental stages, physiological conditions, and disease states may identify spatially regulated genes associated with economically important traits such as growth, meat quality, milk production, fertility, disease resistance, and environmental adaptation. Cross-species analysis requires appropriate reference genomes, gene annotations, and orthology information because differences in genome annotation and gene conservation can affect comparisons.
- Despite its usefulness, spatially variable gene detection has several limitations. Results may be influenced by spatial resolution, sequencing depth, tissue quality, gene-detection efficiency, normalization, and the spatial neighbourhood definition. Spot-based datasets may contain mixed expression profiles from multiple cells, making it difficult to determine whether a spatial pattern originates from a particular cell type or from changes in cellular composition. Imaging-based datasets may have incomplete transcript detection, limited gene panels, or cell-segmentation errors. Different statistical methods may also identify different genes because they use different assumptions and spatial models.
- Careful interpretation and validation are therefore essential. Researchers should compare results from suitable analytical methods, inspect spatial expression patterns, consider tissue morphology, and account for biological replicates and experimental conditions. Candidate genes can be validated using RNA in situ hybridization, RNAscope, smFISH, immunofluorescence, immunohistochemistry, and other molecular approaches. Experimental validation is particularly important when spatially variable genes are used to propose new biological mechanisms or identify potential biomarkers.
- Overall, spatially variable gene detection is a fundamental component of spatial transcriptomics analysis. It identifies genes whose expression is organized according to tissue location and helps reveal molecular gradients, anatomical boundaries, functional compartments, and localized biological processes. Integrating SVG detection with spatial clustering, cell-type mapping, deconvolution, single-cell analysis, and multi-omics approaches provides a deeper understanding of how gene expression is organized within complex tissues. These methods are increasingly important in biomedical research, veterinary science, and animal genomics because they connect molecular activity with the spatial architecture of biological systems.