Single cell data integration method based on self-supervised learning
By proposing four models based on self-supervised learning in the field of single-cell data integration, we solve the problems of batch label loss, lack of interpretability, cross-species data integration, and high cost and low spatial transcriptomic data in single-cell data integration. The problem of resolution enables efficient, interpretable and accurate data integration and analysis.
Patent Information
- Application Number
- CN202411319920.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-02-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing single-cell data integration algorithms face problems such as loss of batch labels, lack of interpretability, cross-species data integration challenges, and high cost and low resolution of spatial transcriptomic data.
A single-cell data integration method based on self-supervised learning is proposed, including four models: scCorrector, scInterpreter, CAMEX and stInfer. scCorrector integrates single-cell data from different studies through variational autoencoder and adaptive normalization layer; scInterpreter uses encoder-decoder structure and biological knowledge regularization to improve model interpretability; CAMEX uses heterogeneous graph neural network integration and Annotated multi-species single-cell data; stInfer infers spatial transcriptional expression from histological images through weighted K nearest neighbor models.
It effectively solves the problems of batch label loss and lack of interpretability, realizes efficient integration of cross-species data, and improves the accuracy and efficiency of data analysis by reducing the cost of spatial transcriptomics data acquisition and improving resolution.
Smart Images

Figure CN119446274A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of biological cell data processing, and in particular to a single cell data integration method based on self-supervised learning. Background Art
[0002] Single-cell data is data on cellular epigenetics, transcriptomes, and proteomes at single-cell resolution, which can reflect the heterogeneity of cell populations. With the continuous expansion of single-cell data, especially the generation of atlas data, the batch effect problem has become more prominent. Specifically, batch effects make it easier for cells from different experiments to cluster by batch rather than by cell type, resulting in technical factors masking the biological phenomena that really need to be observed. In order to solve the batch effect, single-cell data from multiple batches need to be effectively integrated. However, single-cell data often lack manually annotated labels. Therefore, designing and developing efficient self-supervised learning integration algorithms is an important topic in single-cell data analysis. In addition, spatial transcriptomics sequencing technology has some limitations that need to be compensated by computational means.
[0003] Although many classic methods have been developed in the field of single-cell data integration and have achieved remarkable results, traditional single-cell integration algorithms often only focus on relatively simple batch effect problems caused by platform technology factors, ignoring the huge challenges faced in the real environment, including: 1) Batch label loss in single-cell data integration scenarios; 2) Lack of interpretability for most existing deep learning-based single-cell integration algorithms; 3) Some difficulties in integrating multi-species single-cell data, such as uncertainty in homology, differences in sequencing technology, and limited biological knowledge; 4) Some limitations of spatial transcriptomics (ST) data, such as high cost, low resolution, and other problems. Summary of the invention
[0004] The purpose of the present invention is to overcome the problems of the above-mentioned prior art, such as batch label loss, lack of interpretability, and cross-species, and to provide a single-cell data integration method for a self-supervised learning model.
[0005] The purpose of the present invention can be achieved by the following technical solutions:
[0006] A single cell data integration method based on self-supervised learning, comprising the following steps:
[0007] scCorrector, a single-cell data integration algorithm based on a study-specific normalization layer, integrates single-cell data from different studies and maps them into a common space;
[0008] The interpretable single-cell data integration algorithm scInterpreter based on knowledge regularization is used to align multiple types of single-cell datasets;
[0009] Integrate and annotate multi-species single-cell data through CAMEX, a multi-species single-cell data integration and annotation algorithm based on heterogeneous graph neural networks;
[0010] Spatial transcriptional expression was inferred from histological images using stInfer, an algorithm based on a weighted K-nearest neighbor model.
[0011] As a preferred technical solution, the scCorrector is a self-supervised learning model based on a variational autoencoder, including an encoder and a decoder, and an adaptive normalization layer SSAN is assigned to each data set in the decoder:
[0012] The encoder encodes different batches of samples into an embedding space in a nonlinear manner; the decoder reconstructs the input representation from the embedding of the hidden layer;
[0013] The adaptive normalization layer SSAN uses a neural network to adaptively learn a new mean μ and variance σ, and recalculate u stand and σ stand The definition is as follows:
[0014] u stand =f u (u)
[0015] σ stand =f σ (σ)
[0016] Among them, f u and f σ It is a fully connected layer, and scCorrector shares the fully connected layer f u and f σ Parameters;
[0017] Based on the obtained u stand and σ stand Each input sample is scaled to normalize across studies or batches.
[0018] As a preferred technical solution, the scInterpreter is based on a self-supervised learning model of a variational autoencoder, including an encoder, a decoder, and a module for constraining the decoder weights:
[0019] The encoder encodes different batches of samples x into the embedding space in a nonlinear way; the decoder D reconstructs x from the embedding representation of the bottleneck layer to simulate the reverse process.
[0020] The module constraining the decoder weights makes the weights similar to the pathway-gene adjacency matrix in the prior knowledge base, and measures the adjacency matrix of the prior knowledge by L1 or L2 norm. and the decoder parameters W, and use it as a loss function to optimize during training.
[0021] As a preferred technical solution, the scInterpreter reconstructs the original vector through the decoder via the hidden variable z:
[0022] x′=σ(W D z+b D )
[0023] Among them, W D represents the decoder parameters, b D is the bias matrix of the decoder, σ is the activation function;
[0024] The L1 / L2 norm is used to constrain the decoder parameters:
[0025]
[0026]
[0027] Among them, W D represents the weight of the decoder, represents the pathway-gene adjacency matrix, * represents the Hadamard product;
[0028] When training the model, use The prior information is used to constrain the weights of the decoder, and the Adam optimizer is used to optimize the parameters of the model.
[0029] As a preferred technical solution, the CAMEX model is as follows:
[0030] After preprocessing, each cell-gene expression matrix containing N cells and M genes is converted into a bipartite graph A with cells and genes as vertices, that is, an edge A is established between cell i and gene m if and only if cell i expresses gene m im ;
[0031] Calculate the distance between cells based on the cell-gene expression matrix and construct a KNN graph to connect the cells;
[0032] Add self-loops for each cell and gene;
[0033] Connect genes from different species based on many-to-many homology relationships;
[0034] A multi-species cell-gene heterogeneous graph containing six types of edges, including cell-expressed genes, genes expressed by cells, cell-cell KNN similarity, cell self-loops, gene self-loops, and gene-gene homology, was obtained; the initial feature of each cell node was set to its original expression, and the initial feature of each gene node was set to empty;
[0035] A heterogeneous GNN encoder is adopted to propagate features from neighboring nodes to the central node in a nonlinear manner, and finally each node is embedded in a shared low-dimensional space.
[0036] As a preferred technical solution, for the integration task, the CAMEX uses an encoder-decoder architecture, as follows:
[0037] CAMEX uses a heterogeneous graph neural network as an encoder and a dot product decoder to reconstruct the edges in the cell-gene graph. Specifically, the dot product of the cell embedding is used to predict whether the edge in the heterogeneous graph exists, and the cross entropy loss function is used to measure the original adjacency matrix A and the reconstructed adjacency matrix A′.
[0038] A fully connected decoder is used to reconstruct the cell features through the fully connected layer, and the mean square error is used to measure the distance between the original cell feature h0 and the reconstructed cell feature h′0:
[0039] The loss function includes the cross entropy loss L between the predicted edge and the true edge A and the mean squared error loss L between predicted cell expression and true cell expression F , the loss function and model parameters are optimized in an end-to-end manner through self-supervised learning via the back-propagation algorithm.
[0040] As a preferred technical solution, for the annotation task, the CAMEX uses an encoder-classifier architecture, as follows:
[0041] A reference dataset with at least one given label during training, the adopted GAT uses the cell embeddings generated by the encoder to classify cells.
[0042] Calculate the attention coefficient for the cell embedding input to the GAT classifier:
[0043] e ij =a([Wh i ||Wh j ]), j∈N i
[0044] Among them, the shared parameter W maps the nodes to the same space, and then performs the || splicing operation. Finally, a maps the spliced result to a real number as the correlation between i and j;
[0045] Normalizing the correlation yields the attention coefficient:
[0046]
[0047] The cross entropy loss between the predicted labels and the true labels of cells in the reference dataset is calculated, and the back-propagation algorithm is used to optimize the loss function and model parameters in a semi-supervised learning manner.
[0048] As a preferred technical solution, the CAMEX method of using accelerated training includes:
[0049] Backtracking checkpoints: During model training, the model parameters are saved as checkpoints at the end of each epoch training, cells are clustered by embedding, and the clustering metric ARI is used to check whether to stop training or return to the checkpoint;
[0050] Adversarial training: Use adversarial methods to reduce the distance between domains:
[0051] Classifier C is used for reference samples. Through the supervision data of reference samples, L cls The classification loss function is used to train the classifier:
[0052]
[0053] Two loss functions L advD and L advM , L advD For the discriminator, we need to minimize L advM It is to learn a domain-invariant representation, which needs to maximize:
[0054]
[0055] Among them, M s and M t Represents the reference sample X s and query sample X t The mapping learned in
[0056] Label smoothing: When performing semi-supervised learning cell annotation tasks, label smoothing techniques are used to improve prediction accuracy. The specific definition is as follows:
[0057] y i =y one hot (1-α)+α / K
[0058] Among them, K is the number of cell categories and α is a hyperparameter.
[0059] As a preferred technical solution, the stInfer includes two parts: visual encoder and k-nearest neighbor weighted prediction, as follows:
[0060] Segment the stained histological images into independent patches according to the locations of sequencing sites in the spatial transcriptome data;
[0061] Input the patch into the pre-trained visual encoder to obtain the embedded representation vector of the patch;
[0062] Using the k-nearest neighbor weighted prediction method, the similarity is calculated by the patch corresponding to the spot, and then the gene expression is predicted by the weighted average of the neighbors.
[0063] As a preferred technical solution, the k-nearest neighbor weighted prediction uses the weighted average of the neighbor expression values as the predicted expression value of the target sample:
[0064] The distance between the rth patch and the qth patch is defined as follows:
[0065]
[0066] Among them, K is the hyperparameter of the number of neighbors, H r is the embedding of the rth query neighbor patch in the test set, H q is the embedding of the qth patch in the test set;
[0067] Predicting spatially unmeasured gene Y by weighted expression of K neighboring genes in the reference data q Expression:
[0068]
[0069] Among them, w kr is the weight between the kth neighbor and q, X k is the expression value of the reference spot.
[0070] Compared with the prior art, the present invention has the following beneficial effects:
[0071] 1) This paper proposes a data integration method called scCorrector for single-cell data integration scenarios with lost batch labels. It is based on a variational autoencoder and a study-specific adaptive normalization layer for efficient single-cell data integration alignment and other downstream tasks. The batch effect is mitigated by variational inference, and the problem of lost or confused study and batch labels is handled by providing a specific adaptive normalization layer for each study. Compared with previous methods, scCorrector improves integration performance while alleviating the problem of lost or confused batch labels.
[0072] 2) In response to the problem that most existing deep learning integration algorithms lack interpretability, the present invention proposes an interpretable self-supervised learning model scInterpreter. scInterpreter has an encoder-decoder structure. During the decoding process, biological knowledge is used to constrain the parameters of the decoder to achieve model interpretability and accelerate model training. In addition, scInterpreter is scalable and can integrate and annotate atlas-level single-cell data with large amounts of data. The cell representation obtained by scInterpreter analyzes each pathway of cell representation in the embedding space and has rich biological significance. scInterpreter is an effective and interpretable integration tool, and it is expected that scInterpreter will greatly facilitate the study of single-cell transcriptomics.
[0073] 3) In view of some difficulties in integrating multi-species single-cell data, such as ambiguity of homology relationships, differences in sequencing technology, and limited biological knowledge, this paper introduces a new heterogeneous graph neural network tool CAMEX, which uses many-to-many homology relationships for integration, alignment, and annotation. During integration, CAMEX is an encoder-decoder structure. CAMEX embeds cells and genes of multiple species into the same space through the encoder. During decoding, the integration task is achieved through self-supervised learning by reconstructing node features and graph structures. During annotation, CAMEX inputs the cell embedding vector obtained from the encoder into a graph attention mechanism neural network classifier, and achieves the annotation task through semi-supervised learning. CAMEX outperforms the most advanced methods in integrating multiple cross-species benchmark datasets. In addition, CAMEX discovered the consistency of different species at different developmental stages, significantly enhancing the understanding of the origin of cells, organs, and organisms. Through cell and gene embedding, CAMEX can more easily detect species-specific cells and marker genes. CAMEX has the potential to provide valuable insights into how evolutionary forces operate between different species at the single-cell level.
[0074] 4) In response to the high cost and low resolution of spatial transcriptomics technology, the present invention proposes a fast and accurate method stInfer that can infer gene expression and improve resolution from hematoxylin and eosin-stained histological images. According to the position of the sequencing site spot in the spatial transcriptomics data, the H&E image is segmented into patches. These patches are then encoded into feature vectors using a pre-trained visual model. Finally, the gene expression values of the target patch and the corresponding spot are predicted using the nearest neighbor weighted method. The application of stInfer in expression value prediction and super-resolution tasks was evaluated. stInfer can infer gene expression values and improve the resolution of spatial transcriptomics data with H&E images. It is expected to be widely used in complex spatial transcriptomics data, bringing new insights into structural composition and microenvironment. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 It is a schematic diagram of the structure of the present invention.
[0076] Figure 2 This is a framework diagram of the scCorrector model proposed in the present invention;
[0077] Figure 3 This is the framework diagram of the scInterpreter model proposed in the present invention;
[0078] Figure 4 This is the framework diagram of the CAMEX model proposed in the present invention;
[0079] Figure 5 Figure 1 is a framework diagram of the stInfer model proposed in the present invention; a) The correspondence between spots in spatial transcriptome data and patches in H&E staining images; b) Dividing H&E staining images into small blocks according to the locations of sequencing sites; c) Encoding image patches as feature vectors; d) Finding the k nearest neighbors in the embedding space by distance; e) Application scenarios of stInfer. DETAILED DESCRIPTION
[0080] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0081] Example 1
[0082] This paper proposes a single-cell data integration method based on self-supervised learning. Relying on deep learning-related algorithms, a series of self-supervised learning models for integrating single-cell data are developed for various scenarios such as batch label loss, lack of interpretability, and cross-species, alleviating the adverse effects on downstream tasks caused by differences in sequencing technology. In addition, inferring gene expression through staining images greatly reduces the research cost of spatial transcriptomes and facilitates the exploration of tissue microenvironment. Figure 1 As shown, the specific method steps include:
[0083] Step 1: Integrate single-cell data from different studies and map them into a common space using the single-cell data integration algorithm scCorrector based on a study-specific normalization layer;
[0084] Step 2: Use the knowledge-regularized interpretable single-cell data integration algorithm scInterpreter to align multiple types of single-cell datasets;
[0085] Step 3: Integrate and annotate multi-species single-cell data through CAMEX, a multi-species single-cell data integration and annotation algorithm based on heterogeneous graph neural network;
[0086] Step 4: Infer spatial transcriptional expression from histological images using stInfer, an algorithm based on a weighted K-nearest neighbor model.
[0087] The specific implementation process of each step is as follows:
[0088] 1. scCorrector, a single-cell data integration algorithm based on a specific normalization layer
[0089] In order to solve the problems faced in integrating different types of single-cell data, including technical noise, sample heterogeneity, and differences in omics and species, this paper proposes a self-supervised learning model scCorrector based on variational autoencoder, which can integrate single-cell data from different studies (even if batch labels are lost) and map them to a common space. A study-specific adaptive normalization layer is designed for each dataset in the decoder to achieve this feature.
[0090] Different studies contain different batches of noise sources in real scenarios, where study labels or batch labels may be lost or mixed up. The architecture of the scCorrector proposed in this invention is as follows: Figure 2 As shown in the figure, it consists of an encoder and a decoder. The purpose of the encoder is to encode different batches of samples into the embedding space in a nonlinear way, and the purpose of the decoder is to reconstruct the input expression from the embedding of the hidden layer. During forward propagation, the representation of the l+1th layer is calculated as follows:
[0091] x l+1 =σ(W l x l +b l )(1.1)
[0092] Among them, x l is the feature of the lth layer, W l is the parameter matrix of the lth layer, b l is the bias matrix of the lth layer, and σ is the activation function.
[0093] The goal of scCorrector is to maximize the log-likelihood (x) of the observed single-cell data:
[0094]
[0095] ELBO can be further decomposed into two terms:
[0096] L ELBO (x) = E q(z|x) [logp(x|z)]-αD KL (q(z|x)||p(z)) (1.5)
[0097] The purpose of the first term is to minimize the distance between the output and input of the decoder, and the second term is the regularization term, which aims to minimize the KL (Kullback-Leibeler) divergence between the posterior distribution of the potential representation z and the prior normal distribution. α is a hyperparameter and is set to 0.5 as the default parameter.
[0098] The phenomenon of internal covariate shift (ICS) brings difficulties to the training of neural networks. The proposal and application of batch normalization (BN) layer greatly alleviates this problem. The definition of BN layer is as follows:
[0099]
[0100] Among them, μ is the displacement parameter (mean), σ is the scale parameter (variance), μ and σ are calculated by counting the data in a mini-batch, g and b are the scaling parameter and movement parameter respectively, which are learnable parameters, f represents the mapping function of a layer in the neural network, and h represents the output.
[0101] Among the sources of noise in real scenarios, different studies contain different batches. When the study or batch label is lost, the BN layer will calculate the mean and variance of all study data in a mini-batch; when the batch labels in a certain study data are confused, the BN layer will incorrectly calculate the mean and variance of different batches of data in this study. The above two factors will amplify the study (batch) effect. Most of the previous batch correction calculation methods integrated data from different batches in the same study, without considering the scenarios of multiple studies and multiple batches. However, with the widespread application of single-cell sequencing technology and the accumulation of a large amount of single-cell data, such scenarios are gradually increasing.
[0102] In order to alleviate the above problems, the present invention proposes a Study Specific Adaptive Normalization (SSAN). scCorrector assigns a SSAN layer to each study data, and uses a neural network to adaptively learn statistical information to improve the domain generalization ability of the model, thereby providing a general method for normalizing statistics. C , for c = 1…, C, the traditional mean μ and variance σ are calculated as follows:
[0103]
[0104] where x m represents the mth sample, and M represents the total number of samples.
[0105] On this basis, the new mean μ and variance σ are learned through the neural network, so the recalculated u stand and σ stand The definition is as follows:
[0106] u stand =f u (u) (1.9)
[0107] σ stand =f σ (σ) (1.10)
[0108] Among them, f u and f σ It is a fully connected layer, scCorrector shares f u and f σ Parameters. In the obtained u stand and σ stand , each input sample is scaled to achieve normalization across different studies (batches).
[0109] In this section, the performance of the proposed model scCorrector is evaluated against the state-of-the-art methods, and a summary and discussion are presented based on the experimental results.
[0110] scCorrector's data integration method is based on variational autoencoders and study-specific adaptive normalization layers for efficient single-cell data integration and alignment and other downstream tasks. The method mitigates batch effects through variational inference and handles the problem of missing or confused study and batch labels by providing a specific adaptive normalization layer for each study. Compared with previous methods, scCorrector improves integration performance while alleviating the problem of missing or confused batch labels.
[0111] In order to evaluate the performance of the proposed model scCorrector with the most advanced methods, the present invention collects data sets from multiple studies and batches of various organs, among which the pancreas data set comes from 5 studies and contains 9 batches, of which the indrop study contains 4 batches, the celseq study contains 2 batches, and the brain chromatin openness data set comes from 3 studies and contains 11 batches, of which the Cusanovich study contains four batches and the Fang study contains 6 batches. Each study in the spleen multi-omics data set, the cross-species embryo data set, and the brain spatial data set contains one batch. ARI and NMI are used to measure the ability of different methods to preserve biological variation in single-cell data; in addition, Batch entropy and Silhouette are used to measure the ability of different methods to remove batch effects. The results show the robustness of scCorrector in integrating multiple batches of data in a single-omics scenario. In addition, the high-performance integration effect and high-precision cell annotation effect of scCorrector in multi-omics data are demonstrated. Finally, by integrating scRNA-seq and MERFISH data, it is demonstrated that scCorrector can extend the gene coverage of MERFISH to the entire genome. These advantages make scCorrector particularly suitable for integrating and exploiting current complex single-cell datasets.
[0112] Compared with the state-of-the-art methods, scCorrector largely achieves superior and robust performance and brings new insights in various situations, such as different batches, multi-omics, across species, and developmental stages. In addition, the integration of single-cell data and MERFISH spatial data enables information transfer between different studies, which greatly expands the narrow gene range covered by imaging-based spatial transcriptomic techniques such as MERFISH. In summary, scCorrector can effectively integrate single-cell datasets from multiple studies, providing a wide range of opportunities for in-depth analysis of single-cell data. scCorrector has strong competitive and more robust performance and brings new insights in various situations, such as different batches, multi-omics, across species, and developmental stages. The proposed submodule SSAN layer has significant advantages over the BN layer when batch labels are confused. In addition, the integration of single-cell data and spatial data enables information transfer between different studies, while expanding the narrow gene range covered by imaging-based spatial transcriptomic techniques such as MERFISH.
[0113] 2. scInterpreter, an interpretable single-cell data integration algorithm based on knowledge regularization
[0114] The rapid accumulation of single-cell datasets has put forward several requirements for the integration task. First, batch effects can seriously confuse biological information, so effective integration tools are needed to eliminate technical factors and preserve weak biological signals, while requiring the model not to over-correct. Second, due to the sharp increase in the number of samples in the dataset, resulting in the dataset containing tens of thousands of cells, the integration method is required to be scalable. Third, deep learning models are often considered black boxes, so interpretable single-cell data integration models are needed.
[0115] In order to solve the above problems, the present invention proposes an interpretable self-supervised learning model scInterpreter to efficiently and accurately align multi-type single-cell data sets. scInterpreter has an encoder-decoder structure. During the decoding process, the weight parameters are constrained by existing biological knowledge to achieve model interpretability and accelerate model training. Specifically, first, scInterpreter accurately integrates multiple batches of single-cell data while preventing over-integration through variational inference; secondly, scInterpreter processes large-scale single-cell data through a small batch training strategy, and has strong scalability; finally, the embedding dimension is set to the number of pathways, and the weight of the decoder is constrained by prior knowledge, so that the cell function can be estimated and explained according to the expression of each dimension of the hidden layer, making the model and results interpretable.
[0116] like Figure 3As shown in the figure, scInterpreter is a self-supervised learning model based on a variational autoencoder, consisting of an encoder E and a decoder D. Specifically, the purpose of encoder E is to encode samples x from different batches into the embedding space in a nonlinear way to eliminate the impact of the batch, and the purpose of decoder D is to reconstruct x from the embedding representation of the bottleneck layer to simulate the opposite process. At the same time, scInterpreter contains a module to constrain the decoder weights so that the weights are similar to the pathway-gene adjacency matrix in the prior knowledge base, and the adjacency matrix A^ of the prior knowledge and the parameters W of the decoder are measured by L1 or L2 norms, and used as a loss function to optimize them during training. The weight parameters are constrained by existing biological knowledge to achieve model interpretability and accelerate model training. After training, single-cell data from different batches can be mapped to a unified space to form a complete data set for downstream analysis.
[0117] During forward propagation, the representation of the l+1th layer is calculated as follows:
[0118] x l+1 =σ(W l x l +b l )(2.1)
[0119] Among them, x l is the feature of the,th layer, W l is the parameter matrix of the ,th layer, b l is the bias matrix of the lth layer, and σ is the activation function.
[0120] The goal of scInterpreter is to maximize the log-likelihood (x) of the observed single-cell data:
[0121]
[0122] L ELBO (x) can be further decomposed into two terms:
[0123] L ELBO (x) = E q(z|x) [logp(x|z)]-αD KL (q(z|x)||p(z)) (2.5)
[0124] The purpose of the first term is to minimize the distance between the decoder output and input, and the purpose of the second term is to minimize the Kullback-Leibeler divergence between the posterior distribution and the prior distribution of the latent representation z, where α is a hyperparameter, which is set to 0.5 here.
[0125] Finally, the latent variable z is reconstructed into the original vector through the decoder:
[0126] x′=σ(W D z+b D ) (2.6)
[0127] Among them, W D represents the decoder parameters, b D is the bias matrix of the decoder and σ is the activation function.
[0128] In order to make the decoder parameters sparse and consistent with the pathway-gene bipartite adjacency graph in the knowledge base Similarly, the L1 / L2 norm is used here to constrain the parameters of the decoder:
[0129]
[0130]
[0131] Among them, W D represents the weight of the decoder, represents the pathway-gene adjacency matrix, and * represents the Hadamard product.
[0132] When training the model, use As a priori information to constrain the decoder weights, assume contains the functional correlations between most pathways and genes. At the end of training, the constraints make W D and Therefore, each dimension in the representation z of the middle hidden layer represents the cell function, and the value of each dimension represents the strength of the expression of this function, thereby achieving the interpretability of the integrated model and the integrated results.
[0133] Use the Adam optimizer to optimize the parameters of the model. Specifically, first calculate the gradient:
[0134]
[0135] where g t represents the gradient at time t, represents the gradient of the parameter θ, f t (θ t-1 ) represents the function to be optimized.
[0136] Second, update the first-order moment estimate vector:
[0137] m t =β1·m t-1 +(1-β1)·g t (2.10)
[0138] Where m tRepresents the first-order moment vector at time t, and β1 represents that the decay rate is a constant.
[0139] Then, update the second-order moment estimate vector:
[0140]
[0141] Among them, v t Represents the second-order moment vector at time t, and β2 represents the decay rate which is a constant.
[0142] Then, the deviation of the correction moment is:
[0143]
[0144] in, represents the average value of the first-order moment vector at time t, Represents the decay rate of m at time t.
[0145] Finally, update the parameters:
[0146]
[0147] Among them, θ t+1 represents the updated parameters, θ t represents the current parameter, α represents the learning rate, represents the average value of the first-order moment vector at time t, represents the bias-corrected second-order moment gradient estimate, and ε represents a constant.
[0148] To comprehensively evaluate scInterpreter, firstly, scInterpreter was compared with the most advanced models quantitatively (extensive evaluation indicators) and qualitatively (UMAP visualization) based on multiple single tissues of mice. Compared with the baseline method, scInterpreter achieved competitive performance. Secondly, for the atlas-level integration and annotation scenarios, scInterpreter reasonably integrated the mouse single-cell transcriptome atlas and accurately annotated the cell types, which showed that scInterpreter has strong scalability. In order to evaluate the performance of scInterpreter under multi-batch and multi-condition single-cell data, scInterpreter was applied to pancreatic data composed of six technologies and multiple sampling methods. From the results, it can be found that prior knowledge greatly accelerated the training speed and shortened the training time, which shows that the data-driven model is consistent with the previously accumulated biological knowledge in a sense. Finally, based on the integration results of PBMC data, scInterpreter is able to obtain highly interpretable cell embeddings and decoder weight matrices.
[0149] Through extensive experiments, the performance of scInterpreter has been verified in a variety of real-world scenarios. Compared with other state-of-the-art methods, scInterpreter has better biological variation preservation performance during the integration process, and is able to integrate and annotate single-cell data at the spectral level. Even under multiple noise interferences, scInterpreter can still robustly and efficiently integrate single-cell data samples from multiple different platforms. Finally, each dimension (pathway) of the cell representation in the embedding space was analyzed, proving that the cell representation obtained by scInterpreter has rich biological significance. By weight sorting, in addition, scInterpreter discovered several new pathway-related genes in the PBMC dataset. In summary, scInterpreter can be considered a powerful computational tool for integrating scRNA-seq data.
[0150] 3. CAMEX, a multi-species single-cell data integration and annotation algorithm based on heterogeneous graph neural network
[0151] It is very difficult to integrate single-cell data from different species. The reasons include the ambiguity of homology, the differences in sequencing technology, and the limited biological knowledge. Specifically, there are three challenges. First, the feature alignment problem. When inputting data into the model, the features in the expression matrices of different species do not correspond one to one. Especially when integrating single-cell data from multiple different species, the number of feature intersections will decrease sharply, which will lose a lot of key biological information. Second, the problem of technical differences. Different batches of data may have large differences due to different sequencing technologies, mainly reflected in the total number of reads detected and the total number of genes in each cell. These technical factors may mask the true biological signals. Finally, the problem of incomplete biological knowledge. Existing biological knowledge is relatively incomplete, especially for non-model organisms. The understanding is even more scarce. However, it is the understanding of these non-model organisms that biologists really care about.
[0152] In response to the above challenges, the present invention proposes CAMEX to achieve the integration, comparison and annotation of multi-species single-cell data. Specifically, the present invention constructs a heterogeneous graph composed of cells and genes based on the expression matrix and many-to-many homology relationships, that is, converts the expression matrix into a cell-gene bipartite graph, and connects the genes in the bipartite graphs of different species through existing biological knowledge (many-to-many homology relationships between genes). In order to solve the batch effect problem, a heterogeneous graph neural network with self-supervised learning with an encoder-decoder structure was developed to achieve end-to-end training by reconstructing the graph structure and node features. In addition, the distance between domains is reduced by using adversarial training, and finally the integration of single-cell data of different species is achieved. For cell annotation, CAMEX inputs the cell representation output by the encoder into the graph attention network classifier for classification.
[0153] Figure 4 As shown in Figure 2, CAMEX takes as input single-cell datasets of multiple species generated by different techniques.
[0154] Specifically, for each cell-gene expression matrix containing N cells and M genes in the CAMEX model, after normalization, logarithmic transformation, selection of highly variable genes, clustering, and selection of differentially expressed genes, the expression matrix can be converted into a bipartite graph A with cells and genes as vertices. If and only if cell i expresses gene m, an edge A is established between cell i and gene m. im . Then, the distances between cells are calculated based on the cell-gene expression matrix, and a KNN graph is constructed to connect the cells. In addition, CAMEX adds self-loops to each cell and gene to alleviate the problem of over-smoothing in graph neural networks. Finally, genes from different species are connected based on many-to-many homology relationships. As a result, a multi-species cell-gene heterogeneous graph containing six types of edges, namely "cell-expressed gene", "gene expressed by cell", "cell-cell KNN similarity", "cell self-loop", "gene self-loop" and "gene-gene homology relationship" is obtained. The initial features of each cell node are set to its original expression, and the initial features of each gene node are set to empty. CAMEX adopts a heterogeneous GNN encoder to propagate features from neighboring nodes to the central node in a nonlinear manner, and finally embeds each node into a shared low-dimensional space.
[0155] For the integration task, CAMEX uses an encoder-decoder architecture. Specifically, CAMEX uses a heterogeneous graph neural network as an encoder, a dot-product decoder to reconstruct the edges in the cell-gene graph, and a fully connected decoder to reconstruct cell features. The loss function includes the cross-entropy loss (CE) between the predicted edges and the true edges and the mean square error loss (MSE) between the predicted cell expression and the true cell expression. CAMEX optimizes the loss function and model parameters in an end-to-end manner through self-supervised learning using the back-propagation algorithm.
[0156] For the annotation task, CAMEX uses an encoder-classifier architecture with at least one reference dataset with a given label during training. The GAT adopted by CAMEX uses the cell embedding generated by the encoder to classify cells. It calculates the cross entropy loss between the predicted labels and the true labels of cells in the reference dataset, and uses the back-propagation algorithm to optimize the loss function and model parameters in a semi-supervised learning manner.
[0157] CAMEX is a heterogeneous graph neural network model consisting of two structures: an encoder and a decoder. During encoding, the features of adjacent nodes are nonlinearly transformed according to the message passing paradigm and propagated to the central node. After passing information through multiple layers of neural networks, the embedding of cells and genes can be obtained. The embedding of cells and genes in the l+1 layer is calculated as follows:
[0158]
[0159]
[0160] in, and The,th layer, which represents cells and genes, and The weight matrix of the first layer representing “cell self-loop” and “gene self-loop”, Represents the neighbor index set of node (cell or gene) i under relation r∈R. i,r is a normalization factor, is the weight matrix of the,th layer transformation of relation r, is the first layer representation of neighbor j, σ is the activation function, and Leaky ReLU is used here.
[0161]
[0162] When decoding, the goal of the dot product decoder is to reconstruct the graph structure. Specifically, it predicts whether an edge in the heterogeneous graph exists through the dot product of the cell embedding:
[0163] A′=H N H M (3.4)
[0164] Among them, H N is cell embedding, H M is the gene embedding, A′ is the reconstructed adjacency matrix
[0165] The original adjacency matrix A and the reconstructed adjacency matrix A′ are measured by the cross entropy loss function:
[0166]
[0167] The purpose of another decoder is to reconstruct the cell features through a fully connected layer:
[0168]
[0169] Among them, W fc is the weight of the fully connected neural network, and h′0 is the reconstructed cell feature.
[0170] The mean square error is used to measure the distance between the original h0 and the predicted h′0:
[0171]
[0172] L A and L F The sum is used as the final loss function:
[0173] L reconstruction =L A +L F (3.8)
[0174] When performing the cell annotation task, the cell embedding can be input into the GAT classifier. Specifically, the attention coefficient is first calculated:
[0175] e ij =a([Wh i ||Wh j ]), j∈N i (3.9)
[0176] Among them, the shared parameter W maps the nodes to the same space, and then performs the || splicing operation. Finally, a maps the spliced result to a real number as the correlation between i and j. Then the correlation is normalized to obtain the attention coefficient:
[0177]
[0178] Optimizing the semi-supervised model through the cross entropy loss function:
[0179]
[0180] For larger datasets or datasets with more types, heterogeneous graphs are sampled as multiple subgraphs and the mini-batch method is used to train the graph neural network.
[0181] In addition, CAMEX also uses other techniques to speed up training, including:
[0182] Backtracking checkpoints: In the process of deep learning model training, in order to prevent overfitting, the model parameters are usually saved as checkpoints at the end of each epoch training. When the validation set loss is no longer decreasing or starts to increase, the training is stopped and the model is backtracked to the appropriate checkpoint. However, during unsupervised integration and supervised annotation tasks, such checkpoints may lead to overcorrection or overfitting. Here CAMEX uses a new indicator, the Adjusted Rand Index ARI, to evaluate checkpoints. Specifically, cells are clustered by embedding, and the clustering metric ARI is used to check whether to stop training or return to the checkpoint.
[0183] Adversarial training: Use adversarial methods to reduce the distance between domains:
[0184]
[0185]
[0186]
[0187] Among them, M s and M t Represents the reference sample X s and query sample X t The mapping learned in . The classifier C is used for the reference sample. Through the supervision data of the reference sample, using L cls The classification loss function is used to train the classifier. In addition, there are two loss functions L advD and L advM , L advD For the discriminator, it needs to minimize, L advM is to learn a domain-invariant representation, which needs to be maximized.
[0188] Label smoothing: When performing semi-supervised learning cell annotation tasks, label smoothing techniques are used to improve prediction accuracy. The specific definition is as follows:
[0189] y i =y one hot (1-α)+α / K (3.15)
[0190] Among them, K is the number of cell categories, and α is a hyperparameter with a default value of 0.1.
[0191] The CAMEX framework uses heterogeneous graph neural networks to integrate and annotate multi-species single-cell data. The expression matrix of each species is converted into a bipartite graph, and these bipartite graphs are connected through many-to-many homology relationships. This design enables CAMEX to make full use of homology information and can be extended to distant species and non-model organisms. In addition, the model is trained in a self-supervised manner, and adversarial learning is used to reduce the distance between domains to achieve data integration. CAMEX is applied to RNA-seq data of 7 species, including 6 organs at different developmental stages from embryos to adults, and CAMEX accurately integrates these data. The results demonstrate the effectiveness of CAMEX on single-cell datasets of different organs from multiple different species. CAMEX is applied to integrate retinal development scRNA-seq data at multiple developmental stages of mice and humans. The results show that CAMEX can reasonably integrate different cell types and achieve the highest score, showing excellent performance compared with scVI, Harmony and LIGER. In summary, as a powerful cell annotation tool, CAMEX shows competitive performance compared with baseline methods across multiple datasets.
[0192] 4. stInfer, an algorithm for inferring spatial transcriptional expression from histological images based on a weighted K-nearest neighbor model
[0193] The rapid development of spatial transcriptomics (ST) technologies has made it possible for biologists to measure transcriptional abundance while obtaining the spatial location of cells. However, the high cost has hindered the implementation of spatial omics in a large number of tissues. In addition, widely used ST platforms can only measure gene expression corresponding to spatial locations at low resolution, which limits their usability in studying detailed structures. The present invention proposes stInfer, a method that can infer gene expression from hematoxylin and eosin (H&E) stained histological images without training and improve the resolution.
[0194] Based on deep learning and weighted K-nearest neighbor models, this model can infer gene expression in the whole transcriptomics range and improve the resolution of ST data through H&E histological images. Specifically, according to the sequencing sites (spots) in the spatial transcriptomics data, the corresponding areas in the H&E images are segmented into small blocks (patches). These patches are then encoded into feature vectors using a pre-trained ResNet visual model. Finally, the gene expression of the target patch and the corresponding spot is predicted by weighted k-nearest neighbors.
[0195] The architecture and workflow of stInfer are as follows Figure 5As shown. For ease of description, the term sequencing site (spot) used in this section refers to the sequencing area of the spatial transcriptome, and the image block (patch) refers to the area corresponding to the spot on the H&E staining image. The training set is defined as the reference, which is a sample that is both stained and sequenced. The test set is defined as the query, which is a sample that is only stained but whose expression value needs to be predicted by a computational method.
[0196] like Figure 5 As shown, the patches in the H&E images of the reference and query need to be determined jointly based on the location of the spot and the hyperparameter patch_size (adjusting the size of the patch). These patches are then input into a shared pre-trained image encoder to obtain an embedded representation vector of the patch. The pre-trained image encoder is trained in a supervised or self-supervised manner. For supervised learning, a high-quality dataset with manual annotations such as Imagenet is used to pre-train the model. For generative methods in self-supervised learning, such as autoencoders, the input is first encoded into a hidden representation, and then the input is reconstructed through a decoder. This method can better model contextual dependencies; for contrastive methods in self-supervised learning, this is achieved by setting noise contrast estimation. This method has made breakthrough progress in the field of image classification. The performance of models such as SimCLR and MoCo has demonstrated the potential of discriminative models.
[0197] In the embedding space, the distance between reference and query is calculated as the weight, such as Figure 5 As shown. Finally, the weighted average expression value of the reference is used as the predicted expression value of the query. stInfer implements two types of tasks: expression prediction and super-resolution. stInfer can use the expression values of known spots in multiple other slices or in the same slice as references to predict the expression of gaps between spots.
[0198] stInfer consists of two parts: a visual encoder and a k-nearest neighbor (KNN) weighted prediction module. First, the image corresponding to the spot in the whole slide image (WSI) is segmented into independent patches, and these patches are input into the pre-trained image model to obtain features. The embedding representation of the image patch is defined as follows:
[0199] H=f encoder (patch img ) (4.1)
[0200] Among them, f encoderFor the pre-trained visual model, patch img are the image patches of the reference and query slices, and H is the embedded representation of the image patch.
[0201] Specifically, the visual model is mainly composed of convolutional neural networks, which are artificial neural networks designed specifically for image data. Its purpose is to find a set of suitable filters (weights) that can detect and extract the features required for a given task (such as image classification). A typical CNN architecture consists of three types of structures: convolutional layers, pooling layers, and fully connected layers.
[0202] The convolution operation is defined as follows:
[0203]
[0204] Among them, f and g represent the input image and convolution kernel respectively, m and n represent the width and height of the convolution kernel respectively, and (x, y) are the horizontal and vertical coordinates of the output pixel.
[0205] The average pooling operation is defined as follows:
[0206]
[0207] Among them, Z represents the input feature, k represents the size of the pooling window, and X represents the output feature.
[0208] When the fully connected layer is forward propagated, the representation of the l+1th layer is calculated as follows:
[0209] x l+1 =σ(W l x l +b l )(4.4)
[0210] Among them, x l is the feature of the lth layer, W l is the parameter matrix of the lth layer, b l is the bias matrix of the lth layer, and σ is the activation function.
[0211] These layers can be stacked in a certain order to form a CNN architecture. This chapter uses ResNet1 8 as the backbone, and its main module is the residual network structure:
[0212] y=F(x,[W i ])+x (4.5)
[0213] Where x and y represent input and output, F(x, [W i ]) represents the transformation of x by the intermediate layers such as convolution and pooling. Therefore, the gradient calculation during back propagation is as follows:
[0214]
[0215] The distance or similarity between these H can be calculated in the embedding space, where stInfer uses cosine similarity to measure the similarity of these vectors.
[0216]
[0217] In addition, other distances such as the Manhattan distance d can also be used M Or Euclidean distance d E To calculate the similarity of different embeddings H:
[0218]
[0219]
[0220] stInfer uses the weighted average of neighbor expression values as the predicted expression value of the target sample. It is a deep learning model that does not require training. Therefore, it has a significant speed advantage over previous CNN and Transformer-based methods and can predict the expression of the entire transcript range. The pre-trained model comes from the ImageNet dataset, which covers most natural scenes and has strong generalization ability. The distance (weight) between the rth patch and the qth patch is defined as follows:
[0221]
[0222] Among them, K is the hyperparameter of the number of neighbors, H r is the embedding of the rth query neighbor patch in the test set, H q is the embedding of the qth patch in the test set.
[0223] Finally, stInfer predicts the spatially unmeasured gene Y by weighted expression of K neighboring genes in the reference data. q Expression:
[0224]
[0225] Among them, w kr is the weight between the kth neighbor and q, X k is the expression value of the reference spot.
[0226] stInfer is compared with other baseline methods. Specifically, they are evaluated on the breast cancer ST dataset in a leave-one-out cross-validation manner. This section selects one slice as the query (test) sample one by one, and the remaining 35 samples are used as reference (training) samples. Finally, a total of 108 (36*3) models are trained. stInfer outperforms other baseline models both in single samples and the average of all samples. These results show that stInfer can effectively predict the gene expression values of the spot at the corresponding position through H&E images. In particular, in patients B, C, D, G, and h, the average PCC of stInfer is 11.4%, 6.7%, 9.9%, 4.3%, and 3.1% higher than the second-ranked model, respectively. In general, the average performance of stInfer is 5.5% higher than that of the second-ranked method.
[0227] Analysis of super-resolution prediction results of stInfer on multiple slices: 35 slice samples were used as training sets and one slice sample was used as a test set for super-resolution prediction tasks. Specifically, B1 and F1 were selected as test sets, and the other 35 slices in ST were used as training sets to demonstrate the super-resolution function of stInfer. There are four cell (tissue) types, including fat, breast, connective tissue, and invasive carcinoma, in the B1 slice, with a total of 295 sequencing sites. Three cell (tissue) types, including immune, connective tissue, and invasive carcinoma, can be seen on the F1 slice, with a total of 659 sequencing sites. In B1 and F1, H&E staining images have been able to clearly separate tumors from other tissues, showing clear boundaries. Further, 1193 and 3242 pseudo spots were simulated for B1 and F1 slices, and they were inserted into the gaps between the original spots in B1 and F1 slices, respectively. Using the other 35 slices as training sets, the gene expression of these pseudo spots was predicted, and some predicted tumor marker gene expressions were visualized. Through these expressions, the spatial structure of the tumor can be observed more clearly, which demonstrates the super-resolution capability of stInfer.
[0228] Analysis of super-resolution prediction results of stInfer on a single slice: A more challenging super-resolution scenario was performed. Specifically, a single slice was used as a training set to predict the gene expression of pseudo spots within the same slice. In the H1 slice, there are six cell (tissue) types, including fat, breast, carcinoma in situ, connective tissue, immune, and invasive cancer. There are two types of tumors, including breast cancer and carcinoma in situ. Breast cancer is mainly distributed in the lower left of the slice, and carcinoma in situ is distributed in the upper right of the slice. After removing the "unknown" type, a total of 530 spots remain. Due to the lower resolution of the ST technology, it is difficult to determine the location and boundaries of these two tumors by marker genes. First, with the original spot as a reference, pseudo spots are generated between the gaps of the original spots. The 2463 pseudo spots on H1 are inserted into the gaps between the original spots. With the original spot as a reference, the gene expression of all pseudo spots can be predicted. In this way, the location and structure of the tumor can be clearly and easily found. Secondly, 50% of the spots are randomly deleted in H1, leaving 278 spots. We hope to restore the location and expression of the original spots by super-resolution and predict the expression of pseudo spots that do not exist in H1. We simulated 2769 pseudo spots in the gaps, and stInfer successfully restored their gene expression and identified tumor domains.
[0229] stInfer interpretability analysis: After preprocessing the spot gene expression, the spot was visualized using UMAP; the image corresponding to the patch was input into the pre-trained visual model to obtain the embedding vector of each patch, and then these vectors were visualized using UMAP. The results show that the expression of the spot contains similar information as the image vector of the patch, which is basically consistent with the manual annotation.
[0230] stInfer was evaluated in expression prediction and super-resolution tasks, and its effectiveness was demonstrated on the ST and 10XVisium breast cancer datasets. At the same time, stInfer's interpretability analysis can further verify the results and provide reliable guarantees for the biomedical field.
[0231] In summary, the proposed stInfer is a powerful tool to infer gene expression and improve the resolution of spatial transcriptomic data by analyzing H&E images. It is expected to be widely applied to complex spatial transcriptomic data, bringing new insights into the understanding of structural composition and microenvironment.
[0232] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A single cell data integration method based on self-supervised learning, characterized in that the steps include: scCorrector, a single-cell data integration algorithm based on a study-specific normalization layer, integrates single-cell data from different studies and maps them into a common space; The interpretable single-cell data integration algorithm scInterpreter based on knowledge regularization is used to align multiple types of single-cell datasets; Integrate and annotate multi-species single-cell data through CAMEX, a multi-species single-cell data integration and annotation algorithm based on heterogeneous graph neural networks; Spatial transcriptional expression was inferred from histological images using stInfer, an algorithm based on a weighted K-nearest neighbor model.
2. A single cell data integration method based on self-supervised learning according to claim 1, characterized in that: The scCorrector is a self-supervised learning model based on a variational autoencoder, including an encoder and a decoder, and an adaptive normalization layer SSAN is assigned to each data set in the decoder: The encoder encodes samples of different batches into an embedding space in a nonlinear manner; The decoder reconstructs the input representation from the embedding of the hidden layer; The adaptive normalization layer SSAN uses a neural network to adaptively learn a new mean μ and variance σ, and recalculate u stand and σ stand The definition is as follows: in stand =f u (in) s stand =f σ (s) Among them, f u and f σ It is a fully connected layer, and scCorrector shares the fully connected layer f u and f σ Parameters; Based on the obtained u stand and σ stand Each input sample is scaled to normalize across studies or batches.
3. The single cell data integration method based on self-supervised learning according to claim 1, characterized in that: The scInterpreter described is based on a self-supervised learning model of a variational autoencoder, including an encoder, a decoder, and a module for constraining the decoder weights: The encoder encodes different batches of samples x into the embedding space in a nonlinear manner; The decoder D reconstructs x from the embedding representation of the bottleneck layer to simulate the reverse process The module constraining the decoder weights makes the weights similar to the pathway-gene adjacency matrix in the prior knowledge base, and measures the adjacency matrix of the prior knowledge by L1 or L2 norm. and the decoder parameters W, and use it as a loss function to optimize during training.
4. A single cell data integration method based on self-supervised learning according to claim 3, characterized in that: The scInterpreter reconstructs the original vector through the decoder via the hidden variable z: x′=σ(W D z+b D ) Among them, W D represents the decoder parameters, b D is the bias matrix of the decoder, σ is the activation function; The L1 / L2 norm is used to constrain the decoder parameters: Among them, W D represents the weight of the decoder, represents the pathway-gene adjacency matrix, * represents the Hadamard product; When training the model, use The prior information is used to constrain the weights of the decoder, and the Adam optimizer is used to optimize the parameters of the model.
5. The single cell data integration method based on self-supervised learning according to claim 1, characterized in that: The CAMEX model is as follows: After preprocessing, each cell-gene expression matrix containing N cells and M genes is converted into a bipartite graph A with cells and genes as vertices, that is, an edge A is established between cell i and gene m if and only if cell i expresses gene m im ; Calculate the distance between cells based on the cell-gene expression matrix and construct a KNN graph to connect the cells; Add self-loops for each cell and gene; Connect genes from different species based on many-to-many homology relationships; A multi-species cell-gene heterogeneous graph containing six types of edges, including cell-expressed genes, genes expressed by cells, cell-cell KNN similarity, cell self-loops, gene self-loops, and gene-gene homology, was obtained; the initial feature of each cell node was set to its original expression, and the initial feature of each gene node was set to empty; A heterogeneous GNN encoder is adopted to propagate features from neighboring nodes to the central node in a nonlinear manner, and finally each node is embedded in a shared low-dimensional space.
6. A single cell data integration method based on self-supervised learning according to claim 5, characterized in that: For the integration task, the CAMEX uses an encoder-decoder architecture as follows: CAMEX uses a heterogeneous graph neural network as an encoder and a dot product decoder to reconstruct the edges in the cell-gene graph. Specifically, the dot product of the cell embedding is used to predict whether the edge in the heterogeneous graph exists, and the cross entropy loss function is used to measure the original adjacency matrix A and the reconstructed adjacency matrix A′. A fully connected decoder is used to reconstruct the cell features through the fully connected layer, and the mean square error is used to measure the distance between the original cell feature h0 and the reconstructed cell feature h′0: The loss function includes the cross entropy loss L between the predicted edge and the true edge A and the mean squared error loss L between predicted cell expression and true cell expression F , the loss function and model parameters are optimized in an end-to-end manner through self-supervised learning via the back-propagation algorithm.
7. The single cell data integration method based on self-supervised learning according to claim 5, characterized in that: For the annotation task, CAMEX uses an encoder-classifier architecture as follows: A reference dataset with at least one given label during training, the adopted GAT uses the cell embeddings generated by the encoder to classify cells. Calculate the attention coefficient for the cell embedding input to the GAT classifier: e ij =a([Wh i ||Wh j ]),j∈N i Among them, the shared parameter W maps the nodes to the same space, and then performs the || splicing operation. Finally, a maps the spliced result to a real number as the correlation between i and j; Normalizing the correlation yields the attention coefficient: The cross entropy loss between the predicted labels and the true labels of cells in the reference dataset is calculated, and the back-propagation algorithm is used to optimize the loss function and model parameters in a semi-supervised learning manner.
8. A single cell data integration method based on self-supervised learning according to any one of claims 5 to 7, characterized in that: The CAMEX accelerated training method includes: Backtracking checkpoints: During model training, the model parameters are saved as checkpoints at the end of each epoch training, cells are clustered by embedding, and the clustering metric ARI is used to check whether to stop training or return to the checkpoint; Adversarial training: Use adversarial methods to reduce the distance between domains: Classifier C is used for reference samples. Through the supervision data of reference samples, L cls The classification loss function is used to train the classifier: Two loss functions L advD and L advM , L advD For the discriminator, we need to minimize L advM It is to learn a domain-invariant representation, which needs to maximize: Among them, M s and M t Represents the reference sample X s and query sample X t The mapping learned in Label smoothing: When performing semi-supervised learning cell annotation tasks, label smoothing techniques are used to improve prediction accuracy. The specific definition is as follows: y i =y onehot (1-a)+a / K Among them, K is the number of cell categories and α is a hyperparameter.
9. The single cell data integration method based on self-supervised learning according to claim 1, characterized in that: The stInfer includes two parts: visual encoder and k-nearest neighbor weighted prediction, as follows: Segment the stained histological images into independent patches according to the locations of sequencing sites in the spatial transcriptome data; Input the patch into the pre-trained visual encoder to obtain the embedded representation vector of the patch; Using the k-nearest neighbor weighted prediction method, the similarity is calculated by the patch corresponding to the spot, and then the gene expression is predicted by the weighted average of the neighbors.
10. A single cell data integration method based on self-supervised learning according to claim 9, characterized in that: The k-nearest neighbor weighted prediction uses the weighted average of the neighbor expression values as the predicted expression value of the target sample: The distance between the rth patch and the qth patch is defined as follows: Among them, K is the hyperparameter of the number of neighbors, H r is the embedding of the rth query neighbor patch in the test set, H q is the embedding of the qth patch in the test set; Predicting spatially unmeasured gene Y by weighted expression of K neighboring genes in the reference data q Expression: Among them, w kr is the weight between the kth neighbor and q, X k is the expression value of the reference spot.
Citation Information
Patent Citations
Space transcription expression prediction method based on breast cancer pathological image
CN118136101A
Cross-species single cell annotation method
CN118298926A
Cited By
Idle data feature extraction method, spatial domain identification method and system
CN120388612A
Prediction method and prediction system for space transcriptomics, and storage medium
CN120727108A