Method and system for identification of spatial transcriptomic cell expression patterns
By constructing a graph autoencoder model and training the model with multimodal information, the error problem of cell expression pattern recognition in spatial transcriptomics in existing technologies has been solved, achieving higher accuracy and reliability in cell expression pattern recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-17
- Publication Date
- 2026-04-07
AI Technical Summary
Existing spatial transcriptomics methods fail to fully utilize multimodal information, resulting in large errors in cell expression pattern recognition and a lack of unified, efficient, and reliable identification and analysis methods.
A graph autoencoder model is constructed using tissue images, gene expression data, and adjacency matrices. The model is trained with positive and negative sample data, and the reconstruction loss function and information entropy loss function are combined to improve the model's recognition accuracy and reliability.
It improves the accuracy and reliability of spatial transcriptomics cell pattern recognition, and is particularly suitable for sequencing methods such as 10X and MERFISH, improving scalability and operability.
Smart Images

Figure CN115732034B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of bioinformatics, and particularly relates to a spatial transcriptome cell expression pattern recognition method and system. BACKGROUND
[0002] The statements in this section merely provide background information related to the present application and do not necessarily constitute the prior art.
[0003] In recent years, spatial transcriptomics technology has developed rapidly. Unlike traditional sequencing technology, spatial transcriptomics integrates gene expression information with tissue section staining images, and locates gene expression data information of different cells to the original space of the tissue, which enables researchers to obtain information on the composition of cells and gene expression in different regions. However, there is no unified recognition and analysis method for efficiently and reliably using tissue images, gene expression information and location information to analyze cell expression patterns.
[0004] Existing STAGATE, SEDR, CCST and other model methods do not involve omics image information. Although SpaGCN, DeepST and other model methods add omics information, they do not fully utilize the omics information for analysis. Moreover, spatial transcriptome is multi-modal data, and insufficient use of this information will cause large errors in recognizing cell expression patterns. SUMMARY
[0005] To overcome the above-mentioned deficiencies of the prior art, the present application provides a spatial transcriptome cell expression pattern recognition method and system, which constructs a graph autoencoder, fully utilizes the multi-modal information in spatial transcriptomics, realizes cell pattern recognition of spatial transcriptomics, and improves the scalability and operability, and improves the recognition accuracy and reliability of cell expression patterns in tissue sections.
[0006] To achieve the above object, one or more embodiments of the present application provide the following technical solutions:
[0007] The first aspect of the present application provides a spatial transcriptome cell expression pattern recognition method.
[0008] A spatial transcriptome cell expression pattern recognition method comprises:
[0009] The obtained spatial transcriptome data is preprocessed to obtain positive sample data composed of image features, gene expression data and adjacency matrix, and the image features and gene expression data belonging to the same cell have a corresponding relationship;
[0010] The image features and gene expression data in the positive sample data are randomly adjusted to obtain negative sample data;
[0011] The graph auto-encoder model is constructed, and the graph auto-encoder model is trained by using positive sample data and negative sample data.
[0012] The sample data to be identified is input into the trained graph auto-encoder model to obtain a cell label as a final recognized cell type.
[0013] The graph auto-encoder model uses the encoder and the decoder in the model to construct a reconstruction loss function and an information entropy loss function to supervise the training of the model.
[0014] Further, the spatial transcriptome data includes tissue images, gene expression data and cell spatial coordinates.
[0015] Further, the preprocessing includes cutting a picture centered on the position of each identified cell to obtain an image of each cell from the tissue image, and extracting image features of single cells from the image of each cell by using an image feature extraction model.
[0016] Further, the preprocessing further includes gene screening, regularization and logarithm taking on the gene expression data.
[0017] Further, the preprocessing further includes calculating the Euclidean distance between cells according to the cell spatial coordinates, and constructing an adjacency matrix according to the distance of the Euclidean distance.
[0018] Further, the encoder of the graph auto-encoder model extracts encoding data from the image features, the gene expression data and the adjacency matrix.
[0019] The decoder of the graph auto-encoder model reconstructs the encoding data output by the encoder to obtain new image features and gene expression data.
[0020] A reconstruction loss function is constructed based on the mean square error (MSE) between the original data and the reconstructed data.
[0021] Further, the information entropy loss function is trained based on the contrast learning idea by using the information entropy between the local features and the global features of the positive sample and the information entropy between the local features and the global features of the negative sample to train the graph auto-encoder model.
[0022] The local features are the encoding data output by the encoder, and the global features are the mean values of the local features, i.e., the mean values of all cells.
[0023] The second aspect of the present application provides a spatial transcriptome cell expression pattern recognition system.
[0024] A spatial transcriptome cell expression pattern recognition system comprises a positive sample construction module, a negative sample construction module, a model construction module and a cell recognition module:
[0025] The positive sample construction module is configured to preprocess acquired spatial transcriptome data to obtain positive sample data composed of image features, gene expression data and an adjacency matrix, and the image features and the gene expression data belonging to the same cell have a corresponding relationship.
[0026] The negative sample construction module is configured to randomly adjust the image features and the gene expression data in the positive sample data to obtain negative sample data.
[0027] The model construction module is configured to construct a graph autoencoder model and train the graph autoencoder model using the positive sample data and the negative sample data.
[0028] The cell recognition module is configured to input sample data to be recognized into the trained graph autoencoder model to obtain a cell label as a final recognized cell type.
[0029] The graph autoencoder model uses the encoder and the decoder in the model to construct a reconstruction loss function and an information entropy loss function to supervise the training of the model.
[0030] The third aspect of the present application provides a computer readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps of the spatial transcriptome cell expression pattern recognition method according to the first aspect of the present application.
[0031] The fourth aspect of the present application provides an electronic device comprising a memory, a processor and a program stored on the memory and executable on the processor, wherein the processor executes the program to implement the steps of the spatial transcriptome cell expression pattern recognition method according to the first aspect of the present application.
[0032] The above one or more technical solutions have the following beneficial effects:
[0033] The present application constructs a graph autoencoder, fully utilizes the multi-modal information in spatial transcriptomics, realizes cell pattern recognition of spatial transcriptomics, is particularly suitable for sequencing methods such as 10X and MERFISH, and improves the scalability and operability, and improves the accuracy and reliability of cell expression pattern recognition in tissue sections.
[0034] The present application constructs positive sample data and negative sample data, uses the encoder and the decoder in the model to construct a reconstruction loss function and an information entropy loss function, and comprehensively trains the model to improve the model training efficiency and the model recognition accuracy.
[0035] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0036] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0037] Figure 1 This is a flowchart of the method in the first embodiment.
[0038] Figure 2 is an example diagram of spatial transcriptome data from the first embodiment.
[0039] Figure 3 This is a schematic diagram illustrating the construction of negative sample data in the first embodiment.
[0040] Figure 4 This is a structural diagram of the autoencoder model for the first embodiment.
[0041] Figure 5 Figure 7 shows a box-type diagram of the seven methods in the first embodiment.
[0042] Figure 6 This is a system structure diagram of the second embodiment. Detailed Implementation
[0043] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0044] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of the invention; unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0045] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments of the present invention; as used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise; furthermore, it should be understood that when the terms “comprising” and / or “including” are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0046] Example 1
[0047] This embodiment discloses a method for identifying spatial transcriptomic cellular expression patterns;
[0048] like Figure 1 As shown, a method for identifying spatial transcriptomic cellular expression patterns includes:
[0049] S101: preprocessing the obtained spatial transcriptome data to obtain positive sample data composed of image features r, gene expression data x and adjacency matrix a, and the image features and gene expression data belonging to the same cell have a corresponding relationship;
[0050] The spatial transcriptome data includes tissue images, gene expression data and cell spatial coordinates, as shown in FIG. 2(a), FIG. 2(b) and FIG. 2(c), respectively. Each cell has a unique cell number.
[0051] From the tissue image, the image of each cell is obtained by cutting the picture with the position of each identified cell as the center and expanding 40 pixels up and down.
[0052] The image of each cell is input into the ViT model to extract image features r; the ViT model is a professional image feature extraction model, the model parameters are loaded and the last linear layer is deleted. Here, only the features are extracted, and the values of 3000 image feature attributes are extracted.
[0053] The preprocessing also includes screening out non-human genes, mitochondrial genes and the like from the gene expression data, and only retaining genes that can be expressed in human cell nuclei, and then screening 3000 genes with the highest expression. Then, regularization is performed and logarithm is taken to obtain the preprocessed gene expression information x.
[0054] In constructing the adjacency matrix a, it is considered that the cells close in physical space have an influence, and in the graph representation, there is a connected edge; the farther ones have no influence, and in the graph representation, they are considered to have no connected edge. The specific method is as follows:
[0055] Calculate the Euclidean distance between any two cells. For each cell, select the 6 closest cells in physical space as the nearest neighbor cells, which have an edge connection and a weight of 1. The remaining cells are far neighbors, and the edge connection weight is 0. It should be noted that each cell itself is considered to have a connection with itself and the weight is 1. The adjacency matrix a is constructed.
[0056] The image features r, gene expression data x and adjacency matrix a obtained above are associated according to the cell number to form the positive sample data.
[0057] S102: randomly adjusting the image features and gene expression data in the positive sample data to obtain negative sample data;
[0058] In order to better train the model, it is necessary to expand the sample data. On the basis of the positive sample, negative sample data is supplemented. It is hoped that the positive sample data is more similar to the true data, and the negative sample is not similar to the true data. The construction method of the negative sample data is as follows:
[0059] r and x are image features and gene expression data in positive sample data, and the data in r and x except cell number are randomly interchanged to construct negative samples and As Figure 3 shown.
[0060] S103: Constructing a graph autoencoder model, and training the graph autoencoder model with positive sample data and negative sample data;
[0061] As Figure 4 shown, a graph autoencoder model is constructed, including an encoder E and a decoder D, both of which are two-layer attention graph neural network GAT structures, the two-layer attention graph neural network GAT structure of the encoder E includes two attention graph neural networks GAT in the first layer and one attention graph neural network GAT in the second layer; the two-layer attention graph neural network GAT structure of the decoder D includes one attention graph neural network GAT in the first layer and two attention graph neural networks GAT in the second layer; and the parameters of the attention graph neural networks GAT at the corresponding positions in the encoder E and the decoder D are the same, and the weights are transposed to each other, that is, the weights W1, W2 and W3 of the three attention graph neural networks GAT in the encoder E are transposed to the weights W T 1, W T 2 and W T 3 of the three attention graph neural networks GAT in the decoder D.
[0062] In the encoder E, (image features, adjacency matrix) and (gene expression data, adjacency matrix) pass through the first layer attention graph neural network GAT respectively to obtain two intermediate features, and then the two intermediate features pass through the second layer attention graph neural network GAT to obtain the encoding data e, and the encoder E can be represented as:
[0063] e=E(x,r,a)
[0064] In the decoder D, the encoding data e passes through the first layer attention graph neural network GAT to obtain two intermediate features, and then passes through the second layer attention graph neural network GAT to reconstruct new image features r' and gene expression data x', and the decoder D can be represented as:
[0065] r',x'=D(e,a)
[0066] Using the encoder E and the decoder D in the model, a reconstruction loss function and an information entropy loss function are constructed to supervise the training of the model.
[0067] The construction method of the reconstruction loss function is:
[0068] (1) The image features r, gene expression data x and adjacency matrix a in the positive sample data are input into the encoder E to obtain positive sample encoding data e, also known as positive sample local features.
[0069] (2) The mean value of the positive sample encoding data e is calculated by row to obtain the mean value of all cells, which is used as the global feature s.
[0070] (3) The image features r, gene expression data x and adjacency matrix a in the positive sample data are input into the encoder E to obtain negative sample encoding data , also known as negative sample local features. (4) The positive sample encoding data e and the negative sample encoding data are input into the decoder D respectively, and data reconstruction is performed to obtain new r', x' and
[0071]
[0072] (5) Based on the mean square error MSE of the original data and the reconstructed data, a reconstruction loss function L r is constructed, that is:
[0073] L r =MSE(x,x′)+MSE(r,r′)
[0074] The construction method of the information entropy loss function is:
[0075] (1) The information entropy between the positive sample local features and the global features and the information entropy between the negative sample local features and the global features are calculated respectively. The calculation method of the information entropy is introduced below by taking the positive sample information entropy as an example.
[0076] A binary classifier is generated to evaluate and calculate the information entropy between the positive sample local features and the global features, that is:
[0077] C(e,s)=σ(e T ws)
[0078] where w is the weight learning parameter of the binary classifier, e T is the transpose matrix of the positive sample local features e, and s is the global feature.
[0079] (2) In order to better evaluate the effect of the positive sample and the negative sample on the training, the information entropy between the positive sample local features and the global features should be as large as possible, and the information entropy between the negative sample local features and the global features should be as small as possible. Therefore, the information entropy loss function is designed as:
[0080]
[0081] Based on the above contents, the reconstruction loss Lr and information entropy loss L i The final loss function of the composition graph autoencoder model is specifically:
[0082] L = L r + a * L i
[0083] Wherein, a is a manually set hyperparameter, which is 0.04 here.
[0084] The loss function is input into the optimizer for iterative optimization to obtain the trained graph autoencoder model; wherein the optimizer selects the Adam optimizer.
[0085] S104: input the sample data to be identified into the trained graph autoencoder model to obtain the cell label as the final recognized cell type, specifically:
[0086] The sample data to be identified is input into the trained graph autoencoder model to obtain the encoding data e, and the clustering is performed through the mclust clustering method, and the clustering result is associated through the Hungarian algorithm (Hungarian Algorithm) to finally obtain the label of each cell, completing the recognition of the cell expression pattern.
[0087] In order to verify the effect of the clustering recognition method stGCL of the embodiment, based on the commercialized spatial transcriptome (empty) sequencing platform Visium of 10x Genomics, 12 slices on the human dorsolateral prefrontal cortex DLPFC (dorsolateral prefrontal cortex) public data set were respectively clustered and recognized by using the existing six methods (SCANPY, BayesSpace, SpaGCN, SEDR, STAGATE, DeepST) and the clustering recognition method stGCL of the embodiment:
[0088] SCANPY: is a popular single-cell transcriptomics library, which has been expanded to process spatial transcriptomics data.
[0089] BayesSpace: uses a Bayesian model with Markov random fields to model spatial transcriptomics data, and simultaneously uses spatial information and gene expression information for clustering analysis.
[0090] SpaGCN: is a graph convolutional network method that integrates gene expression, spatial location information and histology for spatial transcriptome data analysis.
[0091] SEDR: uses a deep autoencoder network to learn gene representation, and uses a variational graph autoencoder to simultaneously embed spatial information.
[0092] STAGATE: It combines a self-encoder and a graph attention mechanism to learn latent representations by modeling gene expression profiles and spatial location information.
[0093] DeepST: uses a graph neural network (GNN) autoencoder and a denoising autoencoder to jointly generate latent representations of enhanced spatial transcriptome data, and a domain adversarial neural network (DAN) is used to integrate spatial transcriptome data from multiple batches or different technologies.
[0094] Based on the clustering results of the seven methods, the adjusted Rand index ARI (Adjusted Rand index) is calculated, and the effect is as shown in the box plot of Figure 5 The box plot shows that the central line, box limit and whisker represent the median, upper quartile and lower quartile and 1.5 times the quartile range; by comparing these methods in detail, it can be seen that the performance of the six spatial algorithms using spatial information is better than that of one non-spatial clustering algorithm (SCANPY), which shows that spatial information is needed to correctly identify cell types; and the stGCL method proposed in this embodiment realizes the mean of ARI is 0.55, which performs better than the existing most advanced method.
[0095] Embodiment Two
[0096] The embodiment discloses a spatial transcriptome cell expression pattern recognition system;
[0097] As shown in Figure 6 A spatial transcriptome cell expression pattern recognition system includes a positive sample construction module, a negative sample construction module, a model construction module, and a cell recognition module:
[0098] The positive sample construction module is configured to preprocess the obtained spatial transcriptome data to obtain positive sample data composed of image features, gene expression data, and an adjacency matrix, and the image features and gene expression data belonging to the same cell have a corresponding relationship;
[0099] The negative sample construction module is configured to randomly adjust the image features and gene expression data in the positive sample data to obtain negative sample data;
[0100] The model construction module is configured to construct a graph autoencoder model and train the graph autoencoder model with the positive sample data and the negative sample data;
[0101] The cell recognition module is configured to input the sample data to be recognized into the trained graph autoencoder model to obtain cell labels as the final recognized cell types;
[0102] The graph autoencoder model uses an encoder and a decoder in the model to construct a reconstruction loss function and an information entropy loss function to supervise the training of the model.
[0103] Embodiment three
[0104] An objective of this embodiment is to provide a computer-readable storage medium.
[0105] A computer-readable storage medium, having stored thereon a computer program, which when executed by a processor, implements the steps of the spatial transcriptome cell expression pattern recognition method according to Embodiment One of the present disclosure.
[0106] Embodiment four
[0107] An objective of this embodiment is to provide an electronic device.
[0108] An electronic device, comprising a memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor implements the steps of the spatial transcriptome cell expression pattern recognition method according to Embodiment One of the present disclosure when executing the program.
[0109] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. The present application can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for identifying spatial transcriptomic cellular expression patterns, characterized in that, include: The acquired spatial transcriptome data was preprocessed to obtain positive sample data consisting of image features, gene expression data, and adjacency matrix. There is a correspondence between image features and gene expression data belonging to the same cell. The image features and gene expression data in the positive sample data are randomly adjusted to obtain the negative sample data; Construct a graph autoencoder model and train it using positive and negative sample data; The sample data to be identified is input into the trained graph autoencoder model to obtain cell labels, which are used as the final cell types to be identified. The graph autoencoder model utilizes the encoder and decoder in the model to construct a reconstruction loss function and an information entropy loss function to supervise the training of the model. The encoder in the graph autoencoder model extracts encoded data from image features, gene expression data, and adjacency matrix; The decoder of the encoder model reconstructs the encoded data output by the encoder to obtain new image features and gene expression data. Based on the mean squared error (MSE) of the original data and the reconstructed data, a reconstruction loss function is constructed. The information entropy loss function utilizes the information entropy between local and global features of positive samples and between local and global features of negative samples. Based on the idea of contrastive learning, it trains the graph autoencoder model. The local features are the encoded data output by the encoder, and the global features are the average of all cells obtained by averaging the local features by row. The input data consists of three modalities: image, gene expression, and spatial adjacency matrix. Image features are extracted using an image feature extraction model to construct an adjacency matrix, which is then integrated with a graph neural network (GAT). The adjacency matrix selects the six cells that are closest to it in physical space as the nearest neighbor cells.
2. The method for identifying spatial transcriptome cellular expression patterns as described in claim 1, characterized in that, The spatial transcriptome data includes tissue images, gene expression data, and cell spatial coordinates.
3. The method for identifying spatial transcriptome cellular expression patterns as described in claim 2, characterized in that, The preprocessing includes cutting the image from the tissue image with the location of each identified cell as the center to obtain an image of each cell; and using an image feature extraction model to extract single-cell image features from the image of each cell.
4. The method for identifying spatial transcriptome cellular expression patterns as described in claim 2, characterized in that, The preprocessing also includes gene screening, regularization, and logarithmic calculation of the gene expression data.
5. The method for identifying spatial transcriptome cellular expression patterns as described in claim 1, characterized in that, The preprocessing also includes calculating the Euclidean distance between cells based on their spatial coordinates, and constructing an adjacency matrix based on the proximity of the Euclidean distances.
6. A system for identifying spatial transcriptomic cellular expression patterns, characterized in that, It includes a positive sample construction module, a negative sample construction module, a model construction module, and a cell recognition module: The positive sample construction module is configured to: preprocess the acquired spatial transcriptome data to obtain positive sample data consisting of image features, gene expression data and adjacency matrix, where there is a correspondence between image features and gene expression data belonging to the same cell; The negative sample construction module is configured to randomly adjust the image features and gene expression data in the positive sample data to obtain negative sample data. The model building module is configured to: build a graph autoencoder model and train the graph autoencoder model using positive and negative sample data; The cell identification module is configured to input the sample data to be identified into a trained graph autoencoder model to obtain cell labels, which are used as the final cell types to be identified. The graph autoencoder model utilizes the encoder and decoder in the model to construct a reconstruction loss function and an information entropy loss function to supervise the training of the model. The encoder in the graph autoencoder model extracts encoded data from image features, gene expression data, and adjacency matrix; The decoder of the encoder model reconstructs the encoded data output by the encoder to obtain new image features and gene expression data. Based on the mean squared error (MSE) of the original data and the reconstructed data, a reconstruction loss function is constructed. The information entropy loss function utilizes the information entropy between local and global features of positive samples and between local and global features of negative samples. Based on the idea of contrastive learning, it trains the graph autoencoder model. The local features are the encoded data output by the encoder, and the global features are the average of all cells obtained by averaging the local features by row. The input data consists of three modalities: image, gene expression, and spatial adjacency matrix. Image features are extracted using an image feature extraction model to construct an adjacency matrix, which is then integrated with a graph neural network (GAT). The adjacency matrix selects the six cells that are closest to it in physical space as the nearest neighbor cells.
7. A computer-readable storage medium having a program stored thereon, characterized in that, When executed by a processor, the program implements the steps in the method for identifying spatial transcriptomic cell expression patterns as described in any one of claims 1-5.
8. An electronic device, comprising a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the method for identifying spatial transcriptome cell expression patterns as described in any one of claims 1-5.
Citation Information
Patent Citations
Spatial transcriptome cell clustering and analyzing method
CN114091603A
Deep learning method and system for processing single-cell multi-modal omics data
CN114187969A