Single-cell transcriptome sequencing data clustering method based on contrast learning and related device

CN122551912APending Publication Date: 2026-08-11SHANXI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610698138.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-20
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

一些假设认为表示空间内的节点相似度矩阵是相同的,忽略了不同细胞类型间固有的语义关联和结构差异,导致特征空间映射不精确;而且传统的对比损失函数未充分考虑单细胞转录组测序数据的统计分布特性(如零膨胀特性),难以在高噪声环境下维持细胞间的语义一致性

Benefits of technology

本申请提供了一种基于对比学习的单细胞转录组测序数据聚类方法及相关装置,通过对单细胞核糖核酸测序数据进行预处理操作、图构建与校正操作以及拉普拉斯平滑滤波操作,得到平滑后的表达矩阵和校正后的邻接矩阵,有效消除了原始数据中的高维噪声和批次效应,增强了细胞间真实生物学信号的表达,为后续特征提取提供了高质量的输入数据。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122551912A_ABST
    Figure CN122551912A_ABST
Patent Text Reader

Abstract

This application discloses a clustering method and related apparatus for single-cell transcriptome sequencing data based on contrastive learning, relating to the fields of bioinformatics and deep learning. The method includes: first, processing the acquired single-cell transcriptome sequencing data to obtain a smoothed expression matrix and a corrected adjacency matrix; then, training a contrastive learning clustering model, using a mini-batch sampling strategy to filter the attribute feature sub-matrices and adjacency sub-matrices of the current round, inputting them into the contrastive learning clustering model of the current round to obtain the node similarity matrix and zero-inflated negative binomial distribution of the current round, and calculating the overall objective function value of the current round. If it is less than a preset loss threshold, the trained model is output; otherwise, iterative optimization continues; finally, all smoothed and corrected single-cell transcriptome sequencing data are input into the trained model for cluster analysis to obtain the target cell type classification results, thereby improving the clustering quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of bioinformatics and deep learning technologies, and in particular to a method and related apparatus for clustering single-cell transcriptome sequencing data based on contrastive learning. Background Technology

[0002] The cell, as the basic unit of life, is the smallest structural unit that performs physiological metabolism and biochemical reactions. Multicellular organisms are composed of cells with diverse morphologies, functions, and gene expression patterns. Studies have shown that even within phenotypically similar tissues or populations of the same type, complex and significant differences exist between cells. This heterogeneity is not only the basis for the development, differentiation, and homeostasis of organisms, but also a key driving factor for tumor progression, immune escape, drug resistance, and the dynamic evolution of various complex diseases.

[0003] Traditional bulk RNA-seq technology exhibits significant limitations in deeply analyzing cellular heterogeneity. This technique studies tissues or populations of tens of thousands of cells as a whole, and the gene expression levels it measures are essentially the average of signals from all cells within the population. This "averaging" approach makes it difficult to analyze the unique molecular characteristics of individual cells. Furthermore, gene expression regulation varies, and expression levels are not uniform across different cells. Specific expression signals from a few cells are often masked by the high abundance of transcripts from the more numerous cells, making it difficult for traditional sequencing methods to accurately characterize the dynamic changes in cell state, especially when identifying and analyzing rare cell subpopulations, where their detection sensitivity is significantly limited.

[0004] Single-cell transcriptome sequencing (scRNA-seq) technology provides high-throughput expression profiles at the whole genome level at cellular resolution, greatly deepening researchers' understanding of single-cell transcriptome heterogeneity, cell developmental trajectories, and complex disease mechanisms. However, with the rapid increase in sequencing scale, single-cell transcriptome sequencing data exhibits high dimensionality, sparsity, and significant "zero-dropping" phenomena. This highly sparse technical noise severely masks the true biological signals, posing a serious challenge to downstream cell clustering.

[0005] Graph clustering, a key technique for dividing cell nodes into disjoint subgroups, has attracted attention due to its ability to capture relationships between cells. Recently, contrastive learning has shown great potential in the field of deep graph clustering. Its core logic lies in inducing neural networks to learn more discriminative feature embeddings by bringing positive sample pairs closer together and pushing negative sample pairs further apart in the representation space.

[0006] Nevertheless, existing graph clustering methods based on contrastive learning still have limitations in mining node similarity. Some assumptions assume that the node similarity matrix within the representation space is identical, ignoring the inherent semantic connections and structural differences between different cell types, leading to inaccurate feature space mapping. Moreover, traditional contrastive loss functions do not fully consider the statistical distribution characteristics of single-cell transcriptome sequencing data (such as zero inflation), making it difficult to maintain semantic consistency between cells in noisy environments. On large-scale datasets, due to the lack of effective similarity matrix guidance and sparsification strategies, models often face problems of computational redundancy or loss of key local information. Summary of the Invention

[0007] The purpose of this application is to provide a clustering method and related device for single-cell transcriptome sequencing data based on contrastive learning, which can significantly improve the clustering quality of single-cell transcriptome sequencing data and help to more accurately identify cellular heterogeneity.

