A cell clustering method, device and medium for unbalanced single cell RNA-seq data

By combining the methods of comparative learning and knowledge distillation, the problems of high dimensionality, high sparsity and high noise in single-cell RNA-seq data clustering are solved, and more accurate and reliable single-cell type identification is achieved, especially in identifying rare cells.

CN118016167BActive Publication Date: 2025-03-04CENT SOUTH UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410085639.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-22
Publication Date
2025-03-04
Estimated Expiration
2044-01-22

AI Technical Summary

Technical Problem

Existing clustering methods for single-cell RNA-seq data are insufficient in processing high-dimensional, high-sparseness and high-noise data, especially in identifying rare cell types, which are difficult to effectively distinguish.

Method used

The combination of contrast learning and knowledge distillation model is adopted to map high-dimensional data to low-dimensional potential space through contrast learning model, and the clustering results are refined and corrected using the knowledge distillation model to reduce the impact of technical noise and bionoise.

Benefits of technology

Improves clustering accuracy and reliability of single-cell RNA-seq data, enables more precise identification of single-cell types, and performs excellently in identifying rare cells.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118016167B_ABST
    Figure CN118016167B_ABST
Patent Text Reader

Abstract

The present invention discloses a cell clustering method, device and medium for unbalanced single-cell RNA-seq data, and the method includes: obtaining RNA-seq data of clustered cells, generating a gene expression matrix and preprocessing; using the gene expression matrix to calculate the similarity between each cell, selecting an approximate cell as an additional enhanced positive example for contrast learning; building a contrast learning model, and using the positive example, additional enhanced positive example and negative example of each cell to train the contrast learning model to obtain cell potential representation; clustering all cells based on the potential representation of the cell, generating pseudo-labels of the cell; calculating the distance value between cells based on the potential representation of the cell and then selecting anchor cells; building a knowledge distillation model, training using the potential representation and pseudo-labels of anchor cells, and finally using it for cell clustering. The present invention has good clustering results for cell data sets from different sequencing platforms, different species, different tissues and different scales.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of bioinformatics and relates to a cell clustering method, a device and a medium for unbalanced single-cell RNA-seq data. Background Art

[0002] With the rapid progress of high-throughput sequencing technology, a large number of single-cell RNA-seq data sets have emerged, which has greatly promoted a number of studies based on these data. In-depth exploration of this field covers a detailed analysis of cell heterogeneity, inference of cell trajectories, in-depth research on cell-to-cell communication, and gene regulatory networks. In these studies, the exploration of directions such as cell heterogeneity analysis and rare cell identification has become crucial, and clustering methods have become one of the key technologies for these analyses.

[0003] However, single-cell RNA-seq data itself has characteristics such as high dimensionality, high sparsity and high noise, which brings many computational challenges to related research. Therefore, proposing a cell clustering method specifically for the characteristics of single-cell data is of great significance for promoting in-depth analysis and research based on single-cell RNA-seq data. The introduction of these novel methods will help overcome data difficulties and provide strong support for a deeper and more accurate understanding of biological processes at the single-cell level. This not only helps to solve computational problems, but also provides an innovative way to reveal biological phenomena such as the complex relationships between cells and more comprehensively depict gene regulatory networks. At present, there are mainly the following types of clustering methods for single-cell RNA-seq data:

[0004] (1) Based on similarity measurement: This type of method mainly relies on single-cell RNA-seq data to construct a network. In this network, each node corresponds to a cell, and the edge represents the similarity relationship between cells. Then, the community detection algorithm is used to segment the network to obtain the clustering result. Therefore, the clustering effect of this type of method is largely subject to the construction quality of the similarity network. The accuracy and robustness of clustering directly depend on the accurate reflection of the similarity between nodes in the network. Therefore, when constructing a similarity network, factors such as data quality, noise level, and the choice of similarity measurement need to be considered to ensure that the final clustering results are credible and interpretable.

[0005] (2) Based on integration strategy: This is proposed to address the problem that a single clustering method may have limitations when dealing with the complex characteristics of single-cell RNA-seq data. A single clustering method may perform well in some aspects, but its performance is limited due to the diversity and high dimensionality of single-cell RNA-seq data. Therefore, the strategy of integrating multiple clustering algorithms has become a common method, aiming to integrate the outputs of multiple clustering models to improve the robustness of the overall model. This integration method helps to make up for the limitations of different algorithms, making the final clustering results more comprehensive and robust, thereby better adapting to the diversity and complexity of single-cell RNA-seq data. In this process, it is necessary to comprehensively consider the performance of each clustering model in order to formulate an effective integration strategy, so as to achieve more comprehensive and accurate single-cell clustering results.

