Single-cell omics data embedding representation extraction method based on graph contrastive neural network
Patent Information
- Application Number
- CN202411104581.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2044-08-13
AI Technical Summary
此外,尽管现有的基于图对比学习的嵌入表示提取方法取得了良好的性能,但它们仍然面临着图结构构建不准确和潜在的假阴性样本存在的问题,使得单细胞嵌入表示的提取变得困难
[0061] The beneficial effects of this invention are as follows: First, this invention uses a ZINB-based encoder-decoder architecture as its foundation and incorporates cluster-guided contrastive learning into the decoder part, enabling it to more effectively utilize clustering information to explore cell co-expression patterns and enhance the classification and discrimination capabilities of the learned embedding representations. Furthermore, a self-expression module is designed, which can assist in in-depth research into the intrinsic relationships existing in single-cell data, and the learned self-expression matrix improves the quality of the cell maps required for contrastive learning. By clustering the self-expression matrix, the single-cell clustering performance of this invention is further improved.
Smart Images

Figure CN119049560B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the interdisciplinary field of bioinformatics and machine learning, specifically relating to a method for single-cell omics data embedding and representation extraction based on graph contrastive neural networks. Background Technology
[0002] Single-cell clustering plays a crucial role in downstream analysis of single-cell data. It classifies cells based on their expression patterns, thereby providing a deeper understanding of the complexity and function of individual cells. Single-cell deep embedding representation models have been widely applied in single-cell clustering tasks because they can simultaneously acquire feature representations and perform clustering. However, the extraction of single-cell deep embedding representations remains challenging due to the high dimensionality, sparsity, and noise inherent in single-cell data, as well as the lack of cell type labels.
[0003] To address these challenges, recent studies have largely employed an autoencoder based on a zero-inflated negative binomial distribution to model and extract features from raw single-cell expression data. This zero-inflated negative binomial distribution better captures the zero-inflatment and sparsity of the data, thus providing a more accurate probability distribution fit for single-cell data. Many subsequent models have adopted this autoencoder architecture. However, these methods rely solely on raw gene expression and neglect the relationships between cells.
[0004] To better integrate gene expression information with intercellular relationships, some methods utilize graph neural networks (GNNs) for feature extraction. However, GNN-based models heavily rely on constructed k-nearest neighbor (kNN) graphs, which primarily focus on local similarities between cells. Specifically, a target cell only connects to its k nearest neighbors, ignoring relationships with other similar cells. To fully reveal co-expression patterns, global similarity must be considered. Global similarity takes into account the relationships between all similar cells, providing a more comprehensive understanding of cellular co-expression. Co-expression patterns are fundamental cellular characteristics. Since specific genes can be expressed identically in different cells, cells sharing co-expression patterns often cluster together, forming different subpopulations. Furthermore, noise and sparsity in single-cell data can lead to inaccurate or incomplete graph structure construction in graph learning, resulting in error accumulation during iterative graph learning.
[0005] Another major challenge in analyzing single-cell data is the high cost of obtaining accurate cell labels, as labeling unknown cells often requires extensive biological knowledge, which can be challenging even for experienced researchers. Therefore, unsupervised learning methods are frequently applied to unlabeled data. Recently, contrastive learning has emerged as a promising solution by autonomously mining self-supervised signals to learn knowledge from unlabeled data. Although some studies have attempted to incorporate contrastive learning into deep embedding representation extraction methods for single-cell data to improve model performance, they have neglected the structural information of cell interactions.
[0006] In summary, a natural approach is to combine contrastive learning with graph neural networks to analyze single-cell data, and recently proposed graph contrastive learning-based models have successfully validated the effectiveness of this idea. While these graph contrastive learning-based models address some of the shortcomings of deep embedding representation extraction methods, they often overlook co-expression patterns in single-cell data and fail to consider crucial clustering information. Specifically, previous graph contrastive learning-based models may treat some cells within the same subpopulation as negative samples. This can lead to false negatives being pushed aside during subsequent contrastive learning, thus weakening the model's capabilities. Therefore, it is necessary to explicitly utilize clustering information to capture co-expression patterns among cells. Furthermore, although existing graph contrastive learning-based embedding representation extraction methods have achieved good performance, they still face problems such as inaccurate graph structure construction and the presence of potential false negatives, making single-cell embedding representation extraction difficult. Summary of the Invention
[0007] To overcome the shortcomings of existing technologies, this invention provides a clustering-guided graph contrastive learning framework for single-cell embedding representation extraction tasks. Furthermore, to leverage the global similarity of cell data, a self-expression computation module is introduced. Simultaneously, this invention improves the graph structure in graph contrastive learning by utilizing a similarity matrix learned in the self-expression computation module to adjust the graph structure, thereby enhancing the performance of graph contrastive learning.
[0008] The single-cell omics data embedding representation extraction method based on graph contrastive neural networks of the present invention includes the following steps:
[0009] 1) Collect gene expression data from single-cell sequencing from different platforms;
[0010] 2) Preprocess the single-cell gene expression matrix, including the following steps:
[0011] 2.1 Filter cells, retaining only those cells that exhibit expression counts in at least one gene;
[0012] 2.2 Add a logarithm to the expression value of each gene, i.e., X = log(X+1). Adding a logarithm is to handle zero or low expression values in the expression count, which helps to reduce unnecessary bias and make the data more suitable for subsequent statistical analysis and modeling.
[0013] 2.3 Screen for N highly variable genes, where the default value of N is 2000;
[0014] 3) Construct cell maps from preprocessed single-cell data, including the following steps:
[0015] 3.1 Use the KNN algorithm to construct a cell graph A, where each node in the graph represents a cell and the edges represent the relationships between cells. Specifically, if cell A is one of the k nearest neighbors of cell B, then there is an edge between cell A and cell B.
[0016] 4) Perform symmetric normalization on the obtained adjacency matrix, including the following steps:
[0017] 4.1 Defining the degree matrix This represents the degree of each node in the graph;
[0018] 4.2 Pass The symmetric normalized graph Laplacian matrix, where, I is the identity matrix;
[0019] 4.3 Defining a widely used Laplace filter using a symmetrically normalized Laplace matrix A smooth feature matrix that better utilizes the graph's topology and local information;
[0020] 5) Construct a non-shared parametric twin encoder with Gaussian noise for the symmetrically normalized adjacency matrix to extract meaningful feature representations from the data, including the following steps:
[0021] 5.1 To prevent the two encoders from generating the same parameters during subsequent comparative learning iterations, i.e., producing shortcut solutions, Gaussian noise is introduced into the input of Encoder1. In, that is: in: The input to Encoder2 represents Gaussian noise with a mean of 0 and a variance of 1.
[0022] 5.2 pairs and Using two parameter-non-shared twin encoders with Gaussian noise, it can be represented as:
[0023] and
[0024] Where: Encoder1 and Encoder2 are each a layer of MLP;
[0025] 6) To improve the quality of positive and negative samples in subsequent comparative learning, confidence scores are set, and reliable samples are selected for subsequent learning, including the following steps:
[0026] 6.1 First, consider the two embedded Z-shapes obtained in step 5). v1 and Z v2 Use formula Integrate;
[0027] 6.2 Further obtain valuable samples and set confidence scores (CONF). i :
[0028] Among them: CEN p The cluster centers are obtained by performing k-means clustering on the embedding Z;
[0029] 6.3 Based on the obtained confidence score CONF i Sort the embeddings Z and select the τth embedding as the threshold, ignoring samples with scores below the threshold;
[0030] 7) Establish a cluster-guided contrastive learning mechanism to mitigate the negative impact of false negatives in contrastive learning and obtain more reliable feature representations, including the following steps:
[0031] 7.1 Represent the selected embedding in step 6.3 as follows and Based on the k-means clustering in step 6.2, H v1 and H v2 Divide into K disjoint clusters, denoted as: and
[0032] 7.2 will and Samples within the same cluster are considered positive sample pairs;
[0033] 7.3 To mitigate the false negative problem in negative sample pairs, first calculate and The average value of the samples corresponding to each cluster is used to obtain the center of the corresponding cluster;
[0034] 7.4 Treat the cluster centers corresponding to different clusters as negative samples;
[0035] 8) Based on step 7), define positive and negative samples, and set a joint optimization objective to improve the quality of positive and negative samples in contrastive learning, including the following steps:
[0036] 8.1 The joint optimization objective is determined by the positive sample loss L pos and negative sample loss L neg Composition, L pos The mean squared error loss between positive sample embeddings is expressed as:
[0037]
[0038] L neg It is the cosine similarity between different cluster centers, specifically represented as:
[0039]
[0040] The joint optimization objective is expressed as: L con =L pos +L neg ;
[0041] 9) Optimize the model using a decoder based on the ZINB distribution to effectively model and capture background noise and high variability in single-cell data, including the following steps:
[0042] 9.1 For the last layer of the decoder, three fully connected layers are used to estimate the parameters of the ZINB distribution, as follows:
[0043]
[0044]
[0045] Among them: W μ W π and W θ The learnable weights, modeled using the ZINB distribution on single-cell data, are described as follows:
[0046]
[0047] The decoder loss function based on the ZINB distribution is calculated as the negative logarithm of the ZINB distribution, expressed as:
[0048] L ZINB = -log(ZINB(X|π,μ,θ));
[0049] 10) Utilize MSE computation to mitigate over-modeling of zero-inflation components while enhancing reconstruction results for genes with lower non-zero expression levels, including the following steps:
[0050] 10.1 Input the learned embedding Z from step 6) into the decoder, represented as:
[0051]
[0052] 10.2 Use the MSE operation to compare the reconstructed mean μ obtained in step 9) with the original gene expression matrix, that is:
[0053]
[0054] 11) Introduce an additional self-expression computational layer to further reveal the internal structure and deeper relationships in single-cell data, including the following steps:
[0055] 11.1 The expression of the current cell is represented by utilizing other cells of the same type, where similarity is only close to 1 between cells belonging to the same category. The specific process is as follows:
[0056] Z = ZC;
[0057] in: Let represent the self-expression matrix, and the optimization objective for this part is defined as:
[0058]
[0059] Where: ||C||2 represents the L2 regularization constraint on C;
[0060] 12) In each iteration, the present invention uses the self-expression matrix to adjust the original adjacency matrix. The final learned self-expression matrix is the feature extraction result of the model, which can be used for downstream clustering tasks.
[0061] The beneficial effects of this invention are as follows: First, this invention uses a ZINB-based encoder-decoder architecture as its foundation and incorporates cluster-guided contrastive learning into the decoder part, enabling it to more effectively utilize clustering information to explore cell co-expression patterns and enhance the classification and discrimination capabilities of the learned embedding representations. Furthermore, a self-expression module is designed, which can assist in in-depth research into the intrinsic relationships existing in single-cell data, and the learned self-expression matrix improves the quality of the cell maps required for contrastive learning. By clustering the self-expression matrix, the single-cell clustering performance of this invention is further improved. Attached Figure Description
[0062] Figure 1 This is a flowchart of a single-cell omics data embedding representation extraction method based on graph contrastive neural networks;
[0063] Figure 2 The images show the t-SNE dimensionality reduction results of the embeddings learned in the mouse diaphragm dataset using the present invention and existing SOTA methods, respectively. Raw represents the distribution of the original single-cell transcriptome data, Ours represents the clustering results of the single-cell transcriptome data using the present invention, and the remaining methods are existing SOTA methods.
[0064] Figure 3 This is a heatmap showing the similarity of the self-expression matrix learned by the self-expression module in this invention. Detailed Implementation
[0065] The present invention will now be described in conjunction with the accompanying drawings.
[0066] like Figure 1 As shown, this embodiment uses a single-cell transcriptome dataset of mouse diaphragm obtained by Smart-seq2 sequencing as an example. This dataset contains 870 cells, 23,341 genes, and 5 cell categories.
[0067] Step S1: Collect tagged single-cell transcriptome data from currently published papers. Perform preprocessing operations on the raw single-cell data. The main steps include first filtering cells, retaining only those cells that show expression counts in at least one cell and at least one gene. Then, logarithmize the expression value of each gene, i.e., X = log(X+1). Logarithmization is used to handle zero or low expression values in the expression count, which helps to reduce unnecessary bias and make the data more suitable for subsequent statistical analysis and modeling. Finally, select N highly variable genes, with the default value of N being 2000, to obtain preprocessed data suitable for model input.
[0068] Step S2: Construct a single-cell adjacency graph for the preprocessed single-cell data. This is mainly done by using the KNN algorithm to construct the cell graph A. Each node in the graph represents a cell, and the edges represent the relationships between cells. Specifically, if cell A is one of the k nearest neighbors of cell B, then there is an edge between cell A and cell B.
[0069] Step S3 involves symmetric normalization of the adjacency matrix corresponding to the obtained single-cell adjacency graph. The main steps are: first, defining the degree matrix. Represent the degree of each node in the graph; then through The symmetric normalized graph Laplacian matrix, where, I is the identity matrix; finally, the widely used Laplace filter is defined using the symmetric normalized Laplace matrix. A smooth feature matrix that better utilizes the graph's topology and local information;
[0070] Step S4 involves constructing a parameter-non-shared twin encoder with Gaussian noise for the symmetrically normalized adjacency matrix to extract meaningful feature representations from the data. This includes the following steps: First, to prevent the two encoders from generating the same parameters during subsequent iterative optimization of contrastive learning (i.e., generating shortcut solutions), Gaussian noise is introduced into the input of encoder 1. In, that is: in: The input of encoder 2 represents Gaussian noise with a mean of 0 and a variance of 1. Then to and Using two parameter-non-shared twin encoders with Gaussian noise, it can be represented as: and Wherein: Encoder 1 and Encoder 2 are each a layer of MLP;
[0071] Step S5, to improve the quality of positive and negative samples in subsequent contrastive learning, sets confidence scores and selects reliable samples for subsequent learning, mainly including the following steps: First, the two embeddings Z obtained in step S4 are processed... v1 and Z v2 Use formula The data is then integrated; then valuable samples are obtained, and confidence scores (CONF) are set. i : Among them: CEN p The cluster centers are obtained by performing k-means clustering on the embedding Z; finally, the confidence scores CONF are used to determine the cluster centers. i Sort the embeddings Z and select the τ-th embedding as the threshold, ignoring samples with scores below the threshold to perform sample filtering;
[0072] Step S6, setting up a cluster-based contrastive learning mechanism to mitigate the negative impact of false negative samples in contrastive learning and obtain more reliable feature representations, includes the following steps: representing the selected embedding in step S5 as... and Based on the K-means clustering in step S5, H v1 and H v2 Divide into K disjoint clusters, denoted as: and Then and Samples within the same cluster are considered positive sample pairs; finally, to mitigate the false negative problem in negative sample pairs, calculation and The average value of the samples corresponding to each cluster is used to obtain the center of the corresponding cluster, and the cluster centers corresponding to different clusters are regarded as negative samples;
[0073] Step S7, based on the positive and negative samples defined in step S6, sets a joint optimization objective to improve the quality of positive and negative samples in contrastive learning, including the following steps: First, the joint optimization objective is determined by the positive sample loss L. pos and negative sample loss L neg Composition, L pos The mean squared error loss between positive sample embeddings is expressed as: Lneg It is the cosine similarity between different cluster centers, specifically represented as: The joint optimization objective is expressed as: L con =L pos +L neg ;
[0074] Step S8, design the ZINB module, and use a decoder optimization model based on the ZINB distribution to effectively model and capture background noise and high variability in single-cell data. This includes the following steps: First, for the last layer of the decoder, three fully connected layers are used to estimate the parameters of the ZINB distribution, which are expressed as follows: Among them: W μ W π and W θ The learnable weights, modeled using the ZINB distribution on single-cell data, are described as follows:
[0075] The decoder loss function based on the ZINB distribution is calculated as the negative logarithm of the ZINB distribution, expressed as: L ZINB = -log(ZINB(X|π,μ,θ));
[0076] Step S9 utilizes MSE operations to mitigate over-modeling of zero-inflation components while enhancing the reconstruction results of genes with lower non-zero expression levels. This includes the following steps: First, the embedding Z learned in step S5 is input into the decoder, represented as: Then, the reconstructed average value μ obtained in step S8 is compared with the original gene expression matrix using the MSE operation, i.e.
[0077] Step S10 introduces an additional self-expression computation layer to further reveal the internal structure and deeper relationships in single-cell data, including the following steps: First, the expression of the current cell is represented by utilizing other cells of the same type, where similarity is only close to 1 between cells belonging to the same category, specifically: Z = ZC; where: Let represent the self-expression matrix, and the optimization objective for this part is defined as:
[0078] stdiag(C) = 0; where ||C||2 represents the L2 regularization constraint on C;
[0079] In step S11, the present invention uses a self-expression matrix to adjust the original adjacency matrix in each iteration. The final learned self-expression matrix is the feature extraction result of the model, which can be used for downstream clustering tasks.
[0080] The technical effects of the present invention will be described below in conjunction with simulation experiments.
[0081] Simulation conditions
[0082] Computer hardware: NVIDIA GeForce RTX 3090, with 24GB of video memory;
[0083] Computer software: Python 3.8 integrated development environment.
[0084] Simulation content
[0085] Comparative experiments were conducted using this invention and eight existing methods: scTAG, scGNN, scGAE, scDEFR, scNAME, contrastive-sc (con-sc), scCCL, and scGCL. Our method was compared with other baselines on 10 widely used single-cell sequencing datasets. These datasets were collected from 12 different platforms. They cover a wide range of species, including mice and humans, and encompass various organs such as the brain, lungs, and kidneys. Normalized mutual information (NMI) and adjusted RAND index (ARI) were used as evaluation metrics for the clustering results of each method. The results are shown in Tables 1 and 2, respectively.
[0086] Table 1
[0087]
[0088] Table 2
[0089]
[0090]
[0091] As shown in Table 1, this invention outperforms other methods on ten single-cell datasets. The accuracy of this invention in single-cell clustering is demonstrated on fluorescence in situ hybridization-based sequencing data, and it exhibits good generalization across different sequencing platforms.
Claims
1. A method for extracting embedding representations from single-cell omics data based on graph contrastive neural networks, characterized in that, Includes the following steps: 1) Collect gene expression data from single-cell sequencing from different platforms; 2) Preprocess the single-cell gene expression matrix, including the following steps: S2.1 Filter cells, retaining only those cells that exhibit expression counts in at least one gene; S2.2 Add a logarithm to the expression value of each gene, i.e., X=log(X+1). Adding a logarithm is to handle zero or low expression values in the expression count, which helps to reduce unnecessary bias and makes the data more suitable for subsequent statistical analysis and modeling. S2.3 Filter N highly variable genes, where the default value of N is 2000; 3) Construct cell maps from preprocessed single-cell data, including the following steps: S3.1 uses the KNN algorithm to construct the cell map. Each node in the graph represents a cell, and the edges represent the relationships between cells. Specifically, if cell A is one of the k nearest neighbors of cell B, then there is an edge between cell A and cell B. 4) Perform symmetric normalization on the obtained adjacency matrix, including the following steps: S4.1 Define the degree matrix This represents the degree of each node in the graph; S4.2 Pass Symmetric normalized graph Laplacian matrix, where, I is the identity matrix; S4.3 Define the widely used Laplace filter using a symmetrically normalized Laplace matrix. , A smooth feature matrix that better utilizes the graph's topology and local information; 5) Construct a non-shared parameter twin encoder with Gaussian noise for the symmetrically normalized adjacency matrix to extract meaningful features from the data. The process of expressing an opinion includes the following steps: S5.1 To prevent the two encoders from generating the same parameters during subsequent comparative learning iterations, i.e., producing shortcut solutions, Gaussian noise is introduced into the input of Encoder1. In, that is: ,in: The input to Encoder2 represents Gaussian noise with a mean of 0 and a variance of 1. ; S5.2 to and Using two parameter-non-shared twin encoders with Gaussian noise, it can be represented as: Z v1 = Encoder1( ) and Z v2 = Encoder2( ), Where: Encoder1 and Encoder2 are each a layer of MLP; 6) To improve the quality of positive and negative samples in subsequent comparative learning, confidence scores are set, and reliable samples are selected for subsequent learning, including the following steps: S6.1 First, the two embeddings Z obtained in step 5) are processed... v1 and Z v2 Using the formula Z= (Z v1+ Z v2 Integrate; S6.2 Further obtain valuable samples and set confidence scores. : ; Among them: CEN p The cluster centers are obtained by performing k-means clustering on the embedding Z; S6.3 Based on the obtained confidence score CONF i Sort the embeddings Z and select the first one. One embedding is used as a threshold, and samples with scores below that threshold are ignored; 7) Establish a cluster-guided contrastive learning mechanism to mitigate the negative impact of false negatives in contrastive learning and obtain more reliable feature representations, including the following steps: S7.1 Represent the selected embedding in step 6.3 as and Based on the k-means clustering in step 6.2, and Divide into K disjoint clusters, denoted as: p=1,2,…,K and p=1,2,…,K; S7.2 will and Samples within the same cluster are considered positive sample pairs; S7.3 To mitigate the false negative problem in negative sample pairs, first calculate... and The average value of the samples corresponding to each cluster is used to obtain the center of the corresponding cluster; S7.4 Treat the cluster centers corresponding to different clusters as negative samples; 8) Based on step 7), define positive and negative samples, and set a joint optimization objective to improve the quality of positive and negative samples in contrastive learning, including the following steps: S8.1 The joint optimization objective is determined by the positive sample loss L. pos and negative sample loss L neg Composition, L pos The mean squared error loss between positive sample embeddings is expressed as: ; L neg It is the cosine similarity between different cluster centers, specifically represented as: ; The joint optimization objective is expressed as: L con = L pos+ L neg ; 9) Optimize the model using a decoder based on the ZINB distribution to effectively model and capture background noise and high variability in single-cell data, including the following steps: S9.1 For the last layer of the decoder, three fully connected layers are used to estimate the parameters of the ZINB distribution, as follows: ; ; ; in: The learnable weights, modeled using the ZINB distribution on single-cell data, are described as follows: ; The decoder loss function based on the ZINB distribution is calculated as the negative logarithm of the ZINB distribution, expressed as: ; 10) Utilize MSE computation to mitigate over-modeling of zero-inflation components while enhancing reconstruction results for genes with lower non-zero expression levels, including the following steps: S10.1 Input the learned embedding Z from step 6) into the decoder, represented as: ; S10.2 Use the MSE operation to compare the reconstructed mean µ obtained in step 9) with the original gene expression matrix, that is: ; 11) Introduce an additional self-expression computational layer to further reveal the internal structure and deeper relationships in single-cell data, including the following steps: S11.1 The expression of the current cell is represented by utilizing other cells of the same type, where similarity is only close to 1 between cells belonging to the same category. The specific process is as follows: Z=ZC; in: Let represent the self-expression matrix, and the optimization objective for this part is defined as: ; in: This represents an L2 regularization constraint on C; 12) In each iteration, the present invention uses the self-expression matrix to adjust the original adjacency matrix. The final learned self-expression matrix is the feature extraction result of the model, which can be used for downstream clustering tasks.
Citation Information
Patent Citations
Single-cell RNA-seq data clustering method based on dual self-supervision
CN114022693A