[0008] To achieve the above objectives, this application provides the following solution: Firstly, this application provides a comparative learning method for clustering single-cell transcriptome sequencing data, including: Obtain single-cell transcriptome sequencing data from the tissue sample to be analyzed; The single-cell transcriptome sequencing data were preprocessed, graph constructed and corrected, and Laplacian smoothing filter was applied to obtain the smoothed expression matrix and the corrected adjacency matrix. The smoothed representation matrix and the corrected adjacency matrix are input into the trained contrastive learning clustering model to obtain the target low-dimensional embedding representation; The low-dimensional embedding representation of the target was clustered using the Leuven clustering algorithm to obtain the target cell type classification results; The process of determining the trained contrastive learning clustering model is as follows: During the current iteration, the smoothed expression matrix and the corrected adjacency matrix are processed using a mini-batch sampling strategy to obtain the attribute feature submatrix and the adjacency submatrix of the current iteration. The attribute feature submatrix and the adjacency submatrix of the current round are input into the contrastive learning clustering model of the current round to obtain the node similarity matrix and the zero-inflated negative binomial distribution of the current round; the contrastive learning clustering model includes an attribute encoding module, a structure encoding module, a similarity matrix construction module, and a zero-inflated negative binomial distribution decoding module; Based on the overall objective function, the adjacency submatrix of the current round, the node similarity matrix of the current round, and the zero-inflated negative binomial distribution of the current round are calculated to obtain the overall objective function value of the current round; the overall objective function includes cross-view alignment loss, neighborhood consistency loss, reliable node semantic sparsity loss, and zero-inflated negative binomial distribution reconstruction loss; Determine whether the overall objective function value of the current round is less than the preset loss threshold; If so, the contrastive learning clustering model of the current round will be used as the trained contrastive learning clustering model; If not, then based on the overall objective function value of the current round, the model parameters in the contrastive learning clustering model of the current round are optimized to obtain a new contrastive learning clustering model for the current round, and the next round of iteration is carried out.

[0009] Optionally, the preprocessing operations include data cleaning, normalization, logarithmic transformation, screening for highly variable genes, standardization, and dimensionality reduction; the graph construction and correction operations include undirected graph construction and cross-batch effect correction; the single-cell transcriptome sequencing data are subjected to preprocessing, graph construction and correction operations, and Laplacian smoothing filtering operations to obtain a smoothed expression matrix and a corrected adjacency matrix, specifically including: The single-cell transcriptome sequencing data is cleaned to obtain cleaned single-cell transcriptome sequencing data; The total cell count in the cleaned single-cell transcriptome sequencing data was normalized to obtain the normalized expression matrix; Perform a logarithmic transformation on the normalized expression matrix to obtain the logarithmically transformed expression matrix; The logarithmically transformed expression matrix is ​​subjected to high-variability gene screening to obtain a high-variability gene screening expression matrix; the high-variability gene screening is to retain gene features whose expression variation intensity exceeds a preset intensity threshold; The expression matrix after screening for highly variable genes is standardized to obtain a standardized expression matrix; Principal component analysis is used to reduce the dimensionality of the standardized expression matrix to obtain the dimensionality-reduced feature space. The K-nearest neighbor algorithm is used to construct an undirected graph in the dimensionality-reduced feature space to obtain the initial adjacency matrix; The initial adjacency matrix is ​​corrected for cross-batch effects using the mutual nearest neighbor algorithm to obtain the corrected adjacency matrix; Based on the corrected adjacency matrix, the degree matrix is ​​calculated, and a symmetric normalized Laplacian matrix is ​​obtained by adding self-loops to the degree matrix and a preset graph Laplacian matrix. The normalized Laplacian matrix is ​​then smoothed using a generalized Laplacian smoothing filter to obtain a smoothed expression matrix.

[0010] Optionally, a mini-batch sampling strategy is used to process the smoothed expression matrix and the corrected adjacency matrix to obtain the attribute feature sub-matrix and the adjacency sub-matrix of the current round, specifically including: A predetermined number of cell samples are randomly extracted without replacement from the smoothed expression matrix to obtain the attribute feature submatrix for the current round; Based on the cell index in the attribute feature submatrix, the corresponding row is extracted from the corrected adjacency matrix to obtain the adjacency submatrix for the current round.

[0011] Optionally, the attribute encoding module includes a first attribute encoding network and a second attribute encoding network; the first attribute encoding network is used to process the attribute feature submatrix to obtain a first attribute embedding representation; the second attribute encoding network is used to process the attribute feature submatrix to obtain a second attribute embedding representation; the first attribute encoding network and the second attribute encoding network are two fully connected neural networks with the same structure but without shared parameters; The structure encoding module includes a first structure encoding network and a second structure encoding network; the first structure encoding network is used to process the structure feature submatrix to obtain a first structure embedding representation; the second structure encoding network is used to process the structure feature submatrix to obtain a second structure embedding representation; the first structure encoding network and the second structure encoding network are two fully connected neural networks with the same structure but no shared parameters; The similarity matrix construction module is used to process the attribute feature embedding representation and the structural feature embedding representation to obtain a node similarity matrix; the attribute feature embedding representation includes the first attribute embedding representation and the second attribute embedding; the structural feature embedding representation includes the first structural embedding representation and the second structural embedding representation; The zero-inflated negative binomial distribution decoding module is used to process the attribute feature embedding representation to obtain the parameters of the zero-inflated negative binomial distribution; the parameters of the zero-inflated negative binomial distribution are used to reconstruct single-cell transcriptome sequencing data.

[0012] Optionally, the attribute feature embedding representation and the structural feature embedding representation are processed to obtain a node similarity matrix, specifically including: Calculate the product of the first attribute embedding representation and the transpose of the second attribute embedding representation to obtain the attribute similarity matrix; Calculate the product of the first structural embedding representation and the transpose of the second structural embedding representation to obtain the structural similarity matrix; The node similarity matrix is ​​obtained by fusing the attribute similarity matrix and the structure similarity matrix through weighted summation.

