Method for carrying out spatial domain division on spatial transcriptomics data
Through the combination of pseudo-label semi-supervised and clustering integration algorithms, graph neural networks are used to divide spatial transcriptome data, which solves the problems of discontinuity and noise influence in spatial domain division in the existing technology, and realizes classification on different data sets. Stability and robustness, accurately identifying spatial regions and preserving organizational structure.
Patent Information
- Application Number
- CN202410734123.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-09-03
AI Technical Summary
Existing spatial transcriptome data partitioning methods cannot effectively combine spatial location information, resulting in discontinuous partitioning results and are easily affected by noise, leading to 'over-smoothing' and 'over-squeezing' phenomena, and insufficient performance on different data sets. Robust.
The pseudo-label semi-supervised method is used to train the graph neural network, combined with the clustering integration algorithm, the graph neural network is used to divide the spatial domain, the stability is enhanced through pre-clustering labels and clustering integration algorithms, and the multi-task training of the graph neural network is Protects against noise and preserves fine structure of tissue.
It achieves the stability and robustness of spatial domain division results on different platforms, can accurately identify spatial regions with certain gene expression patterns, retains the complex fine structure in tissues, reduces the impact of noise, and avoids 'over-smoothing' and 'over-squeezing' phenomenon.
Smart Images

Figure CN118588159A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data mining, and in particular relates to a method for performing spatial domain division on spatial transcriptomics data. Background Art
[0002] Spatial transcriptomics is a method to study the spatial distribution and heterogeneity of intracellular gene expression in tissues or organs. Compared with traditional single-cell transcriptome sequencing technology, spatial transcriptomics can not only provide transcriptome expression profiles based on sequencing sites, but also provide the physical location of each sequencing site. Many major discoveries in life sciences stem from the realization that the arrangement of cells in tissues is closely related to their biological functions. Therefore, spatial transcriptomics technology helps us to deeply analyze topics such as the development of tissues and organs, the pathogenesis of diseases, and the tumor immune microenvironment. Most studies on spatial transcriptome data are analyzed based on functional areas as the basic unit. This regional division can help researchers identify the spatial distribution patterns of different cell types, cell subtypes, or cell states. Therefore, spatial domain identification, that is, mining spatial regions with similar gene expression patterns from the transcriptional profile expression of spatial transcriptome sequencing sites, is the primary and important task in analyzing spatial transcriptome data.
[0003] The detection of spatially highly variable genes is to mine genes with certain spatial distribution patterns from all sequenced genes. These genes show significant spatial variability in tissues or cell populations and may be associated with tissue-specific functions or disease states. By detecting these spatially highly variable genes, researchers can identify genes with restricted expression in tissues, key genes in tissue development and functional regulation, and potential markers associated with diseases.
[0004] To derive spatial domains with certain biological functions and screen spatially highly variable genes with certain spatial expression patterns, the method is required to fully utilize the transcriptome expression obtained by spatial transcriptome sequencing and its corresponding spatial position information.
[0005] Traditional clustering methods such as Louvain, K-means, and mclust cannot combine spatial location information, resulting in discontinuous partitioning results in space. Existing spatial domain partitioning methods designed specifically for spatial transcriptome data can be divided into two categories according to their output: the first category directly outputs clustering results, and the second category outputs a low-dimensional representation for each sequencing site, and performs clustering, visualization, pseudo-sequential trajectory analysis, and other downstream analyses on the low-dimensional representation.
[0006] In the first category of methods, Edward Zhao et al. proposed a method called BayesSpace in Nature Biotechnology in 2021. This method achieves spatial clustering by encouraging adjacent points to belong to the same cluster through a hidden Markov random field prior that obeys the Potts distribution. The shortcoming of this type of method is that it is obviously oversimplified to use only linear models to model the relationship between complex genes.
[0007] The second type of method uses a self-supervised learning strategy to train a graph neural network. It performs nonlinear dimensionality reduction on high-dimensional gene expression data to obtain a more expressive low-dimensional representation. At the same time, the graph constructed using the physical location of the sequencing site introduces a spatial location prior. The low-dimensional representation obtained by this type of method has a wide range of applications. It can not only be used for spatial domain partitioning, but also can be visualized using uniform manifold approximation and projection, and pseudo-time series trajectory inference using a partition-based graph abstraction algorithm.
[0008] In 2022, Kangning Dong et al. published a method called STAGATE in Nature Communications, which uses spatial positions to build a map according to Euclidean distance and uses an adaptive graph self-attention network to extract representations. This method completely relies on the graph neural network to reconstruct the input feature space, which will cause the model to learn noise.
[0009] In 2023, Yahui Long published a method called GraphST in Nature Communications. This method constructs a neighbor graph for each sequencing site according to its spatial position, uses a graph convolutional neural network as the basic architecture, and combines the idea of contrastive learning to maximize the mutual information of each sequencing site and its neighborhood representation. The obtained representation is clustered using the mclust method to obtain the spatial domain partitioning result. This method sets contrast constraints in a low-noise, low-dimensional embedding space, which to some extent alleviates the impact of relying entirely on high-noise sequencing data. However, incorrect selection of positive and negative samples during contrastive learning will lead to incorrect self-supervision signals for model mining.
[0010] The above algorithm using graph neural network does not take into account that graph neural network uses summing or averaging to aggregate surrounding nodes, which leads to "over-smoothing" and "over-squeezing" phenomena. "Over-smoothing" is manifested as the fine structure in the tissue cannot be reflected in the final spatial domain division result because the graph neural network aggregates multiple layers of neighborhoods, resulting in the convergence of neighborhood nodes; "over-squeezing" is due to the fact that the sequencing sites that should belong to the same type in the tissue are far apart in space. During the mapping process, these sites cannot be directly connected. During the message transmission process of the graph neural network, the messages of long-distance neighbors are submerged, and ultimately these sites are divided into different spatial domains. In addition, the above method does not resist noise very well. In practical applications, the performance on different data sets varies greatly, and the division results are not robust enough. Summary of the invention
[0011] In order to overcome the shortcomings of the prior art, assist researchers in in-depth analysis of spatial transcriptome sequencing data, and promote cutting-edge research in the field of life sciences, the present invention discloses a robust, interpretable, finely divided graph neural network based on semi-supervised learning for spatial transcriptome spatial domain partitioning. The present invention can accurately identify spatial regions with certain gene expression patterns, retain the complex and fine structures in tissues, and perform stably on sequencing data from different platforms. To achieve the above objectives, the present invention adopts the following technical solutions: using a pseudo-label semi-supervised method to train a graph neural network to retain the fine structure in the tissue; using a clustering ensemble algorithm to synthesize the classification results obtained by training two neural networks with pre-processed gene expression data to enhance the stability of the spatial domain partitioning of the present invention on different data sets.
[0012] A method for spatial domain division of spatial transcriptomics data of the present invention comprises the following steps:
[0013] 1) Collect spatial transcriptomics data samples and record the information obtained by sequencing into two matrices: a gene expression matrix and a spatial position matrix; the gene expression matrix is the behavior sequencing site, the column is the gene being tested, and its elements represent the expression level of the gene transcriptome at the sequencing site; the spatial position matrix is the behavior sequencing site, the column is the matrix of the horizontal and vertical coordinates of the physical space;
[0014] 2) Preprocessing the gene expression matrix of the spatial transcriptome includes the following steps:
[0015] 2.1 Delete genes expressed in less than 5 sequenced sites;
[0016] 2.2 Screening N highly variable genes, the default value is 3000;
[0017] 2.3 The total number of genes in each sequencing site was normalized to 10,000;
[0018] 2.4 Logarithmize the gene expression and record it as X ns ;
[0019] 2.5 Scale the expression of each gene to unit variance and zero mean, denoted as X s ;
[0020] 3) Use the position matrix to calculate the Euclidean distance between each sequencing site. For each sequencing site, select K nearest neighbors to construct the adjacency matrix A. The value of K depends on the sequencing technology. For Visium sequencing data with non-single-cell resolution, K is 7, while for single-cell resolution sequencing data such as Stereo-seq and Slide-seq V2, K is 15.
[0021] 4) Pre-clustering the sequencing sites to obtain pre-clustering labels, including the following steps:
[0022] 4.1 For the X in step 2.4 ns and X from step 2.5 s Perform principal component analysis and extract the first 20 principal components; multiply the principal components with the adjacency matrix to obtain the principal components with spatial perception, which are denoted as PC s and PC ns ;
[0023] 4.2 Use the mclust algorithm to calculate the spatially aware principal component PC obtained in step 4.1 s and PC ns Clustering is performed and divided into C categories;
[0024] 4.3 For PC s and PC ns The clustering results of the screening are recorded as Y ns ,Y s , the corresponding set of sequencing sites is denoted as V ns ,V s ;The default value of μ is 0.997;
[0025] 5) Scale the gene expression X after step 2.5 ns The data is used to construct a graph neural network for feature extraction and spatial domain division, which includes the following steps:
[0026] 5.1 is X in step 2.5 s Building a graph neural network for node classification s (·), including an encoder consisting of two layers of graph isomorphic networks s (·), a mapping layer consisting of a fully connected layer and a classification head consisting of a fully connected layer
[0027] 5.2 Replace the X in step 2.5 s Through Encoder s (·), Get the classification results of the network Right now:
[0028]
[0029] 5.3 Sequencing site set V in step 4.3 ns , calculate the prediction results With the pre-clustered labels Y s The multi-classification cross entropy loss between them is used to update the network parameters;
[0030] 6) Constructing a graph neural network for the unscaled gene expression data, performing feature extraction, spatial domain partitioning and gene expression reconstruction under the supervision of some high-confidence pre-clustering labels, including the following steps:
[0031] 6.1 is X in step 2.4 ns Construct a multi-task graph neural network. The network needs to complete two tasks: spatial domain classification and gene expression reconstruction. The network responsible for spatial domain classification is denoted as f ns (·):Encoder consisting of two layers of graph isomorphism network ns (·), a fully connected layer mapping layer One fully connected layer classification head The network that completes the gene reconstruction task includes: a fully connected layer mapping layer and a decoder consisting of a two-layer graph isomorphic network ns (·);
[0032] 6.2 Randomly select a portion of genes in proportion to add perturbations, including the following steps:
[0033] 6.2.1 Shuffle the gene list and randomly select genes according to the ratio α (the default value of α is 0.8) Add perturbations, including replacement noise and learnable masks;
[0034] 6.2.2 Shuffle the list of genes that need to be disturbed, and add them according to the proportion β (the default value of β is 0.05) Randomly select some genes Add substitution noise, i.e. randomly replace the expression of other genes;
[0035] 6.2.3 Residue Add a learnable mask; the learnable mask masks the expression of the selected gene on all nodes;
[0036] 6.3 Add noise to X ns Through Encoder ns (·) to obtain a low-dimensional embedding Z; Z is sequentially passed through and Get the prediction results of spatial domain division Pass Z in sequence through and Decoder ns (·) Obtained reconstructed gene expression Right now:
[0037] Z=Encoder ns (X ns ,A)
[0038]
[0039] 6.4 For the sequencing site set V obtained in step 4.3 s The sequencing sites in the calculation prediction results With the pre-clustered labels Y ns Multi-classification cross entropy loss; for the genes calculate With X ns The adaptive reconstruction loss function between the two is used; the classification loss and the reconstruction loss are weighted summed to obtain the total loss, and the network weights are updated using the adaptive moment estimation optimizer; after reaching the preset number of updates, the network parameters are saved and the prediction results are and
[0040] Use (X ns +1) 2 As adaptive weights for error calculation, As error; adding noise Calculate the weighted error as the reconstruction loss;
[0041] 6.5 Then, relying only on the reconstruction loss, the adaptive moment estimation optimizer is used to update the network weights. After reaching the pre-set number of updates, the reconstructed gene expression is saved. for corrected gene expression;
[0042] 7) Using a clustering integration algorithm to fuse the spatial domain division results obtained in step 5) and step 6) to obtain the final spatial domain division result, including the following steps:
[0043] 7.1 Construct a bipartite graph based on the spatial domain partition results. The two types of nodes in the bipartite graph correspond to the sequencing sites and the two clusters respectively. The subordinate inclusion relationship between the clusters constitutes the edge. Convert the connection relationship of the bipartite graph into a real symmetric adjacency matrix.
[0044] 7.2 Calculate the Laplacian matrix of the real symmetric adjacency matrix, take the top_num eigenvectors of the Laplacian matrix and use the K-means algorithm to divide it into C clusters; the cluster to which each sequencing site belongs is the final spatial domain division result;
[0045] 8) For each spatial domain, spatially highly variable genes are obtained by interpreting the trained spatial domain partitioning network; the union of spatially highly variable genes obtained from all spatial domains is the spatially highly variable genes on the sample, including the following steps:
[0046] 8.1 Read the spatial domain partitioning network f trained in step 6.1 ns (·), fix the parameters and construct a trainable vector S with the same dimension as the input gene as the gene selector; read the gene expression after denoising Calculate the difference between the average expression of each gene in the spatial domain and the average expression at other locations to initialize the gene selector S; read the node classification results Convert it into binary labels The node label of the current spatial domain d is 1, otherwise it is 0;
[0047] 8.2 After the gene selector S is activated by the Sigmoid function, it is used as a mask and X ns Multiply, input space domain partition network f ns (·),from Get classification results Right now:
[0048]
[0049] Where: ⊙ represents each value of Sigmoid(S) and X ns Multiply each column of genes in;
[0050] 8.3 and Calculate binary cross entropy classification loss Calculating L1 loss To limit the total number of genes selected; calculate the information entropy loss Discretize the values of the constrained gene selector; calculate the contrast loss The genes selected by the constraint can distinguish this spatial domain from other spatial domains; binary cross entropy classification loss L1 loss Information entropy loss Contrastive loss The sum is the total loss of the model Use the adaptive moment estimation optimizer to update the weight of the gene selector S and train until the gene selector S converges;
[0051] 8.4 Read the weight of the trained gene selector S, calculate its mean and variance after passing it through the Sigmoid function; select genes that exceed the mean plus ε times the variance as spatially highly variable genes.
[0052] The beneficial effects of the present invention are:
[0053] The present invention is a technology for spatial domain partitioning of spatial transcriptome data and identification of spatially highly variable genes. In terms of framework, the present invention connects the spatial domain partitioning with the identification tasks of spatially highly variable genes, and uses spatial domain partitioning to guide the identification of spatially highly variable genes. In terms of method, the present invention uses a graph neural network to fuse the spatial position information and gene expression information obtained by spatial transcriptome sequencing. The two tasks completed during the graph neural network training process: spatial domain classification and gene interpolation tasks can well resist the problems of large noise and high sparseness rate that are prevalent in spatial transcriptome sequencing, making the present invention more robust to low-quality sequencing data compared to other spatial domain partitioning algorithms. At the same time, the pre-clustering labels introduced in the network training can well resist the problems of over-smoothing and over-backlog that are prevalent in graph neural networks, so that the spatial domain obtained by the present invention, compared to other spatial domain partitioning algorithms, retains the fine structure in the tissue structure while maintaining spatial smoothness, which is conducive to the in-depth analysis of the development of tissues and organs, the pathogenesis of diseases, tumor immune microenvironment and other topics by experts in related fields. At the same time, the present invention uses a clustering integration algorithm to comprehensively scale the spatial expression patterns of the two gene expressions before and after, making the present invention more robust in the face of spatial transcriptome data on different platforms. Finally, the present invention introduces deep learning interpretability methods into spatial transcriptomics data analysis to identify spatially highly variable genes. Compared with other methods, the present invention is interpretable, which helps researchers identify genes with restricted expression in tissues, key genes in tissue development and functional regulation, and potential markers associated with diseases. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 This is a flowchart of the spatial domain partitioning method based on graph neural network;
[0055] Figure 2 Based on Figure 1 Flow chart of the method for identifying spatially highly variable genes based on the method of spatial domain partitioning;
[0056] Figure 3 The visualization diagrams are of the spatial domain partitioning results of 151674 slices in the human dorsolateral prefrontal cortex dataset using the present invention and the prior art methods respectively;
[0057] Figure 4 These are spatially highly variable genes detected by the present invention on 151,673 slices in the human dorsolateral prefrontal cortex dataset. DETAILED DESCRIPTION
[0058] The present invention is described below with reference to the accompanying drawings.
[0059] like Figure 1 As shown, the present invention takes the spatial transcriptome dataset of 151674 slices of the human dorsolateral prefrontal cortex obtained by 10x Visium sequencing as an example. The dataset contains 3673 pixels, 7 clusters, and each pixel has 33538 genes.
[0060] The specific steps are as follows:
[0061] S1 uses spatial transcriptome sequencing technology to obtain spatial transcriptome sequencing data, and processes the obtained data into a data structure that can be processed by the model. Specifically, the model input includes the gene expression level of each sequencing site and its corresponding coordinate position;
[0062] S2 processes gene expression data. First, we screen genes expressed in at least five sequencing sites, screen 3,000 highly variable genes, normalize the total gene expression in each sequencing site to 10,000, logarithmize the gene expression, and record the gene expression at this time as X s , the total expression of each gene at different sequencing sites was normalized to 10, and the gene expression was recorded as X ns ;
[0063] S3 processes the spatial position coordinates. For each sequencing site, the Euclidean distance from it to other sites is calculated, and the 7 points closest to it are selected as neighbors. The adjacency matrix is denoted as A, and the weight is 1 if there is an adjacency relationship, otherwise it is 0;
[0064] S4 pre-clustered the sequencing sites and constructed high-quality pseudo tags.
[0065] S4.1 X s ,X ns Use principal component analysis to reduce the dimension, and take the first 20 principal components as the expression after dimension reduction. The expression after dimension reduction is aggregated according to the adjacency graph A and the average is taken as the principal component dimension reduction result with spatial structure information, recorded as PC ns ,PC s ;
[0066] S4.2 Use the mclust algorithm to separate PC ns ,PC s ;
[0067] S4.3, for PC ns We consider the probability of each sequencing site being assigned to its category. If the probability value is greater than 0.997, the node number is added to the set V. ns, the corresponding label is added to the set Y ns For PC s The clustering results of are processed in the same way to obtain the node set V s and label set Y s .
[0068] S5 constructs a graph neural network for the scaled gene expression data, performs feature extraction under the supervision of some high-confidence pre-clustering labels, and completes the spatial domain classification task.
[0069] S5.1 uses X s Building a graph neural network for node classification s (·): Encoder consisting of two layers of graph isomorphic networks s (·) Used to map 3000-dimensional gene expression features to 64-dimensional low-order embeddings, a fully connected layer mapping layer Used to map low-dimensional embeddings to a 64-dimensional classification space, a fully connected layer classification head Output the probability that each node belongs to 7 classes
[0070] S5.2 will be X s Sequential Get the classification results of the network Right now:
[0071]
[0072] S5.3 to V s The nodes in the collection, With Y s Calculate the multi-classification cross entropy loss. Use the adaptive moment estimation algorithm to update the network parameters. After 200 updates, save
[0073] S6 constructs a graph neural network for unscaled gene expression data, performs feature extraction under the supervision of some high-confidence pre-clustering labels, and completes spatial domain classification tasks and gene interpolation tasks.
[0074] S6.1 for X ns Building a multi-task graph neural network f ns (·):Encoder consisting of two layers of graph isomorphism network ns (·) is used to reduce the dimensionality of 3000-dimensional gene expression to obtain a 64-dimensional low-dimensional embedding Z, a fully connected layer mapping layer Used to map Z to a 64-dimensional classification space, a fully connected layer classification head Output the probability that each node belongs to 7 classes A fully connected layer mapping layer Decoder Decoder is a two-layer graph isomorphic network used to map the low-dimensional embedding Z to a 64-dimensional reconstruction space. ns (·) Obtain 3000-dimensional node attribute reconstruction results
[0075] S6.2 Using pseudo-random method to ns Add perturbations. We first shuffle the gene order, select the top 80% of genes (2400) to add replacements, and mask the two perturbations. Shuffle all genes and select the top 4% of genes (120) as noise sources. Shuffle the order of the selected 2400 genes and select the top 120 genes whose expression is replaced as noise sources. The remaining selected noise genes (2280) are replaced with the same trainable mask.
[0076] S6.3 After adding noise disturbance X ns Through Encoder ns (·) to get the low-dimensional embedding Z. Input Z into Get node classification results Enter Z one by one Right now:
[0077] Z=Encoder ns (X ns ,A)
[0078]
[0079] S6.4 For V ns Nodes in the collection, calculation With Y ns Multi-class cross entropy loss between Calculate the adaptive reconstruction loss for the 2400 genes with added noise
[0080] Weighted sum of classification loss and reconstruction loss As the total loss, the network weights are updated using the adaptive moment estimation optimizer. After 200 updates, save and f ns (·) Model parameters.
[0081] S6.5 stops the node classification task and relies only on the reconstruction loss Using the Adaptive Moment Estimator Update f ns (·) parameter, save the corrected gene expression after updating 300 times
[0082] S7 uses a clustering ensemble algorithm to classify the spatial domain results in steps S5.3 and S6.3 and The fusion is performed to obtain the final spatial domain division result.
[0083] S7.1 Construction of bipartite graph G: The nodes in the graph include 3673 sequencing site nodes and and The divided 2*7 spatial domain nodes are composed of a total of 3687 nodes; the edge set represents the subordinate and inclusive relationship between the sequencing site and the spatial domain. If there is a subordinate or inclusive relationship, it is 1, otherwise it is 0. The adjacency matrix of the graph is a real symmetric matrix.
[0084] S7.2 Calculate the Laplace matrix L of the adjacency matrix of the graph G, perform eigenvalue decomposition on L, and select the 10 eigenvalues with the largest eigenvalues as the representation of the nodes in the graph. Use the K-means algorithm to divide the representation into 7 categories, among which the category labels obtained for the 3673 nodes representing the sequencing sites are the spatial domain division results.
[0085] S8 trains gene selectors for the seven spatial domains on the 151674 slices to find spatially highly variable genes.
[0086] S8.1 loads the f obtained in the previous step after 200 generations of training ns (·) Network model, fixed network model parameters. For the current spatial domain, construct a trainable gene selector with the same parameters as the input gene dimension, that is, a 3000-dimensional mask S. Read the gene expression after denoising obtained in S6.3 Calculate the difference between the average expression of each gene in the spatial domain and the average expression of other locations to initialize the gene selector S. Read the prediction results of the model and convert the prediction results into binary labels with the current spatial domain sequencing site label as 1 and the other spatial domain sequencing site labels as 0, recorded as
[0087] S8.2 Network forward propagation. First, the 3000-dimensional mask is normalized by the Sigmoid function. Then the normalized gene selector Sigmoid (S) is combined with the gene expression X obtained by preprocessing in step S2. ns Multiply them together to get the gene input f selected according to the weight ns (·),from Get the result of binary classification of sequencing sites
[0088]
[0089] Where ⊙ represents each value of Sigmoid(S) and X nsMultiply each row in (3000-dimensional gene expression of sequenced sites).
[0090] S8.3 Calculation of losses and The binary cross entropy loss between For the gene selector Sigmoid(S), calculate its L1 regularization loss Limit the total number of selected genes and calculate their entropy loss Discretize the selection and calculate the category contrast loss The selected genes are expressed similarly in the current spatial domain, while the current spatial domain is not similar to other spatial domains. Weighted calculation of the total loss The Adam optimizer is used to update the parameters of the gene selector S. The network training ends when the loss no longer decreases.
[0091] S8.4 Obtain spatially highly variable genes from gene selectors. For each spatial domain gene selector, the normalized weight is obtained by the Sigmoid function, denoted as Sigmoid(S), and its mean and variance are calculated. Genes with values exceeding 2.5 times the variance of the mean are considered to be spatially highly variable genes. The spatially highly variable genes obtained by the gene selectors of the 7 spatial domains are combined to obtain spatially highly variable genes on 151,674 slices.
[0092] 6. Simulation
[0093] The technical effects of the present invention are described below in conjunction with simulation experiments.
[0094] 1. Simulation conditions:
[0095] Computer hardware: NVIDIA GeForce RTX 3090, 24G video memory;
[0096] Computer software: Python3.8 integrated development software.
[0097] 2. Simulation content:
[0098] The spatial domain division was performed on the spatial transcriptome dataset of 12 slices of the human dorsolateral prefrontal cortex DLPFC obtained by the Visium platform based on the second-generation sequencing and the mouse somatosensory cortex dataset obtained by osmFISH sequencing based on fluorescence in situ hybridization using the present invention and the existing SEDR, GraphST, STAGATE, SpaGCN, BayesSpace, and Seurat methods, and the adjusted Rand index ARI was used as an evaluation index for evaluating the spatial domain division results of each method. The results are shown in the following table:
[0099]
[0100] As can be seen from the table above, on the 12 slices of the DLPFC dataset of Visium, the present invention has better results than other methods, and the average is also higher than other methods. On the sequencing data based on fluorescence in situ hybridization, the present invention achieved the highest ARI score compared to other methods, which proves the accuracy of the present invention in spatial domain division and has good generalization on different sequencing platforms.
Claims
1. A method for spatial domain partitioning of spatial transcriptomics data, characterized in that: The following steps are involved: 1) Collect spatial transcriptomics data samples and record the information obtained from sequencing into two matrices: a gene expression matrix and a spatial position matrix; the gene expression matrix is a behavioral sequencing site, with the columns being the genes being tested, and its elements representing the expression level of the gene transcriptome at the sequencing site; The spatial position matrix is a matrix of behavioral sequencing sites, listed as horizontal and vertical coordinates of physical space; 2) Preprocessing the gene expression matrix of the spatial transcriptome includes the following steps: 2.1 Delete genes expressed in less than 5 sequenced sites; 2.2 Screening N highly variable genes, the default value is 3000; 2.3 The total number of genes in each sequencing site was normalized to 10,000; 2.4 Logarithmize the gene expression and record it as X ns ; 2.5 Scale the expression of each gene to unit variance and zero mean, denoted as X s ; 3) Use the position matrix to calculate the Euclidean distance between each sequencing site. For each sequencing site, select K nearest neighbors to construct the adjacency matrix A. The value of K depends on the sequencing technology. For Visium sequencing data with non-single-cell resolution, K is 7, while for single-cell resolution sequencing data such as Stereo-seq and Slide-seq V2, K is 15. 4) Pre-clustering the sequencing sites to obtain pre-clustering labels, including the following steps: 4.1 For the X in step 2.4 ns and X from step 2.5 s Perform principal component analysis and extract the first 20 principal components; multiply the principal components with the adjacency matrix to obtain the principal components with spatial perception, which are denoted as PC s and PC ns ; 4.2 Use the mclust algorithm to calculate the spatially aware principal component PC obtained in step 4.1 s and PC ns Clustering is performed and divided into C categories; 4.3 For PC s and PC ns The clustering results of the screening are recorded as Y ns ,Y s , the corresponding set of sequencing sites is denoted as V ns ,V s ;The default value of μ is 0.997; 5) Scale the gene expression X after step 2.5 ns The data is used to construct a graph neural network for feature extraction and spatial domain division, which includes the following steps: 5.1 is X in step 2.5 s Building a graph neural network for node classification s (·), including an encoder consisting of two layers of graph isomorphic networks s (·), a mapping layer consisting of a fully connected layer and a classification head consisting of a fully connected layer 5.2 Replace the X in step 2.5 s Through Encoder s (·), Get the classification results of the network Right now: 5.3 Sequencing site set V in step 4.3 ns , calculate the prediction results With the pre-clustered labels Y s The multi-classification cross entropy loss between them is used to update the network parameters; 6) Constructing a graph neural network for the unscaled gene expression data, performing feature extraction, spatial domain partitioning, and gene expression reconstruction under the supervision of some high-confidence pre-clustering labels, including the following steps: 6.1 is X in step 2.4 ns Construct a multi-task graph neural network. The network needs to complete two tasks: spatial domain classification and gene expression reconstruction. The network responsible for spatial domain classification is denoted as f ns (·):Encoder consisting of two layers of graph isomorphism network ns (·), a fully connected layer mapping layer One fully connected layer classification head The network that completes the gene reconstruction task includes: A fully connected layer mapping layer and a decoder consisting of a two-layer graph isomorphic network ns (·); 6.2 Randomly select a portion of genes in proportion to add perturbations, including the following steps: 6.2.1 Shuffle the gene list and randomly select genes according to the ratio α (the default value of α is 0.8) Add perturbations, including replacement noise and learnable masks; 6.2.2 Shuffle the list of genes that need to be disturbed, and add them according to the proportion β (the default value of β is 0.05) Randomly select some genes Add substitution noise, i.e. randomly replace the expression of other genes; 6.2.3 Residue Add a learnable mask; the learnable mask masks the expression of the selected gene on all nodes; 6.3 Add noise to X ns Through Encoder ns (·) to obtain a low-dimensional embedding Z; Z is sequentially passed through and Get the prediction results of spatial domain division Pass Z in sequence through and Decoder ns (·) Obtained reconstructed gene expression Right now: Z=Encoder ns (X ns ,A) 6.4 For the sequencing site set V obtained in step 4.3 s The sequencing sites in the calculation prediction results With the pre-clustered labels Y ns Multi-classification cross entropy loss; for the genes calculate With X ns The adaptive reconstruction loss function between the two is used; the classification loss and the reconstruction loss are weighted summed to obtain the total loss, and the network weights are updated using the adaptive moment estimation optimizer; after reaching the preset number of updates, the network parameters are saved and the prediction results are and Use (X ns +1) 2 As adaptive weights for error calculation, As error; adding noise Calculate the weighted error as the reconstruction loss; 6.5 Then, relying only on the reconstruction loss, the adaptive moment estimation optimizer is used to update the network weights. After reaching the pre-set number of updates, the reconstructed gene expression is saved. for corrected gene expression; 7) Using a clustering integration algorithm to fuse the spatial domain division results obtained in step 5) and step 6) to obtain the final spatial domain division result, including the following steps: 7.1 Construct a bipartite graph based on the spatial domain partition results. The two types of nodes in the bipartite graph correspond to the sequencing sites and the two clusters respectively. The subordinate inclusion relationship between the clusters constitutes the edge. Convert the connection relationship of the bipartite graph into a real symmetric adjacency matrix. 7.2 Calculate the Laplacian matrix of the real symmetric adjacency matrix, take the top_num eigenvectors of the Laplacian matrix and use the K-means algorithm to divide it into C clusters; the cluster to which each sequencing site belongs is the final spatial domain division result; 8) For each spatial domain, spatially highly variable genes are obtained by interpreting the trained spatial domain partitioning network; the union of spatially highly variable genes obtained from all spatial domains is the spatially highly variable genes on the sample, including the following steps: 8.1 Read the spatial domain partitioning network f trained in step 6.1 ns (·), fix the parameters and construct a trainable vector S with the same dimension as the input gene as the gene selector; read the gene expression after denoising Calculate the difference between the average expression of each gene in the spatial domain and the average expression at other locations to initialize the gene selector S; Read node classification results Convert it into binary labels The node label of the current spatial domain d is 1, otherwise it is 0; 8.2 After the gene selector S is activated by the Sigmoid function, it is used as a mask and X ns Multiply, input space domain partition network f ns (·),from Get classification results Right now: Where: ⊙ represents each value of Sigmoid(S) and X ns Multiply each column of genes in; 8.3 and Calculate binary cross entropy classification loss Calculating L1 loss To limit the total number of genes selected; calculate the information entropy loss Discretize the values of the constrained gene selector; calculate the contrast loss The genes selected by the constraint can distinguish this spatial domain from other spatial domains; binary cross entropy classification loss L1 loss Information entropy loss Contrastive loss The sum is the total loss of the model Use the adaptive moment estimation optimizer to update the weight of the gene selector S and train until the gene selector S converges; 8.4 Read the weight of the trained gene selector S, calculate its mean and variance after passing it through the Sigmoid function; select genes that exceed the mean plus ε times the variance as spatially highly variable genes.
Citation Information
Cited By
Method and device for identifying spatial organization structure of spatial transcriptome data
CN119673270A
Three-dimensional space sequencing interpolation method and system based on diffusion model
CN119889440A
Spatial domain identification method based on multi-view weighted fusion GCN network
CN120148635A
A Spatial Domain Recognition Method Based on a Multi-View Weighted Fusion GCN Network
CN120148635B
Idle data feature extraction method, spatial domain identification method and system
CN120388612A
