Skip to main content
Briefings in Bioinformatics logoLink to Briefings in Bioinformatics
. 2025 Aug 21;26(4):bbaf423. doi: 10.1093/bib/bbaf423

Deep clustering of single-cell RNA-seq using adversarial graph contrastive learning

Le Van Vinh 1,, Tran Nhat Quang 2, Lai Hoang Hiep 3, Pham Nhat Phuong 4,5, Tran Van Hoai 6,7
PMCID: PMC12368859  PMID: 40838782

Abstract

Single-cell technologies enable the exploration of biological insights at cellular resolution. One of the crucial tasks in the analysis of single-cell RNA sequencing (scRNA-seq) data is to classify cells into groups of cell types. Recent developments in scRNA-seq clustering methods utilize the strength of contrastive learning and graph-based deep learning to learn high-quality representations which are beneficial for classifying cells. However, the unique characteristics of the scRNA-seq data still pose many computational challenges. This study proposes a novel method for clustering scRNA-seq data using adversarial graph contrastive learning, called scAGCL. The proposed algorithm creates a cell-cell graph and then generates a meaningful representation for clustering based on a contrastive learning process with the support of an adversarial attack on both the graph structures and node features. In addition, a subgraph sampling technique is used to increase the scalability of the method. Experiments on real scRNA-seq datasets demonstrate that the proposed method outperforms seven state-of-the-art algorithms. Furthermore, scAGCL also shows the ability to support the identification of marker genes for cell types. The source code of the proposed method and all datasets used in this paper can be downloaded at https://github.com/levinhcntt/scAGCL.

Keywords: single-cell RNA-seq, clustering, adversarial attack, graph neural network, contrastive learning

Introduction

Cells are the basic biological units of all living organisms. Understanding cellular biology from transcriptional profiling benefits different fields such as life sciences and clinical applications [1]. Traditional methods such as microarrays or bulk RNA sequencing provide only a measurement of average gene expression levels across a population of cells. The development of single-cell RNA sequencing (scRNA-seq) technologies [2] overcomes the limitation by allowing the ability to analyze gene expression at cellular level, which can reveal heterogeneity and diversity across cells.

One of the crucial tasks in an scRNA-seq data analyzing workflow is to classify cells with similar transcriptome files into the same clusters. The clustering results support the identification of cell subpopulations as well as other downstream analysis steps. Due to the unique properties of scRNA-seq data, cell clustering still remains highly challenging despite the improvement of scRNA sequencing technologies or advances in machine learning methods. In particular, the high dimensionality and high sparsity of the data cause difficulty in distinguishing cells [3, 4]. Moreover, many scRNA-seq datasets that contain extremely large numbers of cells also pose computational challenges [3].

Several clustering methods for single-cell analysis have been proposed in recent years. Early methods for scRNA-seq clustering such as RaceID [5], SINCERA [6] directly use traditional clustering methods in their classification process. While RaceID computes Pearson’s correlation coefficients between cells serving as input for the Inline graphic-means algorithm, SINCERA is a pipeline for analyzing scRNA-seq data using a hierarchical clustering technique. Dealing with the high dimensionality of data, SC3 [7] uses the Principal Component Analysis algorithm for feature extraction before performing consensus clustering techniques to classify cells. Another method, SNN-Cliq [8] constructs a share nearest-neighbor graph where each node is a cell, and then finds quasi-cliques in the graph to produce clusters.

Recent advances of deep learning offer opportunities to enhance clustering performance of scRNA-seq data. Due to the high dimensionality and sparsity of scRNA-seq data, most current deep clustering based methods perform techniques to train an encoder for reducing data dimensionality as well as extracting meaningful representation of data. A category of methods, i.e. scMAE [9], and scDeepCluster [10], use an autoencoder model which sequentially adds a decoder to the encoder and optimizes a reconstruction loss in their training process. scDeepCluster utilizes ZINB model-based autoencoder and incorporates with random Gaussian noise to improve the embedded feature representation. Meanwhile, scMAE is based on a masked autoencoder in which scRNA-seq data are shuffled and masked to support autoencoder training. Besides, scVI [11], and autoCell [12] are based on variational autoencoder networks to deal with noises and generate embedded data. Another group of methods, such as contrastive-sc [13], and scNAME [14], applies contrastive learning techniques that learn meaningful representations of data by pulling similar samples closer, as well as increasing the distance between dissimilar ones in the embedding space. Those algorithms utilize data augmentation strategies to generate different sample views of original data and use them to train an encoder. Depending on specific behaviors of each learning paradigm, scDeepCluster, and scNAME perform a fine-tuning step to align the latent embeddings of data with clustering targets using Kullback–Leibler divergence loss or soft Inline graphic-means loss. On the other hand, scMAE and contrastive-sc use clustering algorithms such as Inline graphic-means, or spectral clustering to classify cells on latent space.