[0013] Optionally, the parameters of the zero-inflated negative binomial distribution include a zero-inflated probability parameter, a mean parameter, and a deviation parameter; the parameters of the zero-inflated negative binomial distribution are obtained by processing the attribute feature embedding representation, specifically including: The first attribute embedding representation and the second attribute embedding representation are fused element-wise to obtain the fused embedding representation; The fusion embedding representation is input into three different fully connected layers to generate a zero-inflation probability parameter, a mean parameter, and a deviation parameter. The zero-inflation probability parameter is output after activation by a sigmoid function and takes a value between 0 and 1. The mean parameter and the deviation parameter are output after activation by an exponential function and take positive values.

[0014] Optionally, the overall objective function is specifically: ; in, For cross-view alignment loss; This is due to neighborhood consistency loss; For reliable node semantic sparsity loss; The loss is reconstructed using a zero-inflated negative binomial distribution; The neighborhood consistency loss weight; For reliable node semantic sparse loss weights, Reconstruct the loss weights for a zero-inflated negative binomial distribution.

[0015] Optionally, the cross-view alignment loss specifically refers to: ; in, This represents the i-th sample in the node similarity matrix S; n represents the number of samples. The neighborhood consistency loss is specifically as follows: ; in, This represents the relationship between the i-th cell sample and the j-th cell sample in the adjacency matrix. If the i-th cell sample in the adjacency matrix is ​​connected to the j-th cell sample in the graph structure, then... This represents the relationship between the i-th cell sample and the j-th cell sample in the node similarity matrix S; The specific form of the reliable node semantic sparsity loss is: ; in, This represents the relationship between the i-th cell sample and the j-th cell sample in the adjacency matrix. When the i-th cell sample in the adjacency submatrix is ​​not connected to the j-th cell sample in the graph structure, then the i-th cell sample in the adjacency submatrix is ​​not connected to the j-th cell sample in the graph structure. Represents the Sigmoid function; This is the similarity threshold parameter; For temperature parameters; The zero-inflated negative binomial distribution reconstruction loss is specifically as follows: ; in, , , , These are the original count, zero inflation probability parameter, mean parameter, and deviation parameter of gene k in the i-th cell sample, respectively. It is a parameter of the zero-inflated negative binomial distribution; This means taking the negative logarithm after taking the probability density; Indicates the number of samples in a small batch; This indicates the number of highly variable genes selected.

[0016] In a second aspect, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the single-cell transcriptome sequencing data clustering method based on contrastive learning as described above.

[0017] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the single-cell transcriptome sequencing data clustering method based on contrastive learning as described above.

[0018] Fourthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the single-cell transcriptome sequencing data clustering method based on contrastive learning as described above.

[0019] According to the specific embodiments provided in this application, this application has the following technical effects: This application provides a clustering method and related apparatus for single-cell transcriptome sequencing data based on contrastive learning. By performing preprocessing, graph construction and correction, and Laplacian smoothing filtering on single-cell ribonucleic acid sequencing data, a smoothed expression matrix and a corrected adjacency matrix are obtained. This effectively eliminates high-dimensional noise and batch effects in the original data, enhances the expression of real biological signals between cells, and provides high-quality input data for subsequent feature extraction.

[0020] By inputting the attribute feature submatrix and the adjacency submatrix of the current round into the contrastive learning clustering model of the current round, the node similarity matrix and the zero-inflated negative binomial distribution of the current round are obtained. The contrastive learning clustering model includes an attribute encoding module, a structure encoding module, a similarity matrix construction module, and a zero-inflated negative binomial distribution decoding module. On the one hand, attribute encoding and structure encoding are used to extract the gene expression features and topological structure features of cells, respectively, and then fused to construct the node similarity matrix. This solves the problem that existing methods ignore the semantic associations and structural differences between different cell types, and achieves more accurate feature space mapping. On the other hand, the zero-inflated negative binomial distribution decoding module is introduced to model the statistical distribution characteristics of the data. This solves the problem that traditional contrastive loss functions do not fully consider the zero-inflated characteristics and are difficult to maintain the semantic consistency between cells in a high-noise environment, and achieves robust representation of sparse and overly discrete single-cell data.

[0021] By calculating the adjacency submatrix, node similarity matrix, and zero-inflated negative binomial distribution of the current round based on the overall objective function, the overall objective function value of the current round is obtained. The overall objective function includes cross-view alignment loss, neighborhood consistency loss, reliable node semantic sparsity loss, and zero-inflated negative binomial distribution reconstruction loss. Among them, cross-view alignment loss constrains the representation of the same sample to be consistent in different views, neighborhood consistency loss enhances the similarity of neighboring nodes, reliable node semantic sparsity loss suppresses false high similarity of non-neighboring samples, and zero-inflated negative binomial distribution reconstruction loss maintains the original probabilistic structure of the data. The joint optimization of the four factors solves the problem of computational redundancy or loss of key local information caused by the lack of effective similarity matrix guidance and sparsification strategy on large-scale data. It achieves a balance between computational efficiency and local structure preservation, and improves the clustering accuracy and stability of the model on large-scale single-cell datasets. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is an application environment diagram of a single-cell transcriptome sequencing data clustering method based on contrastive learning in one embodiment of this application; Figure 2 A flowchart illustrating a single-cell transcriptome sequencing data clustering method based on contrastive learning, provided as an embodiment of this application; Figure 3A flowchart illustrating the process of determining a trained contrastive learning clustering model according to an embodiment of this application; Figure 4 This is a schematic diagram of the training process of a contrastive learning clustering model provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of a single-cell transcriptome sequencing data clustering method provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0025] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0026] The single-cell transcriptome sequencing data clustering method based on contrastive learning provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be set up independently, integrated into server 104, or placed in the cloud or on another server. Terminal 102 can send single-cell transcriptome sequencing data of the tissue sample to be analyzed to server 104. Server 104 performs preprocessing, graph construction and correction, and Laplacian smoothing filtering on the single-cell transcriptome sequencing data to obtain a smoothed expression matrix and a corrected adjacency matrix. The smoothed expression matrix and corrected adjacency matrix are then input into a trained contrastive learning clustering model to obtain a low-dimensional embedding representation of the target. The Leuven clustering algorithm is used to perform cluster analysis on the low-dimensional embedding representation of the target to obtain the target cell type classification results. Server 104 can then feed back the obtained target cell type classification results to terminal 102.