[0006] (3) Based on deep embedding learning: This type of method usually builds an autoencoder model. The core idea is to learn the potential representation of data in low-dimensional space by setting different objective functions based on multiple assumptions about single-cell RNA-seq data. First, the original high-dimensional data is mapped to a low-dimensional space through an autoencoder model to capture the key features of the data. Then, the learned potential representation is clustered with the help of traditional clustering algorithms to obtain the final clustering results. Deep embedding learning gives full play to the powerful computing power of deep learning, enabling it to efficiently process large-scale single-cell RNA-seq datasets. The advantage of this method is that it can better capture the inherent complex structure of the data by learning the abstract representation of the data, providing more accurate and meaningful results for subsequent clustering analysis.

[0007] Although there are many single-cell clustering methods currently available, due to the complex characteristics of single-cell RNA-seq, these methods still have a series of shortcomings in clustering accuracy. This includes insufficient adaptation to high dimensionality, high sparsity, and high noise of the data, which limits their effective application in real biological complexity. At the same time, these methods also face challenges in identifying rare cell types, and it is difficult to distinguish these rare but biologically important cell subpopulations in an effective and accurate manner. Therefore, clustering methods for single-cell RNA-seq data still need further improvement and innovation to overcome these technical challenges, improve the accuracy and reliability of clustering, and achieve a more comprehensive analysis of cell populations. Summary of the invention

[0008] The present invention provides a cell clustering method, device and medium for unbalanced single-cell RNA-seq data, which integrates contrast learning and knowledge distillation models, can effectively process single-cell RNA-seq data of different scales, and can provide more accurate clustering results.

[0009] In order to achieve the above technical objectives, the present invention adopts the following technical solutions:

[0010] A cell clustering method for unbalanced single-cell RNA-seq data, including:

[0011] Step 1, data preprocessing;

[0012] Obtain RNA-seq data of all clustered cells, generate a gene expression matrix, and preprocess it; each row of the gene expression matrix represents a cell, and each column represents a gene;

[0013] Step 2: model pre-training and clustering;

[0014] The gene expression matrix obtained by preprocessing is used to calculate the similarity between cells, and C similar cells are selected for each cell based on the similarity as additional enhanced positive examples for comparative learning;

[0015] Building a contrastive learning model, and training the contrastive learning model using positive examples, additional enhanced positive examples, and negative examples of each cell, and using the trained model to obtain a potential representation of each clustered cell;

[0016] Cluster all cells based on their potential representations and use the clustering results as pseudo labels for each cell.

[0017] Step 3, cluster correction;

[0018] Calculate the distance between each cell and other cells based on the cell's potential representation, and select anchor cells from all cells based on the distance value;

[0019] A knowledge distillation model is built, the potential representations and pseudo labels of the anchor cells are used to train the knowledge distillation model, and all cells are clustered using the Student model in the trained model.

[0020] Furthermore, preprocessing of the gene expression matrix includes:

[0021] (1) Screening the genes in the gene expression matrix and eliminating genes expressed in no more than 3 cells;

[0022] (2) Data normalization of the gene expression matrix after gene screening;

[0023] (3) Perform feature selection on the gene expression matrix after data normalization to select highly variable genes.

[0024] Furthermore, the similarity calculated in step 2 uses cosine similarity; for each cell, the C cells with the highest similarity are selected as the C approximate cells.

[0025] Furthermore, the contrastive learning model consists of a two-branch structure, the first branch consists of a query encoder and a projector, the query encoder outputs the potential representation of the cell, and the second branch consists of a pruned momentum encoder and a momentum projector; wherein the pruned momentum encoder is a pruned sparse model, represented by f k , whose parameter is denoted by θ k ,θ k No backpropagation is required for updating; momentumprojector is a dense model whose parameters do not need to be updated through backpropagation, denoted as f mp , whose parameter is denoted by θ mp ; Let f q represents the query encoder model, f p represents the projector model, θ q ,θ p Represent the parameters of the query encoder model and the projector model respectively, then θ k and θ mp The momentum update formula is as follows:

