Skip to main content
Genome Biology logoLink to Genome Biology
. 2025 Aug 19;26:252. doi: 10.1186/s13059-025-03722-3

A message passing framework for precise cell state identification with scClassify2

Wenze Ding 1,2,3,#, Yue Cao 1,2,3,4,#, Xiaohang Fu 1,2,3,4,5, Marni Torkel 1,2,3, Jean Yee Hwa Yang 1,2,3,4,✉
PMCID: PMC12362893  PMID: 40830895

Abstract

Cell annotation is crucial for downstream exploration. Although many approaches, spanning from classic statistics to large language models, have been developed, most of their focus is on distinct cell types and overlook sequential cell populations. Here, we propose an annotation method, scClassify2, to specifically focus on adjacent cell state identification. By incorporating prior biological knowledge through a novel dual-layer architecture and ordinal regression, scClassify2 achieves competitive performance compared to other state-of-the-art methods. Besides single-cell RNA-sequencing data, scClassify2 is generalizable from different platforms including subcellular spatial transcriptomics data. We also develop a web server for academic uses.

Supplementary Information

The online version contains supplementary material available at 10.1186/s13059-025-03722-3.

Keywords: ScRNA-seq, Cell state identification, MPNN, Ordinal regression, Dual layer architecture

Background

Leveraging advancements in sequencing technologies, single-cell transcriptomics has revolutionized biological and medical research by offering unprecedented opportunities to observe gene expression across the entire transcriptome at cellular resolution [1–5]. A fundamental task in single-cell research is cell annotation, as understanding the identity of cells is key to further downstream analysis [6–8]. Current cell annotation tasks are based on two main categories of approaches: supervised and unsupervised (including some semi-supervised ones) [9–16]. Firstly, with an unsupervised approach, the process typically involves clustering the query data into groups based on their molecular characteristics, such as gene expression. This is then followed by annotating cells from each group via marker gene analysis. The alternative approach is supervised classification, where a set of cell expression data and their corresponding known cell type labels are used as the training or reference data to build a model. The model can then be used to annotate cell types in query or unseen datasets.

To date, many studies suggest that gene expression states form a continuous space rather than distinct clusters. While differentiation likely follows a continuous trajectory, cells in it can still be best annotated or explored as discrete but sequential states. For example,in the biological system, many processes often involve cell transitions (Fig. 1a), such as human preimplantation embryo development [17] and T cell differentiation during infection [18]. Although numerous approaches for cell type annotation exist, a significant portion of these focuses on discrete and non-sequential cell subpopulations. Adjacent cell states are typically more similar as they represent transition from one to the other, which often results in overlapping clustering, posing a clear challenge for unsupervised machine learning strategies which rely on clear cluster separation and potentially leading to misclassification of intermediate cell states. There is a gap of existing approaches specially designed to account for cell state transition and thus effectively discriminate adjacent cell states; this remains a challenge in current cell annotation [19, 20].

Fig. 1.

Fig. 1

Overview of the scClassify2 framework for sequential cell state identification. a Linear cell state transformation is one of the most common and important phenomena in nature when external disturbance factors like signal molecules, drugs, or stresses occur. b Conceptual illustration of expression distribution difference between distinct cell types and adjacent cell states. c Brief illustration of our work. scClassify2 adapts stable log-ratio values of expression data and incorporates prior gene co-expression knowledge via a dual-layer graph neural network (MPNN) to capture the expression topology of cells and then identify them accurately with a novel ordinal regression component. d scClassify2 could be applied to not only the traditional scRNA-seq data but also sequencing data from subcellular spatial transcriptomics. e Brief illustration of the MPNN architecture adopted by scClassify2. Gene identities are encoded as nodes of the graph; meanwhile, the log-ratio of corresponding expression is encoded as edges. The model contains an encoder for topology capturing and a decoder for better learning

Annotation between different single-cell expression data is subject to dataset or batch effect, where the distribution of gene expression varies across datasets due to technical and biological differences even after log transformation. This makes the generalizability of the single-cell classification model for cell annotation a persistent challenge. Selected classification methods such as CHETAH [21], scLearn [22], scMap [23], and scTyper [24] use correlation-based distance instead of Euclidean distance to match between query cells and training cells as correlation is unit independent. Other strategies involve using data integration strategies to find common embeddings [25, 26] between the query and reference. However, this entails additional computational expenses and needs to be repeated for each query dataset of interest. Some machine-learning-based approaches also tried to learn the generalised cell identity annotations from one experiment to another by semi-supervised training [15, 16]. More recently, pre-trained models, especially large language models (LLMs) have emerged as the latest state-of-the-art tools in multiple disciplines. LLMs are characterised by their ability to generalise. Methods have applied LLMs to single-cell research including Geneformer [27] and scGPT [28]. However, these models require computationally intensive training based on a massive number of databases and require additional adaptation to optimise for specific tasks.