[0027] The terminal 102 can be, but is not limited to, various desktop computers, laptops, and IoT devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers, or it can be a cloud server.

[0028] In one exemplary embodiment, such as Figure 2As shown, a method for clustering single-cell transcriptome sequencing data based on contrastive learning is provided. This method is executed by a computer device, specifically a terminal or server, or both. In this embodiment, the method is applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps 201 to 204. Wherein: Step 201: Obtain single-cell transcriptome sequencing data from the tissue sample to be analyzed.

[0029] Step 202 involves preprocessing the single-cell transcriptome sequencing data, performing graph construction and correction operations, and applying Laplacian smoothing filtering to obtain the smoothed expression matrix and the corrected adjacency matrix.

[0030] Step 203: Input the smoothed representation matrix and the corrected adjacency matrix into the trained contrastive learning clustering model to obtain the target low-dimensional embedding representation.

[0031] Step 204: Use the Leuven clustering algorithm to perform cluster analysis on the target low-dimensional embedding representation to obtain the target cell type classification results.

[0032] Among them, such as Figure 3 As shown, the process of determining the trained contrastive learning clustering model in step 203 is as follows: Step 2031: In the current iteration process, the smoothed expression matrix and the corrected adjacency matrix are processed using a mini-batch sampling strategy to obtain the attribute feature submatrix and the adjacency submatrix of the current round.

[0033] Step 2032: Input the attribute feature submatrix and the adjacency submatrix of the current round into the contrastive learning clustering model of the current round to obtain the node similarity matrix and the zero-inflated negative binomial distribution of the current round. The contrastive learning clustering model includes an attribute encoding module, a structure encoding module, a similarity matrix construction module, and a zero-inflated negative binomial distribution decoding module.

[0034] Step 2033: Based on the overall objective function, calculate the adjacency submatrix of the current round, the node similarity matrix of the current round, and the zero-inflated negative binomial distribution of the current round to obtain the overall objective function value of the current round; the overall objective function includes cross-view alignment loss, neighborhood consistency loss, reliable node semantic sparsity loss, and zero-inflated negative binomial distribution reconstruction loss.

[0035] Step 2034: Determine whether the overall objective function value of the current round is less than the preset loss threshold; if yes, use the contrastive learning clustering model of the current round as the trained contrastive learning clustering model; if no, optimize the model parameters in the contrastive learning clustering model of the current round based on the overall objective function value of the current round to obtain a new contrastive learning clustering model of the current round, and proceed to the next iteration.

[0036] By implementing steps 201 to 204 above, this application has the following beneficial effects: (1) By performing preprocessing, graph construction and correction, and Laplacian smoothing filtering on single-cell ribonucleic acid sequencing data, a smoothed expression matrix and a corrected adjacency matrix were obtained. This effectively eliminated high-dimensional noise and batch effects in the original data, enhanced the expression of real biological signals between cells, and provided high-quality input data for subsequent feature extraction.

[0037] (2) By inputting the attribute feature submatrix and the adjacency submatrix of the current round into the contrastive learning clustering model of the current round, the node similarity matrix and the zero-inflated negative binomial distribution of the current round are obtained. The contrastive learning clustering model includes an attribute encoding module, a structure encoding module, a similarity matrix construction module and a zero-inflated negative binomial distribution decoding module. On the one hand, the attribute encoding and structure encoding are used to extract the gene expression features and topological structure features of cells respectively, and the node similarity matrix is ​​constructed by fusion. This solves the problem that the existing methods ignore the semantic association and structural differences between different cell types, and realizes the precision of feature space mapping. On the other hand, the zero-inflated negative binomial distribution decoding module is introduced to model the statistical distribution characteristics of the data. This solves the problem that the traditional contrastive loss function does not fully consider the zero-inflated characteristics and is difficult to maintain the semantic consistency between cells in a high-noise environment, and realizes the robust representation of sparse and overly discrete single-cell data.

