Method for spatial transcriptomic data clustering based on joint adjacency matrix

By constructing a joint adjacency matrix and a graph autoencoder, the problems of inconsistent information architecture and incomplete gene modeling in existing spatial transcriptome data analysis are solved. This enables accurate identification of spatial structural domains and improves biological interpretability, thereby enhancing clustering accuracy and robustness.

CN122177243APending Publication Date: 2026-06-09CHANGCHUN NORMAL UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHANGCHUN NORMAL UNIV
Filing Date
2026-01-26
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing spatial transcriptome data analysis methods have shortcomings in terms of high precision, high robustness, and biological interpretability. In particular, they have limited accuracy in identifying spatial domain boundaries, and their multimodal data integration and gene modeling are incomplete. They also lack a unified information architecture, which leads to inaccurate analysis results and difficulty in adapting to different data platforms.

Method used

A joint adjacency matrix is ​​constructed that integrates the SPOT-SPOT spatial adjacency matrix, the SPOT-GENE expression matrix, and the GENE-GENE gene co-expression network matrix. End-to-end learning is performed using a graph autoencoder, and adaptive alignment and feature fusion of multimodal data are achieved through residual connections and multi-task learning mechanisms.

Benefits of technology

It achieves accurate identification of spatial structural domains, improves clustering accuracy and biological interpretability, reduces the complexity of multimodal data integration, and enhances the robustness and reproducibility of the method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122177243A_ABST
    Figure CN122177243A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on joint adjacency matrix spatial transcriptome data clustering method, belong to computer science and bioinformatics field.The method constructs a fusion SPOT-SPOT space adjacency matrix, SPOT-GENE expression matrix and GENE-GENE gene co-expression network matrix, to realize the adaptive alignment of multi-modal data in structure.On this basis, by introducing the graph auto-encoder with residual connection and multi-task learning mechanism, joint learning node low-dimensional embedding and model parameters, finally realize the accurate identification of spatial functional domain.The application constructs a complete technical process from multi-source data integration, graph structure modeling, feature learning to spatial domain identification, can accurately analyze the spatial organization mode and functional state of cell in tissue sample, provides a powerful computing tool for developmental biology, tumor microenvironment and other researches.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of computer science and bioinformatics, and relates to a spatial transcriptome data clustering method, specifically a multimodal graph neural network clustering analysis method for spatial transcriptome data. Background Technology

[0002] Spatial transcriptomics, by preserving the spatial location information of genes while measuring their expression, provides a crucial tool for understanding the spatial heterogeneity of tissue microenvironment and cellular function. This technology primarily relies on platforms such as 10x Visium and Stereo-seq, combining spatial barcoding with high-throughput sequencing on tissue sections to achieve the localization and quantitative analysis of transcriptomes at each sampling point (SPOT). Currently, spatial domain clustering algorithms, such as BayesSpace and SpaGCN, have provided fundamental analytical methods for this field. With the maturation of the technology, spatial transcriptomics is expanding from basic research to clinical and translational research areas such as oncology, neuroscience, and developmental biology.

[0003] However, existing technologies still face a series of interconnected core challenges in achieving high-precision, robust, and biologically interpretable spatial analysis. First, the accuracy of spatial domain boundary identification is limited. Between adjacent but functionally different regions (such as the tumor-stromal junction and different layers of the cerebral cortex), existing methods often result in blurred boundaries and mixed regions. This problem is particularly pronounced in regions with high cell type mixing and gentle gene expression gradients, leading to the loss of crucial spatial information when analyzing microenvironment structures. Second, the high dimensionality, sparsity, and technical noise of the data itself pose significant challenges to analytical methods. Spatial transcriptome data typically contains expression values ​​of tens of thousands of genes at tens of thousands of spatial points, and contains a large number of zero counts and platform-specific noise. Traditional linear dimensionality reduction methods (such as PCA) or shallow networks struggle to extract discriminative robust features, thus necessitating deep learning architectures capable of characterizing nonlinear relationships and resisting noise. Furthermore, cross-platform and cross-resolution versatility remains a weakness of current methods. Different experimental platforms (such as 10x Genomics Visium, Slide-seqV2, and MerFish) exhibit significant differences in spatial resolution, gene capture efficiency, and noise patterns. Most methods are often optimized for specific data types during their design, lacking adaptability to different technical platforms. This results in large performance fluctuations when the same analytical method is applied to data from different sources, limiting its widespread adoption and application in practical research.