Here, we proposed scClassify2, a novel and transferable framework for adjacent cell state identification across platforms. This is achieved with three key innovations. Firstly, the transferable component is achieved by adapting our recent cross-platform biomarker strategies [29] which identify reference-free markers by examining log-ratio of expression values in multiple samples to capture consistent relationships between two genes. The relationship between genes is shown to be more stable across datasets compared to individual gene expression. Secondly, we use a dual-layer architecture to enable joint learning from both the expression information and gene co-expression patterns derived from the log-ratio of genes. Specifically, to capture the gene co-expression pattern as well as the relationship between states, we utilized a type of graph neural network (GNN) named message passing neural network (MPNN) for the first time in single-cell research. MPNN incorporates both node and edge information[30], unlike other types of GNN that focus on node features while ignoring edge information. Thirdly, to identify adjacent cell state transitions, we adopt ordinal regression as the classifier of the network with a conditional training procedure. Using eight diverse datasets, we show our transferable dual-layer model outperformed other cell annotation methods on transitional cell state identification tasks. Our framework is generalizable for both cell type and cell state annotation including spatially resolved data. A catalogue framework of cell state annotations containing pre-trained models for various human tissues is made available via a user-friendly web server (https://shiny.maths.usyd.edu.au/scClassify_catalogue/) as a community resource.

Results

scClassify2 learns expression topology by integrating prior biological information through message passing network

We introduce scClassify2, which provides a generalizable and transferable cell annotation framework for sequential cell state identification across platforms. With the increased number of perturbation studies, this new extension of scClassify is specifically designed to recognize the inherent order of cell state. In our previous study, scClassify captures discrete cell type relationships by constructing a cell type hierarchical tree through a recursive clustering algorithm. It may capture sequential cell states by annotating them under the intermediate cell type category[31]. To further increase our capacity to effectively distinguish subtle cell type or cell state differences, we used a dual-layer design with a type of graphical neural network called message passing neural network (MPNN). We chose MPNN as the backbone due to its ability to capture both node and edge information as well as its flexibility and scalability [32–35]. Based on MPNN, we encode each cell as a graph and employ a dual-layer deep learning approach, as illustrated in Fig. 1. The dual-layer design allows the integration of two levels of information in the network: (i) log-ratio of pairwise gene expression counts modeled as edge and (ii) biological knowledge derived from gene co-expression modeled as node. This allows information to propagate among genes across connecting edges and captures subtle gene expression topology of different cell states including gene co-expression. We used the ratio of gene expression as it is shown to be relatively more stable across datasets compared to individual gene expression [29].

To assess the benefit of additional gene information in enhancing cell state annotation, we compared the single-layer mode with the dual-layer mode, where the former relies solely on expression data. As illustrated in Fig. 2a, the integration of biological information into gene representations via the dual-layer architecture yields higher accuracy for sequential cell state identification compared to no information (e.g., the accuracy of using one-hot vectors versus zero vectors is 0.63 versus 0.86). Moreover, we checked the cell embeddings captured by MPNN correspondingly (Fig. 2b) and found dual-layer information could help the neural network recognize and construct specific embedding patterns of subtly different cell states much better.

Fig. 2.

Fig. 2

scClassify2 uses dual-layer architecture based on message-passing neural network. a tSNE plots of validation mouse gastrulation embryo dataset to show the prediction difference between single-layer architecture and dual-layer (with gene2vec). The left panel is annotated by ground truth. The middle and right panels are the predictions of single-layer and dual-layer architecture correspondingly. b Clustered cell embeddings captured by single-layer (left panel) and dual-layer (right panel) architecture correspondingly. In the heatmap, each row represents a cell, whose state is marked by the very left colored stripes. As we can see, cell embeddings obtained from dual-layer architecture show certain patterns which are highly correlated with corresponding cell states, while single-layer ones do not. c Comparison among single-layer using only gene expression data and dual-layer integrating different sources of prior biological knowledge. d Prediction accuracy comparison between classifiers of general multi-classification and specifically designed ordinal regression across various cell states. e Confusion matrices of predictions from different classifiers show more details

We further investigated model performance using various implementations to capture the gene co-expression pattern. We found the performance of cell state identification could be further enhanced by utilizing distributed gene representations as node embeddings. For instance, as depicted in Fig. 2c, the accuracy of cell state identification increases from 0.86 when using one-hot vectors to 0.95 when employing vectors from Gene2vec. Such distributed gene representations, derived from embedding methods like Gene2vec, scEMT, and scSpectra, estimate gene regulation networks by capturing gene co-expression patterns from large-scale transcriptome-wide data. Gene2vec, for example, derives the pattern using nearly 1000 datasets from GEO. Based on the performance of these embedding methods, we implemented Gene2Vec in scClassify2 to embed each gene into a node vector with 200 dimensions.

scClassify2 uses ordinal regression to effectively identify adjacent cell states

Given the many biological processes that involve transitional cell states, it is important to capture the sequential nature between transitional cell states. scClassify2 introduced an ordinal regression layer in the model and a novel training procedure based on the conditional probability distribution of adjacent cell states.

To demonstrate its effectiveness, we compared scClassify2 with a conventional multi-classification layer on a mouse gastrulation embryonic development cell state dataset. Figure 2d highlights the improved performance of the ordinal regression with a cell state prediction accuracy of 0.93 compared to 0.82 of the conventional multi-classification. Notably, the multi-classification model had trouble identifying E6.75. It only correctly identified ~ 30% of E6.75 and incorrectly predicted over 40% as E7.0. In contrast, the cell classification model based on ordinal regression in scClassify2 can correctly identify almost 95% of the E6.75 as E6.75 cells (Fig. 2e). Given the subtle differences in gene expression profiles along adjacent cell states, the use of ordinal regression and the conditional probability distribution between states underscores the benefits of learning the underlying relationship between the cell states.

scClassify2 outperforms other advanced approaches for sequential cell state identification

We compared the performance of scClassify2 with our previous version, as well as three other state-of-the-art classification methods sigGCN, scGCN, scGPT, and scFoundation [36], across eight datasets (Table S1) on the sequential cell state identification task (Fig. 3). scClassify2 represents a significant improvement over our previous work, scClassify, evident across all eight datasets. For example, on dataset 8, scClassify2 achieves a prediction accuracy of 80.76 ± 0.43% compared to 67.22 ± 0.82% for scClassify. When compared with other state-of-the-art graph-neural-network-based methods such as sigGCN and scGCN, scClassify2 demonstrates consistent performance advantages across all datasets. For example, as shown in Fig. 3, scClassify2 achieves an accuracy of 87.93 ± 0.28%, outperforming sigGCN and scGCN with 78.55 ± 0.34% and 79.31 ± 1.13%, respectively, on dataset 3. Notably, scClassify2 slightly outperforms scGPT and scFoundation, the latest cell annotation method using generative artificial intelligence, on most test datasets. For example, on dataset 1, scClassify2 achieves an accuracy of 94.45 ± 0.17% compared to 93.04 ± 0.18% for scGPT and 91.06 ± 0.10% for scFoundation. These foundation models are pre-trained on thousands of information, providing them with a vast amount of prior knowledge. In contrast, scClassify2 is trained on a specific tissue dataset, which provides it with the flexibility to tailor the reference dataset more effectively than generalized models.

Fig. 3.

Fig. 3

Performance comparison for eight different datasets. Comparison of model performance for 6 advanced approaches on 8 different sequential cell state datasets. Relative ranks of these methods on each dataset are presented at the top

Broad applicability of scClassify2 including subcellular spatial transcriptomics data

To assess the applicability of scClassify2 on other biotechnology platforms, we tested it on a breast cancer dataset generated by a subcellular spatial transcriptomics (SST) platform, Xenium. SST is the latest spatial technology in the new era of spatial omics sequencing. We firstly applied BIDCell, our recently published state-of-the-art segmentation algorithm, to delineate individual cells. As illustrated in Fig. 4a–d, scClassify2 worked well even for scenarios without sequential relationships among cell types and achieved an identification precision of around 0.92 when compared to scClassify. Furthermore, we found the prediction accuracy of scClassify2 is relatively consistent across spatial regions of the breast cancer slide (Fig. 4e–g), while slightly fluctuating among different cell types (Fig. 4h). Our findings prove scClassify2 as a cell type identification method with broad applicability that can be seamlessly applied to SST data.

Fig. 4.

Fig. 4

Applicability of scClassify2 for SST data. scClassify2 could be directly applied on subcellular spatial transcriptomics (SST) data. a–d The raw image and cell types identified by scClassify2 of human breast tissues, where a and b is replicate 1 while c and d stand for replica 2. e–g We equally divided the vision into 25 regions to observe the annotation results of scClassify2. e Regional cell enrichment (how many cells in one specific region compared with the whole vision). f scClassify2’s prediction accuracy for each region. g The relationship between regional cell enrichment (x-axis) and scClassify2’s prediction accuracy (y-axis). h We also checked scClassify2’s precision for each cell type when applied to SST data

scClassify2 provides catalogue for convenient single-cell annotation

To provide a resource for the scientific community, we developed a user-friendly web server called scClassify-catalogue, offering a comprehensive catalogue of scClassify2 models trained from datasets covering almost 1000 cell types and 30 tissue types (Fig. 5a). Traditional web portals often present multiple non-integrated references for the same tissue and place overhead on the users with the task of experimenting with multiple references. In contrast, scClassify-catalogue directly delivers annotation results for the selected tissue within a relatively short time. The input of scClassify-catalogue is flexible and allows either the direct output from 10 × cell ranger software, or a csv file or h5ad file containing the gene expression matrix (Fig. 5b). Once the job is submitted, a job ID will be made available (Fig. 5c–d). A file containing the predicted outcome as well as an HTML file will be emailed to the email address entered by the user once the job finishes. The HTML file visualizes the predicted cell type such that the user can easily check the prediction result (Fig. 5e).

Fig. 5.

Fig. 5

Overview of scClassify-catalogue—the web server. a A brief overview of our web server, scClassify-catalogue. b Homepage of scClassify-catalogue. The window for uploading expression profiles of query data is marked by a green rectangular (Box 1). After filling all necessary information in, click the “SUBMIT” button. c After submission, the waiting panel would pop up. The prompt window of the waiting panel is marked by a purple rectangular (Box 2). Job ID in this window is important for us to trace the backend activity of the user’s submission. Please wait enough time (usually less than 2 min) before clicking the “Generate result” button. d If the job has not been finished, another waiting panel would pop up. e The result page of the finished job. A UMAP of input data with annotations and a brief statistical bar plot of analysis results is available on this page. Downloadable and editable result table and analysis plot mentioned above could be reviewed by users (Box 3)

Discussion and conclusions

In this study, we introduce scClassify2, a cell state identification method based on log-ratio values of gene expression, a message passing framework with dual-layer architecture and ordinal regression. scClassify2 effectively distinguishes adjacent cell states with similar gene expression profiles. Our comprehensive evaluation demonstrates the superior performance of scClassify2 compared to other state-of-the-art methods, including scGPT, sigGCN, and scGCN. Moreover, scClassify2 can be applied for cell annotation tasks on SST data. To enhance its accessibility for researchers, we have developed a user-friendly web server equipped with pre-trained models for over 30 tissues.

The integration of dual-layer learning, which combines expression data with prior biological knowledge, represents an innovative strategy to incorporate prior knowledge. As intended, relevant additional information leads to improved prediction performance. Using distributed gene representations such as Gene2vec, scETM, and scSpectra as node embedding leads to further enhancement in performance. These representations estimate gene regulation networks by capturing gene co-expression patterns from transcriptome-wide data and play a critical role in enabling the network to discern subtle high-dimensional expression pattern disparities among neighboring cell states. Interestingly, the results suggest that MPNN is quite an effective learning model, as the simpler gene embeddings from Gene2vec are sufficient to achieve the best performance compared to more comprehensive and detailed association information from scETM and scSpectra.

The distinct efficacy of MPNN in comparison to other graph neural network architectures (Fig. S1) lies in its unique message passing mechanism, enabling nodes within the graph to exchange information along edges and influence neighboring nodes. In contrast, Graph Convolutional Network (GCN) relies solely on aggregated signals within each node for self-update, potentially limiting their effectiveness. Despite attempts to augment GCN with attention mechanisms, such as Graph Attention Network (GAT) and graph transformer, they still fall short of MPNNs due to their inherent lack of message passing and propagation. This crucial process is indispensable for capturing subtle gene expression differences among adjacent cell states. With genes as nodes and pairwise log-ratio values of gene expression counts as edges, we speculate the graph itself mimics the whole signal pathway network within a cell, where messages of different layers computed by MPNN establish bridges facilitating gene communication akin to regulatory molecules in biological systems.

Gene expression profile exhibits only subtle differences along adjacent cell states. Many approaches ignore this sequential relationship, separately assign them to different labels and use multi-classification to do the annotation task. In scClassify2, we use ordinal regression to establish a comprehensive consistency of gene expression distributions from different cell states. While we did not compare against one-vs-rest or one-vs-one approaches, we have benchmarked against several other widely used multi-class classification strategies that are specifically designed for single-cell data and found the superiority of scClassify2. With ordinal regression, scClassify2 leverage the nature of cell state evolution by using conditional probability among them.

We have shown that besides scRNA-seq, scClassify2 is directly applicable on SST. This offers the potential to continuously generate additional pre-trained models within the catalogue to accommodate other forms of spatial datasets including spatial proteomics, imaging mass cytometry (IMC) and spatial transcriptomics data. Spatial proteomics and IMC, different from transcriptomics data, sequence selective panels of genes containing only a few hundred genes. This requires some special adaptation strategy of the pre-trained models such as subsetting the models to the gene panels.

In summary, we present scClassify2, a single-cell annotation tool with an emphasis on identifying sequential cell states in an ordinal manner that is applicable to both scRNA-seq and SST data. As a resource for the community, we have constructed a dedicated web server with pre-trained references available at (https://shiny.maths.usyd.edu.au/scClassify_catalogue/). Our work contributes to the community by alleviating the laborious process of selecting appropriate reference data and the requirement for computational infrastructure such as GPUs.

Methods

scClassify2

scClassify2 is a graphical deep learning model for single-cell cell state annotation. scClassify2 introduces the following novelties:

  • A dual-layer architecture based on the backbone of a Message Passing Neural Network (MPNN) that integrates dual information of gene expression and prior biological knowledge

  • An ordinal regression loss to leverage the sequential information between cell states

  • A reconstruction loss that captures biologically meaningful embedding of gene features

Below, we explain each component in detail.

MPNN

scClassify2 is based on a dual-layer MPNN architecture. In this architecture, each cell is represented as a cell graph, where nodes correspond to genes and edges encode pairwise log-ratio values of gene expression to capture the relationship between gene pairs.

As shown in Fig. 1, the MPNN model of scClassify2 uses an encoder-decoder architecture. The encoder processes the cell graph by integrating the node and edge dual-information, iteratively updating them through message passing. Initially, all input vectors are aligned, and for each edge, the connected node vectors are concatenated with the edge vector. Then, a three-layer perceptron with hidden dimensions of (384,128,128) computes the edge message, which is used to update node vectors via a residual module with layer normalization and dropout (10%). Once all nodes are updated, a second perceptron with a similar structure recalculates the edge messages, and edge vectors are updated accordingly. This message passing process is executed three times; i.e., the encoder has three layers. The decoder is simpler, using encoded node and edge features to compute messages along edges, updating only node features to reconstruct the gene representation.

During training, we set 16 as the default batch size of scClassify2 and train the model for 28 epochs with early stopping. We performed hyperparameter tuning, as shown in Supplementary Fig. S2, to assign the defaults before systematic evaluation.

Cell graph construction

To construct the nodes in cell graph, we used Gene2Vec, a distributed representation dictionary pretrained from transcriptome-wide gene co-expression data. This embeds each gene into a node vector with 200 dimensions.

As for edges, we firstly pick up around 600 highly variable genes and then transfer gene expression counts into pairwise log-ratio values. For a typical matrix X of gene expression counts with dimension n × m, where n is the number of observations (cells), and m is the number of variables (sequenced genes). We define the “pairwise log-ratio values” for n cells as n square matrices all of size m × m. More specifically, for each cell (assume its index is i), the gene expression counts vector would be Xi, and the jth value Xi,j is the expression counts of Gene j. For the m × m log-ratio matrix, its jth column would be enumerated by logXi,j-logXi.k for k in the range of 1 to m, including j.

scRNA-seq data is inherently sparse due to several biological and technical factors. Most values in the expression matrix X are zero. Hence, we would meet lots of failures when trying to compute log0 during the log ratio transformation we mentioned above. To avoid these computational failures caused by the data sparsity, we add a Gaussian noise with a mean of 0.5 to the original expression counts. Adding such a Gaussian noise (all so-called stochastic regularization in computer science) also helps prevent overfitting and makes the model more robust, as it prevents the model from treating zero values as absolute absences of gene expression. The mean value of this Gaussian noise, 0.5, is an empirical trade-off between being large enough to avoid log0 errors and small enough not to artificially inflate expression counts.

We used radial basis functions (RBFs) with Gaussian kernels to transform these single numerical ratio values into dense multidimensional vectors by mapping each input onto a high-dimensional space using radial symmetry.

RBFx,c=exp-x-c2r2 1

herex,c, and r represent the log-ratio scalar needing to be vectorized, the center point and the variance (spreadability) of the current Gaussian kernel respectively. We have calculated the distribution of these log-ration values and found most of them were within the range of − 6 to 6. For efficient vectorization, we used 8 kernels whose center points were unevenly spaced in that range according to our parameter searching process.

After comprehensively balancing the model performance and computation consumption like memory usage, we pruned the previous dense graph and only kept 16 outgoing edges for each node. More specifically, for each gene (node in the graph), we chose 8 other genes with the largest log-ratio values and 8 with the smallest values and kept the corresponding edges. It is worth noting that log-ratio values between two paired genes are actually the opposites; i.e., if we mark the expression count of gene A and gene B as EA and EB, then the log-ratio of A to B would be log(EA/EB) while B to A is log(EB/EA). To fully utilize the edge information, we added a perceptron layer for information propagation. This perceptron layer effectively integrates and reweights the corresponding neighborhood of a certain node, serving as an attention mechanism and making the graph topology fit expression data better.

Ordinal regression

scClassify2 utilises an ordinal regression approach to model the ordering of adjacent cell states, an innovative approach over the conventional multi-class classification. Instead of predicting a categorical label, the model learns a series of conditional binary classifiers, each distinguishing whether a cell belongs to a given state or following states.

Drawing on prior studies from the literature [38], we construct n–1 conditional training subsets S1,...,Sj,...,S(n-1) for n sequential cell states. The first subset is the whole training set, and we conduct binary classification with regular binary cross-entropy loss to decide whether a cell belongs to the first state or following states. Meanwhile, the jth subset only contains samples belonging to states following the (j-1)th state and we also conduct similar binary classification with cross-entropy to decide whether a cell belongs to the jth state or states following the jth state. After transferring the original large and complex multi-classification problem to a series of smaller but simpler binary classification problems, we obtain unconditional probability through the chain rule of conditional probability. More specifically, the predicted state index q of a cell would be

q=1+∑j=1n-1IP^y>stagej>threshold 2

where I is the indicator function, y represents current cell state and P^(y>stagej) means the estimated probability of the current cell belonging to states following the jth state, and the threshold is a tuneable predefined probability value. Then, the ordinal regression loss of scClassify2 would be:

Lossord=-1∑j=1K-1|Sj|∑j=1K=1∑i=1|Sj|[log(σ(z[i]))·I(y[i]>stagej)+(log(σ(zi))-zi)·I(yi≤stagej)] 3

where z[i] represents the predicted logits of the ith training example in Sj,σ means sigmoid function and Sj means the jth training subset with all cells belonging to states following the (j-1)th state.

Gene embedding reconstruction

scClassify2 includes the reconstruction loss to promote the network to learn gene representations. The rationale is that, during the message passing, the model integrates local gene expression relationships into a global embedding that captures gene relationships, such as co-expression information and regulatory dependencies. This information can be important in distinguishing between cell states. To better assist this learning process, we implement a masking and reconstructing strategy, supervised through the reconstruction loss. The reconstruction loss measures overall distance between the distributed gene representation inputted to nodes with random masks (mask rate 15%) in the first layer of encoder and the corresponding recovered gene representation distribution outputted by the last layer of decoder. Since these two distributions might shift unevenly by computations and operations conducted within MPNN and thus do not share the same base anymore, we choose an approximating Wasserstein distance[39–42] as our loss instead of directly using Kullback–Leibler divergence[43]. The reconstruction loss would be:

Lossrec=infγεηP,QEx,yx-y 4

where γ is the joint distribution of original gene representation P and reconstructed gene representation Q, Π is the set of all possible γ, inf means the infimum of the expectation.

Loss function

The final loss function of scClassify2 combines the ordinal regression loss, which guides the classification of cell states according to the gene expression pattern, and the gene embedding reconstruction, which guides the gene relationships captured by the network. We use two empirical coefficients to combine them:

Loss=λ1Lossord+λ2Lossrec. 5

Dual-layer implementation

We compared the single-layer network which only used expression counts with the dual-layer.

architecture which integrates estimated gene–gene association information with gene expression. As mentioned above, an observation or a cell is represented by a graph, where the nodes represent genes and the edges represent log-ratio values of two connected genes’ expression counts. For implementation convenience, we kept the main framework and designed the comparison of node fillers in order from simplicity (no information) to complexity (more information), where each node could be.

  1. Set to all zeros—representing no information in nodes and the network only used expression counts.

  2. One-hot vectors—representing only unrelated gene information in nodes.

  3. Gene embeddings from Gene2vec [37]—representing gene–gene association information estimated by a machine learning approach from large-scale gene–gene co-expression data.

  4. Gene embeddings from scETM [44] and scSpectra [45]—representing gene–gene association information estimated by deep learning approaches from transcriptome-wide gene–gene co-expression data.

Data collection

We included eight diverse scRNA-seq datasets (Table S1) which not only provide highly credible cell states of certain sequential biological processes but also have been cited by other cell trajectory research for performance evaluation. The datasets covered both human and mouse, different tissue types and cell types, diseased and healthy. For example, mouse gastrulation embryo dataset was found at NCBI Gene Expression Omnibus (GEO: GSE171588). To control variables and focus on cell state classification, we only collected “Epiblast” cells (13,377 in total). According to embryo development time, these cells are naturally divided into 6 states, i.e., E6.5 (17.01%), E6.75 (6.40%), E7.0 (37.89%), E7.25 (31.06%), E7.5 (6.91%), and E7.75 (1.73%). A detailed distribution of these cells could be found at Fig. 2a. We filtered cells which expressed less than 100 genes and genes which were expressed by less than 10 cells. No additional processing was conducted after collection, and raw unnormalized expression count matrix was directly used by scClassify2.

Evaluation framework

We executed fivefold cross validation with 5 repeats on a collection of eight datasets (Supplementary Table S1) covering both human and mouse, different tissue types and cell types, diseased and healthy. To assess stability with respect to training set size, we randomly subsampled different proportions of the data (from 10 to 100% of the available training cells on Dataset-1) and evaluated model performance over independent runs per proportion. The boxplots in Supplementary Fig. S3 summarize the model performance across these runs.

To evaluate and compare the performance of scClassify2, we obtained four other publicly available methods by their default settings. These packages were installed either through their official Bioconductor website or directly from their GitHub page before December of 2023. Among them, scClassify is our previous version, which is based on traditional ensembled k-neighbours network (KNN) and cell type hierarchies. sigGCN is a multimodal end-to-end Graph Convolutional Network combined with gene interaction information. scGCN is another graph convolution network which achieves effective knowledge transfer across disparate datasets. scGPT is a pre-trained foundation large language model with fine tuning pipeline for single-cell multi-omics.

Subcellular spatial transcriptomics (SST)

We used the Xenium Breast Cancer dataset downloaded from https://www.10xgenomics.com/products/xenium-in-situ/preview-dataset-human-breast to validate scClassify2’s capability on SST data. We used BIDCell with the default settings to get the cell segmentations (details could be found at: https://github.com/SydneyBioX/BIDCell). Next, the data was transferred into regular single-cell expression data, and we apply a pre-trained model created by scClassify2 to estimate the cell states.

Web server

For the front-end, the interface of our web server, scClassify-catalogue (https://shiny.maths.usyd.edu.au/scClassify_catalogue/) is based on Shiny. Meanwhile, the back-end functionality is implemented through Python, as described in our GitHub [46] and Zenodo page [47].

Supplementary Information

13059_2025_3722_MOESM1_ESM.docx (45.3KB, docx)

Additional file 1: Fig. S1. The comparison among several graph neural network architectures. The overall prediction accuracy of MPNN and graph transformer is approximately equal, outperforming GCN and GAT. However, the graph transformer consumes significantly more training time compared with MPNN.

13059_2025_3722_MOESM2_ESM.docx (273.4KB, docx)

Additional file 2: Fig. S2. The comprehensive hyperparameter search was conducted for scClassify2. Network hyperparameters of 12 aspects from 3 domains were involved to optimise its performance and robustness for real-world applications.

13059_2025_3722_MOESM3_ESM.docx (59.1KB, docx)

Additional file 3: Fig. S3. The stability of model performance with respect to changes in the size of the training set.

13059_2025_3722_MOESM4_ESM.docx (16.3KB, docx)

Additional file 4: Table S1. Details of eight scRNA-seq datasets of sequential cell state transformation. The columns #cells, #genes, #states denote the number of cells, the number of genes and the number of cell states respectively.

13059_2025_3722_MOESM5_ESM.docx (14.7KB, docx)

Additional file 5: Supplementary Methods.

Acknowledgements

The authors thank all their colleagues, particularly at the University of Sydney, Sydney Precision Data Science, and Charles Perkins Centre for their support and intellectual engagement. Special thanks to Zhenghao (Chris) Chen for his contribution in our weekly discussion.

Peer review information

Andrew Cosgrove was the primary editor of this article and managed its editorial process and peer review in collaboration with the rest of the editorial team. The peer-review history is available in the online version of this article.

Authors’ contributions

J.Y. conceived and funded the study. J.Y., W.D., Y.C. and X.F. completed the design of study. W.D and Y.C. completed the evaluation and analysis. The implementation of the package was done by W.D. The construction of the web server was done by M.T. All authors wrote, reviewed, and approved the manuscript.

Funding

AIR@innoHK programme of the Innovation and Technology Commission of Hong Kong to all authors. Judith and David Coffey funding and the Chan Zuckerberg Initiative Single Cell Biology Data Insights grant (DI2-0000000197) to J.Y.H.Y and Y.C; NHMRC Investigator APP2017023 to J.Y.H.Y. The funding source had no role in the study design, in the collection, analysis, and interpretation of data, in the writing of the manuscript, and in the decision to submit the manuscript for publication.

Data availability

We used 8 public datasets in this study (Supplementary Table 1). The mouse gastrulation embryo dataset [48] was found at NCBI Gene Expression Omnibus (GEO: GSE171588). The T-cell development dataset [18] was found at GEO: GSE211602. The human embryo dataset [17] was found at EMBL’s European Bioinformatics Institute (EMBL-EBI: E-MTAB-3929). The mouse oligodendrocyte dataset [49] was found at GSE75330. The mouse bone marrow mesenchyme erythrocyte dataset [50] was found at GSE108097. The mouse dentate gyrus neurogenesis dataset [51] was found at GSE95753. The mouse kidney brush border dataset [50] was found at GSE108097. The mouse kidney collecting duct dataset [52] was found at GSE107585. Our codes and related instructions could be found at our GitHub [47] and Zenodo page [48].

Declarations

Ethics approval and consent to participate

Not applicable.

Competing interests

The authors declare no competing interests.

Footnotes

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Wenze Ding and Yue Cao contributed equally to this work.

References

  • 1.Armingol E, Officer A, Harismendy O, Lewis NE. Deciphering cell-cell interactions and communication from gene expression. Nat Rev Genet. 2021;22:71–88. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 2.Jovic D, Liang X, Zeng H, Lin L, Xu F, Luo Y. Single-cell RNA sequencing technologies and applications: A brief overview. Clin Transl Med. 2022;12: e694. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 3.Papalexi E, Satija R. Single-cell RNA sequencing to explore immune cell heterogeneity. Nat Rev Immunol. 2018;18:35–45. [DOI] [PubMed] [Google Scholar]
  • 4.Stark R, Grzelak M, Hadfield J. RNA sequencing: the teenage years. Nat Rev Genet. 2019;20:631–56. [DOI] [PubMed] [Google Scholar]
  • 5.Stubbington MJT, Rozenblatt-Rosen O, Regev A, Teichmann SA. Single-cell transcriptomics to explore the immune system in health and disease. Science. 2017;358:58–63. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Lähnemann D, Köster J, Szczurek E, McCarthy DJ, Hicks SC, Robinson MD, et al. Eleven grand challenges in single-cell data science. Genome Biol. 2020;21:31. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.Stegle O, Teichmann SA, Marioni JC. Computational and analytical challenges in single-cell transcriptomics. Nat Rev Genet. 2015;16:133–45. [DOI] [PubMed] [Google Scholar]
  • 8.Zappia L, Theis FJ. Over 1000 tools reveal trends in the single-cell RNA-seq analysis landscape. Genome Biol. 2021;22:301. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.Chen J, Xu H, Tao W, Chen Z, Zhao Y, Han J-DJ. Transformer for one stop interpretable cell type annotation. Nat Commun. 2023;14(1):223. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.Li C, Liu B, Kang B, Liu Z, Liu Y, Chen C, et al. SciBet as a portable and fast single cell type identifier. Nat Commun. 2020;11:1818. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11.Liu Y, Wei G, Li C, Shen LC, Gasser RB, Song J, et al. TripletCell: a deep metric learning framework for accurate annotation of cell types at the single-cell level. Brief Bioinform. 2023;24(3):bbad132-10.1093/bib/bbad132. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12.Ma F, Pellegrini M. ACTINN: automated identification of cell types in single cell RNA sequencing. Bioinformatics. 2020;36:533–8. [DOI] [PubMed] [Google Scholar]
  • 13.Wang J, Ma A, Chang Y, Gong J, Jiang Y, Qi R, et al. scGNN is a novel graph neural network framework for single-cell RNA-Seq analyses. Nat Commun. 2021;12:1882. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Xie P, Gao M, Wang C, Zhang J, Noel P, Yang C, et al. Superct: a supervised-learning framework for enhanced characterization of single-cell transcriptomic profiles. Nucleic Acids Res. 2019;47: e48. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 15.Xu Z, Luo J, Xiong Z. scSemiGAN: a single-cell semi-supervised annotation and dimensionality reduction framework based on generative adversarial network. Bioinformatics. 2022;38:5042–8. [DOI] [PubMed] [Google Scholar]
  • 16.Kimmel JC, Kelley DR. Semisupervised adversarial neural networks for single-cell classification. Genome Res. 2021;31(10):1781–93. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17.Petropoulos S, Edsgärd D, Reinius B, Deng Q, Panula SP, Codeluppi S, et al. Single-cell RNA-seq reveals lineage and X chromosome dynamics in human preimplantation embryos. Cell. 2016;167:285. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 18.Fernández-García J, Franco F, Parik S, Altea-Manzano P, Pane AA, Broekaert D, et al. CD8+ T cell metabolic rewiring defined by scRNA-seq identifies a critical role of ASNS expression dynamics in T cell differentiation. Cell Rep. 2022;41: 111639. [DOI] [PubMed] [Google Scholar]
  • 19.Zhang Y, Sun H, Zhang W, Fu T, Huang S, Mou M, et al. CellSTAR: a comprehensive resource for single-cell transcriptomic annotation. Nucleic Acids Res. 2024;52:D859–70. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20.Zhou P, Wang S, Li T, Nie Q. Dissecting transition cells from single-cell transcriptome data through multiscale stochastic dynamics. Nat Commun. 2021;12:5609. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 21.de Kanter JK, Lijnzaad P, Candelli T, Margaritis T, Holstege FCP. CHETAH: a selective, hierarchical cell type identification method for single-cell RNA sequencing. Nucleic Acids Res. 2019;47: e95. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 22.Li X, Wang K, Lyu Y, Pan H, Zhang J, Stambolian D, et al. Deep learning enables accurate clustering with batch effect removal in single-cell RNA-seq analysis. Nat Commun. 2020;11: 2338. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 23.Kiselev VY, Yiu A, Hemberg M. scmap: projection of single-cell RNA-seq data across data sets. Nat Methods. 2018;15:359–62. [DOI] [PubMed] [Google Scholar]
  • 24.Ianevski A, Giri AK, Aittokallio T. Fully-automated and ultra-fast cell-type identification using specific marker combinations from single-cell transcriptomic data. Nat Commun. 2022;13:1246. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 25.Lotfollahi M, Naghipourfar M, Luecken MD, Khajavi M, Büttner M, Wagenstetter M, et al. Mapping single-cell data to reference atlases by transfer learning. Nat Biotechnol. 2022;40:121–30. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 26.Liu C, Huang H, Yang P. Multi-task learning from multimodal single-cell omics with Matilda. Nucleic Acids Res. 2023;51: e45. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 27.Theodoris CV, Xiao L, Chopra A, Chaffin MD, Al Sayed ZR, Hill MC, et al. Transfer learning enables predictions in network biology. Nature. 2023;618:616–24. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 28.Cui H, Wang C, Maan H, Pang K, Luo F, Wang B. scGPT: toward building a foundation model for single-cell multi-omics using generative AI. Nat Methods. 2024;21(8):1470–80. [DOI] [PubMed] [Google Scholar]
  • 29.Wang KYX, Pupo GM, Tembe V, Patrick E, Strbenac D, Schramm S-J, et al. Cross-platform omics prediction procedure: a statistical machine learning framework for wider implementation of precision medicine. NPJ Digit Med. 2022;5: 85. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 30.Zhou Y, Huo H, Hou Z, Bu L, Mao J, Wang Y, et al. Co-embedding of edges and nodes with deep graph convolutional neural networks. Sci Rep. 2023;13: 16966. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 31.Lin Y, Cao Y, Kim HJ, Salim A, Speed TP, Lin DM, et al. scClassify: sample size estimation and multiscale classification of cells using single and multiple reference. Mol Syst Biol. 2020;16: e9389. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 32.Gilmer J, Schoenholz SS, Riley PF, Vinyals O, Dahl GE. Neural Message Passing for Quantum Chemistry. In: Precup D, Teh YW, editors. Proceedings of the 34th International Conference on Machine Learning. PMLR; 2017. p. 1263–72.
  • 33.Yang K, Swanson K, Jin W, Coley C, Eiden P, Gao H, et al. Analyzing learned molecular representations for property prediction. J Chem Inf Model. 2019;59:3370–88. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 34.Dauparas J, Anishchenko I, Bennett N, Bai H, Ragotte RJ, Milles LF, et al. Robust deep learning-based protein sequence design using ProteinMPNN. Science. 2022;378:49–56. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 35.Liu C, Sun Y, Davis R, Cardona ST, Hu P. ABT-MPNN: an atom-bond transformer-based message-passing neural network for molecular property prediction. J Cheminform. 2023;15: 29. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 36.Hao M, Gong J, Zeng X, et al. Large-scale foundation model on single-cell transcriptomics. Nat Methods. 2024;21:1481–91. [DOI] [PubMed] [Google Scholar]
  • 37.Wang R, Yang X, Chen J, Zhang L, Griffiths JA, Cui G, et al. Time space and single-cell resolved tissue lineage trajectories and laterality of body plan at gastrulation. Nat Commun. 2023;14:5675. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 38.Du J, Jia P, Dai Y, Tao C, Zhao Z, Zhi D. Gene2vec: distributed representation of genes based on co-expression. BMC Genomics. 2019;20:82. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 39.Shi X, Cao W, Raschka S. Deep neural networks for rank-consistent ordinal regression based on conditional probabilities. Pattern Anal Appl. 2023;26:941–55. [Google Scholar]
  • 40.Vaserstein LN. Markov processes over denumerable products of spaces, describing large systems of automata. Problemy Peredachi Informatsii. 1969;5:64–72. [Google Scholar]
  • 41.Cuturi M. Sinkhorn distances: Lightspeed computation of optimal transport. Adv Neural Inf Process Syst. 2013;26:2292–2300.
  • 42.Frogner C, Mirzazadeh F, Solomon J. Learning Embeddings into Entropic Wasserstein Spaces. arXiv [cs.LG]. 2019. Available from: http://arxiv.org/abs/1905.03329. Accessed 13 Aug 2025.
  • 43.Patrini G, van den Berg R, Forré P, Carioni M, Bhargav S, Welling M, et al. Sinkhorn AutoEncoders. In: Adams RP, Gogate V, editors. Proceedings of The 35th Uncertainty in Artificial Intelligence Conference. PMLR; 2020. p. 733–43.
  • 44.Kullback S, Leibler RA. On information and sufficiency. Ann Math Stat. 1951;22:79–86. [Google Scholar]
  • 45.Zhao Y, Cai H, Zhang Z, Tang J, Li Y. Learning interpretable cellular and gene signature embeddings from single-cell transcriptomic data. Nat Commun. 2021;12: 5261. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 46.Kunes RZ, Walle T, Land M, Nawy T, Pe’er D. Supervised discovery of interpretable gene programs from single-cell data. Nat Biotechnol. 2024;42(7):1084–95. 10.1038/s41587-023-01940-3. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 47.Ding WZ, Yue C, Yang J. scClassify2. Github. https://github.com/SydneyBioX/scClassify2. 2025 Accessed 13 Aug 2025.
  • 48.Ding WZ, Yue C, Yang J. scClassify2. Zenodo 10.5281/zenodo.16416238. 2025 Accessed 13 Aug 2025.
  • 49.Marques S, Zeisel A, Codeluppi S, van Bruggen D, et al. Oligodendrocyte heterogeneity in the mouse juvenile and adult central nervous system. Science. 2016;352(6291):1326–9. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 50.Han X, Wang R, Zhou Y, Fei L, et al. Mapping the Mouse Cell Atlas by Microwell-Seq. Cell. 2018;172(5):1091–107. [DOI] [PubMed] [Google Scholar]
  • 51.Hochgerner H, Zeisel A, Lönnerberg P, Linnarsson S. Conserved properties of dentate gyrus neurogenesis across postnatal development revealed by single-cell RNA sequencing. Nat Neurosci. 2018;21(2):290–9. [DOI] [PubMed] [Google Scholar]
  • 52.Park J, Shrestha R, Qiu C, Kondo A, et al. Single-cell transcriptomics of the mouse kidney reveals potential cellular targets of kidney disease. Science. 2018;360(6390):758–63. [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

13059_2025_3722_MOESM1_ESM.docx (45.3KB, docx)

Additional file 1: Fig. S1. The comparison among several graph neural network architectures. The overall prediction accuracy of MPNN and graph transformer is approximately equal, outperforming GCN and GAT. However, the graph transformer consumes significantly more training time compared with MPNN.

13059_2025_3722_MOESM2_ESM.docx (273.4KB, docx)

Additional file 2: Fig. S2. The comprehensive hyperparameter search was conducted for scClassify2. Network hyperparameters of 12 aspects from 3 domains were involved to optimise its performance and robustness for real-world applications.

13059_2025_3722_MOESM3_ESM.docx (59.1KB, docx)

Additional file 3: Fig. S3. The stability of model performance with respect to changes in the size of the training set.

13059_2025_3722_MOESM4_ESM.docx (16.3KB, docx)

Additional file 4: Table S1. Details of eight scRNA-seq datasets of sequential cell state transformation. The columns #cells, #genes, #states denote the number of cells, the number of genes and the number of cell states respectively.

13059_2025_3722_MOESM5_ESM.docx (14.7KB, docx)

Additional file 5: Supplementary Methods.

Data Availability Statement

We used 8 public datasets in this study (Supplementary Table 1). The mouse gastrulation embryo dataset [48] was found at NCBI Gene Expression Omnibus (GEO: GSE171588). The T-cell development dataset [18] was found at GEO: GSE211602. The human embryo dataset [17] was found at EMBL’s European Bioinformatics Institute (EMBL-EBI: E-MTAB-3929). The mouse oligodendrocyte dataset [49] was found at GSE75330. The mouse bone marrow mesenchyme erythrocyte dataset [50] was found at GSE108097. The mouse dentate gyrus neurogenesis dataset [51] was found at GSE95753. The mouse kidney brush border dataset [50] was found at GSE108097. The mouse kidney collecting duct dataset [52] was found at GSE107585. Our codes and related instructions could be found at our GitHub [47] and Zenodo page [48].


Articles from Genome Biology are provided here courtesy of BMC

RESOURCES