[0038] (3) The overall objective function value of the current round is obtained by calculating the adjacency submatrix, the node similarity matrix, and the zero-inflated negative binomial distribution of the current round based on the overall objective function. The overall objective function includes cross-view alignment loss, neighborhood consistency loss, reliable node semantic sparsity loss, and zero-inflated negative binomial distribution reconstruction loss. Cross-view alignment loss constrains the representation of the same sample in different views to be consistent. Neighbor consistency loss enhances the similarity of neighboring nodes. Reliable node semantic sparsity loss suppresses false high similarity of non-neighboring samples. Zero-inflated negative binomial distribution reconstruction loss maintains the original probability structure of the data. The four are jointly optimized to solve the problem of computational redundancy or loss of key local information caused by the lack of effective similarity matrix guidance and sparsification strategy on large-scale data. It achieves a balance between computational efficiency and local structure preservation, and improves the clustering accuracy and stability of the model on large-scale single-cell datasets.

[0039] In summary, this application effectively overcomes the shortcomings of existing technologies, such as inaccurate feature mapping, poor semantic consistency under high noise, and redundancy in large-scale data computation, by employing a contrastive learning training strategy that combines data preprocessing with graph Laplacian smoothing filtering, bi-branch feature encoding with attribute-structure fusion similarity matrix construction, zero-inflated negative binomial distribution probability reconstruction, and multi-loss joint optimization. This significantly improves the clustering quality of single-cell transcriptome sequencing data and helps to more accurately identify cellular heterogeneity and rare cell subpopulations.

[0040] Furthermore, the preprocessing operations in step 202 include data cleaning, normalization, logarithmic transformation, screening for highly variable genes, standardization, and dimensionality reduction; the graph construction and correction operations include undirected graph construction and cross-batch effect correction; the preprocessing, graph construction and correction operations, and Laplacian smoothing filtering operations are performed on the single-cell transcriptome sequencing data to obtain the smoothed expression matrix and the corrected adjacency matrix, specifically including the following sub-steps: Step 2021: Clean the single-cell transcriptome sequencing data to remove low-quality cells or genes, and obtain cleaned single-cell transcriptome sequencing data.

[0041] Step 2022: Normalize the total cell count in the cleaned single-cell transcriptome sequencing data to eliminate sequencing depth differences and save the corresponding scaling factor to obtain the normalized expression matrix.

[0042] Step 2023: Perform a logarithmic transformation on the normalized expression matrix (usually with the natural logarithm or base 10) to stabilize the data variance and reduce the impact of extremely high expression values, thus obtaining the logarithmically transformed expression matrix.

[0043] Step 2024: Perform high-variance gene screening on the logarithmically transformed expression matrix to obtain the high-variance gene screening expression matrix; high-variance gene screening is to retain gene features whose expression variation intensity exceeds a preset intensity threshold.

[0044] Step 2025: Standardize the expression matrix after screening for highly variable genes to ensure that each gene has zero mean and unit variance, thus obtaining a standardized expression matrix (denoted as the normalized matrix). ,in, It's the number of cells. (This refers to the number of genes selected).

[0045] Step 2026: Use Principal Component Analysis (PCA) to analyze the standardized expression matrix. Dimensionality reduction is performed by projecting the data into a lower-dimensional feature space to obtain the reduced feature space.

[0046] Step 2027: Use the K-Nearest Neighbor (KNN) algorithm to construct an undirected graph in the dimensionality-reduced feature space to obtain the initial adjacency matrix (denoted as undirected graph G=(V,E)). Here, V represents the set of N cells, and E represents the set of edges between cells.

[0047] Step 2028: Apply the Mutual Nearest Neighbors (MNN) algorithm to correct for cross-batch effects in the initial adjacency matrix to obtain the corrected adjacency matrix. Specifically, the adjacency matrix elements Defined as: Among them, if cell samples Cell sample The set of K nearest neighbors, then =1, otherwise =0.

[0048] Step 2029: Calculate the degree matrix based on the corrected adjacency matrix. ,in The Graph Laplace matrix is ​​defined as follows: Based on the degree matrix and the preset graph Laplacian matrix, self-loops are added to obtain... ( (where the identity matrix is ​​used), and then the symmetric normalized Laplace matrix is ​​calculated. ,in = - , -for The degree matrix is ​​then obtained. Finally, the normalized Laplacian matrix is ​​smoothed using a generalized Laplacian smoothing filter to obtain the smoothed expression matrix. ,in .

[0049] Thus, the smoothed representation matrix is ​​obtained. and the corrected adjacency matrix This serves as the input for subsequent model training.

[0050] Furthermore, in step 2031, during each round of iterative training, a mini-batch sampling strategy is used to smooth the expression matrix. and the corrected adjacency matrix Processing: From the smoothed expression matrix A predetermined number of m cell samples are randomly selected without replacement to construct the attribute feature submatrix for the current round. Based on the cell indices in the attribute feature submatrix, from the corrected adjacency matrix... Extract the corresponding rows to obtain the adjacency submatrix for the current round. ;in, Indicates the number of cells sampled. Indicates the total number of nodes. Represents the dimension of attribute features.

[0051] Furthermore, such as Figure 4 As shown, in step 2032, the attribute feature submatrix of the current round is... and adjacency submatrix The data is input into the contrastive learning clustering model for the current round. The contrastive learning clustering model includes an attribute encoding module, a structure encoding module, a similarity matrix construction module, and a zero-inflated negative binomial distribution decoding module.

[0052] (1) Attribute encoding module: The attribute encoding module consists of two fully connected neural networks (multilayer perceptrons, MLPs) with identical structures but no parameter sharing, denoted as the first attribute encoding network ( ) and second attribute encoding network ( ). Attribute feature submatrix Inputting the first attribute encoding network yields the first attribute embedding representation. ; Submatrices with the same attribute features Inputting the second attribute encoding network yields the second attribute embedding representation. .in, , , This indicates the number of cell samples collected, and d represents the preset embedding dimension.

[0053] (2) Structure coding module: The structure encoding module consists of two fully connected neural networks with identical structures but no parameter sharing, denoted as the first structure encoding network (…). ) and second structure coding network ( ). Adjacency submatrix Inputting the first structure encoding network yields the first structure embedding representation. ; The same adjacent submatrix Inputting the second structure encoding network yields the second structure embedding representation. .in , , This indicates the number of cell samples collected, and d represents the preset embedding dimension.