A different branch of deep learning methods for scRNA-seq data clustering are based on graph neural networks which can utilize structural information between cells. With the same objective of training a graph encoder, those methods build a cell-to-cell graph (AttentionAE-sc [15], and scGAC [16] ) or cell-to-gene graph (graph-sc [17], and scGPCL [18]). While graph-sc only uses graph convolutional network (GCN) as a core of an autoencoder, AttentionAE-sc and scGAC additionally employ attention mechanisms to improve the quality of data representation. Additionally, scGPCL uses contrastive learning on graphs to cluster scRNA-sq data and applies feature marking on subgraph to generate augmented views.

Graph contrastive learning strategies bring a promising solution for the clustering of scRNA-seq data. However, a major challenge is how to generate meaningful augmented samples to support the contrastive learning process. One of the techniques used to make reliable augmented samples which could be hard enough for the training task is adversarial attack [19]. Some works in other fields [20, 21] have applied adversarial training to enhance the performance of contrastive learning processes.

Inspired by the recent studies above, we propose a novel clustering method for scRNA-seq data, called scAGCL (i.e. single-cell Adversarial Graph Contrastive Learning). The proposed method performs a process to train an encoder that extracts low-dimensional embeddings from gene expression data for clustering using graph contrastive learning. Different from existing studies, this work employs a new graph-based contrastive learning with the support of adversarial training to generate reliable augmented samples. Additionally, a subgraph sampling technique is applied to produce a scalability ability to analyze large datasets. Experimental results on real scRNA-seq datasets demonstrate the strength of scAGCL compared with state-of-the-art methods.

Materials and methods

The framework of scAGCL

Given a gene expression matrix Inline graphic, where Inline graphic and Inline graphic denote the number of cells and genes, respectively. The objective of scAGCL is to classify Inline graphic cells into Inline graphic clusters of cell types using the gene expression features. Figure 1 presents the general framework of the proposed method. Additionally, the detailed algorithm of scAGCL is provided in Supplementary Algorithm 1. scAGCL consists of two phases of training and clustering. In the training phase, after a cell-to-cell graph is constructed, different graph views are generated by augmentation and adversarial attack techniques. Adversarial graph contrastive learning is then applied to produce embeddings for the clustering phase.

Figure 1.

Figure 1

The overall architecture of scAGCL.

Cell-to-cell graph construction

First of all, an attributed cell-to-cell graph Inline graphic is constructed, where Inline graphic is an adjacency matrix, and Inline graphic is the gene expression matrix, which is used as node features. A Inline graphic-nearest neighbors algorithm is applied to generate the adjacency matrix. The algorithm requires a distance matrix that measures the similarity between cells. Given two cells, represented by two vectors Inline graphic and Inline graphic, this work calculates the distance between the two cells based on Pearson’s correlation coefficient as follows:

graphic file with name DmEquation1.gif (1)

in which, Inline graphic and Inline graphic are the mean of the elements of vectors Inline graphic and Inline graphic, respectively.

Graph augmentation and adversarial attack

The first step in a contrastive learning process is to generate views of the original data. In this work, two graphs Inline graphic and Inline graphic are generated from Inline graphic using edge dropping and feature (or gene) masking augmentation techniques [21]. Given the adjacency matrix Inline graphic, a masking matrix Inline graphic is generated randomly following the Bernoulli distribution with probability Inline graphic independently. A modified matrix Inline graphic (i.e. Inline graphic or Inline graphic) is created as follows:

graphic file with name DmEquation2.gif (2)

in which, Inline graphic, and Inline graphic represents element-wise multiplication. Additionally, in order to generate Inline graphic and Inline graphic, this work also uses the Bernoulli distribution to generate a dropout mask which determines the genes to be kept or dropped from the original node feature Inline graphic.

In order to enhance the robustness of the graph contrastive learning framework, the proposed method uses an adversarial attack technique, which allows the model to learn more discriminative representations. Two adversarial samples Inline graphic, and Inline graphic are generated from the two augmented graphs Inline graphic, and Inline graphic, respectively. This work uses a projected gradient descent (PGD) attack method that performs simultaneously on graph structures [22], and node features [23]. The PGD attack is one of the effective techniques for adversarial training because it offers a balance between perturbation strength and computational efficiency. It is considered a universal first-order adversary that is strong enough to generate meaningful perturbations to enhance the model robustness. Additionally, the technique can generate adversarial samples efficiently during each training iteration, ensures its applicability even to large-scale datasets. Given a graph Inline graphic, an adversarial sample Inline graphic is generated as follows.

We firstly calculate the supplement matrix of Inline graphic, Inline graphic, where Inline graphic is an identity matrix. Define Inline graphic, the perturbed adjacency matrix Inline graphic is calculated as follows:

graphic file with name DmEquation3.gif (3)