[0004] To address some of the aforementioned challenges, researchers have proposed various computational schemes. Traditional methods, such as clustering based on Seurat or Scanpy, relying on algorithms like K-means and Louvain, while widely used, often neglect spatial continuity, leading to histologically disjointed identified domains. To introduce spatial constraints, probabilistic methods like Giotto and BayesSpace utilize Hidden Markov Random Fields or Bayesian priors to encourage adjacent points to belong to the same category, improving local consistency. However, their utilization of spatial coordinates remains relatively shallow and struggles to characterize nonlinear patterns in gene expression. In recent years, deep learning methods based on graph neural networks have become mainstream. For example, SpaGCN constructs a weighted graph by fusing histological images, spatial coordinates, and gene expression to enhance the recognition of morphological boundaries; STAGATE introduces a graph attention mechanism to adaptively learn the association strength between adjacent points; and SEDR uses deep autoencoders and variational graph autoencoders to process expression data and spatial structure, respectively. In addition, contrastive learning frameworks have been widely introduced to improve feature robustness. For example, CCST and SpaceFlow employ strategies such as Depth Graph Information Maximization (DGI) to learn low-dimensional representations that are invariant to noise and enhancement.

[0005] Despite improvements in various methods to address specific challenges, the current field of spatial transcriptome analysis still faces several interconnected core technical limitations. First, heterogeneous information lacks a unified, collaboratively learnable architecture; most methods fail to align and jointly optimize the spatial relationships between SPOTs, the expression relationships between SPOTs and genes, and the functional associations between genes within the same graphical model or mathematical framework. Second, gene modeling suffers from inherent flaws; existing models typically treat genes merely as feature vectors characterizing cell states, rather than as independent entities within a graph structure, neglecting the crucial role of functional association networks between genes in defining cell communities. Finally, fragmented analytical workflows and rigid optimization strategies constrain overall performance. Feature engineering, graph construction, and representation learning are often independent steps, and the fusion weights between different information sources rely heavily on subjective presets or discrete searches, failing to achieve data-driven adaptive adjustments. These shortcomings collectively lead to irreconcilable contradictions between the accuracy of boundary delineation, the biological interpretability of results, and robustness to diverse data, severely hindering the in-depth exploration from spatial mapping to the analysis of underlying functional mechanisms. Summary of the Invention

[0006] To address several key technical bottlenecks in current spatial transcriptome data analysis caused by inconsistent information architecture, incomplete entity modeling, and inflexible optimization mechanisms, this invention provides a spatial transcriptome data clustering method based on a joint adjacency matrix. The core of this method lies in constructing a fusion of the SPOT-SPOT spatial adjacency matrix, the SPOT-GENE expression matrix, and the GENE-GENE gene co-expression network matrix, thereby achieving adaptive alignment of multimodal data structurally. Based on this, a graph autoencoder with residual connections and multi-task learning mechanisms is introduced to jointly learn low-dimensional node embeddings and model parameters, ultimately achieving accurate identification of spatial functional domains. This invention constructs a complete technical workflow from multi-source data integration, graph structure modeling, feature learning to spatial domain identification, capable of accurately resolving the spatial organization patterns and functional states of cells in tissue samples, providing a powerful computational tool for research in developmental biology, tumor microenvironment, and other fields.

[0007] The objective of this invention is achieved through the following technical solution:

[0008] A spatial transcriptome data clustering method based on a joint adjacency matrix includes the following steps:

[0009] Step 1) Data Input and Preprocessing:

[0010] Step 1.1) Read the spatial transcriptome gene expression matrix and the spatial coordinate data of each SPOT;