[0054] (3) Similarity matrix construction module: The similarity matrix construction module processes the attribute feature embedding representation and the structural feature embedding representation to obtain the node similarity matrix. Specifically: The attribute similarity matrix is ​​obtained by multiplying the first attribute embedding representation with the transpose of the second attribute embedding representation. .

[0055] Calculate the product of the first structural embedding representation and the transpose of the second structural embedding representation to obtain the structural similarity matrix. .

[0056] The node similarity matrix is ​​obtained by fusing the attribute similarity matrix and the structure similarity matrix through weighted summation. ,in, , These are preset fusion weights used to balance the contributions of attribute information and structural information.

[0057] (4) Zero-inflated negative binomial distribution decoding module: The Zero-Inflated Negative Binomial (ZINB) decoding module processes the attribute feature embedding representation to obtain the parameters of the ZINB distribution. These parameters are then used to reconstruct single-cell transcriptome sequencing data (i.e., the raw counting matrix without preprocessing). Specifically: Embed the first attribute to represent Second attribute embedding representation Element-wise averaging is performed to obtain the fused embedding representation. .

[0058] fusion embedding representation Input three different fully connected layers respectively to generate zero-inflation probability parameters. Mean parameter and deviation parameters Wherein: the zero-inflation probability parameter is output after activation by the sigmoid function, i.e. The value ranges from 0 to 1; the mean parameter is output after activation by an exponential function, i.e. The value is positive; the deviation parameter is output after activation by an exponential function, i.e. The value is positive. Here , , They correspond to A trainable weight matrix with three parameters.

[0059] The probability density function of the zero-inflated negative binomial distribution is defined as: ; ; in, For indicator functions: ; when hour, =1, otherwise =0. This is a count of raw, unprocessed single-cell transcriptome sequencing data.

[0060] Furthermore, in step 2033, based on the overall objective function, the adjacency submatrix of the current round is... The overall objective function value of the current round is obtained by calculating the node similarity matrix S of the current round and the zero-inflated negative binomial distribution parameters of the current round.

[0061] The overall objective function includes cross-view alignment loss. Neighborhood consistency loss Reliable node semantic sparse loss and zero-inflated negative binomial distribution reconstruction loss The specific expression is as follows: (1) Cross-view alignment loss: ; in, Let represent the i-th diagonal element in the node similarity matrix S, used to measure the similarity between the i-th sample and the embedding representations in the two views, where n is the number of samples (n=m in this embodiment). This loss function minimizes the representation of the same sample in different views to ensure consistency.

[0062] (2) Neighborhood consistency loss: ; in, Represents the elements in the adjacency submatrix, when Time indicates that there is a connection between the i-th cell sample and the j-th cell sample in the graph structure. This represents the corresponding element in the node similarity matrix. This loss function is used to enhance the similarity of neighboring nodes in the representation space.

[0063] (3) Reliable node semantic sparsity loss: ; in, This represents a sigmoid function. For similarity threshold parameters, The temperature parameter is used. This loss function is used to suppress excessively high similarity between non-neighbor samples, preventing structural collapse of the representation space.

[0064] (4) Zero-inflated negative binomial distribution reconstruction loss: ; in, It is the original count of the k-th gene in the i-th cell of the original counting matrix. , , These are the zero-inflation probability parameter, mean parameter, and deviation parameter output by the decoder, respectively. This loss function is used to preserve the original probability distribution characteristics of single-cell expression data.

[0065] The overall objective function is the weighted sum of the four losses mentioned above: ; in, The neighborhood consistency loss weight, For reliable node semantic sparse loss weights, The loss weights are reconstructed for a zero-inflated negative binomial distribution, and are all preset hyperparameters. In a preferred embodiment, the neighborhood consistency loss weights are... and the semantic sparse loss weights of the reliable nodes When all are set to 1, the model achieves the best balance between maintaining the similarity of neighboring nodes and the sparsity of non-neighboring nodes, resulting in optimal clustering performance.

[0066] Further, in step 2034, the overall objective function value of the current round is calculated. It determines whether the value is less than the preset loss threshold.

[0067] If so, the current round of contrastive learning clustering model is used as the trained contrastive learning clustering model, and training ends.

[0068] If not, based on the overall objective function value of the current round, the model parameters (including trainable weights and biases in the attribute encoding module, structure encoding module, and zero-inflated negative binomial distribution decoding module) in the contrastive learning clustering model of the current round are optimized and updated using the backpropagation algorithm and gradient descent optimizer to obtain a new contrastive learning clustering model for the current round, and then the mini-batch sampling step is returned for the next iteration.

[0069] Repeat the above process until the model converges to obtain a trained contrastive learning clustering model.