where Inline graphic is a learnable perturbation matrix, and Inline graphic is responsible as a constraint matrix to ensure that the perturbations only effect valid edges of the graph.

In addition, the perturbed gene expression matrix Inline graphic can be calculated as:

graphic file with name DmEquation4.gif (4)

in which, Inline graphic is a perturbation on the gene expression matrix. The PGD method updates the perturbation Inline graphic and Inline graphic through an optimization process aiming to maximize contrastive loss Inline graphic defined in equation (8). It is noted that Inline graphic is chosen as the anchor for the adversarial attack. Let Inline graphic, and Inline graphic be the values of Inline graphic and Inline graphic at iteration Inline graphic, they can be calculated as follows:

graphic file with name DmEquation5.gif (5)
graphic file with name DmEquation6.gif (6)

where Inline graphic and Inline graphic are two projection operations onto the constraint set Inline graphic and Inline graphic, respectively [22, 23]. Inline graphic and Inline graphic are the corresponding step sizes for the adjacency and the feature perturbation. Furthermore, Inline graphic in each step is relaxed to a convex hull Inline graphic for ease of optimization.

Adversarial graph contrastive learning

The objective of graph contrastive learning with the support of adversarial training in this work is to learn an encoder Inline graphic to generate node representation. The encoder is built on top of a two-layer GCN [24]. All created graphs Inline graphic and Inline graphic are treated as different augmentation views of the original graph Inline graphic in the contrastive learning. Given a graph Inline graphic, the embedded feature matrix Inline graphic for Inline graphic can be computed as follows:

graphic file with name DmEquation7.gif (7)

where Inline graphic is a symmetrically normalized adjacency matrix, Inline graphic is a matrix with self-connections, and Inline graphic is a degree matrix.