[0026] θ k =mθ k +(1-m)θ q

[0027] θ mp =mθ mp +(1-m)θ p

[0028] Where m is the momentum update hyperparameter.

[0029] Furthermore, the parameters f in the joint training contrast learning model are q 、f p 、f k and f mp The objective function is:

[0030]

[0031] Among them, q i and k i Respectively represent cell i through f p and f mp The output of forms a pair of positive examples in the objective function; λ represents the hyperparameter of the neighbor weight, i c represents the cth nearest neighbor of cell i, represents the cth neighbor cell of cell i through f mp The output of q i constitutes a pair of additional enhanced positive examples; M represents the capacity of the momentum queue, all elements in the momentum queue are negative examples of cell i, j represents the jth element in the momentum queue, Yes mp The output negative example features stored in the momentum queue; T represents the matrix transpose, and τ represents the temperature hyperparameter in the objective function.

[0032] Furthermore, in step 2, when clustering all cells, the Leiden clustering method is specifically used for clustering.

[0033] Furthermore, the distance calculated in step 3 uses the cosine distance, and the method for selecting anchor cells based on the cosine distance value is:

[0034] For each cell: calculate the distance to other cells and sort them, select the k cells with the smallest distance as the neighboring cells of the cell; then calculate the average of the distances from the cell to its k neighboring cells as the density value of the cell;

[0035] In the cells of each pseudo-label corresponding to the pseudo-category, a preset number of high-density value cells are selected as anchor cells under the pseudo-category.

[0036] Furthermore, the knowledge distillation model includes a Teacher model and a Student model;

[0037] The cross entropy function is used as the objective function to train the Teacher model:

[0038]

[0039]

[0040] Among them, σ(Q) is a softmax function, τ is a temperature parameter, σ(Q i ) is represented as the probability vector of cell i, which is the output of the Teacher model, and σ(Q i ) c represents the probability value of cell i belonging to the cth class, p ic represents the true probability value of cell i being of the cth class. If the pseudo label of cell i is of the cth class, then p ic =1; H(p, σ(Q)) represents the cross entropy function of the Teacher model;

[0041] The objective function L of the Student model training KD Using a combination of cross entropy and KL divergence formula:

[0042]

[0043] Among them, τ1 and τ2 are the temperature parameters in the softmax function formula, is the cross entropy formula, p is the pseudo label obtained in the pre-training phase, and is the output of the Student model; Represents the KL divergence formula, which is used to measure the distance between two probability distributions; and are the probability values ​​of each cell output by the Teacher model and the Student model to which category; α is the trade-off hyperparameter between the cross entropy formula and the KL divergence formula.

[0044] An electronic device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor implements any of the above-mentioned cell clustering methods for unbalanced single-cell RNA-seq data.

[0045] A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the cell clustering method for unbalanced single-cell RNA-seq data described in any one of the above items is implemented.

[0046] Beneficial Effects

[0047] The present invention is a cell clustering method for unbalanced single-cell RNA-seq data. The contrast learning model maps high-dimensional, highly sparse, and high-noise data to a low-dimensional, low-noise latent space. Then, the learned hidden layer data is preliminarily clustered by using an existing clustering method, and the clustering results are refined in combination with the knowledge distillation model. The erroneous results that may exist in the pre-training stage are corrected. This not only effectively reduces the influence of factors such as technical noise and biological noise carried by the single-cell data itself, but also more accurately identifies the type of single cells. Among them, the design of a new data enhancement strategy and the addition of contrast learning can better understand the differences between single cells, and the clustering results are refined in combination with the knowledge distillation model to further improve the accuracy of cell clustering.

[0048] The experimental results show that the method of the present invention performs well on real data sets and has higher accuracy, stronger robustness and wider generalization than multiple existing methods. This not only demonstrates the excellent performance of the method in processing single-cell RNA-seq data, but also provides an advanced and reliable method for the research and application of single-cell clustering. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 It is a schematic diagram of the pretreatment stage in the process of the method of the present invention;

[0050] Figure 2 A schematic diagram of the pre-training phase in the method flow of the present invention;

[0051] Figure 3 It is a schematic diagram of the correction stage in the process of the method of the present invention;