[0070] After completing model training, such as Figure 5As shown, the trained model can be used to perform cluster analysis on the single-cell transcriptome sequencing data to be analyzed. The smoothed expression matrix and the corrected adjacency matrix are input into the trained contrastive learning clustering model. Specifically: the smoothed expression matrix is ​​used as input, and through the trained attribute encoding modules (first attribute encoding network and second attribute encoding network), the first attribute embedding representation of all cells in the first view and the second attribute embedding representation in the second view are obtained. The first attribute embedding representation and the second attribute embedding representation are then fused element-wise to obtain the final low-dimensional embedding representation for each cell. The Louvain algorithm is used to perform cluster analysis on the final low-dimensional embedding representation. The Louvain algorithm divides the cells in the embedding space into disjoint clusters by dividing the nodes in the graph into communities, and outputs the cluster label to which each cell belongs, thus obtaining the target cell type classification result.

[0071] This application also provides an application scenario in which the above-mentioned clustering method for single-cell transcriptome sequencing data based on contrastive learning is applied. Specifically, the single-cell transcriptome sequencing data clustering method provided in this embodiment can be applied to a single-cell identification scenario. The single-cell identification scenario includes a target cell type classification result generation stage and a contrastive learning clustering model determination stage. The target cell type classification result generation stage is used to input single-cell transcriptome sequencing data into a trained contrastive learning clustering model to identify the target cell type classification result. The contrastive learning clustering model determination stage is used to train and iterate the contrastive learning clustering model and output the trained contrastive learning clustering model. The video tagging method provided in this embodiment belongs to the target cell type classification result generation stage and the contrastive learning clustering model determination stage.

[0072] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 6As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores and processes data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements a contrastive learning-based single-cell transcriptome sequencing data clustering method.

[0073] Those skilled in the art will understand that Figure 6 The structures shown are merely block diagrams of some structures related to the present application and do not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0074] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0075] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0076] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of the relevant data are carried out in compliance with the relevant data protection laws and policies of the country where the location is located, and with the authorization granted by the owner of the corresponding device.

[0077] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

[0078] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0079] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0080] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A contrastive learning based single-cell transcriptome sequencing data clustering method, characterized in that, The method includes: Obtain single-cell transcriptome sequencing data from the tissue sample to be analyzed; The single-cell transcriptome sequencing data were preprocessed, graph constructed and corrected, and Laplacian smoothing filter was applied to obtain the smoothed expression matrix and the corrected adjacency matrix. The smoothed representation matrix and the corrected adjacency matrix are input into the trained contrastive learning clustering model to obtain the target low-dimensional embedding representation; The low-dimensional embedding representation of the target was clustered using the Leuven clustering algorithm to obtain the target cell type classification results; The process of determining the trained contrastive learning clustering model is as follows: During the current iteration, the smoothed expression matrix and the corrected adjacency matrix are processed using a mini-batch sampling strategy to obtain the attribute feature submatrix and the adjacency submatrix of the current iteration. The attribute feature submatrix and the adjacency submatrix of the current round are input into the contrastive learning clustering model of the current round to obtain the node similarity matrix and the zero-inflated negative binomial distribution of the current round; the contrastive learning clustering model includes an attribute encoding module, a structure encoding module, a similarity matrix construction module, and a zero-inflated negative binomial distribution decoding module; Based on the overall objective function, the adjacency submatrix of the current round, the node similarity matrix of the current round, and the zero-inflated negative binomial distribution of the current round are calculated to obtain the overall objective function value of the current round; the overall objective function includes cross-view alignment loss, neighborhood consistency loss, reliable node semantic sparsity loss, and zero-inflated negative binomial distribution reconstruction loss; Determine whether the overall objective function value of the current round is less than the preset loss threshold; If so, the contrastive learning clustering model of the current round will be used as the trained contrastive learning clustering model; If not, then based on the overall objective function value of the current round, the model parameters in the contrastive learning clustering model of the current round are optimized to obtain a new contrastive learning clustering model for the current round, and the next round of iteration is carried out.

2. The contrastive learning based single-cell transcriptomic sequencing data clustering method of claim 1, wherein, The preprocessing operations include data cleaning, normalization, logarithmic transformation, screening for highly variable genes, standardization, and dimensionality reduction. The graph construction and correction operations include undirected graph construction and cross-batch effect correction. The single-cell transcriptome sequencing data undergoes preprocessing, graph construction and correction, and Laplacian smoothing filtering to obtain a smoothed expression matrix and a corrected adjacency matrix, specifically including: The single-cell transcriptome sequencing data is cleaned to obtain cleaned single-cell transcriptome sequencing data; The total cell count in the cleaned single-cell transcriptome sequencing data was normalized to obtain the normalized expression matrix; Perform a logarithmic transformation on the normalized expression matrix to obtain the logarithmically transformed expression matrix; The logarithmically transformed expression matrix is ​​subjected to high-variability gene screening to obtain a high-variability gene screening expression matrix; the high-variability gene screening is to retain gene features whose expression variation intensity exceeds a preset intensity threshold; The expression matrix after screening for highly variable genes is standardized to obtain a standardized expression matrix; Principal component analysis is used to reduce the dimensionality of the standardized expression matrix to obtain the dimensionality-reduced feature space. The K-nearest neighbor algorithm is used to construct an undirected graph in the dimensionality-reduced feature space to obtain the initial adjacency matrix; The initial adjacency matrix is ​​corrected for cross-batch effects using the mutual nearest neighbor algorithm to obtain the corrected adjacency matrix; Based on the corrected adjacency matrix, the degree matrix is ​​calculated, and a symmetric normalized Laplacian matrix is ​​obtained by adding self-loops to the degree matrix and a preset graph Laplacian matrix. The normalized Laplacian matrix is ​​then smoothed using a generalized Laplacian smoothing filter to obtain a smoothed expression matrix.