[0011] Step 1.2) Preprocess the gene expression matrix, including: filtering out genes expressed in fewer than a preset number of SPOTs (e.g., the preset number is 5), then performing standardization and logarithmic transformation, then screening for highly variable genes, and finally normalizing the expression values ​​of highly variable genes by Z-score.

[0012] Step 2) Construct the joint adjacency matrix :

[0013] Step 2.1) Construct the SPOT-SPOT spatial adjacency matrix :

[0014] First, the Euclidean distance matrix between each pair of SPOTs is calculated based on the spatial coordinates of all SPOTs. Then, an adaptive Gaussian kernel function is used to convert the Euclidean distances into a spatial similarity matrix. Finally, the spatial similarity matrix is ​​subjected to K-nearest neighbor sparsification, meaning that for each SPOT, only the connections to its K most similar neighbors are retained, and the symmetry of the matrix is ​​ensured by taking the maximum value, thus generating a sparse, spatially proximity-based SPOT-SPOT adjacency matrix. ;

[0015] Step 2.2) Construct the SPOT-GENE expression matrix :

[0016] The gene expression matrix that has been screened and standardized in step 1) is directly defined as the SPOT-GENE expression matrix. ;

[0017] Step 2.3) Constructing a gene co-expression network matrix :

[0018] matrix Transpose the matrix to obtain the GENE-SPOT expression matrix. Principal component analysis was used to reduce the dimensionality of the gene expression network, and cosine similarity was used to calculate the functional similarity between genes. Threshold sparsification was then applied to construct the gene co-expression network matrix. ;

[0019] Step 2.4) Construct the joint adjacency matrix :

[0020] matrix , , , The following block structure is used to construct a joint adjacency matrix. :

[0021]

[0022] in, and The global weight coefficients are learnable and satisfy the following conditions: ;

[0023] Step 3) Construct the dual-source node feature matrix :

[0024] Using the screened and standardized gene expression matrix from step 1) as the first-person perspective... After transposing it, principal component analysis is performed to reduce the dimensionality, resulting in a second perspective. ;Will and Vertically concatenated, the final dual-source node feature matrix is ​​formed. ;

[0025] Step 4) Node embedding learning and online clustering evaluation based on graph autoencoder:

[0026] Joint adjacency matrix With dual-source node feature matrix The input is fed into an encoder-decoder architecture based on a graph convolutional network (GCN) for end-to-end training, yielding clustering result labels with the highest adjusted Land index (ARI) values, where:

[0027] The encoder consists of a multi-layer graph convolutional network containing residual connections, which is achieved through a joint adjacency matrix. The message passing is performed on the upper level, a low-dimensional embedding representation is generated for all nodes, and the embedding representation is output after L2 normalization;

[0028] The decoder is a multilayer perceptron used to reconstruct input features;

[0029] End-to-end training uses the AdamW optimizer with the goal of minimizing the reconstruction loss (mean squared error) of node features;

[0030] The end-to-end training and evaluation process is as follows: After each round of training, the model performs online evaluation. First, the SPOT node embeddings of the first num_spot dimensions are accurately extracted from the complete embeddings output by the encoder. Then, principal component analysis (PCA) is performed on these embeddings for dimensionality reduction to further denoise and visualize them, and the K-Means algorithm is immediately used to cluster them. Finally, the ARI of the current clustering result and the baseline label is calculated and compared with the historical best value to update the results, thereby dynamically tracking and saving the clustering result label with the highest ARI value for spatial domain partitioning and performance evaluation. This process ensures that the model can directly produce the optimal spatial domain partitioning while optimizing representation learning.

[0031] Step 5) Spatial Domain Identification:

[0032] The clustering result label with the highest ARI value saved in step 4) is directly used as the final clustering result input for spatial domain identification. This clustering result label fully records the spatial domain category to which each SPOT belongs.

[0033] Compared with the prior art, the present invention has the following advantages:

[0034] 1. Significantly improved accuracy in spatial domain identification. Traditional methods mostly rely on a single spatial proximity graph, which cannot effectively identify functionally synergistic but spatially discrete cell communities. This invention constructs a unified encoding of multi-source heterogeneous information from the graph structure source by integrating the SPOT-SPOT spatial adjacency matrix, the SPOT-GENE expression matrix, and the GENE-GENE gene co-expression network matrix. This fundamental improvement enables the model to simultaneously utilize the local continuity of space and the global synergy of gene function for discrimination. Based on this, trainable global weight coefficients (…) are introduced. , This invention employs gradient descent for end-to-end optimization, adaptively finding the optimal information fusion balance point for different datasets. Experimental verification shows that this series of designs enables the present invention to significantly outperform existing mainstream methods in clustering accuracy metrics (such as the adjusted RAND index, ARI) on multiple publicly available spatial transcriptome benchmark datasets (such as the human dorsolateral prefrontal cortex DLPFC), achieving a more refined and reliable analysis of tissue spatial structure.

[0035] 2. Reduces the complexity of multimodal data integration and analysis. This invention provides a complete, automated process from raw data to clustering results. Users do not need to manually design complex graph structures or preset key global weight coefficients based on experience (such as...). , The model can automatically determine the optimal configuration of different relational modules in a joint heterogeneous graph through data-driven learning. This significantly reduces the requirement for users' professional experience, reduces subjective bias and trial-and-error costs introduced by human intervention, and improves the robustness and repeatability of the method.

[0036] 3. Explicitly modeling genes as network nodes significantly enhances the biological interpretability and mechanism discovery potential of clustering results. Existing methods typically treat genes merely as a "feature list" describing cells, ignoring the intrinsic, collaborative networks between genes. This invention treats each gene as an independent point (node) in a graph and specifically constructs a gene co-expression network matrix (…). This method is used to clearly establish the connections between genes and how they work and are expressed together. When dividing tissue regions, the model considers not only the proximity of cells but also the functional similarity of the genes expressed by these cells. Therefore, the method of this invention can discover cell populations that may be spatially discontinuous but perform highly similar biological functions. Attached Figure Description

[0037] Figure 1 This is an overall flowchart of the spatial transcriptome data clustering method based on the joint adjacency matrix (stJAG);

[0038] Figure 2 A bar chart showing the numerical comparison of clustering performance metrics between stJAG and four other spatial transcriptome clustering methods on the human DLPFC dataset;

[0039] Figure 3 The image shows the spatial domain identification results of sample 151508 processed using stJAG and four other spatial transcriptome clustering methods. Detailed Implementation

[0040] The technical solution of the present invention will be further described below with reference to the accompanying drawings, but it is not limited thereto. Any modifications or equivalent substitutions to the technical solution of the present invention that do not depart from the spirit and scope of the technical solution of the present invention should be covered within the protection scope of the present invention.

[0041] This invention provides a spatial transcriptome data clustering method based on a joint adjacency matrix. The method proposes a deep clustering and analysis framework for spatial transcriptome data based on unified heterogeneous graph modeling, aiming to provide a more robust, interpretable, and end-to-end computational tool for studying tissue spatial heterogeneity. The core of this framework is the construction of a fusion matrix integrating SPOT-SPOT spatial adjacency matrices, SPOT-GENE expression matrices, and GENE-GENE gene co-expression networks. For the first time, it computationally unifies cells, genes, and their diverse interactions within a complete topological structure, laying the foundation for in-depth exploration of spatial biological laws. Furthermore, learnable dynamic weight parameters are introduced, enabling the model to adaptively optimize the contributions of different information sources, achieving data-driven tuning of the fusion strategy. Finally, by deploying an encoder on this enhanced graph structure, the model can simultaneously perceive spatial context and gene functional modules during information aggregation, thereby learning more biologically interpretable node embeddings. This series of collaborative designs collectively achieves more accurate and interpretable identification and analysis of spatial structural domains. Experiments have demonstrated that this invention effectively overcomes the shortcomings of existing technologies, achieving superior clustering results compared to mainstream methods on multiple benchmark datasets, and providing a more reliable computational tool for the analysis of spatial transcriptome data. Figure 1 As shown, the specific steps include the following:

[0042] Step 1) Obtain the spatial transcriptome dataset:

[0043] The spatial transcriptome data used in this invention are derived from internationally recognized standardized platforms or public databases, including five independent datasets produced by technologies such as 10x Genomics Visium and MerFish. These data cover multiple sample types with clear anatomical or pathological backgrounds, such as human dorsolateral prefrontal cortex (DLPFC), human breast cancer tissue, and mouse whole brain slices. Each dataset provides validated benchmark clustering labels, providing a reliable basis for verifying the performance of the method of this invention.

[0044] Step 2) Data preprocessing:

[0045] Read the spatial transcriptome gene expression matrix and the spatial coordinate data of each SPOT, and preprocess the gene expression matrix, including: firstly filtering out genes expressed in fewer than a preset number of SPOTs (e.g., the preset number is 5), then performing standardization and logarithmic transformation, then screening for highly variable genes (e.g., 2000), and finally normalizing the expression values ​​of highly variable genes by Z-score.

[0046] Step 3) Construction of the joint adjacency matrix:

[0047] Step 3.1) Construct the SPOT-SPOT spatial adjacency matrix :

[0048] First, based on the loaded spatial coordinate data, calculate the pairwise Euclidean distance matrix between all SPOT coordinates. For coordinates respectively... and The Euclidean distance between two SPOTs The calculation formula is:

[0049]

[0050] Subsequently, an adaptive Gaussian kernel function is used to transform the above Euclidean distance matrix into a spatial similarity matrix, the elements of which are... Defined as:

[0051]

[0052] in, To control the Gaussian kernel width parameter within the neighborhood range, the bandwidth parameter of the kernel function is dynamically determined by calculating the median of the non-zero distance, thus achieving adaptation to different spatial distribution scales of datasets; this spatial similarity matrix serves as the SPOT-SPOT spatial adjacency matrix. .

[0053] Finally, the spatial similarity matrix is ​​subjected to K-nearest neighbor sparsification, which means that for each SPOT, only the connections of its K most similar neighbors are retained, and the symmetry of the matrix is ​​ensured by taking the maximum value, thereby generating a sparse SPOT-SPOT adjacency matrix based on spatial proximity. The expression is as follows:

[0054]

[0055] In the formula, This represents the total number of SPOTs in the spatial transcriptome data. Represents the first in the matrix line, number The elements of the column, i.e., SPOTi With SPOT j The final spatial proximity weight between them .

[0056] Step 3.2) Construct the SPOT-GENE expression matrix :

[0057] The gene expression matrix that has been screened and normalized in step 2) is used as the SPOT-GENE expression matrix. The expression is as follows:

[0058]

[0059] In the formula, This represents the total number of SPOTs in the spatial transcriptome data. This represents the total number of genes retained after pretreatment (hypervariate gene screening). Representation matrix The Middle line, number The elements of the column, whose values ​​represent the values ​​of the elements in the column. In the SPOT, the first The normalized expression levels of each gene after preprocessing. Preprocessing included: library size normalization, logarithmic transformation, Z-score normalization, etc. (as described in step 1.2). Therefore, It is usually a continuous real value (positive or negative) with a mean of 0 and a variance of 1, which can be directly used for subsequent numerical calculations.

[0060] Step 3.3) Construct the GENE-GENE gene co-expression network matrix :

[0061] For matrix Transpose the matrix to obtain the GENE-SPOT expression matrix. The expression is as follows:

[0062]

[0063] Based on matrix Principal component analysis was used to reduce the dimensionality of gene expression vectors, and cosine similarity was used to calculate the functional similarity between genes, resulting in a fully connected similarity matrix. For the dimensionality-reduced gene expression vectors... and cosine similarity The calculation formula is:

[0064]

[0065] in, Represents the dot product of vectors. This represents the L2 norm (Euclidean length) of a vector. Calculation results. The value range is [−1,1][−1,1]. The closer the value is to 1, the more similar the expression patterns of the two genes are; the closer it is to -1, the more opposite they are; and the closer it is to 0, the less related they are.