[0052] Figure 4 The results of the Jaccard Index matrix obtained by various methods on the Shekhar dataset containing rare cells are shown; (a)(b)(c)(d)(e) correspond to the clustering methods GiniClust3, Clear, graph-sc, scNAME, and scDeepCluster, respectively, and (f) corresponds to the method of the present invention;

[0053] Figure 5 The results of the JaccardIndex matrix obtained by various methods on the Baron_human dataset containing rare cells are shown; (a)(b)(c)(d)(e) correspond to the clustering methods GiniClust3, Clear, graph-sc, scNAME, and scDeepCluster, respectively, and (f) corresponds to the method of the present invention;

[0054] Figure 6 The results of the Jaccard Index matrix obtained by various methods on the Macosko dataset containing rare cells are shown; among them, (a)(b)(c)(d)(e) correspond to the clustering methods GiniClust3, Clear, graph-sc, scNAME, and scDeepCluster, respectively, and (f) corresponds to the method of the present invention. DETAILED DESCRIPTION

[0055] The following is a detailed description of an embodiment of the present invention. This embodiment is based on the technical solution of the present invention, and provides a detailed implementation method and a specific operation process to further explain the technical solution of the present invention.

[0056] A cell clustering method for unbalanced single-cell RNA-seq data, comprising the following steps:

[0057] 1. Data preprocessing stage: Obtain single-cell RNA-seq data and perform data preprocessing. Figure 1 shown.

[0058] 1. Considering a given cell gene expression matrix, where each row represents a cell and each column represents a gene. First, filter the gene expression matrix of all cells and remove genes that are expressed in no more than three cells;

[0059] 2. Normalize the data of the gene-filtered expression matrix to ensure that the data is of consistent scale across genes, providing a consistent basis for subsequent analysis;

[0060] 3. Perform feature selection on the gene expression matrix after data normalization to select highly variable genes.

[0061] 2. Pre-training stage: Use the ratio learning model for pre-training to learn the potential representation of cells and obtain pseudo labels of cells through clustering methods. Figure 2 shown.

[0062] 1. Using the highly variable gene expression matrix after feature selection, the set of C nearest neighbor cells is calculated for each cell.

[0063] First, the cosine similarity between each cell and other cells is calculated, where the greater the similarity, the more similar the current cell is to other cells. Then, the C cells with the highest cosine similarity are selected as the nearest neighbors of the cell. This step helps to establish the association relationship between cells, thus providing a more targeted data foundation for subsequent analysis and model training.

[0064]

[0065] where x,y∈R d are two eigenvectors after data preprocessing, which come from the gene expression of two cells in the gene expression matrix obtained by data preprocessing. d is the dimension of the vector, and cosine_sim is the cosine similarity of the two vectors x and y.

[0066] 2. Build a contrastive learning model, and use the positive examples, additional enhanced positive examples and negative examples of each cell to train the contrastive learning model, and use the trained model to obtain the potential representation of each clustered cell.

[0067] like Figure 1 The contrastive learning model consists of a two-branch structure. The left branch consists of the query encoder and the projector, and the right branch consists of the pruned momentum encoder and the momentum projector. The pruned momentum encoder is a pruned sparse model whose parameters do not need to be updated through backpropagation. The momentum projector is a dense model whose parameters do not need to be updated through backpropagation. They perform momentum updates based on the parameters of the query encoder and the projector, respectively. Let f qrepresents the query encoder model, f p represents the projector model, f k represents the pruned momentum encoder model, f mp represents the momentum projector model, and θ q ,θ p ,θ k and θ mp They represent the parameters of query encoder, projector, pruned momentum encoder and momentum projector respectively, and the momentum update formula is as follows:

[0068] θ k =mθ k +(1-m)θ q

[0069] θ mp =mθ mp +(1-m)θ p

[0070] Where m is the momentum update hyperparameter.

[0071] After building the model structure, the present invention applies the idea of ​​contrastive learning and innovatively proposes a new data enhancement strategy. This strategy combines the weighted nearest neighbor and model pruning methods to jointly train f q , f p , f k and f mp Among them, the specific objective function of the model is:

[0072]

