Method and device for determining cell types based on graphsage-based spatial transcriptome deconvolution
Patent Information
- Application Number
- CN202410086176.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-22
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2044-01-22
AI Technical Summary
[0007]本发明的目的是提供一种基于GraphSAGE的空间转录组解卷积确定细胞类型的方法及装置,基于图神经网络架构GraphSAGE,提出了一种用于空间转录组细胞类型解卷积模型STdGraphSAGE,在预测单个位置点细胞类型比例的同时,能够学习到相邻位置点的节点信息,从而提升细胞类型比例预测精度,解决了现有模型对位置点进行独立预测带来的精度不足问题
[0056] (1) In the current spatial transcriptome data cell type prediction, only the location point is predicted independently, while the node information of the neighboring location points is ignored. This invention utilizes the similarity of node expression levels in spatial transcriptome data and scRNA-seq data, constructs pseudo location points based on scRNA-seq data, extracts real location points from spatial transcriptome data as nodes to be predicted, and constructs adjacency matrices for real location points and pseudo location points and each other, fully considering the node information of adjacent location points, which can significantly improve the prediction accuracy of cell types in spatial transcriptome data;
Smart Images

Figure CN118098356B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of biological computing, specifically relating to a method and apparatus for determining cell types based on GraphSAGE spatial transcriptome deconvolution. Background Technology
[0002] The development of spatial transcriptome (ST) technology has greatly improved the ability to explore spatial heterogeneity and gene expression heterogeneity in tissues. ST technology is a technique used to resolve RNA sequence (RNA-seq) data at a spatial level. It can resolve the expression information of mRNA at different spatial locations in a single tissue slice, and can maintain the spatial information of the tissue while measuring the transcriptome, providing valuable insights and information for pathological research.
[0003] However, ST technology still faces certain limitations due to current limitations in cell resolution and throughput. For example, many fluorescence in situ hybridization (FISH)-based techniques cannot capture the full information of the transcriptome within a single cell, which presents computational challenges when attempting to infer missing gene expression information from FISH data. Furthermore, many methods used in single-cell sequencing lack sufficient resolution at the single-cell level, which poses computational challenges for unconvolution of cell types detected at the same spatial point / location.
[0004] Unlike ST technology, single-cell RNA sequencing (scRNA-seq) can detect the expression of thousands of genes within a single cell. Therefore, scRNA-seq can be effectively used as a complementary tool to address some of the limitations of ST technology. For example, decomposing cell types in ST data is similar to using scRNA-seq to deconvolve RNA sequencing data in batches.
[0005] Several models exist specifically for deconvolution of batch RNA sequencing data, and theoretically, these models can also be used to deconvolve ST data. However, in practice, the number of cells at a given location in ST data is significantly lower than the number of cells in batch RNA sequencing data. Therefore, applying batch RNA sequencing deconvolution methods to such small sample sizes typically introduces noise from irrelevant cell types, and these analyses have been confirmed.
[0006] In addition, several statistical or machine learning-based algorithms have been developed for deconvolution of ST data. Statistical algorithms typically assume that gene transcription counts follow a certain distribution, usually a Poisson or negative binomial distribution. These methods first use scRNA-seq data to calculate the distribution coefficients of genes in each cell type, and then use maximum likelihood estimation or maximum a posteriori estimation to infer the proportion of cell types. On the other hand, machine learning-based algorithms typically combine predicted ST data with scRNA-seq data, directly predicting the proportion of cell types through a neural network system. These models eliminate the additional step of learning cell type gene features from scRNA-seq data. However, a common limitation of these models is that they deconvolve independently at locations within a given ST dataset without considering neighborhood connections between locations. Summary of the Invention
[0007] The purpose of this invention is to provide a method and apparatus for determining cell types based on spatial transcriptome deconvolution using GraphSAGE. Based on the graph neural network architecture GraphSAGE, a cell type deconvolution model STdGraphSAGE for spatial transcriptome is proposed. While predicting the cell type ratio at a single location point, it can learn the node information of adjacent locations, thereby improving the accuracy of cell type ratio prediction and solving the problem of insufficient accuracy caused by existing models predicting locations independently.
[0008] To achieve the above-mentioned objectives, the present invention provides the following technical solution:
[0009] In a first aspect, the present invention provides a spatial transcriptome deconvolution method based on GraphSAGE, comprising the following steps:
[0010] Step 1: Using in situ sequencing technology, obtain the node expression matrix of spatial points in the spatial transcriptome. The spatial points are used as real location points. Logistic regression is used to determine the marker genes from single-cell RNA sequencing data.
[0011] Step 2: Based on the marker genes, randomly select several cell types from the single-cell RNA sequencing data and extract the corresponding cells to construct a cell library. Randomly select several cells from the cell library to form pseudo-location points and calculate the node expression matrix of the pseudo-location points.
[0012] Step 3: Calculate the Euclidean distance based on the node representation matrix to obtain the pseudo distance matrix between pseudo locations, the real distance matrix between real locations, and the connection distance matrix between pseudo locations and real locations. Based on the pseudo distance matrix, the real distance matrix, and the connection distance matrix, use the K nearest neighbor algorithm to obtain the K neighbor graph between pseudo locations and real locations and the graph adjacency matrix corresponding to the K neighbor graph.
[0013] Step 4: Construct a deconvolution model based on GraphSAGE. Input the node expression matrix and graph adjacency matrix into the deconvolution model to aggregate node information and output the proportion of cell types in the real location points.
[0014] This invention proposes constructing adjacency matrices for both true and false locations, as well as between them, based on gene expression matrices and Euclidean distance. This allows for the full consideration of node information from adjacent locations when predicting cell types at a location, thus improving prediction accuracy. Furthermore, based on the GraphSAGE graph neural network architecture, this invention proposes the STdGraphSAGE spatial transcriptome cell type deconvolution model. Utilizing the expression similarity between locations in spatial transcriptome data and scRNA-seq data, and using the constructed adjacency matrices as input, the STdGraphSAGE model iteratively aggregates node information from both true and false locations. This allows true locations to learn node information from false locations with similar expression levels, thereby achieving accurate prediction of cell type proportions within true locations.
[0015] Furthermore, in step 2, the node expression matrix of the pseudo-location point is calculated by concatenating the expression matrices of several cells contained in each pseudo-location point to obtain the node expression matrix of the corresponding pseudo-location point.
[0016] Furthermore, in step 3, the calculation of Euclidean distance based on the node representation matrix is expressed by the following formula:
[0017] d(u,v)=||X u -X v ||2
[0018] Where d(u,v) represents the Euclidean distance between point u and point v, and X u and X v Let ||·||2| represent the nodal representation matrix at locations u and v, where ||·||2 represents the L2 norm.
[0019] Furthermore, in step 3, the process of using the K-nearest neighbor algorithm based on the pseudo-distance matrix, the true distance matrix, and the connectivity distance matrix to obtain the K-nearest neighbor graph between the pseudo-location points and the true location points, and the graph adjacency matrix corresponding to the K-nearest neighbor graph, specifically involves:
[0020] The elements in the pseudo distance matrix, the true distance matrix, and the connection distance matrix represent the Euclidean distance between the corresponding points.
[0021] The K nearest neighbor algorithm is used to sort the elements in each row of the pseudo distance matrix, the real distance matrix, and the connection distance matrix in ascending order, and then filter and retain the top K elements to obtain the pseudo nearest neighbor matrix, the real nearest neighbor matrix, and the connection nearest neighbor matrix.
[0022] Connect the position points contained in the pseudo-neighbor matrix, the real neighbor matrix, and the connected neighbor matrix to obtain a pseudo position point subgraph, a real position point subgraph, and an association subgraph connecting the pseudo position points and the real position points.
[0023] The pseudo-location point subgraph, the real location point subgraph, and the correlation subgraph connecting the pseudo-location points and the real location points are superimposed to obtain the K-nearest neighbor graph between the pseudo-location points and the real location points;
[0024] The graph adjacency matrix corresponding to the K-nearest graph is obtained by summing the pseudo-nearest neighbor matrix, the true neighbor matrix, and the connected neighbor matrix.
[0025] Furthermore, in step 4, the step of inputting the node representation matrix and graph adjacency matrix into the deconvolution model for node information aggregation includes:
[0026] Input the node representation matrix corresponding to the pseudo-location point, the node representation matrix corresponding to the real location point, and the graph adjacency matrix into the deconvolution model;
[0027] In the deconvolutional model, the GraphSAGE model, based on the adjacency relationships between points indicated in the graph adjacency matrix, uses mean aggregation at each layer to aggregate node information from the node representation matrices corresponding to pseudo-points and the node representation matrices corresponding to real-points. This aggregated feature is then input into the next layer of the GraphSAGE model for iteration. The aggregation process is expressed by the following formula:
[0028]
[0029]
[0030] Where N(v) represents the set of adjacent nodes of point v at a certain layer. This represents the node features of location point v after updating at layer t, where t represents the layer number, AGG is the aggregator, the aggregation method is set to mean aggregation, h represents the updated features, and W... t denoted as the parameter matrix of layer t, concat(·) is the concatenation function, and σ represents the ReLU activation function.
[0031] Furthermore, in step 4, a layer aggregation mechanism with skip connections is adopted, and the aggregated features obtained from each layer in the GraphSAGE model are aggregated using the Long Short-Term Memory method. The aggregation method is expressed by the following formula:
[0032]
[0033] in, This represents the feature output of location point v through iteration to the last layer of the GraphSAGE model, where k represents the number of network layers in the GraphSAGE model.
[0034] Furthermore, step 4 specifically involves:
[0035] Based on the GraphSAGE model, a first fully connected neural network layer and a second fully connected neural network layer are encapsulated before and after the GraphSAGE model to obtain a deconvolution model. Both the first and second fully connected neural network layers are used to match the cell type dimension in the real location points and pseudo location points.
[0036] The node representation matrices of the pseudo-location points, the node representation matrices of the real-location points, and the graph adjacency matrix are input into the deconvolution model. The node representation matrices of the pseudo-location points and the node representation matrices of the real-location points are dimension-matched through the first fully connected neural network layer, and then concatenated to obtain the representation matrix X. exp This can be expressed as a formula:
[0037]
[0038] Where u represents the dimension of the marker gene, and n r and n p Let R represent the number of samples for real location points and pseudo location points, respectively, and R represent the set of real numbers.
[0039] The expression matrix X exp The graph adjacency matrix is input into the GraphSAGE model, and the GraphSAGE model, based on the graph adjacency matrix, processes the expression matrix X. exp The node information in the process is iteratively updated, and the information from each node is aggregated. The true label γ in the iterative process is expressed by the formula:
[0040]
[0041] Where m represents the number of cell types, and the number of cell types is the same in the real location point and the pseudo location point;
[0042] Expression matrix X exp The output H is obtained after the last hidden layer of the GraphSAGE model, which can be expressed by the formula:
[0043]
[0044] Where, hidden represents the dimension of the hidden layer in the GraphSAGE model;
[0045] H is input into the second fully connected neural network layer to match the dimension of H with the target dimension, which is the total number of all cell types in the true location point to be predicted. This total number is the same as the number of cell types in the single-cell RNA sequencing data. The output cell type ratio of the true location point is expressed by the formula:
[0046]
[0047] Where ELU(·) and softmax(·) represent activation functions, n represents the predicted proportion of cell types. type b represents the total number of all cell types at the predicted true location point. (0) and k (0) b represents the parameter to be updated in the ELU(·) activation function. (1) and k (1) This represents the parameter to be updated in the softmax(·) activation function.
[0048] Secondly, in order to achieve the above-mentioned objectives, the present invention also provides a device for determining cell types based on spatial transcriptome deconvolution of GraphSAGE, including a data acquisition unit, a pseudo-location point generation unit, a graph structure construction unit, and a cell type ratio prediction unit.
[0049] The data acquisition unit is used to obtain the node expression matrix of spatial points in the spatial transcriptome using in situ sequencing technology. The spatial points are used as real location points, and logistic regression is used to determine marker genes from single-cell RNA sequencing data.
[0050] The pseudo-location point generation unit is used to randomly select several cell types from single-cell RNA sequencing data based on the marker gene and extract corresponding cells to construct a cell library, randomly select several cells from the cell library to form pseudo-location points and calculate the node expression matrix of the pseudo-location points.
[0051] The graph structure construction unit is used to calculate the Euclidean distance based on the node representation matrix, and obtain the pseudo distance matrix between pseudo locations, the real distance matrix between real locations, and the connection distance matrix between pseudo locations and real locations. Based on the pseudo distance matrix, the real distance matrix, and the connection distance matrix, the K nearest neighbor algorithm is used to obtain the K neighbor graph between pseudo locations and real locations and the graph adjacency matrix corresponding to the K neighbor graph.
[0052] The cell type ratio prediction unit is used to construct a deconvolution model based on GraphSAGE. It inputs the node expression matrix and graph adjacency matrix into the deconvolution model to aggregate node information and output the cell type ratio at the real location point.
[0053] Thirdly, to achieve the above-mentioned objectives, embodiments of the present invention also provide a device for determining cell types based on spatial transcriptome deconvolution using GraphSAGE, including a memory and a processor. The memory is used to store a computer program, and the processor is used to implement the method for determining cell types based on spatial transcriptome deconvolution using GraphSAGE provided in the first aspect of the present invention when the computer program is executed.
[0054] Fourthly, to achieve the above-mentioned objectives, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program, when used with a computer, implements the method for determining cell types based on GraphSAGE spatial transcriptome deconvolution provided in the first aspect of the present invention.
[0055] The beneficial effects of this invention are as follows:
[0056] (1) In the current spatial transcriptome data cell type prediction, only the location point is predicted independently, while the node information of the neighboring location points is ignored. This invention utilizes the similarity of node expression levels in spatial transcriptome data and scRNA-seq data, constructs pseudo location points based on scRNA-seq data, extracts real location points from spatial transcriptome data as nodes to be predicted, and constructs adjacency matrices for real location points and pseudo location points and each other, fully considering the node information of adjacent location points, which can significantly improve the prediction accuracy of cell types in spatial transcriptome data;
[0057] (2) Based on the graph neural network GraphSAGE, this invention constructs a deconvolution model STdGraphSAGE for spatial transcriptome data. With the constructed graph adjacency matrix and node expression matrix as input, the STdGraphSAGE model learns the topological structure information of each location point and its neighborhood, as well as the distribution of node features in the neighborhood. It adopts a layer aggregation mechanism with skip connections to aggregate node information, so that the real location point learns node information from the pseudo location point, thereby accurately predicting the cell types and proportions contained in the real location point. Attached Figure Description
[0058] Figure 1 This is a flowchart of a method for determining cell types based on spatial transcriptome deconvolution using GraphSAGE, provided in an embodiment of the present invention.
[0059] Figure 2 This is a schematic diagram of the scRNA-seq data feature selection process provided in the embodiments of the present invention.
[0060] Figure 3 This is a schematic diagram of the process for generating pseudo-location points provided in an embodiment of the present invention.
[0061] Figure 4 This is a schematic diagram of the process for constructing a K-nearest neighbor graph provided in an embodiment of the present invention.
[0062] Figure 5 This is a detailed flowchart illustrating the process of using the StdGraphSAGE model for deconvolution of spatial transcriptome data, as provided in this embodiment of the invention.
[0063] Figure 6 This is a schematic diagram of the device for determining cell types based on spatial transcriptome deconvolution using GraphSAGE, provided in an embodiment of the present invention. Detailed Implementation
[0064] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the scope of protection of the invention.
[0065] The technical concept of this invention is as follows: While current statistical or machine learning-based deconvolution algorithms for spatial transcriptome (ST) data eliminate the additional step of learning cell type gene features from scRNA-seq data, these models share a common limitation: they independently deconvolve locations within a given ST dataset without considering neighborhood connections between these locations, leading to insufficient prediction accuracy. This invention proposes a spatial transcriptome cell type deconvolution model, STdGraphSAGE, based on the graph neural network architecture GraphSAGE. This is a novel method for cell type deconvolution of ST data.
[0066] First, real location points are extracted from the spatial transcriptome data as test locations. Each real location point contains several cells, and each cell corresponds to a cell type. Then, pseudo-location points with known cell types and proportions are extracted from the scRNA-seq data. Based on the node expression matrix of each location point and the Euclidean distance between any two points, distance matrices are constructed between real location points, between pseudo-location points, and between real location points and pseudo-location points. The K-nearest neighbor algorithm is used to find the K nearest location points of each location point in the constructed distance matrix and connect them to obtain their respective K-nearest neighbor graphs and node adjacency matrices. The sum of the node adjacency matrices is the graph adjacency matrix corresponding to the overall graph structure.
[0067] By leveraging the similarity of gene expression levels in spatial transcriptome data and scRNA-seq data, the node expression matrix and graph adjacency matrix are input into the STdGraphSAGE model. The node information of real and pseudo-location points is aggregated, enabling real location points to learn the node information in pseudo-location points, thereby outputting the cell types and their proportional relationships in the real location points.
[0068] Spatial transcriptome data is a type of data used to study how gene expression in cells varies spatially and temporally. It is typically distributed as location points, with each location containing several cells, each cell type corresponding to a specific cell type, representing the different expression patterns of genes at different locations within a tissue.
[0069] GraphSAGE, short for Graph Sampling and Aggregation, is a node embedding learning algorithm for graph neural networks. Its core idea is to perform node vector embedding in large-scale graph feature tasks by sampling from the local neighbors of a vertex and aggregating the features of neighboring nodes and the vertex to obtain the vertex's GraphEmbedding. The trained GraphSAGE model can be used to generate node embeddings for previously unseen nodes or entirely new input graphs, as long as the input graph has the same attribute model as the training data. Therefore, this invention utilizes the similarity of node expression levels between the spatial transcriptome data to be tested and the known scRNA-seq data. Through the GraphSAGE model, the true location points in the spatial transcriptome data learn the node information in the scRNA-seq data, thereby predicting the proportion of cell types in the spatial transcriptome.
[0070] Figure 1 This is a flowchart of the spatial transcriptome deconvolution method based on GraphSAGE provided in this embodiment of the invention. Figure 1 As shown, the embodiment provides a method for determining cell type based on GraphSAGE spatial transcriptome deconvolution, including the following steps:
[0071] S110 uses in situ sequencing technology to obtain the node expression matrix of spatial points in the spatial transcriptome. These spatial points are used as real location points, and logistic regression is used to determine marker genes from single-cell RNA sequencing data.
[0072] In this embodiment, the spatial transcriptome deconvolution is implemented based on the PyTorch framework in Python. During the Pseudo-spots generation process, K is selected. up =4, N low =4, N up=16. For the GraphSAGE graph framework, the number of adjacent points for each point in the three subgraphs is set to {real:10, pseudo:20, real_pseudo:20}. The dimension of the hidden layer of the middle GraphSAGE graph is set to 256.
[0073] Specifically, such as Figure 2 As shown, during data acquisition, in situ sequencing technology was used to extract the node expression matrix of spatial points from the spatial transcriptome data. The extracted spatial points were used as ground truth points, and each ground truth point contained several cells. These ground truth points were the data to be tested. Logistic regression was then used to identify marker genes from the single-cell RNA sequencing data (scRNA-seq). For processing the single-cell gene expression matrix, the original counting matrix could be used, or normalization could be performed.
[0074] S120: Based on the marker gene, several cell types are randomly selected from single-cell RNA sequencing data and corresponding cells are extracted to construct a cell library. Several cells are randomly selected from the cell library to form pseudo-location points and the node expression matrix of the pseudo-location points is calculated.
[0075] In this embodiment, a sampling method based on cell type is used to ensure that the generated pseudo-spots contain more comprehensive and balanced information. For example... Figure 3 As shown, for the generation of each Pseudo-spot, from [1,K] up A random number k is selected from [N] to represent the number of cell types to be generated in the Pseudo-spots. Based on the marker genes, k cell types are randomly selected from the scRNA-seq data as the cell type set in the Pseudo-spots. Based on the cell type set, k cells are extracted from the scRNA-seq data to construct a cell bank. Then, from [N]... low N up Randomly select a number N from [the data]. s To determine the number of cells in the Pseudo-spot, N cells were randomly selected from the cell bank. s One Pseudo-spot consists of 10 cells.
[0076] In this embodiment, the number of generated pseudo-spots is set to 30,000, and the 30,000 pseudo-spots samples are divided into training set and test set in a 9:1 ratio. The training set is used to complete the model training on a single A100 GPU, and the test set is used to verify the prediction accuracy of the trained model.
[0077] Calculate the cell expression matrix corresponding to several cells in each Pseudo-spot, and sum them to obtain the node expression matrix of the corresponding Pseudo-spot.
[0078] S130: Calculate the Euclidean distance based on the node representation matrix to obtain the pseudo-distance matrix between pseudo-location points, the real distance matrix between real location points, and the connection distance matrix between pseudo-location points and real location points. Based on the pseudo-distance matrix, the real distance matrix, and the connection distance matrix, use the K-nearest neighbor algorithm to obtain the K-nearest neighbor graph between pseudo-location points and real location points and the graph adjacency matrix corresponding to the K-nearest neighbor graph.
[0079] The Euclidean distance between any two points can be expressed by the formula:
[0080] d(u,v)=||X u -X v ||2
[0081] Where d(u,v) represents the Euclidean distance between position points u and v, and X u and X v The matrix representing the node representations of locations u and v.
[0082] Calculate the distance matrix between any two points based on the Euclidean distance between them, for either the Pseudo-spots or the real-spots. Here, the real-spots refer to the ST real data that needs to be deconvolutionally analyzed. The distance matrix contains the pseudo-distance matrix of the subgraphs within the Pseudo-spots, the true distance matrix of the subgraphs within the real-spots, and the distance matrix of the associated subgraphs connecting the Pseudo-spots and the real-spots.
[0083] Based on the distance matrix above, the K-nearest neighbor algorithm is used, such as... Figure 4 As shown, for each location point, the K nearest locations are found in each distance matrix and connected to them, resulting in three subgraphs: the internal subgraph of Pseudo-spots, the internal subgraph of real-spots, and the association subgraph connecting Pseudo-spots and real-spots. The proximity matrices corresponding to the three subgraphs are the pseudo-proximity matrix, the real proximity matrix, and the association proximity matrix, respectively. The three subgraphs are superimposed to obtain the K-nearest neighbor graph between the pseudo-location points and the real location points.
[0084] G = (V, E)
[0085] Where G represents the K-nearest neighbor graph between pseudo-location points and real location points, N = |V| represents the number of location points, and E represents the edges in the graph structure that represent connectivity relationships.
[0086] The graph adjacency matrix of the K-nearest neighbor graph is obtained by concatenating the neighbor matrices corresponding to the three subgraphs contained in the K-nearest neighbor graph.
[0087] S140 is based on GraphSAGE to construct a deconvolution model. The node expression matrix and graph adjacency matrix are input into the deconvolution model to aggregate node information and output the proportion of cell types in the real location points.
[0088] In this embodiment, a deconvolution model STdGraphSAGE for spatial transcriptomics cell types is constructed based on the graph neural network GraphSAGE. STdGraphSAGE consists of a first fully connected neural network layer, the GraphSAGE model, and a second fully connected neural network layer.
[0089] like Figure 5 As shown, the input to the STdGraphSAGE model includes: the node expression matrix of the real location points, the node expression matrix of the pseudo location points, and the graph adjacency matrix representing the K-nearest neighbor graph. The node expression matrices of the real location points and the pseudo location points are dimensionally matched through the first fully connected neural network layer and concatenated to obtain the expression matrix. u represents the dimension of the marker gene, n r and n p Let R represent the number of samples for the real location points and the pseudo location points, respectively, and let R represent the set of real numbers.
[0090] The expression matrix X exp The graph adjacency matrix is input into the STdGraphSAGE model. Each layer of the GraphSAGE model uses mean aggregation to aggregate the expression matrix X based on the adjacency relationships between points indicated by the graph adjacency matrix. exp The node information in the data is used to generate new node features for each location point. The aggregation layer can be represented as:
[0091]
[0092]
[0093] Where N(v) represents the set of adjacent nodes of point v at a certain layer. This represents the node features of location point v after updating at layer t, where t represents the layer number, AGG is the aggregator, the aggregation method is set to mean aggregation, h represents the updated features, and W... t denoted as the parameter matrix of layer t, concat(·) is the concatenation function, and σ represents the ReLU activation function.
[0094] To avoid oversmoothing, this embodiment employs a layer aggregation mechanism with skip connections, and aggregates each layer of the GraphSAGE model using Long Short-Term Memory (LSTM). The aggregation method is as follows:
[0095]
[0096] in, The last layer output of location point v represents the feature, and k represents the number of network layers in the STdGraphSAGE model.
[0097] Since the K-nearest neighbor graph uses all Pseudo-spots and Real-spots as nodes, the graph adjacency matrix corresponding to the K-nearest neighbor graph contains node information for all nodes. Using the STdGraphSAGE model, real-spots can learn node information from Pseudo-spots and perform information iteration. During the iteration process, the true labels are... m represents the number of cell types.
[0098] During the iteration process, node information at both real and pseudo-location points is updated with features until the preset maximum number of iterations is reached, resulting in the trained STdGraphSAGE model. Specifically, to match the number of cell types at the real location points to be predicted, the GraphSAGE model outputs... To further input the data into the second fully connected neural network layer, we obtain:
[0099]
[0100] Where ELU(·) and softmax(·) represent activation functions, n represents the predicted proportion of cell types. type b represents the total number of all cell types at the predicted true location point. (0) and k (0) b(1) and k(1) represent the parameters to be updated in the ELU(·) activation function, and b(1) and k(1) represent the parameters to be updated in the softmax(·) activation function.
[0101] Based on the same inventive concept, embodiments of the present invention also provide a device 600 for determining cell types based on GraphSAGE spatial transcriptome deconvolution, such as... Figure 6 As shown, it includes a data acquisition unit 610, a pseudo-location point generation unit 620, a graph structure construction unit 630, and a cell type ratio prediction unit 640.
[0102] The data acquisition unit 610 is used to obtain the node expression matrix of spatial points in the spatial transcriptome using in situ sequencing technology. The spatial points are used as real location points, and logistic regression is used to determine the marker genes from single-cell RNA sequencing data.
[0103] The pseudo-location point generation unit 620 is used to randomly select several cell types from single-cell RNA sequencing data based on marker genes, extract corresponding cells to construct a cell library, randomly select several cells from the cell library to form pseudo-location points, and calculate the node expression matrix of pseudo-location points.
[0104] The graph structure building unit 630 is used to calculate the Euclidean distance based on the node representation matrix, and obtain the pseudo distance matrix between pseudo location points, the real distance matrix between real location points, and the connection distance matrix between pseudo location points and real location points. Based on the pseudo distance matrix, the real distance matrix, and the connection distance matrix, the K nearest neighbor algorithm is used to obtain the K neighbor graph between pseudo location points and real location points and the graph adjacency matrix corresponding to the K neighbor graph.
[0105] The cell type ratio prediction unit 640 is used to build a deconvolution model based on GraphSAGE. It inputs the node expression matrix and graph adjacency matrix into the deconvolution model to aggregate node information and output the cell type ratio at the real location point.
[0106] For the device for determining cell types based on GraphSAGE spatial transcriptome deconvolution provided in the embodiments of the present invention, since it basically corresponds to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separating components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the present invention according to actual needs. Those skilled in the art can understand and implement this invention without creative effort.
[0107] Based on the same inventive concept, the embodiment also provides a device for determining cell types based on GraphSAGE spatial transcriptome deconvolution, including a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to implement the above-described GraphSAGE-based spatial transcriptome deconvolution method when the computer program is executed.
[0108] The device for determining cell types based on spatial transcriptome deconvolution using GraphSAGE, as proposed in this invention, can be a device such as a computer. The device can be implemented through software, hardware, or a combination of both. Taking software implementation as an example, it is formed by the processor of any device with data processing capabilities reading the corresponding computer program instructions from non-volatile memory into memory and executing them. From a hardware perspective, in addition to a processor, memory, network interface, and non-volatile memory, the device for determining cell types based on spatial transcriptome deconvolution using GraphSAGE provided in this invention may also include other hardware depending on the actual functions of the device with data processing capabilities; these will not be elaborated further.
[0109] Based on the same inventive concept, the embodiment also provides a computer-readable storage medium storing a computer program, which, when used by a computer, implements the above-described method for determining cell types based on GraphSAGE spatial transcriptome deconvolution.
[0110] The computer-readable storage medium can be an internal storage unit of any data processing device described in any of the foregoing embodiments, such as a hard disk or memory. The computer-readable storage medium can also be an external storage device of a wind turbine, such as a plug-in hard disk, smart media card (SMC), SD card, flash card, etc., mounted on the device. Furthermore, the computer-readable storage medium can include both internal storage units of any data processing device and external storage devices. The computer-readable storage medium is used to store the computer program and other programs and data required by the data processing device, and can also be used to temporarily store data that has been output or will be output.
[0111] It should be noted that the apparatus, device, and computer-readable storage medium for determining cell types based on GraphSAGE spatial transcriptome deconvolution provided in the above embodiments all belong to the same concept as the method embodiments for determining cell types based on GraphSAGE spatial transcriptome deconvolution. For details of their implementation process, please refer to the method embodiments for determining cell types based on GraphSAGE spatial transcriptome deconvolution, which will not be repeated here.
[0112] Experimental Example
[0113] The proposed STdGraphSAGE model was tested using four sets of simulated data, generated from the pancreas and lung datasets. Each set contained 1000 spatial transcriptome samples and several scRNA-seq data. The proposed STdGraphSAGE model will be compared with other state-of-the-art methods using the following four metrics:
[0114] (1) The Pearson correlation coefficient (PCC) is used to measure the linear relationship between two datasets. The larger the PCC, the better.
[0115] (2) The divergence coefficient (Jensen-Shannon divergence, JSD) is used to measure the difference between two probability distributions. The smaller the JSD, the better.
[0116] (3) Root Mean Square Error (RMSE) is used to measure the average difference between the predicted value and the actual value. The smaller the RMSE, the better.
[0117] (4) The Structural similarity index (SSIM) is used to measure the structural similarity between two images. The larger the SSIM, the better.
[0118] The following four sets of simulated data demonstrate the actual prediction performance of the STdGraphSAGE model proposed in this invention:
[0119] Simulation Data 1
[0120]
[0121]
[0122] Simulation Data 2
[0123] STdGraphSAGE 0.9133 0.1861 0.0872 0.8917 RCTD 0.7372 0.2698 0.1339 0.6738 STRIDE 0.7091 0.4008 0.1783 0.5611 DSTG 0.8311 0.3746 0.1337 0.6817 Tangram 0.8983 0.2529 0.1216 0.7953
[0124] Simulation Data 3
[0125] STdGraphSAGE 0.9123 0.1865 0.0970 0.8906 RCTD 0.8279 0.2224 0.1057 0.7910 STRIDE 0.9185 0.2378 0.0969 0.8636 DSTG 0.8490 0.3364 0.1208 0.7602 Tangram 0.8917 0.2916 0.1276 0.7598
[0126] Simulation data 4
[0127] STdGraphSAGE 0.8722 0.3138 0.0858 0.7976 RCTD 0.8630 0.2664 0.1112 0.7318 STRIDE 0.8747 0.4016 0.0983 0.6397 DSTG 0.6262 0.5135 0.1266 0.4549 Tangram 0.8367 0.3648 0.1476 0.6358
[0128] The comparative results show that the spatial transcriptome deconvolution method proposed in this invention can significantly improve the prediction accuracy of cell type ratios.
[0129] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention in any way. Although the implementation process of the present invention has been described in detail above, those skilled in the art can still modify the technical solutions described in the foregoing examples or make equivalent substitutions for some of the technical features. All modifications and equivalent substitutions made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for determining cell type based on GraphSAGE spatial transcriptome deconvolution, characterized in that, Includes the following steps: Step 1: Using in situ sequencing technology, obtain the node expression matrix of spatial points in the spatial transcriptome. The spatial points are used as real location points. Logistic regression is used to determine the marker genes from single-cell RNA sequencing data. Step 2: Based on the marker genes, randomly select several cell types from the single-cell RNA sequencing data and extract the corresponding cells to construct a cell library. Randomly select several cells from the cell library to form pseudo-location points and calculate the node expression matrix of the pseudo-location points. Step 3: Calculate the Euclidean distance based on the node representation matrix to obtain the pseudo distance matrix between pseudo locations, the real distance matrix between real locations, and the connection distance matrix between pseudo locations and real locations. Based on the pseudo distance matrix, the real distance matrix, and the connection distance matrix, use the K nearest neighbor algorithm to obtain the K neighbor graph between pseudo locations and real locations and the graph adjacency matrix corresponding to the K neighbor graph. Step 4: Construct a deconvolution model based on GraphSAGE, input the node expression matrix and graph adjacency matrix into the deconvolution model to aggregate node information, and output the proportion of cell types in the real location points; The polymerization process includes: Input the node representation matrix corresponding to the pseudo-location point, the node representation matrix corresponding to the real location point, and the graph adjacency matrix into the deconvolution model; In the deconvolutional model, the GraphSAGE model, based on the adjacency relationships between points indicated in the graph adjacency matrix, uses mean aggregation at each layer to aggregate node information from the node representation matrices corresponding to pseudo-points and the node representation matrices corresponding to real-points. This aggregated feature is then input into the next layer of the GraphSAGE model for iteration. The aggregation process is expressed by the following formula: in, Indicates location point The set of adjacent nodes at a certain level This represents the node features of location point v after the update at layer t. Indicates the number of floors. For the aggregator, the aggregation method is set to mean aggregation. Indicates the updated features, express The parameter matrix of the layer, concat ( splicing function, Represents the activation function ReLU; A layer aggregation mechanism with skip connections is adopted, and the aggregated features obtained from each layer in the GraphSAGE model are aggregated using a long short-term memory method. The aggregation method is expressed by the following formula: in, Indicates location point The GraphSAGE model iterates through the features output from the last layer. This indicates the number of network layers in the GraphSAGE model.
2. The method for determining cell type based on GraphSAGE spatial transcriptome deconvolution according to claim 1, characterized in that, In step 2, the node expression matrix of the pseudo-location point is calculated by concatenating the expression matrices of several cells contained in each pseudo-location point to obtain the node expression matrix of the corresponding pseudo-location point.
3. The method for determining cell type based on GraphSAGE spatial transcriptome deconvolution according to claim 1, characterized in that, In step 3, the calculation of Euclidean distance based on the node representation matrix is expressed by the following formula: in, Indicates location point u and location point v The Euclidean distance between them and Indicates location point u and The node representation matrix, || ||2 represents the L2 norm.
4. The method for determining cell type based on GraphSAGE spatial transcriptome deconvolution according to claim 3, characterized in that, In step 3, the process of using the K-nearest neighbor algorithm based on the pseudo-distance matrix, the true distance matrix, and the connectivity distance matrix to obtain the K-nearest neighbor graph between the pseudo-location points and the true location points, and the graph adjacency matrix corresponding to the K-nearest neighbor graph, specifically involves: The elements in the pseudo distance matrix, the true distance matrix, and the connection distance matrix represent the Euclidean distance between the corresponding points. The K nearest neighbor algorithm is used to sort the elements in each row of the pseudo distance matrix, the real distance matrix, and the connection distance matrix in ascending order, and then filter and retain the top K elements to obtain the pseudo nearest neighbor matrix, the real nearest neighbor matrix, and the connection nearest neighbor matrix. Connect the position points contained in the pseudo-neighbor matrix, the real neighbor matrix, and the connected neighbor matrix to obtain a pseudo position point subgraph, a real position point subgraph, and an association subgraph connecting the pseudo position points and the real position points. The pseudo-location point subgraph, the real location point subgraph, and the correlation subgraph connecting the pseudo-location points and the real location points are superimposed to obtain the K-nearest neighbor graph between the pseudo-location points and the real location points; The graph adjacency matrix corresponding to the K-nearest graph is obtained by summing the pseudo-nearest neighbor matrix, the true neighbor matrix, and the connected neighbor matrix.
5. The method for determining cell type based on GraphSAGE spatial transcriptome deconvolution according to claim 1, characterized in that, Step 4 specifically involves: Based on the GraphSAGE model, a first fully connected neural network layer and a second fully connected neural network layer are encapsulated before and after the GraphSAGE model to obtain a deconvolution model. Both the first and second fully connected neural network layers are used to match the cell type dimension in the real location points and pseudo location points. The node representation matrices of the pseudo-location points, the node representation matrices of the real-location points, and the graph adjacency matrix are input into the deconvolution model. The node representation matrices of the pseudo-location points and the node representation matrices of the real-location points are dimension-matched through the first fully connected neural network layer, and then concatenated to obtain the representation matrix. This can be expressed as a formula: in, u Dimensions representing marker genes, and These represent the number of samples for true location points and false location points, respectively. R Represents the set of real numbers; expression matrix The graph adjacency matrix is input into the GraphSAGE model, and the GraphSAGE model, based on the graph adjacency matrix, processes the expression matrix. The node information is iteratively updated, aggregating the information from each node, and the actual labels during the iteration process. Y Expressed as a formula: in, m This indicates the number of cell types; the number of cell types is the same in both true and false locations. Expression matrix The output H is obtained after the last hidden layer of the GraphSAGE model, which can be expressed by the formula: in, This represents the dimension of the hidden layer in the GraphSAGE model; H is input into the second fully connected neural network layer to match the dimension of H with the target dimension, which is the total number of all cell types in the true location point to be predicted. This total number is the same as the number of cell types in the single-cell RNA sequencing data. The output cell type ratio of the true location point is expressed by the formula: in, and This represents the activation function. This indicates the predicted proportion of cell types. n type This represents the total number of all cell types at the predicted true location point. and express The parameters to be updated in the activation function and express The parameters to be updated in the activation function.
6. A device for determining cell type based on GraphSAGE spatial transcriptome deconvolution, characterized in that, It includes a data acquisition unit, a pseudo-location point generation unit, a graph structure construction unit, and a cell type ratio prediction unit; The data acquisition unit is used to obtain the node expression matrix of spatial points in the spatial transcriptome using in situ sequencing technology. The spatial points are used as real location points, and logistic regression is used to determine marker genes from single-cell RNA sequencing data. The pseudo-location point generation unit is used to randomly select several cell types from single-cell RNA sequencing data based on the marker gene and extract corresponding cells to construct a cell library, randomly select several cells from the cell library to form pseudo-location points and calculate the node expression matrix of the pseudo-location points. The graph structure construction unit is used to calculate the Euclidean distance based on the node representation matrix, and obtain the pseudo distance matrix between pseudo locations, the real distance matrix between real locations, and the connection distance matrix between pseudo locations and real locations. Based on the pseudo distance matrix, the real distance matrix, and the connection distance matrix, the K nearest neighbor algorithm is used to obtain the K neighbor graph between pseudo locations and real locations and the graph adjacency matrix corresponding to the K neighbor graph. The cell type ratio prediction unit is used to construct a deconvolution model based on GraphSAGE. It inputs the node expression matrix and graph adjacency matrix into the deconvolution model to aggregate node information and outputs the cell type ratio in the real location point. The polymerization process includes: Input the node representation matrix corresponding to the pseudo-location point, the node representation matrix corresponding to the real location point, and the graph adjacency matrix into the deconvolution model; In the deconvolutional model, the GraphSAGE model, based on the adjacency relationships between points indicated in the graph adjacency matrix, uses mean aggregation at each layer to aggregate node information from the node representation matrices corresponding to pseudo-points and the node representation matrices corresponding to real-points. This aggregated feature is then input into the next layer of the GraphSAGE model for iteration. The aggregation process is expressed by the following formula: in, Indicates location point The set of adjacent nodes at a certain level This represents the node features of location point v after the update at layer t. Indicates the number of floors. For the aggregator, the aggregation method is set to mean aggregation. Indicates the updated features, express The parameter matrix of the layer, concat ( splicing function, Represents the activation function ReLU; A layer aggregation mechanism with skip connections is adopted, and the aggregated features obtained from each layer in the GraphSAGE model are aggregated using a long short-term memory method. The aggregation method is expressed by the following formula: in, Indicates location point The GraphSAGE model iterates through the features output from the last layer. This indicates the number of network layers in the GraphSAGE model.
7. A device for determining cell types based on GraphSAGE spatial transcriptome deconvolution, comprising a memory and a processor, wherein the memory is used to store a computer program, characterized in that, The processor is configured to, when executing the computer program, implement the method for determining cell type based on spatial transcriptome deconvolution according to any one of claims 1-5.
8. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is used, it implements the method for determining cell types based on spatial transcriptome deconvolution according to any one of claims 1-5.
Citation Information
Patent Citations
Classification method and device, electronic equipment and storage medium
CN113470828A
ScRNA-seq data feature representation and cell type identification method based on graph neural network
CN116452910A