[0066] Based on the cosine similarity of each pair of genes It can construct a fully connected gene similarity matrix. Its specific expression is as follows:

[0067]

[0068] Among them, matrix elements = And satisfy = ,therefore It is A real symmetric matrix. Diagonal elements. =1 indicates that the similarity between each gene and itself is the maximum value of 1. All elements The value range is [-1, 1]. The closer the value is to 1, the more similar the expression patterns of the two genes are. The closer the value is to -1, the more opposite the expression patterns are. The closer the value is to 0, the more linearly independent the expression patterns are.

[0069] Finally, a sparse GENE-GENE gene functional association matrix was constructed by setting a hard threshold to sparsify the similarity matrix. The expression is as follows:

[0070]

[0071] To highlight significant functional associations and construct sparse topologies that are easier for graph neural networks to process, Perform hard threshold sparsity. Set a non-negative threshold. (The example value is 0.5, which can be adjusted between 0.3 and 0.7 depending on data quality.) Keep the absolute value less than... Set the elements to 0, and keep the absolute values ​​greater than or equal to 0. The element. This threshold acts as a saliency filter, designed to preserve strong associations with clear biological functions while suppressing noise and controlling graph complexity.

[0072] Step 3.4) Construct the joint adjacency matrix :

[0073] Combine the matrices obtained in steps 3.1), 3.2), and 3.3). , , and Perform block concatenation to construct a joint adjacency matrix. Its form is:

[0074]

[0075] in, and These are global weight coefficients, and satisfy... Used to adjust the SPOT-SPOT spatial adjacency matrix GENE-GENE gene function association matrix The contribution ratio in the joint adjacency matrix. Using a Bayesian optimization method, with the adjusted Rand index (ARI) between the clustering results and the true labels as the optimization objective, the parameter combinations ( , Automatic search and confirmation are performed.

[0076] Step 4) Construct the dual-source node feature matrix :

[0077] Using the screened and standardized gene expression matrix from step 1) as the first-person perspective... The gene expression matrix was transposed to obtain the gene expression profiles in different SPOTs, and principal component analysis was used to reduce the dimensionality. The dimensionality reduction results were then used as a second perspective. .Will and Vertically concatenating the features results in the final dual-source node feature matrix. These are used as input node features in a graph neural network. The specific steps are as follows:

[0078] Let the pretreated gene expression matrix be ,in For the number of SPOTs, This refers to the number of highly variable genes.

[0079] First-person perspective Directly As the first-person perspective feature matrix, that is:

[0080]

[0081] Second perspective First, Transpose to obtain the gene expression profile matrix .right Perform principal component analysis (PCA) for dimensionality reduction, retaining the previous values. Principal components (of which) The dimension after dimensionality reduction is usually ), to obtain the dimension-reduced matrix To align with the column numbers in the first-person perspective for vertical stitching, Extended by zero-padding or linear projection The column yields the second-view feature matrix. . Specifically, if Then in To fill the column with zeros on the right, make the column number become ;like ,but .

[0082] Vertical splicing: and Vertical concatenation yields the final dual-view node feature matrix. :

[0083]

[0084] The matrix As input node features of a graph neural network, their rows correspond to all nodes in the joint graph: [Previous row] row correspondence One SPOT node, then row correspondence There are GENE nodes. The feature dimension of each node is... This refers to the number of highly variable genes. The first perspective provides the original gene expression information, while the second perspective provides a dimensionality-reduced representation of the gene expression profile (after PCA extraction of major variation patterns). The concatenation of these two perspectives preserves multi-perspective information. In practical implementation, if... Zero-padding is solely for dimension alignment and does not affect the model's expressive power, as the subsequent graph neural network can automatically learn the importance of features through the weight matrix. Alternatively, learnable linear projections can be used instead of zero-padding. Mapped to dimension.

[0085] Step 5) Node embedding learning and online clustering evaluation based on graph autoencoder:

[0086] The joint adjacency matrix constructed in step 3) Compared with the dual-source node feature matrix constructed in step 4), The input is fed into a graph autoencoder to synchronously optimize node embedding representations and model parameters in an end-to-end manner.

[0087] The graph autoencoder employs an encoder-decoder architecture: the encoder consists of a four-layer graph convolutional network (GCN) with residual connections. This network... The previous iteration performs message passing and feature aggregation for each node in the graph (including...). SPOT nodes and The encoder learns a low-dimensional embedding representation (each GENE node) and outputs it after L2 normalization. Specifically, the encoder maps each node to a... A real-valued vector of dimension (in a specific embodiment of the invention, set as follows) =64). The embeddings of all nodes together constitute the node embedding matrix. .

[0088] The decoder is a multilayer perceptron (MLP) that reconstructs the original node features based on the embedding matrix Z. .

[0089] Global weight coefficient (and - The weights of the graph convolutional network and the graph convolutional network are collectively defined as trainable parameters. These parameters are dynamically optimized by minimizing a multi-task loss function consisting of feature reconstruction loss (such as mean squared error loss) and contrastive learning loss.

[0090] After training, from the final embedding matrix Extracting the first Okay, we get the SPOT node embedding matrix. This matrix contains a low-dimensional, dense, and discriminative representation of all spatial locations, which will be directly used for the next step of spatial domain identification.

[0091] Step 6) Spatial Domain Identification and Analysis:

[0092] The best SPOT clustering labels, dynamically saved throughout the training-evaluation optimization cycle in step 5), are directly used as input to the final clustering results for spatial domain identification. The result file directly records the spatial domain category to which each SPOT belongs.

[0093] Figure 3 This image shows the spatial domain identification results for sample 151508 processed using stJAG and four other spatial transcriptome clustering methods. Figure 3 It can be seen that cells belonging to the same color (i.e., the same cluster) exhibit a clear continuous clustering in space, rather than being randomly scattered. This proves that the proposed method effectively utilizes spatial information, and its clustering results have good spatial smoothness and consistency.

[0094] Identifying heterogeneous regions: The image shows multiple regions with relatively clear boundaries and different colors. This demonstrates that the method of this invention can successfully identify spatial domains with different gene expression patterns in tissues and clearly delineate the boundaries between them.

[0095] Step 7) Performance evaluation index testing:

[0096] Adjusted Rand Index (ARI), Normalized Mutual Information (NMI), and Cluster Accuracy (ACC) were used as evaluation metrics to assess the consistency between the clustering results and known real anatomical or functional annotations, thereby validating the effectiveness of the proposed method.

[0097] Figure 2 This is a bar chart comparing the clustering performance metrics of stJAG with four other spatial transcriptome clustering methods on the human DLPFC dataset. The comparison metrics include the adjusted RAND index (ARI), normalized mutual information (NMI), and accuracy (ACC). Figure 2 It can be seen that, in terms of the three key evaluation indicators, ARI, NMI, and ACC, the height of the bar chart corresponding to the method of this invention is significantly higher than that of the other four comparison methods. This provides objective and quantitative direct evidence to prove that the present invention has a significant advantage in clustering accuracy.

Claims