[0073] Among them, q i and k i Respectively represent the output of cell i through the projector and momentum projector, which form a pair of positive examples in the contrastive learning objective function. In addition, the present invention also uses the selected neighbors to reconstruct a set of positive examples, λ represents the hyperparameter of the neighbor weight, i c represents the cth nearest neighbor of cell i, represents the momentumprojector output of the cth neighbor of cell i; M represents the capacity of the momentum queue, all elements in the momentum queue are negative examples of cell i, where j represents the jth element in the momentum queue, It is the output of momentumprojector stored in the momentum queue. The negative sign indicates that the j-th element in the momentum queue is a negative example of cell i.

[0074] 3. Based on the learned cell potential representation, clustering is performed using the Leiden clustering method, and the clustering results are used as pseudo labels for each cell.

[0075] 3. Correction stage: Select anchor cells as training data set based on potential representation, train knowledge distillation model, and use the trained model for final clustering. Figure 3 shown.

[0076] 1. Calculate the distance between each cell and other cells based on the potential representation of the cell, and select anchor cells from all cells based on the distance value as the training data set for the knowledge distillation model.

[0077] First, a cosine distance matrix is ​​calculated. By sorting the distances from each cell to other cells, the k cells with the smallest distances are selected as the neighbors of the cell, thereby constructing the final distance matrix dist.

[0078]

[0079] where raw_dist∈R n×n , by sorting each row in the raw_dist matrix from small to large, retaining the first k minimum values ​​in each row to form di s t distance matrix.

[0080] Among them, Z∈R n×h represents the potential representation matrix learned by the contrastive learning model, that is, the output of all cells through the query encoder. Where n is the number of all cells, h is the dimension of the query encoder output; I represents the unit matrix, the dimension is n×n; and dist∈R n×k is the cosine distance matrix of the nearest neighbors selected after sorting, and k represents the number of nearest neighbors.

[0081] Then, an average distance is calculated based on the distance values ​​from each cell to its nearest neighbors as the density value; a smaller average distance indicates that the cell has a higher density value.

[0082]

[0083] Here dist i Represents the i-th row vector in the dist matrix, that is, the distance vector of cell i. The k elements in the vector dist i,j It represents the cosine distance of cell i to its k nearest neighbors in the latent space; while densei is a scalar, which represents the average cosine distance of cell i to its k nearest neighbors. The smaller the value, the greater the density of cell i.