3. The contrastive learning based single-cell RNA-sequencing data clustering method of claim 1, wherein, The smoothed representation matrix and the corrected adjacency matrix are processed using a mini-batch sampling strategy to obtain the attribute feature sub-matrix and the adjacency sub-matrix of the current round, specifically including: A predetermined number of cell samples are randomly extracted without replacement from the smoothed expression matrix to obtain the attribute feature submatrix for the current round; Based on the cell index in the attribute feature submatrix, the corresponding row is extracted from the corrected adjacency matrix to obtain the adjacency submatrix for the current round.

4. The contrastive learning based single-cell RNA-sequencing data clustering method of claim 1, wherein, The attribute encoding module includes a first attribute encoding network and a second attribute encoding network; the first attribute encoding network is used to process the attribute feature submatrix to obtain a first attribute embedding representation; the second attribute encoding network is used to process the attribute feature submatrix to obtain a second attribute embedding representation; the first attribute encoding network and the second attribute encoding network are two fully connected neural networks with the same structure but no parameter sharing. The structure encoding module includes a first structure encoding network and a second structure encoding network; the first structure encoding network is used to process the structure feature submatrix to obtain a first structure embedding representation; the second structure encoding network is used to process the structure feature submatrix to obtain a second structure embedding representation; the first structure encoding network and the second structure encoding network are two fully connected neural networks with the same structure but no shared parameters; The similarity matrix construction module is used to process the attribute feature embedding representation and the structural feature embedding representation to obtain a node similarity matrix; the attribute feature embedding representation includes the first attribute embedding representation and the second attribute embedding; the structural feature embedding representation includes the first structural embedding representation and the second structural embedding representation; The zero-inflated negative binomial distribution decoding module is used to process the attribute feature embedding representation to obtain the parameters of the zero-inflated negative binomial distribution; the parameters of the zero-inflated negative binomial distribution are used to reconstruct single-cell transcriptome sequencing data.

5. The contrastive learning based single-cell RNA-sequencing data clustering method of claim 4, wherein, The attribute feature embedding representation and the structural feature embedding representation are processed to obtain a node similarity matrix, specifically including: Calculate the product of the first attribute embedding representation and the transpose of the second attribute embedding representation to obtain the attribute similarity matrix; Calculate the product of the first structural embedding representation and the transpose of the second structural embedding representation to obtain the structural similarity matrix; The node similarity matrix is ​​obtained by fusing the attribute similarity matrix and the structure similarity matrix through weighted summation.

6. The single-cell transcriptome sequencing data clustering method based on contrastive learning according to claim 4, characterized in that, The parameters of the zero-inflation negative binomial distribution include the zero-inflation probability parameter, the mean parameter, and the deviation parameter; The attribute feature embedding representation is processed to obtain the parameters of the zero-inflated negative binomial distribution, specifically including: The first attribute embedding representation and the second attribute embedding representation are fused element-wise to obtain the fused embedding representation; The fusion embedding representation is input into three different fully connected layers to generate a zero-inflation probability parameter, a mean parameter, and a deviation parameter. The zero-inflation probability parameter is output after activation by a sigmoid function and takes a value between 0 and 1. The mean parameter and the deviation parameter are output after activation by an exponential function and take positive values.

7. The contrastive learning based single-cell RNA-sequencing data clustering method of claim 1, wherein, The overall objective function is as follows: ; wherein, is a cross-view alignment loss; is a neighborhood consistency loss; is a reliable node semantic sparsity loss; is a zero-inflated negative binomial distribution reconstruction loss; is a neighborhood consistency loss weight; is a reliable node semantic sparsity loss weight, is a zero-inflated negative binomial distribution reconstruction loss weight.

8. The contrastive learning based single-cell RNA-sequencing data clustering method of claim 1, wherein, The cross-view alignment loss is specifically: ; in, This represents the i-th sample in the node similarity matrix S; n represents the number of samples. The neighborhood consistency loss is specifically: ; in, This represents the relationship between the i-th cell sample and the j-th cell sample in the adjacency matrix. If the i-th cell sample in the adjacency matrix is ​​connected to the j-th cell sample in the graph structure, then... This represents the relationship between the i-th cell sample and the j-th cell sample in the node similarity matrix S; The reliable node semantic sparse loss is specifically: ; in, This represents the relationship between the i-th cell sample and the j-th cell sample in the adjacency matrix. When the i-th cell sample in the adjacency submatrix is ​​not connected to the j-th cell sample in the graph structure, then the i-th cell sample in the adjacency submatrix is ​​not connected to the j-th cell sample in the graph structure. Represents the Sigmoid function; This is the similarity threshold parameter; For temperature parameters; The zero-inflated negative binomial distribution reconstruction loss is specifically: ; in, , , , These are the original count, zero inflation probability parameter, mean parameter, and deviation parameter of gene k in the i-th cell sample, respectively. It is a zero-inflated negative binomial distribution; This means taking the negative logarithm after taking the probability density; Indicates the number of samples in a small batch; This indicates the number of highly variable genes selected.

9. A computer device comprising: A memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that the processor executes the computer program to implement the single-cell transcriptome sequencing data clustering method based on contrastive learning as described in any one of claims 1-8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the single-cell transcriptome sequencing data clustering method based on contrastive learning as described in any one of claims 1-8.