1. A spatial transcriptome data clustering method based on a joint adjacency matrix, characterized in that... The method includes the following steps: Step 1) Data Input and Preprocessing: Step 1.1) Read the spatial transcriptome gene expression matrix and the spatial coordinate data of each SPOT; Step 1.2) Preprocess the gene expression matrix; Step 2) Construct the joint adjacency matrix : Step 2.1) Construct the SPOT-SPOT spatial adjacency matrix : First, the Euclidean distance matrix between each pair of SPOTs is calculated based on the spatial coordinates of all SPOTs. Then, an adaptive Gaussian kernel function is used to convert the distances into a spatial similarity matrix. Finally, the spatial similarity matrix is ​​subjected to K-nearest neighbor sparsification, meaning that for each SPOT, only the connections to its K most similar neighbors are retained, and the symmetry of the matrix is ​​ensured by taking the maximum value, thus generating a sparse, spatially proximity-based SPOT-SPOT adjacency matrix. ; Step 2.2) Construct the SPOT-GENE expression matrix : The gene expression matrix that has been screened and standardized in step 1) is directly defined as the SPOT-GENE expression matrix. ; Step 2.3) Constructing a gene co-expression network matrix : matrix Transpose the matrix to obtain the GENE-SPOT expression matrix. Principal component analysis was used to reduce the dimensionality of the gene expression network, and cosine similarity was used to calculate the functional similarity between genes. Threshold sparsification was then applied to construct the gene co-expression network matrix. ; Step 2.4) Construct the joint adjacency matrix : matrix , , , The following block structure is used to construct a joint adjacency matrix. : in, and The global weight coefficients are learnable and satisfy the following conditions: ; Step 3) Construct the dual-source node feature matrix : Using the screened and standardized gene expression matrix from step 1) as the first-person perspective... After transposing it, principal component analysis is performed to reduce the dimensionality, resulting in a second perspective. ;Will and Vertically concatenated, the final dual-source node feature matrix is ​​formed. ; Step 4) Node embedding learning and online clustering evaluation based on graph autoencoder: Joint adjacency matrix With dual-source node feature matrix The input is fed into an encoder-decoder architecture based on a graph convolutional network (GCN) for end-to-end training to obtain clustering result labels with the highest adjusted RAND index (ARI) value. Step 5) Spatial Domain Identification: The clustering result label with the highest ARI value saved in step 4) is directly used as the final clustering result input for spatial structural domain identification.

2. The spatial transcriptome data clustering method based on joint adjacency matrix according to claim 1, characterized in that... In step 1.2), the preprocessing includes: filtering out genes expressed in fewer than a preset number of SPOTs, then performing standardization and logarithmic transformation, then screening for highly variable genes, and finally normalizing the expression values ​​of highly variable genes using Z-score.

3. The spatial transcriptome data clustering method based on a joint adjacency matrix according to claim 1, characterized in that... In step 2.1), for coordinates respectively and The Euclidean distance between two SPOTs The calculation formula is: 。 4. The spatial transcriptome data clustering method based on joint adjacency matrix according to claim 1, characterized in that... In step 2.1), the elements of the spatial similarity matrix Defined as: in, To control the Gaussian kernel width parameter within the neighborhood, The distance is Euclidean.

5. The spatial transcriptome data clustering method based on joint adjacency matrix according to claim 1, characterized in that... In step 2.3), for the gene expression vector after dimensionality reduction... and cosine similarity The calculation formula is: in, Represents the dot product of vectors. This represents the L2 norm of a vector.

6. The spatial transcriptome data clustering method based on a joint adjacency matrix according to claim 1, characterized in that... In step 4), the encoder consists of a multi-layer graph convolutional network containing residual connections, which is implemented through a joint adjacency matrix. The message passing is performed on the upper level, a low-dimensional embedding representation is generated for all nodes, and the embedding representation is output after L2 normalization; The decoder is a multilayer perceptron used to reconstruct the input features.

7. The spatial transcriptome data clustering method based on joint adjacency matrix according to claim 1, characterized in that... In step 4), end-to-end training uses the AdamW optimizer with the goal of minimizing the reconstruction loss of node features.

8. The spatial transcriptome data clustering method based on joint adjacency matrix according to claim 1, characterized in that... In step 4), the end-to-end training and evaluation process is as follows: After each round of training, the model performs online evaluation. First, the SPOT node embeddings of the first num_spot dimension are accurately extracted from the complete embeddings output by the encoder. Then, principal component analysis is performed on this embedding to reduce dimensionality for further noise reduction and visualization, and the K-Means algorithm is immediately used to cluster it. Finally, the adjusted RAND index of the current clustering result and the baseline label is calculated and compared with the historical best value and updated, so as to dynamically track and save the clustering result label with the highest ARI value, perform spatial domain partitioning and performance evaluation.