[0084] Next, according to the pseudo-labels obtained by clustering in the pre-training stage, a certain proportion of high-density value cells (i.e., dense i The cells with smaller values, that is, cells with larger cell density, are selected as anchor cells. These selected anchor cells will constitute the training set of the knowledge distillation model in the correction stage.

[0085] 2. Build a knowledge distillation model and train the knowledge distillation model using the potential representation and pseudo-labels of anchor cells, such as Figure 1 The calibration phase is shown in the figure.

[0086] First, the Teacher model is trained. The Teacher model is a classification model, and the label is the pseudo label obtained by clustering in the pre-training stage. Then, the results of the Teacher model are used to guide the training of the Student model. The Student model is a classification model with the same network structure as the Teacher model.

[0087] The objective function of training Teacher is the cross entropy function:

[0088]

[0089]

[0090] Among them, Q i represents the output of the Teacher model, with a dimension of t*c, where t represents the number of selected anchor cells and c represents the number of clusters (obtained in the pre-training phase); σ(Q) is a sofimax function, τ is a temperature parameter, and τ = 1 in this cross entropy formula; therefore, σ(Q i ) is represented as the probability vector of cell i, which is the output of the Teacher model, and σ(Q i ) c represents the probability value of cell i belonging to the cth category, i is the cell index, c is the cell category index, p ic is the probability value that the real cell i is of the cth class. If the real label of cell i is the cth class, then p ic =1.

[0091] After the parameters of the Teacher model are trained, the Student model is trained. At this time, the parameters of the Teacher model are no longer updated. The objective function of training the Student model is:

[0092]

[0093] Among them, τ1 and τ2 are the temperature parameters in the softmax function formula, is the cross entropy formula, p is the pseudo label obtained in the pre-training phase, and is the output of the Student model, τ1=1; Represents the KL divergence formula, which is used to measure the distance between two probability distributions; here, and are the probability values ​​of which category each cell output by the Teacher model and the Student model belongs to, and τ2=3; finally, α is the trade-off hyperparameter between the cross entropy formula and the KL divergence formula; this process helps guide the training of the Teacher-Student model and achieve the goal of knowledge distillation through the combination of the cross entropy and KL divergence formulas.

[0094] 3. All data are used as input to the trained Student model, and the output is used as the final clustering result.

[0095] All preprocessed gene expression matrices are used as the input of the Student model, and the corresponding prediction results of the Student model are used as the final clustering results.

[0096] In order to verify the effectiveness of this method, 10 sets of single-cell data sets from different species or different tissues or different scales were collected from published literature, including cell gene expression matrices and true category labels, and the method proposed in this invention was tested on these 10 sets of real data sets. The detailed information of the 10 sets of data sets is listed in Table 1. In order to objectively evaluate the effectiveness of this method, 8 classic clustering methods were selected for comparison, including GiniClust3, Leiden, SC3S, scDeepCluster, scziDesk, scNAME, graph-sc, Clear, and two commonly used indicators ARI (Adjusted Rand Index: Adjusted Rand Index) and NMI (Normalized Mutual Information: Normalized Mutual Information) were selected as evaluation criteria. Their corresponding calculation formulas are as follows:

[0097] For two different sets of labels L1 and L2, the calculation formula of ARI is:

[0098]

[0099] Among them, n ij represents the number of cells that belong to both the i-th class in L1 and the j-th class in L2, a i and b jThey represent the total number of cells of type i in L1 and the total number of cells of type j in L2, respectively.

[0100] In addition, the calculation formula of NMI is:

[0101]

[0102] Where I(L1, L2) represents the mutual information between L1 and L2, and H(L1) and H(L2) represent the information entropy of the two respectively.

[0103] The ARI and NMI of the method of the present invention and the eight compared methods on ten sets of data sets are listed in Table 2 and Table 3, respectively.

[0104] Table 1 Dataset information

[0105]

[0106] Table 2 ARI values ​​of this method and eight comparison methods on ten datasets

[0107]

[0108] Table 3 NMI values ​​of this method and eight comparison methods on ten datasets

[0109]

[0110] From the comparison of the data in Table 2 and Table 3, the method of the present invention shows a more significant advantage than the other 8 methods in single cell type identification, with higher ARI and NMI values. Although the ARI and NMI indicators of this method are slightly lower than those of some other comparison methods on the data sets Macosko, Quake_10x_Spleen, and Quake_Smart_Heart, it still ranks second. On the remaining data sets, the method of the present invention has always performed well and continues to lead other methods. This result not only shows that this method has excellent performance on a variety of data sets, but also highlights its excellent robustness and high accuracy.

[0111] Figure 4-6 The results of the Jaccard Index matrix obtained by various methods on the three rare cell datasets Shehkar, Baron_Human and Macosko are shown respectively.

[0112] The present invention fully considers the complex characteristics of single-cell RNA-seq data itself, and proposes an innovative single-cell clustering method. This method combines contrastive learning and knowledge distillation models, aiming to effectively process single-cell RNA-seq data of different scales and provide more accurate clustering results. At the same time, the method also demonstrates excellent ability to accurately identify rare cells. Through the introduction of contrastive learning, the differences between single cells can be better understood, thereby dividing cell populations more finely. The application of the knowledge distillation model enables the algorithm to extract potential rules from complex data, making the clustering results more robust and reliable. The method of the present invention aims to overcome the challenges of current methods in processing high-dimensional, highly sparse and high-noise data, thereby providing more reliable and precise tools for biological research at the single-cell level.

[0113] The above embodiments are preferred embodiments of the present application. Ordinary technicians in this field can also make various changes or improvements on this basis. Without departing from the overall concept of the present application, these changes or improvements should fall within the scope of protection required by the present application.

Claims

1. A cell clustering method for unbalanced single-cell RNA-seq data, characterized in that: include: Step 1, data preprocessing; Obtain RNA-seq data of all clustered cells, generate a gene expression matrix, and preprocess it; each row of the gene expression matrix represents a cell, and each column represents a gene; Step 2: model pre-training and clustering; The gene expression matrix obtained by preprocessing is used to calculate the similarity between cells, and C similar cells are selected for each cell based on the similarity as additional enhanced positive examples for comparative learning; Building a contrastive learning model, and training the contrastive learning model using positive examples, additional enhanced positive examples, and negative examples of each cell, and using the trained model to obtain a potential representation of each clustered cell; Cluster all cells based on their potential representations and use the clustering results as pseudo labels for each cell. The contrastive learning model consists of a two-branch structure. The first branch consists of a query encoder and a projector. The query encoder outputs the potential representation of the cell. The second branch consists of a prunedmomentum encoder and a momentumprojector. The prunedmomentum encoder is a pruned sparse model, represented by f k , whose parameter is denoted by θ k ,θ k No backpropagation is required for updating; momentum projector is a dense model whose parameters do not need to be updated through backpropagation, denoted as f mp , whose parameter is denoted by θ mp ; Let f q represents the query encoder model, f p represents the projector model, θ q ,θ p Represent the parameters of the query encoder model and the projector model respectively, then θ k and θ mp The momentum update formula is as follows: i k =mθ k +(1-m)θ q , i mp =mθ mp +(1-m)θ p , Where m is the momentum update hyperparameter; Step 3, cluster correction; Calculate the distance between each cell and other cells based on the cell's potential representation, and select anchor cells from all cells based on the distance value; A knowledge distillation model is built, the potential representations and pseudo labels of the anchor cells are used to train the knowledge distillation model, and all cells are clustered using the Student model in the trained model.

2. The cell clustering method according to claim 1, characterized in that: Preprocessing of gene expression matrix includes: (1) Screening the genes in the gene expression matrix and eliminating genes expressed in no more than 3 cells; (2) Data normalization of the gene expression matrix after gene screening; (3) Perform feature selection on the gene expression matrix after data normalization to select highly variable genes.

3. The cell clustering method according to claim 1, characterized in that: The similarity calculated in step 2 uses cosine similarity; for each cell, the C cells with the highest similarity are selected as the C approximate cells.

4. The cell clustering method according to claim 1, characterized in that: Joint training and contrast learning of parameters f in the model q 、f p 、f k and f mp The objective function is: Among them, q i and k i Respectively represent cell i through f p and f mp The output of forms a pair of positive examples in the objective function; λ represents the hyperparameter of the neighbor weight, i c represents the cth nearest neighbor of cell i, represents the cth neighbor cell of cell i through f mp The output of q i constitutes a pair of additional enhanced positive examples; M represents the capacity of the momentum queue, all elements in the momentum queue are negative examples of cell i, j represents the jth element in the momentum queue, Yes mp The output negative example features stored in the momentum queue; T represents the matrix transpose, τ represents the temperature hyperparameter in the objective function; L i Represents the calculated objective function value corresponding to cell i.

5. The cell clustering method according to claim 1, characterized in that: In step 2, when clustering all cells, the Leiden clustering method is specifically used for clustering.

6. The cell clustering method according to claim 1, characterized in that: The distance calculated in step 3 uses the cosine distance, and the method for selecting anchor cells based on the cosine distance value is: For each cell: calculate the distance to other cells and sort them, select the k cells with the smallest distance as the neighboring cells of the cell; then calculate the average of the distances from the cell to its k neighboring cells as the density value of the cell; In the cells of each pseudo-label corresponding to the pseudo-category, a preset number of high-density value cells are selected as anchor cells under the pseudo-category.

7. The cell clustering method according to claim 1, characterized in that: The knowledge distillation model includes a Teacher model and a Student model; The cross entropy function is used as the objective function to train the Teacher model: Among them, Q i represents the output of the Teacher model; σ(Q) is a softmax function, τ is a temperature parameter, σ(Q i ) is represented as the probability vector of cell i, which is the output of the Teacher model, and σ(Q i ) c represents the probability value of cell i belonging to the cth class, p ic represents the true probability value of cell i being of the cth class. If the pseudo label of cell i is of the cth class, then p ic =1; H(p,σ(Q)) represents the cross entropy function of the Teacher model; The objective function L of the Student model training KD Using a combination of cross entropy and KL divergence formula: Among them, τ1 and τ2 are the temperature parameters in the softmax function formula, is the cross entropy formula, p is the pseudo label obtained in the pre-training phase, and is the output of the Student model; Represents the KL divergence formula, which is used to measure the distance between two probability distributions; and are the probability values ​​of each cell output by the Teacher model and the Student model to which category; α is the trade-off hyperparameter between the cross entropy formula and the KL divergence formula.

8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the computer program is executed by the processor, the processor is caused to implement the method according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Cell type identification method based on similarity learning and enhancement thereof

    CN110222745A

  • Object view distillation method for general multi-view object clustering

    CN116863177A