As presented in Fig. 1, in order to guide the learning process, the proposed method computes contrastive loss between two pairs of graph views (Inline graphic, and Inline graphic. Given two graph views Inline graphic, Inline graphic, their node representation in latent space are Inline graphic. A projection head Inline graphic constructed by a two-layer multilayer perceptron is used to map Inline graphic, and Inline graphic into a projection space. We denote Inline graphic, Inline graphic. Let Inline graphic be the two corresponding feature vectors of node Inline graphic of Inline graphic and Inline graphic in the latent space. This means that Inline graphic and Inline graphic are the Inline graphic row vectors of Inline graphic and Inline graphic, respectively. The contrastive loss between the two views is as follows:

graphic file with name DmEquation8.gif (8)

where Inline graphic is a pairwise objective to measure the similarity between two node feature vectors [21].

graphic file with name DmEquation9.gif (9)

in which, Inline graphic is temperature parameter, and Inline graphic is the cosine similarity function between two node feature vectors. In this case, every pair Inline graphic of graph view Inline graphic, Inline graphic, respectively, is considered as a positive pair, and Inline graphic is treated as the anchor. In contrast, other pairs Inline graphic of the two graph views and Inline graphic of the same graph view Inline graphic are negative pairs. In addition, because any two views are symmetric, Inline graphic is defined for the case where Inline graphic is the anchor.

Consequently, four embedded feature matrices Inline graphic are produced from the generated graph views Inline graphic, respectively, and equation (8) is used to compute the total loss function of the proposed method as follows:

graphic file with name DmEquation10.gif (10)

in which, Inline graphic is a loss weight to control the contribution of the adversarial contrastive loss.

Besides, to increase the scalability of the proposed method, this study applies a subgraph sampling technique, which has been shown to not only reduce computational cost, but may also help improve the accuracy of contrastive learning methods [21, 25]. Instead of generating graph views Inline graphic directly using the original graph Inline graphic, the views are augmented and adversarial attacked from a subgraph of Inline graphic. With a predefined subgraph size Inline graphic, a subgraph is generated by randomly selecting Inline graphic nodes from Inline graphic and the edges between the selected nodes.

Clustering phase

After performing an adversarial contrastive learning process, the trained encoder corresponding to the best loss is used to generate cell embedding Inline graphic in the latent space. The embedded data are then normalized using L2 normalization and formed as input for the Inline graphic- means algorithm [26] to classify the cells into clusters.

Evaluation metrics

In order to evaluate the quality performance of clustering methods, this work uses two commonly-used metrics including Adjusted Rand Index (ARI) [27] and Normalized Mutual Information (NMI) [28]. ARI is a statistical tool to measure the similarity between clustering results and the ground truth while accounting for the possibility of random chance. In particular, the ARI is calculated as follows:

graphic file with name DmEquation11.gif (11)

in which, Inline graphic is the number of shared cells assigned to cluster Inline graphic of the ground truth and cluster Inline graphic of clustering results, Inline graphic is the number of cells belonging to cluster Inline graphic of the ground truth, and Inline graphic is the number of cells belonging to cluster Inline graphic of the clustering results. On the other hand, NMI is a metric derived from information theory. It quantifies the amount of information shared between the true and predicted clusters, and applies a normalization to scale the results between 0 and 1. Denote Inline graphic be the ground truth clustering assignment, and Inline graphic be a clustering assignment result, the NMI metric is stated as follows:

graphic file with name DmEquation12.gif (12)

where Inline graphic is the mutual information between Inline graphic and Inline graphic, and Inline graphic is an entropy function. Both the ARI and NMI indicate a perfect agreement in clustering when they get value 1.

Benchmark settings

Datasets and data preprocessing

The clustering performance of scAGCL and baseline methods is evaluated on 15 real datasets which are used in previous studies [9, 29–31]. The details of the datasets are provided in Supplementary Table S1. The datasets are generated from different tissues by different sequencing platforms, e.g. Smart-seq2, Drop-seq, 10Inline graphic and others. The sizes of the datasets are from 90 cells to 48 266 cells with numbers of cell types from 4 to 18. Additionally, seven datasets are randomly generated from a large dataset (Mouse Brain dataset by 10Inline graphic Genomics [32]) used to evaluate the computational efficiency of the methods.

Before performing the training process, scAGCL applies a similar technique as previous works [13, 33] to preprocess input raw gene expression matrix using the scanpy package [34]. Firstly, all genes that are not expressed in any cells are discarded. In order to account for differences in library sizes, values of the matrix are then normalized to make sure that every cell has the same total count. The proposed method continues to do a logarithmic transformation to the data matrix, and select the most variable genes (top 2000) used for training tasks.

Baseline methods

There are seven baseline methods evaluated and compared with the proposed method, including SC3 [7], DESC [35], scDeepCluster [10], AttentionAE-sc [15], contrastive-sc [13], scNAME [14], and scMMN [36]. Among them, SC3 is a traditional clustering method. DESC and scDeepCluster are deep learning method used autoencoder model. AttentionAE-sc is a graph neural network based method. scNAME and contrastive-sc utilize contrastive learning techniques. The remaining method, scMMN, uses a graph contrastive learning algorithm. For a fair comparison, the preprocessing task and hyperparameter settings are conducted as the guidelines provided in the studies. Because contrastive-sc returns two ARI and two NMI values for the case of using k-means or Leiden algorithm, respectively, we only get results from the better one using k-means.

Hyperparameter settings

In the proposed algorithm, the number of neighbors Inline graphic used in the Inline graphic-nearest neighbors algorithm to build the cell graph is set automatically as Inline graphic, where Inline graphic is the number of cells and Inline graphic is the number of clusters. Inline graphic is also limited to be in the range of 5 and 15. Meanwhile, we use the same set of hyperparameters for scAGCL for all the tested datasets, in which the temperature parameter Inline graphic is 0.5, step size for the adjacency perturbation Inline graphic is 100, step size for the feature perturbation Inline graphic is 0.01, subgraph size Inline graphic is 400, and adversarial contrastive loss weight Inline graphic is 1.0. Additionally, scAGCL model is trained through 500 epochs for its main process, and 10 iterations for adversarial training. The Adam optimizer is used to train with the learning rate set to 0.001. These hyperparameters are evaluated in Ablation study section and Supplementary Fig. S8. Otherwise, to ensure the reliability of experimental results, we run the proposed method and the baseline methods five times with different random seeds: 1, 12, 123, 1234, 12 345. After obtaining 5 ARI and NMI values from the number of runs, we calculate average results and report them as the performance of each method.

Results and discussion

Results on real datasets

The ARI values of scAGCL and seven baseline methods on the 15 real datasets are presented in Fig. 2. It can be seen in the heatmap that the proposed method outperforms the remaining clustering approaches on the datasets. For more details, scAGCL achieves the highest number of best results with 8/15 cases. Compared separately with each method, scAGCL produces better results for most datasets. Especially, the proposed method has higher ARI scores compared with scDeepCluster for all cases and higher than those of the 4 remaining methods from 10/15 to 14/15 tested cases.

Figure 2.

Figure 2

The ARI scores of scAGCL and seven baseline methods on 15 real datasets where rank 1 indicates the best results.

Figure 3 presents the average ARI scores and NMI scores of the seven methods. The two bar charts in the figure show that scAGCL achieves the best both average ARI and NMI values on the real datasets. In particular, scAGCL has from 3.43% to 24.19% average ARI values, and from 3.18% to 10.29% average NMI values higher than the baseline methods. The details of the results are provided in Supplementary Tables S2 and S3.

Figure 3.

Figure 3

The average ARI and NMI scores of scAGCL and seven baseline methods on 15 real datasets.

Additionally, to deeply understand of the clustering ability of the methods, their cell embeddings and labeling for Limb_Muscle dataset are visualized using UMAP. The dataset contains cells from 6 cell types. UMAP pictures of the embeddings generated by DESC, AttentionAE-sc, scDeepCluster, and scAGCL for the dataset are presented in Fig. 4. The other embeddings from SC3, scName, contrastive-sc, and scMMN are provided in Supplementary Fig. S1. The embeddings are colored based on predicted and ground truth labels. Random seed value used in this experiment is 12 345. It can be seen from the Fig. 4 that the embedding generated from the proposed method provides clearly separated clusters, which makes the clustering algorithm (Inline graphic-means in this case) classify easily. Compared with the ground truth cell types, scAGCL correctly assigns six clusters to six cluster labels. In the case of DESC and AttentionAE-sc, some ground truth clusters are separated into different parts and result in an incorrect cluster assignment. The embedding from scDeepCluster contains six separated components, but many cells from different cell types are put into the same clusters.

Figure 4.

Figure 4

UMAP visualization of the embeddings for Limb_Muscle dataset by DESC, AttentionAE-sc, scDeepCluster, and scAGCL. They are colored according to predicted labels and ground truth labels.

Considering the computational efficiency of scAGCL, other experimental results on seven datasets randomly generated from the Mouse Brain dataset are presented in Supplementary Figs S5–S7 and Supplementary Table S4. The experiments show that the proposed method achieves the best training time among the tested methods. Furthermore, scAGCL and contrastive-sc have the best efficiency GPUs usage, and are the only two methods able to work with two large-scale datasets in the case of using the GPUs available in our system.

Ablation study

The contribution of adversarial training

This section analyzes the contribution of adversarial training and the overall adversarial contrastive learning module to the proposed method. We create two variants of scAGCL called Inline graphic and Inline graphic. Inline graphic is the variant that uses only the normal contrastive loss Inline graphic, and do not use adversarial training process (adversarial contrastive loss weight Inline graphic). Inline graphic is for the case of only using Inline graphic-means algorithm and not using adversarial contrastive learning module.

The experiments are conducted on four datasets (Pollen, Melanoma, Tosches, and Diaphragm). Figure 5 presents the results of scAGCL and its two variants on the datasets. It can be seen in the bar charts that scAGCL achieves higher ARI and NMI values than the two variants on all the tested cases. In particular, the proposed method returns Inline graphic and Inline graphic higher average ARI values than Inline graphic, and Inline graphic on the datasets, respectively. The two variants also get Inline graphic and Inline graphic lower average NMI values than scAGCL, respectively. The results show a significant contribution of the adversarial training to the proposed method.

Figure 5.

Figure 5

The performance of scAGCL and its two variants (Inline graphic, and Inline graphic) on four datasets (Pollen, Melanoma, Tosches, and Diaphragm).

For deeper understanding of the contribution of each module, we analyze the UMAP embeddings of the methods on the four datasets for the case of using a random seed of 12 345. The embeddings generated by the three methods with the coloring labels for predicting results and the ground truth in the case of Tosches dataset (consisting of 15 clusters) are presented in Fig. 6. The cases of Pollen, Melanoma, and Diaphragm datasets are presented in Supplementary Figs S2–S4. The visualization shows that the embeddings generated from scAGCL have a better separation than the ones from Inline graphic, and Inline graphic. That is the reason why scAGCL achieves better clustering results than the two variants.

Figure 6.

Figure 6

UMAP visualization of the embeddings for Tosches dataset by scAGCL and its two variants (Inline graphic, and Inline graphic). They are colored according to predicted labels and ground truth labels.

Furthermore, the effect of the adversarial training task on the overall performance of scAGCL is evaluated using different values of Inline graphic. This experiment carried on Pollen and Diaphragm datasets with Inline graphic being set to gradually increase from 0.2 to 1.8, while other hyperparameters are fixed. The line charts in Fig. 7 present ARI and NMI values of the proposed method on the two datasets. It can be seen from the charts that scAGCL produces stable results with different values of Inline graphic for the two datasets. For the case Inline graphic, the proposed method returns slightly better ARI and NMI scores compared to other values of Inline graphic.

Figure 7.

Figure 7

The performance of scAGCL with different values of Inline graphic on Pollen and Diaphragm datasets.

The effect of subgraph size on the proposed method

Considering the effect of the subgraph size Inline graphic on the quality and computational performance of scAGCL, we tested the method with different values of Inline graphic from 70 to 780 on Diaphragm dataset, while other hyperparameters were fixed. The line charts in Fig. 8 show that scAGCL achieves similar ARI and NMI values for different subgraph sizes. The case of Inline graphic, in which the model is trained on a whole graph, requires the highest training time, but does not help improve ARI or NMI scores compared to other cases. Conversely, the cases trained with smaller graph sizes demonstrate that the subgraph technique not only reduces computing costs, but also achieves similar clustering results.

Figure 8.

Figure 8

The results and training time of scAGCL with different subgraph sizes on Diaphragm dataset.

Biological analysis

One of the significant functions of single-cell analysis tools is to identify marker genes in each cluster. In this experiment, gene expression matrix and predicted labels are used to calculate top 50 differentially expressed genes (DEGs) in each cluster using Wilcoxon Rank Sum test for Limb_Muscle dataset (with six cell types). Figure 9 presents the similarity of the top DEGs generated by four deep learning-based methods (contrastive-sc, scDeepCluster, scName, and scAGCL) and true cell types (B cell, T cell, endothelial cell, macrophage, mesenchymal stem cell, skeletal muscle satellite cell). Each row of the heatmap presents a cluster predicted by the clustering methods, while each column expresses a true cell type from the ground truth. A heatmap cell shows the percentage of the top DEGs that overlap between a cluster and a true cell type. Using the heatmap, we label each cluster by the cell type that has the highest similarity level with it. As a result, it has failed to assign a label to cluster 4 from clustering result of scName, and there are two cell types having the same top DEGs overlapping percentage with cluster 1. In addition, there are no clusters overlapped with mesenchymal stem cell. In the case of scDeepCluster, two clusters 2 and 5 are assigned to endothelial cell, and do not have any clusters labeled as B cells. All clusters produced by scAGCL and contrastive-sc can be assigned to a unique true cell type. However, scAGCL achieves a higher similarity level than contrastive-sc for the assignment to macrophage cell type (83.3% compared with 82.1%, respectively).

Figure 9.

Figure 9

Overlap of top 50 DEGs in clusters that are detected by contrastive-sc, scDeepCluster, scName, and scAGCL with true cell types for Limb_Muscle dataset.

Utilizing the annotated clusters, we continue to find the top 2 DEGs in cell types which can be candidates as marker genes for corresponding cells. Figure 10 presents that the DEGs also get highest mean expression in their cluster labeled by a cell type compared to the remaining clusters. A list of marker genes are discovered for the cell types as B cell (Cd79a, Cd74), T cell (Cd3d, Cd3g), endothelial cell (Fabp4, Cdh5), macrophage (Tyrobp, Fcer1g), mesenchymal stem cell (Gsn, Dcn), and skeletal muscle satellite cell (Chodl, Des). All the marker genes are correctly the same as the ones from the ground truth. We search the all top 2 DEGs on CellMarker 2.0 [37] and Mouse Cell Atlas 3.0 [38] to assess the validity of the marker genes. We found that all the cell types are available on the cell-type lists matching to the discovered marker genes in the two databases. Most of the cell types are at the top of the lists.

Figure 10.

Figure 10

Matrix plot of top 2 DEGs in each cell type detected by scAGCL from the case of Limb_Muscle dataset.

Conclusion

In this study, we propose a novel deep learning-based clustering method for scRNA-seq data. The proposed method performs an effective training process for an encoder to generate a meaningful latent representation of data with the support of adversarial graph contrastive learning and subgraph sampling techniques. The utilization of adversarial training to generate reliable augmented graph views is demonstrated to strengthen clustering performance. The subgraph technique used is also a strength of the proposed method when it helps reduce much computation time while still keeping a competitive clustering accuracy compared with the case of using a whole graph. The proposed method demonstrates to be able to get better results than seven other state-of-the-art clustering algorithms on 15 real datasets. It also shows the ability to correctly support the identification of marker genes in datasets.

With the usage of k-means algorithm in the clustering phase, scAGCL still needs a given number of clusters. However, in real-world project, the information may be not available. Thus, the detection of cluster numbers in datasets automatically should be considered in future works to better support practical applications. Additionally, other adversarial and augmentation techniques could be used to improve the performance of the proposed method. Furthermore, considering the ability to handle batch effects in the data is also an interesting research direction.

Key Points

  • scAGCL is a novel clustering algorithm for scRNA-seq data that employs a new graph-based contrastive learning with the support of adversarial training to generate reliable augmented samples.

  • A subgraph sampling technique is applied to improve the scalability of scAGCL in analyzing large-scale datasets.

  • Experiments on real scRNA-seq datasets demonstrate that scAGCL outperforms other state-of-the-art clustering methods. Experimental results also show the significant contribution of adversarial training to the effectiveness of the proposed method.

  • scAGCL demonstrates the ability to support the identification of marker genes in scRNA-seq datasets.

Supplementary Material

Supplemental_Data_bbaf423

Acknowledgments

This work is supported by funds from the HCMC University of Technology and Education, Vietnam (Project ID: T2025-01).

Contributor Information

Le Van Vinh, Faculty of Information Technology, HCMC University of Technology and Education, Vo Van Ngan Street, Ho Chi Minh City 700000, Vietnam.

Tran Nhat Quang, School of Science, Engineering & Technology, RMIT University Vietnam, Nguyen Van Linh Boulevard, Ho Chi Minh City 700000, Vietnam.

Lai Hoang Hiep, Faculty of Information Technology, HCMC University of Technology and Education, Vo Van Ngan Street, Ho Chi Minh City 700000, Vietnam.

Pham Nhat Phuong, Faculty of Computer Science and Engineering, HCMC University of Technology, Ly Thuong Kiet Street, Ho Chi Minh City, Vietnam; Vietnam National University Ho Chi Minh City, Ho Chi Minh City 700000, Vietnam.

Tran Van Hoai, Faculty of Computer Science and Engineering, HCMC University of Technology, Ly Thuong Kiet Street, Ho Chi Minh City, Vietnam; Vietnam National University Ho Chi Minh City, Ho Chi Minh City 700000, Vietnam.

Author contributions

L.V.V. proposed the idea for the algorithm. L.V.V., T.V.H., and T.N.Q. equally contributed to the design of the method and experiments. L.V.V., L.H.H., and P.N.P. developed and conducted the experiments. All authors wrote and reviewed the manuscript.

Conflict of interest: No competing interest is declared.

References

  • 1. Rapaport  F, Khanin  R, Liang  Y. et al.  Comprehensive evaluation of differential gene expression analysis methods for RNA-seq data. Genome Biol  2013;14:R95. 10.1186/gb-2013-14-9-r95 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 2. Kolodziejczyk  AA, Kim  JK, Svensson  V. et al.  The technology and biology of single-cell RNA sequencing. Mol Cell  2015;58:610–20. 10.1016/j.molcel.2015.04.005 [DOI] [PubMed] [Google Scholar]
  • 3. Kiselev  VY, Andrews  TS, Hemberg  M. Challenges in unsupervised clustering of single-cell RNA-seq data. Nat Rev Genet  2019;20:273–82. 10.1038/s41576-018-0088-9 [DOI] [PubMed] [Google Scholar]
  • 4. Qiu  P. Embracing the dropouts in single-cell RNA-seq analysis. Nat Commun  2020;11:1169. 10.1038/s41467-020-14976-9 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 5. Grün  D, Lyubimova  A, Kester  L. et al.  Single-cell messenger RNA sequencing reveals rare intestinal cell types. Nature  2015;525:251–5. 10.1038/nature14966 [DOI] [PubMed] [Google Scholar]
  • 6. Guo  M, Hui Wang  S, Potter  S. et al.  SINCERA: a pipeline for single-cell RNA-seq profiling analysis. PLoS Comput Biol  2015;11:e1004575. 10.1371/journal.pcbi.1004575 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7. Kiselev  VY, Kirschner  K, Schaub  MT. et al.  SC3: Consensus clustering of single-cell RNA-seq data. Nat Methods  2017;14:483–6. 10.1038/nmeth.4236 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 8. Chen  X, Zhengchang  S. Identification of cell types from single-cell transcriptomes using a novel clustering method. Bioinformatics  2015;31:1974–80. 10.1093/bioinformatics/btv088 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9. Fang  Z, Zheng  R, Li  M. scMAE: a masked autoencoder for single-cell RNA-seq clustering. Bioinformatics  2024;40:btae020. 10.1093/bioinformatics/btae020 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10. Tian  T, Wan  J, Song  Q. et al.  Clustering single-cell RNA-seq data with a model-based deep learning approach. Nat Mach Intell  2019;1:191–8. 10.1038/s42256-019-0037-0 [DOI] [Google Scholar]
  • 11. Lopez  R, Regier  J, Cole  MB. et al.  Deep generative modeling for single-cell transcriptomics. Nat Methods  2018;15:1053–8. 10.1038/s41592-018-0229-2 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12. Junlin  X, Jielin  X, Meng  Y. et al.  Graph embedding and Gaussian mixture variational autoencoder network for end-to-end analysis of single-cell RNA sequencing data. Cell Rep Methods  2023;3:100382. 10.1016/j.crmeth.2022.100382 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13. Ciortan  M, Defrance  M. Contrastive self-supervised clustering of scRNA-seq data. BMC Bioinf  2021;22:280. 10.1186/s12859-021-04210-8 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14. Wan  H, Chen  L, Deng  M. scNAME: neighborhood contrastive clustering with ancillary mask estimation for scRNA-seq data. Bioinformatics  2022;38:1575–83. 10.1093/bioinformatics/btac011 [DOI] [PubMed] [Google Scholar]
  • 15. Li  S, Guo  H, Zhang  S. et al.  Attention-based deep clustering method for scRNA-seq cell type identification. PLoS Comput Biol  2023;19:e1011641. 10.1371/journal.pcbi.1011641 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 16. Cheng  Y, Ma  X. scGAC: a graph attentional architecture for clustering single-cell RNA-seq data. Bioinformatics  2022;38:2187–93. 10.1093/bioinformatics/btac099 [DOI] [PubMed] [Google Scholar]
  • 17. Ciortan  M, Defrance  M. GNN-based embedding for clustering scRNA-seq data. Bioinformatics  2022;38:1037–44. 10.1093/bioinformatics/btab787 [DOI] [PubMed] [Google Scholar]
  • 18. Lee  J, Kim  S, Hyun  D. et al.  Deep single-cell RNA-seq data clustering with graph prototypical contrastive learning. Bioinformatics  2023;39:btad342. 10.1093/bioinformatics/btad342 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 19. Wu  H, Wang  C, Tyshetskiy  Y. et al.  Adversarial examples on graph data: deep insights into attack and defense. In: Kraus S. (ed), Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence. Macao China: AAAI Press, pp. 4816–23, 2019.
  • 20. Kim  M, Tack  J, Hwang  SJ. Adversarial self-supervised contrastive learning. In: Larochelle H, Ranzato M, Hadsell R. (eds), Advances in Neural Information Processing Systems. Vancouver BC Canada: Curran Associates Inc., Vol. 33, pp. 2983–94, 2020. [Google Scholar]
  • 21. Feng  S, Jing  B, Zhu  Y. et al.  ArieL: adversarial graph contrastive learning. ACM Trans Knowl Discovery Data  2024;18:1–22. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 22. Xu  K, Chen  H, Liu  S. et al.  Topology attack and defense for graph neural networks: an optimization perspective. In: Kraus S. (ed), Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence. Macao China: AAAI Press, pp. 3961–7, 2019.
  • 23. Madry  A, Makelov  A, Schmidt  L. et al.  Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083. 2017.
  • 24. Kipf  TN, Welling  M. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907. 2016.
  • 25. Zhu  Y, Xu  Y, Yu  F. et al.  Deep graph contrastive representation learning  arXiv preprint arXiv:2006.04131. 2020.
  • 26. Lloyd  S. Least squares quantization in PCM. IEEE Trans Inf Theory  1982;28:129–37. 10.1109/TIT.1982.1056489 [DOI] [Google Scholar]
  • 27. Hubert  L, Arabie  P. Comparing partitions. J Classif  1985;2:193–218. 10.1007/BF01908075 [DOI] [Google Scholar]
  • 28. Strehl  A, Ghosh  J. Cluster ensembles—a knowledge reuse framework for combining multiple partitions. J Mach Learn Res  2002;3:583–617. [Google Scholar]
  • 29. Chen  L, Wang  W, Zhai  Y. et al.  Deep soft k-means clustering with self-training for single-cell RNA sequence data. NAR Genomics Bioinf  2020;2:lqaa039. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 30. Hang  H, Li  Z, Li  X. et al.  ScCAEs: deep clustering of single-cell RNA-seq via convolutional autoencoder embedding and soft k-means. Brief Bioinform  2022;23:bbab321. [DOI] [PubMed] [Google Scholar]
  • 31. Liu  T, Jia  C, Bi  Y. et al.  ScDFN: enhancing single-cell RNA-seq clustering with deep fusion networks. Brief Bioinform  2024;25:bbae486. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 32. 10x Genomics. PBMCs from C57BL/6 mice (v1, 150x150), Single Cell Immune Profiling Dataset by Cell Ranger v3.1.0. https://support.10xgenomics.com/single-cell-gene-expression/datasets/1.3.0/1M_neurons, July 2019. (20 June 2025, date last accessed).
  • 33. Lei  T, Chen  R, Zhang  S. et al.  Self-supervised deep clustering of single-cell RNA-seq data to hierarchically detect rare cell populations. Brief Bioinform  2023;24:bbad335. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 34. Wolf  FA, Angerer  P, Theis  FJ. SCANPY: large-scale single-cell gene expression data analysis. Genome Biol  2018;19:1–5. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 35. Li  X, Wang  K, Lyu  Y. et al.  Deep learning enables accurate clustering with batch effect removal in single-cell RNA-seq analysis. Nat Commun  2020;11:2338. 10.1038/s41467-020-15851-3 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 36. Shu  Z, Xia  M, Tan  K. et al.  Multi-level multi-view network based on structural contrastive learning for scRNA-seq data clustering. Brief Bioinform  2024;25:bbae562. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 37. Congxue  H, Li  T, Yingqi  X. et al.  Cellmarker 2.0: an updated database of manually curated cell markers in human/mouse and web tools based on scRNA-seq data. Nucleic Acids Res  2023;51:D870–6. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 38. Wang  R, Zhang  P, Wang  J. et al.  Construction of a cross-species cell landscape at single-cell level. Nucleic Acids Res  2023;51:501–16. 10.1093/nar/gkac633 [DOI] [PMC free article] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

Supplemental_Data_bbaf423

Articles from Briefings in Bioinformatics are provided here courtesy of Oxford University Press

RESOURCES