GTM-decon: guided-topic modeling of single-cell transcriptomes enables sub-cell-type and disease-subtype deconvolution of bulk transcriptomes

Cell-type composition is an important indicator of health. We present Guided Topic Model for deconvolution (GTM-decon) to automatically infer cell-type-specific gene topic distributions from single-cell RNA-seq data for deconvolving bulk transcriptomes. GTM-decon performs competitively on deconvolving simulated and real bulk data compared with the state-of-the-art methods. Moreover, as demonstrated in deconvolving disease transcriptomes, GTM-decon can infer multiple cell-type-specific gene topic distributions per cell type, which captures sub-cell-type variations. GTM-decon can also use phenotype labels from single-cell or bulk data to infer phenotype-specific gene distributions. In a nested-guided design, GTM-decon identified cell-type-specific differentially expressed genes from bulk breast cancer transcriptomes. Supplementary Information The online version contains supplementary material available at 10.1186/s13059-023-03034-4.

identification of distinct cancer cell states.These are shown to occur across a range of cancer types and are implicated in tumor progression, with high cell-type heterogeneity associated with poor prognostic outcomes [8,9].However, challenges such as high cost, lower throughput, and difficulties in dissociation of cell types in solid samples make it hard to apply these experimental approaches at the patient population scale.
On the other hand, bulk RNA-seq has been the workhorse behind transcriptome research over the past decades.Its falling costs and ease of experimental setup make it an attractive tool to work with any organism [10].Several databases host tremendous amounts of bulk RNA-seq data such as Gene Expression Omnibus (GEO) [11,12], Genotype-Tissue Expression (GTEx) [13], and The Cancer Genome Atlas (TCGA), a repository of bulk RNA-seq data for more than 11,000 primary cancer samples [14].However, bulk RNA-seq data are mixture of gene expression profiles in the tissue.Computational approaches have been developed to deconvolve these bulk RNA-seq profiles into their constituent cell types in the form of cell-type proportions, since these are substantially cheaper and easier to obtain than conducting scRNA-seq experiments.Moreover, deconvolving the bulk data into constituent cell-type components can not only yield the cell-type proportions facilitating clinical investigation but also enable high-resolution differential analysis of gene expression.Studying the differentially expressed genes at the cell-type or cell-state level can help uncover gene regulatory programs that drive different tissue states.Many deconvolution methods were developed to this end.
Most of the deconvolution approaches require a set of gene markers for each cell type of interest.These marker genes are derived from expert knowledge or differential expression analysis of purified samples of specific cell types.Early methods that leverage these marker genes could achieve good performance in deconvolving mixtures with highly distinct cell types such as blood [15].CIBERSORT improved on these approaches by incorporating a feature selection step, where genes are adaptively selected from the signature matrix based on the input bulk RNA-seq data [16].It uses a linear support vector regression (SVR) to delineate closely related cell types such as leukocytes.BSEQ-sc combined with CIBERSORT was an early method that used scRNA-seq data as a reference for bulk deconvolution [17].CIBERSORTx also uses scRNA-seq as reference profiles, along with improved normalization schemes to suppress cross-platform variation, and an adaptive noise filter to eliminate unreliably estimated genes [18].MuSiC adopts a weighted non-negative least-squares regression approach and addresses the issue of cross-subject heterogeneity as well as within-cell-type variation of gene expression [19].EPIC accommodates user-defined reference profiles to account for the presence of uncharacterized cell types in the target bulk samples [20].Bisque learns gene-specific transformations of the bulk data based on the single-cell reference profiles and the corresponding cell proportions to account for their differences [21].BayesPrism uses Bayesian inference to model scRNA-seq data jointly with bulk RNA-seq data to infer cell-type composition and their proportions [22].The joint modeling overcomes biases that may arise due to technical and biological differences.Beyond cell-type deconvolution, some recently developed methods can estimate CTS gene expression from the bulk samples [23,24].However, these methods rely on an external cell-type deconvolution method like those aforementioned ones and do not utilize or model the distribution of the scRNA-seq reference data to properly express statistical uncertainty while leveraging their information richness.
In this study, we present a guided topic model for cell-type deconvolution (GTMdecon).As an overview of our analysis, we first benchmark GTM-decon on deconvolving simulated and real bulk data in comparison with the state-of-the-art deconvolution methods.We then train GTM-decon on pancreatic and breast scRNA-seq datasets to deconvolve bulk RNA-seq datasets from pancreatic and breast tissues, respectively.When applied to deconvolving cancer bulk transcriptomes, GTM-decon successfully identifies the cell type of origin for pancreatic and breast cancer datasets.Interestingly, the results for human pancreatic cancer are recapitulated using the CTS topics inferred from the mouse pancreas scRNA-seq data, postulating cross-species deconvolution as an option where it is difficult to obtain scRNA-seq data due to technical or ethical challenges.Furthermore, our GTM framework also enables the inference of phenotype-specific topic distributions from bulk RNA-seq data by using the phenotypes (e.g., breast cancer subtypes) from single cell or bulk RNA-seq data as a guide for the topic inference.We leverage this capability to distinguish basal from estrogen receptor (ER) positive (ER +) breast tumor samples, not only achieving high classification accuracy but also identifying the genes and pathways that segregate the cancer subtypes.By fine-tuning the inferred CTS topic distributions guided by the breast cancer subtypes, we deconvolve the average differential gene expression into CTS expression changes, thereby enabling discovery of the subtype-specific aberrance of the gene regulatory programs.

GTM-decon model overview
In GTM-decon, we have made three methodological contributions.As our first and the main contribution, GTM-decon is a marker-free method and automatically infers the contribution of each gene for each cell type in the form of CTS categorical distributions, which we define as "topics" [25], without using marker gene information.Each CTS topic distribution is related to the transcriptional rate of each gene for each cell type.For instance, B cells have higher transcription rate for CD19 compared to alpha cells, which have relatively high rate for FXYD5.Conceptually, we consider genes as vocabulary and cells as documents whose word tokens (i.e., scRNA-seq reads) are sampled from the vocabulary with the CTS topic probabilities.We incorporate the observed cell-type labels for each cell in the form of topic prior to guide the inference of CTS topic mixture, which reflects the uncertainty of the noisy cell-type label.Specifically, the cell-type mixture for cell m follows a K-dimensional asymmetric Dirichlet distribution, θ m ∼ Dir(α m + 0.1) , with the hyperparameter α m,k set to a relatively high value (i.e., 0.9 by default) given the cell-type label y m = k ; the rest of the K-1 α m,k′ values, where y m = k′ , are set to a relatively low values (i.e., randomly sampled from a range between 0.1 and 0.01).As a result, each topic is automatically identified with exactly one cell type.This differs from the standard topic model, where topics are not directly associated with any known concept and require post hoc manual inspection based on their top scoring words to interpret them.Given the CTS gene distributions, we can infer the CTS topic mixtures from the bulk transcriptomes, which are the desired cell-type mixing proportion in the context of deconvolution (Fig. 1a).In brief, GTM-decon infers CTS topics from scRNA-seq data by using a guided topic modeling approach utilizing cell-type labels from the reference.High prior values are assigned to the topic corresponding to the cell type, and lower prior values are assigned to the other topics, enabling it to learn a genes-by-CTS topics matrix, with each topic anchored to a specific cell type.This matrix is used to infer cell-type proportions in bulk RNA-seq data using standard topic modeling, capturing variations in cell type proportions between healthy and diseased tissue.The probabilistic graphical model (PGM) diagram depicts the data generative process assumed by the proposed guided topic model.Suppose there are K cell types in the scRNA-seq data.For each cell indexed by m ∈ {1, . . ., M} , we use K-dimensional Dirichlet-distributed cell-type topic mixture θ m ∼ Dir(α m ) to represent the statistical uncertainty of the noisy cell-type label y m ∈ {1, . . ., K } .Specifically, we clamp the Dirichlet hyperparameter α m,ym of the Dirichlet variable to a relatively high value while setting the rest of the values of α m,k′ ( y m = k′ ) to relatively low values (i.e., 0.9 and [0.01, 0.1], respectively in the cartoon illustration of M = 8 cells and K = 3 cell types).The non-zero prior values for the K -1 unobserved cell types allow the cell-type mixture variable θ m to have non-zero density over those cell types as dictated by the scRNA-seq data likelihood and therefore account for potentially mislabeled cell types.Suppose there are in total N m reads in cell m .Each scRNA-seq read i ∈ {1, . . ., N m } is assumed to be originated from one of the K CTS topics with the categorical rates fixed to the cell-type mixture, i.e., z i,m ∼ Cat(θ m ) .Given cell-type topic assignment z i,m ∈ {1, . . ., K } , the ith read is then mapped to one of the G genes as indexed by x i,m with categorical rates set to be φ zi,m , which itself is a G-dimensional Dirichlet variable of flat hyperparameter β , i.e., x i,m ∼ Cat(φ zi,m ) .To infer the latent variables, namely cell-type mixture proportion θ m ∼ Dir(α) , CTS topic assignments for each read z i,m , and CTS topic distributions , we employ an efficient collapsed variational Bayes algorithm as detailed in the "Methods" section.The genes-by-CTS-topic matrix estimated from the scRNA-seq reference then serves as a template when it comes to infer the cell-type mixing proportions θ j of a bulk RNA-seq sample j using essentially the same inference algorithm as in the scRNA-seq data modeling except for having a flat hyperparameter for the prior (e.g., α k = 1∀k by default) while fixing and only inferring the expected total reads allocated for each CTS topics (i.e., E q [n .,j,k] = E q [ i [z i,j = k] ]).b Phenotype-guided modeling of bulk RNA-seq data.GTM-decon can also use phenotype labels as a guide for topic inference to model sparsified bulk transcriptomes in a disease study.In this design, instead of having each row as a cell and each column as a cell type, each row corresponds to a bulk sample and each column to a phenotype class.For each subject j, we set the topic hyperparameter α j,yj based on the noisy phenotype label y j of the subject.The inference algorithm is the same as in modeling the scRNA-seq reference data.Given a test subject j′ , the inferred topic mixture θ j′ represents the phenotypic probabilities of the subject.c Nested-guided topic model for detecting cell-type-specific differentially expressed genes between phenotypes.In this nested design, we treat the phenotype as level 1 and the cell types as level 2. The pretrained genes-by-CTS-topic distribution learned from panel a are used to initialize the topic distributions for each phenotype in a sparsified bulk transcriptome disease study.As illustrated in the cartoon, for example, for 2 phenotypes and 3 cell types, there are 6 topics.GTM-decon then fine-tunes the combined cell-type-specific topic distribution by running the same algorithm described in panel b.The resulting topic distributions reflect the phenotypic influences on CTS gene distributions, which are the statistics for conducting differential expression analysis in a case-control study design As our second contribution, we extend GTM-decon to infer multiple topics per cell type.The rationale is that cells of the same cell type can manifest in different cell states due to the changes of environments or stimuli.As a result, these cells may exhibit expression patterns that are different from the canonical CTS expression pattern.While there are sophisticated hierarchical topic models involving Dirichlet Processes [26], we took a simple and elegant design.Specifically, we extend the basic GTM-decon model to infer sub-cell-type topics by dedicating multiple topics per cell type (Additional file 1: Fig. S1).As our third contribution, we extend GTM-decon to infer phenotype-specific (PTS) topic distributions using the phenotype label (e.g., cancer subtypes or cancer stages) available in the single-cell or bulk transcriptome data as a guide to detect PTS gene expression (Fig. 1b).We then further extend it to a nested-guided topic model to conduct CTS differential expression analysis in the single-cell or bulk patient cohort data (Fig. 1c).To that end, we use the phenotype labels as the level-1 guide and the celltype labels as the level 2 guide.Through the same guided topic mechanism, GTM-decon updates the CTS topic distributions under each phenotype by fitting the data likelihood of the transcriptomes from either the single-cell or bulk data.The algorithmic details for the 3 contributions were described in "Methods."

Experimentation of data preprocessing and GTM-decon model configurations
We experimented gene selection, data normalization, hyperparameter settings, and number of topics per cell type.We find that GTM-decon works the best with raw read count data using all genes (Additional file 1: Figs.S2 and S3), and it is fairly robust to different hyperparameter values for the topic mixture prior (Figs.S4-S6) and the CTS topic prior values (Fig. S7).In general, GTM-decon confers better deconvolution performance using multiple topics per cell type than the baseline GTM-decon with one topic per cell type (Fig. S8).Please refer to Additional file 1 Section S1-S5 for more details.

Evaluation of deconvolution of simulated bulk from scRNA-seq data
To quantitatively benchmark GTM-decon, we compared it against five existing deconvolution methods, namely Bisque [21], Bseq-sc [17], CIBERSORTx [18], MuSiC [19], and BayesPrism [22] on artificially simulated bulk RNA-seq datasets from the scRNA-seq data (Additional file 1: Table S1).To simulate bulk data, three human scRNA-seq datasets (Pancreas-E-MTAB-5061, Breast Tissue with GEO accession number GSE113197, and Rheumatoid Arthritis (RA) Synovium-SDY998), generated using different technologies (Smart-seq2, 10 × Genomics Chromium, CEL-Seq2) were used.The artificial bulk data for each individual was constructed by summing up the counts for each gene from all cells in that individual [19].This allowed us to use the cell-type proportions from the single-cell data as the ground-truth proportions.Artificially constructed bulk data from scRNA-seq data appear to be a good surrogate of the real bulk data, as observed from the excellent correlation of the log-transformed artificial counts with the log-transformed counts from real bulk data for each gene (Additional file 1: Fig. S9).We performed leaveone-out cross-validation (LOOCV), to avoid any leakage from training data, and used the single-cell RNA-seq of the left-out individual to simulate the bulk RNA-seq (i.e., the total read counts of each gene for that sample) as the validation data and its cell-type proportions as the ground-truth mixing proportions.GTM-decon performs better than other models on the Pancreas and Breast Tissue datasets in terms of both Spearman Rank-based correlation (Spearman R) and Cross Entropy and conferred comparable performance on the RA Synovium dataset (Additional file 1: Fig. S10).Notably, GTM-decon achieves smaller variance for both the pancreatic and breast tissue datasets.We further ascertained the qualities of the predicted cell-type proportions of each method against the ground-truth cell-type proportions (Fig. S10a) and observed that GTM-decon recapitulates cell-type proportions well for pancreatic (Fig. S10b), breast tissues (Fig. S10c), and RA synovium dataset (Fig. S10d).

Evaluation of deconvolution of real bulk with ground-truth cell-type proportions
We also benchmarked GTM-decon on 5 real bulk RNA-seq data with known groundtruth cell-type proportions from 3 different tissue types (Additional file 1: Table S1 and S2; "Methods").We evaluated deconvolution performance using Spearman R and Root Mean Square Error (RMSE), by comparing the inferred proportions for the matching cell types against the ground-truth proportions for each sample.GTMdecon conferred on-par or superior performance compared to the existing methods for all the datasets (Fig. 2a left).In particular, GTM-ALL performed the best for deconvolving PBMC-1 and PBMC-2.For deconvolving whole blood (WB), GTM-HVG performed the best in terms of both metrics and MuSiC is a close second.While deconvolving bulk RNA-seq from the prefrontal brain region from ROSMAP dataset, all methods except Bseq-sc and GTM-HVG performed reasonably well.It is possible that the HVG are the genes having high variance within the cell types, which caused the poor performance of GTM-HVG on this dataset.For the pancreatic dataset with the paired single-cell and bulk RNA-seq data collected from the same individuals, GTM-HVG performs the best with GTM-PP as the runner-up in terms of Spearman (See figure on next page.)Fig. 2 Evaluation of deconvolution performance on real bulk data.a Evaluation of sample deconvolution.We evaluated the deconvolution performance of GTM-decon using all genes (GTM-ALL), preprocessed genes (GTM-PP), and highly variable genes (GTM-HVG) with five SOTA methods-CIBERSORTx, MUSIC, BSEQ-sc, BISQUE, BayesPrism.The 3 immune bulk data and the brain data were deconvolved using independent references of a similar tissue, while the pancreas bulk data is deconvolved using single-cell reference from the same individuals in a leave-one-out cross-validation (LOOCV) manner.The bulk labeled PBMC-1 corresponds to SDY67 dataset, PBMC-2 corresponds to S13 cohort, whole blood to whole blood dataset, and prefrontal cortex to ROSMAP dataset (Additional file 1: Table S2).For each test bulk sample, Spearman correlation and root mean square error (RMSE) were computed between its ground truth and predicted cell-type proportions by each method.The box and whiskers in each boxplot indicate the 25-75% quartile and min-max of the evaluation scores over all samples in a dataset, respectively.The boxplot on the left displays the evaluation across cell types per sample, and the boxplot on the right displays the evaluation across samples per cell type.b Heatmaps comparing the cell-type-specific deconvolution performance of GTM-decon against existing methods on 5 different real bulk datasets with known ground truth mixing proportions.The cell types are ordered from most to least prevalent in the bulk data (green barplots in first row indicate average proportion for each cell type in the bulk data).The middle row shows the Pearson correlation coefficient between the predicted and known cell-type proportions.The lower row shows the inverse RMSE (higher is better, scaled between 0 and 1), per cell type per dataset.The barplots on the right show the average performance over all cell types for each method.For each cell type, Pearson correlation and RMSE were computed between its ground truth and predicted cell-type proportion for each dataset by each method.c Cell-type prediction accuracy of the purified immune bulk RNA-seq samples.The two panels indicate the use of different independent immune references, for the deconvolution of two purified bulk immune datasets (Accession Numbers: GSE107011, GSE64655).For each purified bulk sample, the cell type corresponding to the highest inferred cell-type proportion by each method was used as the predicted cell type.The barplots show the prediction accuracy as the percentage of the correctly predicted samples R, and RMSE are similar among all methods except MuSiC with notably higher error.In summary, GTM-ALL performed the best in 3 datasets; GTM-HVG performed the best in the other two datasets, where the CTS gene expression might exhibit more distinct inter-cell-type variability.Furthermore, we also evaluated the deconvolution performance for separate cell types in terms of the correlation between ground-truth proportions and predicted proportions for each cell type across samples.Overall, GTM-decon conferred competitive performance with the runner-up method being BayesPrism (Fig. 2a right and b; Additional File 1: Figs.S11-S15).Therefore, the results suggest the general effectiveness of topic modeling in cell-type deconvolution and the additional benefits conferred by GTM-decon due to its algorithmic innovations.
Additionally, we evaluated the deconvolution accuracy for purified bulk RNA-seq data of immune cells (GEO accession numbers: GSE107011 and GSE64655; Table S2) using two different independent references (HBC and PBMC2; Table S1).Overlapping cell types were used to evaluate the performance on the purified bulk samples, whereby the highest deconvolution proportion was used as the predicted cell-type label for computing the prediction accuracy.GTM-HVG achieved the highest accuracy across all four experiments (Fig. 2c).Moreover, since some cell types present in the bulk are missing in the scRNA-seq reference, a robust model should either find the closest-matched cell types or properly express statistical uncertainty in this situation.To this end, we examined the inferred cell proportions of the purified bulk for those missing cell types.Plasmablast samples are present among the purified PBMC samples (GSE107011) but absent in the HBC reference (Additional file 1: Fig. S16a).GTM-decon assigned Plasmablast samples with high cell-type proportions for B-cell, a cell type that shares Plasmablast cell lineage.The inferred cell-type proportions for Basophils purified samples were split between HSPCs (immune progenitor cells) and neutrophils, which is also classified as granulocyte.Granulocytes are the most common white blood cells, consisting of 3 specific cell types-neutrophils, eosinophils, and basophils.Using PBMC2 as a reference to deconvolve the same purified bulk immune samples led to similar deconvolution patterns for the missing cell types of plasmablast and basophils (Additional file 1: Fig. S16b).Interestingly, neutrophils were absent in the PMBC2 reference and inferred to be monocytes, which are related to the granulocyte family-a class of immune cells that include basophils, eosinophils, and neutrophils [27].Another missing cell type HSPC (hematopoietic stem and progenitor cells) have their signal spread across all the cell types.These results suggest that when some cell types are missing in the reference, GTM-decon either finds the closest match or appropriately expresses uncertainty.
Finally, we performed benchmarking on the time and memory usage of our GTMdecon software.GTM-decon scales linearly with both the number of topics per cell type and the number of cells (Additional file 1: Section S6; Fig. S17), which is what we expected since its time and space complexity are both O(N × G × K ) for N cells, G genes, and K topics.For large number of cells, we can also perform stochastic variational inference [28] to rapidly update model parameters based on mini-batches of cells with much lower memory overhead.It also compares favorably with BISQUE, BSEQ-sc, and MuSiC in terms of running time and memory usage.

GTM-decon automatically learns CTS gene signatures from scRNA-seq reference
We evaluated the performance of GTM-decon in recapitulating cell-type-specific information as well as deconvolution using pancreatic tissue as a reference.The pancreas consists of several cell types including exocrine and endocrine.While the former aids digestion by secreting several enzymes, the latter regulates glucose uptake and processing by secreting hormones.With a vast literature documenting the biological roles of several cell types and their behavior in healthy and diseased conditions, such as diabetes and cancer, the pancreatic tissue serves as a good benchmark to assess GTMdecon.We trained GTM-decon on an scRNA-seq reference dataset of pancreatic tissue from Segerstolpe et al. [29], consisting of 2209 cells, corresponding to 14 cell types from 10 individuals.GTM-decon captured distinct sets of CTS gene signatures, as shown by the gene-by-topic probability distributions (i.e., the matrix φ ) for the top 20 genes in each topic (Fig. 3a).Indeed, each topic recovers a large number of marker genes for the corresponding cell types based on two databases, namely CellMarker database [30], a manually curated resource of cell markers in human and mouse and the PanglaoDB Fig. 3 Cell-type-specific topic inference and deconvolution of pancreatic tissue.a Gene signatures of cell-type-specific topics in pancreas.We trained GTM-decon on the PI-Segerstolpe scRNA-seq dataset of pancreas tissue.We used 5 topics per cell type, allowing sub-cell-type inference.For the inferred genes-by-cell-type matrix , we took the top 20 genes under each topic and visualized their topic distributions in heatmap.Whenever available from CellMarkerDB and PanglaoDB, cell-type marker genes are indicated on the left.For the cell types where marker genes are not available, "NA" were indicated on the left.The number of statistically significantly different genes in each cell type based on their topic scores (p-value < 0.05; permutation test) is shown below.b Gene set enrichment analysis (GSEA) of inferred topics based on known marker genes.Cell-type-specific topics for acinar, alpha, and beta were evaluated based on whether the top genes are enriched for the known marker genes under that cell type.[31], a database of marker genes generated from scRNA-seq datasets (Fig. 3a).We further ascertained the cell-type coherence of each topic by Gene Set Enrichment Analysis (GSEA), while using the probabilities learnt for each cell type against the CellMarkerDB.For the three cell types with abundant marker genes-acinar, alpha, and beta, each of the 5 topics recovers the exact cell type as the top-most hit in the analysis, with the adjusted p-value ≤ 1 × 10 −15 (permutation test) in most cases (Fig. 3b).Furthermore, the enrichment of known marker genes for the main cell types suggested that GTM-decon with 5 topics per cell type best captures the cell-type-specific signatures (Additional file 1: Fig. S18).We also evaluated the effect of different number of cells per cell type.As expected, the topic confidence scores as measured by the average probabilities over the CTS gene distributions increase with the increasing number of cells for that cell type (i.e., evidence) (Additional file 1: Fig. S19).

GTM-decon delineates the variations of cell-type proportions in pancreatic tissues of healthy and T2D subjects
Based on the inferred CTS topic distributions φ , we used GTM-decon with 5 top- ics per cell type to infer the cell-type proportions of bulk RNA-seq data from a cohort of 89 human pancreatic islet donors with and without type 2 diabetes (GEO accession number: GSE50244) [32] (Fig. 3c).The dataset consists of 51 individuals with normal glucose tolerance (N), 15 with impaired glucose tolerance (IGT) and 12 with type 2 diabetes (T2D); it also has a good segregation of males (N 1 = 54) and females (N 2 = 35).As expected, the inferred proportions of most types of cells for these two sets of individuals are similar since they came from the same tissue.However, GTM-decon predicted a significant reduction in beta cells in T2D individuals (Pearson correlation coefficient (PCC) with HbA1c = − 0.4, p-value = 0.00031; t-distribution with n-2 degrees of freedom) (Fig. 3d).IGT and T2D individuals exhibit low Beta cell-type proportions (Fig. 3d), which was supported by the literature [1,2].The increase in ductal cells is possibly caused by their regulation of glucose uptake (Fig. 3d).These results are consistent when using a different pancreatic dataset as reference (i.e., the PI-Baron reference dataset, generated via Drop-seq instead of PI-Segerstolpe, generated via Smart-seq) (Fig. 3e, f ).

Deconvolving human pancreatic data from mouse pancreas scRNA-seq reference
For cases where scRNA-seq data were not available for the organism of interest, due to either ethical, technical, or financial challenges, there is a need to leverage scRNAseq collected from a model organism.To this end, we investigated the possibility of deconvolving bulk RNA-seq data by training GTM-decon on a mouse scRNA-seq data.We separately trained two GTM-decon models on the human and mouse pancreatic datasets.Specifically, the human datasets include the Segerstolpe and Baron datasets (Additional file 1: Table S1), which consist of 2209 cells from 10 individuals and 8569 cells from 4 individuals, respectively; the mouse dataset consists of 1886 cells collected from 2 mice.For comparative analysis, we focused on only the common set of highconfidence orthologous genes between the two species mapped by the Ensembl database [33].We visualized the cell-type proportions comparing against the ground-truth values (Additional file 1: Fig. S20a).As expected, the cell-type proportions deconvolved using the two human datasets accurately recapitulate the ground-truth proportions (median PCC of 0.94 and 0.97).Interestingly, GTM-decon trained on the non-reference human dataset performed better than the one trained on the reference-matched dataset, which was probably due to the tenfold higher number of cells in the former scRNA-seq dataset.Moreover, GTM-decon trained on the mouse reference dataset also performed quite well in terms of the concordant proportions of the shared cell types (PCC of 0.94).

Deconvolving pancreatic cancer transcriptomes identified tumor cell-type origin
We next turned to deconvolving pancreatic adenocarcinoma (PAAD) (also known as pancreatic ductal adenocarcinoma or PDAC) tumor bulk samples from TCGA.For this application, we also used GTM-decon with 5 topics per cell type.Since the tumor microenvironment is known to be infiltrated with immune cells [34,35], we sought to train GTM-decon on a single-cell reference dataset derived from individuals with pancreatic cancer, in order to capture the cell types of both the tissue of interest and the immune cells in its tumor microenvironment.To this end, we trained GTM-decon on an scRNAseq dataset comprised of the transcriptomic profiles of about 57,000 cells from 24 primary PAAD tumors and 11 healthy control pancreas samples [36] in order to deconvolve the 174 bulk RNA-seq profiles from the TCGA-PAAD tumor samples.Additionally, we also sought to identify possible novel cell types or pathways present in the bulk RNAseq, which are not represented in the reference profiles.This is achieved by running an unguided topic model (i.e., a standard LDA) on the sparsified bulk RNA-seq data to detect de novo bulk RNA-seq (bulkRS) topics ("Methods").We empirically chose the number of de novo bulkRS topics based on how well they could explain the variation observed in the clinical phenotypes.
We observe that the most prevalent cell types are 4 main pancreatic cell types, namely ductal (type 2), acinar, endocrine (alpha and beta cell types), and fibroblasts (Fig. 4a).Notably, the cell type of tumor origin is correctly predicted for the samples: Ductal cells have the highest proportion among the PAAD samples (Fig. 4b; brown rectangle), and acinar for a subset of the PAAD samples (Fig. 4b; blue rectangle).This recapitulates the literature remarkably well, as ductal cells are known to be the site of the tumor origin for most cases of PAAD; however, a subset arises from acinar cells [37].More significantly, an unknown subtype is predicted to originate from endocrine cells (Fig. 4b; green rectangle).This is supported by the recent literature, which reported these samples as the derivatives of the pancreatic neuroendocrine tumor (PNET) were in fact misclassified as PAAD [38].PNET are supposed to originate from alpha or beta cells (endocrine cells) [39].In addition, most of the samples are predicted to have a high proportion of fibroblasts, which are known to be prevalent in pancreatic cancer (Fig. 4b; blue dot) [40][41][42].Interestingly, deconvolving the pancreatic cancer PAAD dataset using mouse reference dataset also conferred high-quality patient clustering comparable to that of human dataset (Additional file 1: Fig. S20b).Notably, the PAAD "other subtype" was predicted to originate from alpha cells (an endocrine cell), which mirrors the results from human reference data (Fig. S20b; shown in blue rectangles).
Interestingly, the de novo bulkRS topics cluster with the most abundant reference topics inferred from the scRNA-seq reference data (Fig. 4b, blue circles).For example, bulkRS Topic 2 corresponds to the CTS topic for acinar cell type, Topic 10 to the CTS topic for endocrine cell type, Topic 9 to Ductal_type_2, Topic 8 to Fibroblast, and Topic 6 to stellate cells.However, there are a few de novo bulkRS topics, such as bulkRS Topic 1, Topic 4, and Topic 5, capturing distinct distributions for specific subsets of samples (Fig. 4b; red dots).These topics could correspond to either novel cell types or gene pathways in the bulk but not implicated in the scRNA-seq reference.
We next estimated whether variation in cell-type proportions or bulkRS topics is indicative of survival time.To this end, we performed Cox Regression to regress the number of days patients lived since their cancer diagnosis on their inferred cell-type proportions as well as the de novo bulkRS topics.Overall, the Cox Regression model is statistically significant compared to the bias term (adjusted p-value = 9 × 10 −5 based on likelihood ratio test).To explore the marginal effect of individual cell-type To complement the inferred proportions of known cell types, we also ran unguided topic model (i.e., LDA) on the TCGA-PAAD bulk RNA-seq profiles directly to detect de novo topics that are not present in scRNA-seq reference.The heatmap visualizes the combined deconvolution results based on the 10 pancreatic cell types, and 10 de novo topics (i.e., columns).Each of the 174 rows represents a subject.Three types of demographic or clinical phenotypes were shown in the legend to aid result interpretation.These include "days to death, " cancer subtype, and whether the cancer type is PNET or not.The regions in the highlighted boxes were discussed in more details in the main text.c Survival analysis of the CTS and de novo topics using inferred cell-type proportions.The 174 subjects were divided into two groups based on K*-means clustering with K* set to 2 (not to be confused with the K cell types or topics).Kaplan-Meier curves were generated for these groups and compared using log-rank test.The plot shows the − log 10 (p-value) from the log-rank test for all the CTS and de novo topics, in decreasing order of significance.d Kaplan-Meier curve for endocrine cell-type proportion.The curve and shaded area represent the mean and standard deviation of the cell-type proportions in the two groups, respectively.The number of subjects for each cluster was indicated in the bottom panel proportions on survival, we performed Kaplan-Meier analysis by separating patients into two groups based on K-means clustering (Fig. 4c).We observe that among the cell types, endocrine cell type exhibits a significant hazard ratio, predicting a good survival outcome (Fig. 4d; p-value = 0.0091; log-rank test), which is supported by the literature as PNETs are mostly benign [43].However, ductal cell type 2 is associated with poor survival outcome, which is expected as pancreatic adeno carcinoma are aggressive (p-value = 0.03; log-rank test).On the other hand, Topic 1 and Topic 5 indicate poorer survival, with hazard ratios of 4 and 40 respectively (Additional file 1: Fig. S21) although their roles are unclear since they do not cluster with any of the CTS topics (Fig. 4b).This reiterates the usefulness of using CTS topics in conjunction with de novo bulkRS topics to enable their interpretation wherever possible.
A similar analysis conducted using a separate scRNA-seq reference from healthy pancreatic subjects only reveals similar results (Additional file 1: Fig. S22).However, in this analysis, only two of the de novo bulkRS topics clearly correspond to CTS topics (acinar and ductal), suggesting that the usage of an appropriate scRNA-seq reference with matched tumor environment is preferred.

Deconvolving breast cancer transcriptomes revealed subtype-specific markers
To capture specific subtypes of breast tumor samples from the TCGA data, we trained GTM-decon on an scRNA-seq reference data from 26 primary tumors of breast cancer (BRCA) patients with three major clinical subtypes of BRCA, including 11 ER + , 5 HER2 + and 10 TNBC [44].The data consists of about 1 million cells and covers 7 major cell types and 29 minor cell types.This served as a high-resolution reference for annotating the TCGA-BRCA tumor samples (n = 1212) based on the major subtypes from the scRNA-seq dataset, namely Cancer-Basal, Cancer-Her2, Cancer-LumA, and Cancer-LumB (Additional file 1: Fig. S23a).As expected, significantly higher proportions of endothelial and myoepithelial cell types are found in the normal-like samples, in comparison to the cancer subtypes (Fig. S23a).Furthermore, basal subtype is enriched for cancer-basal cells (Fig. S23b, shown in dotted brown rectangle), and the cancer-associated fibroblasts (CAFs) are enriched in almost all the samples (Fig. S23b, shown in blue rectangles).Similar to the above analyses, some of the de novo bulkRS topics from sparsified samples overlap with the most represented cell types.For example, Topic 6 resembles myofibroblast-like cancer-associated fibroblasts (myCAF-like), and Topic 8 resembles LumA subtype cancer cells.
Deconvolution using the scRNA-seq reference from the healthy individuals also captures the cell type of origin for the different breast cancer subtypes implicated in the bulk samples (Additional file 1: Fig. S24).For this analysis, using highly variable genes is more discriminatory than all genes (Additional file 1: Fig. S25).The inferred CTS topic distributions from normal breast tissue recapitulate several marker genes from CellmarkerDB and PanglaoDB (Fig. S24a).Furthermore, GTM-decon-inferred cell-type proportions clearly distinguish TCGA breast tumor samples from GTEx normal breast tissues (Fig. S24b).Moreover, the basal cell type is predicted to have the highest proportion in the basal subtype defined by the PAM50 classification in comparison to other subtypes (Fig. S24c) [45].Also, we observed higher predicted proportion for Luminal_2 cell type in both LumA and LumB subtypes as expected [46] (Fig. S24c).Among the de novo bulkRS topics from sparsified samples, Topic 5 is highly enriched in LumB, while Topic 7 and Topic 8 are enriched in basal and LumA subtypes (Fig. S24c).The guided topic score for the basal subtype also correlates with higher proliferation score as expected [45].Specifically, the basal cell type is enriched in this subtype (Fig. S24d; enclosed in green rectangle), whereas Luminal_2 is depleted (Fig. S24d; enclosed in green dashed rectangle).In contrast, ER + samples appear to be enriched for Luminal_2 cells (Wilcoxon test p-value = 4.5e − 10; Fig. S26), as expected [46,47].Furthermore, Topic 7 clearly captures the basal subtype (enclosed in brown rectangle in Fig. S24d), whereas there is no clear topic capturing the ER + phenotype.

GTM-decon learns phenotype-guided gene topics specific to BRCA subtypes
Our guided topic mechanism is not limited to inferring CTS topics, but can be extended to inferring phenotype-specific topics (i.e., topics capturing phenotype-specific gene expression) (Fig. 1b), thereby discovering gene signatures of subtypes or different cancer stages.We applied this approach to study the differences between basal and ER + BRCA subtypes (Fig. 5a-c) and the difference between ductal carcinoma and lobular carcinoma Fig. 5 Phenotype-guided topic modeling of bulk RNA-seq data of breast cancer.a Predicted top genes for the phenotype-guided topics for basal and ER + breast cancer subtypes.GTM-decon was trained on the sparsified TCGA-BRCA bulk RNA-seq data with the basal and ER + cancer subtypes as the guide.Five topics were used per subtype and therefore 10 topics in total.The heatmap illustrates the topic probabilities of the top 20 genes from each topic.As a comparison, the genes were also labeled as up-or downregulated if they were deemed differentially expressed by the DESeq2 analysis.b Classification of basal and ER + subtypes based on phenotype-guided topic scores.The 5 topics for the same subtype were summed to obtain the overall score for basal and ER + subtype.Subjects in the rows were sorted by their basal topic scores.c GSEA analysis of the basal and ER + subtype topics.Significantly enriched MSigDb HALLMARK pathways were identified for each topic and displayed as barplots.The heights of the bar indicate the − log10 adjusted p-values and the colors indicate enriched pathways.d Predicted top genes for the phenotype-guided topics for histological subtypes.Same as in panel a but for ductal and lobular subtypes.e Classification of histological subtypes.Same as in panel b but for ductal and lobular subtypes.f Evaluation of the subtype classification accuracy on the test breast tumor samples.We trained the phenotype-guided GTM-decon separately on 80% of the sparsified TCGA-BRCA tumor samples using basal/ER + and histological types as the guides and evaluated its phenotype prediction accuracy on the 20% held sparsified samples.As a comparison, we also trained and evaluated logistic regression and random forest on the same training and test split, respectively.The classification accuracy on the test set by each method were displayed in the barplots (Fig. 5d-f ).We modeled each phenotype using 5 topics each, based on a sparsified matrix of bulk RNA-seq data ("Methods"), resulting in a genes-by-phenotypes matrix φ with 5 topics per phenotype (Fig. 5a).We then ranked genes by the topic scores under each topic.Almost all the genes identified by our approach were also deemed as differentially expressed (DE) genes by DESeq2 differential analysis [48] (Fig. 5a).GSEA of the topics shows differences between the basal and ER + phenotypes, although there is not much difference among the 5 topics for basal (Fig. 5c).Moreover, the trained GTMdecon confers accurate phenotype classification with 97% accuracy for discriminating basal and ER + (Fig. 5b) and 82% for discriminating ductal and lobular subtypes (Fig. 5d), which is comparable to the traditional supervised learning methods namely logistic regression and random forest (Fig. 5f ).We also evaluated phenotype classification accuracy as a function of sparsification rate (described in Additional file 1 Section S7 and illustrated in Additional file 1: Fig. S27) suggesting the importance of sparsification for inferring topics from bulk RNA-seq data using GTM-decon.We also trained GTMdecon only on the highly variable genes in the unsparsified bulk RNA-seq samples.This results in lower classification accuracy (76% for ductal-lobular samples as compared to 82%, and 95% for basal-ER + samples as compared to 97%), which might be due to information loss (HVG = 1391 for basal-ER + samples, HVG = 445 for ductal-lobular samples).Training using DE genes between the two phenotypes identified by DESeq2 also results in lower classification accuracy of 83% and 75%, respectively.These experiments suggest that GTM-decon can utilize more informative genes to discriminate the breast cancer subtypes than the traditional differential analysis approach.

Nested-guided topic modeling identifies CTS DE genes in breast cancer subtypes
scRNA-seq can facilitate molecular understanding of genes and pathways in specific cell types with respect to phenotypic states.This level of detail is absent in bulk RNAseq data, which profiles only the averaged gene expression from all cell types in the tissue.However, due to the cost, scRNA-seq profiles at the patient cohort size are rare.To take advantage of both types of data, we sought a way to identify cell-type-specific gene expression differences corresponding to the phenotypes observed for the bulk samples.Briefly, we took a pretrained GTM-decon on a scRNA-seq reference data and then updated its CTS topics based on the corresponding phenotypes from the sparsified bulk data (Fig. 1c).This is equivalent to treating the phenotype as level 1 and cell types as level 2 in a two-stage nested factor design in statistics.
For the TCGA-BRCA data, in particular, we first initialized the genes-by-topic matrix φ with the pretrained guided topics learned from the scRNA-seq reference for normal breast tissue.We then fine-tuned 5 CTS topics for each phenotype (i.e., ER + or basal) from sparsified bulk data, resulting in a 10-topic model.During the fine-tuning, all CTS topics corresponding to the patient's phenotype are assigned a prior value of 0.9.Applying this approach to 798 sparsified samples from TCGA-BRCA, corresponding to basal (N 1 = 140) and ER + (N 2 = 658) led to a new genes-by-topic matrix φ * .First of all, the top genes for the topics corresponding to the same cell type are similar in both phenotypes, as they are expected to capture CTS signatures (Fig. 6a).However, differential analysis of genes between two phenotypes revealed upregulated genes in one phenotype being downregulated in the other (Fig. 6b).These differences between basal and ER + are statistically significant across all genes for all the cell types based on paired Wilcoxon signed-rank tests.Next, we evaluated the ability of the fine-tuned GTM-decon to classify the held-out test set and observed a 97% classification accuracy (Fig. 6c, top panel).These higher-resolution deconvolved CTS breast cancer profiles reveal that ER + samples are enriched for Luminal-2 cell type, whereas the basal subtype is depleted for that cell type (Fig. 6c).As a validation for our nested phenotype-cell-type guided approach, we evaluated the classification accuracy on the 160 held-out sparsified breast tumor samples.For each subtype, we summed the cell-type-specific topic probabilities from bottom heatmap for each sample to obtain the phenotype scores, which are shown in the top heatmap.d Comparison of DE genes detected by our approach and by DESeq2.DESeq2 was applied to the bulk RNA-seq gene expression data to compare gene expression between ER + and basal samples.In total, 6815 DE genes were deemed significant by adjusted p-value < 0.05 (Wald test) with 2952 upregulated and 3863 downregulated genes in ER + relative to basal.The grey bar and the heatmap on the left display the − log adjusted p-value for all of the upregulated genes (top half ) and the downregulated genes (bottom half ).Genes were ordered in decreasing order of the absolute test statistic for each half.The corresponding log 2 fold-change of ER + over basal was also shown as heatmap.The heatmap on the right displays the change of gene topic score from basal subtype to ER + subtype.e Cell-type-specific DE genes identified by nested-guided topic approach.The top and bottom part of the heatmap displays the topic scores for the upregulated and downregulated genes in basal relative to ER + , respectively (p-value < 0.05; permutation test).Genes that were also detected by DESeq2 were labeled in the color bar.f ORA was applied to the differential topic scores of upregulated and downregulated genes in ER + relative to basal.MSigDb HALLMARK pathway gene sets were used in ORA.The − log p-values for the significant pathways were shown in the bar plot Next, we identified the DE genes per cell type by subtracting the genes-by-topic entries in the φ matrix for phenotype d (e.g., basal) from phenotype d′ (e.g., ER +) under the same cell type (e.g., Luminal 2).To evaluate the consistency of our DE genes, we compared them against the DE genes identified by DESeq2 (Fig. 6d).We observe that all upregulated and downregulated DE genes nominated by DESeq2 in ER + versus basal comparison were also deemed upregulated and downregulated by our approach, respectively.We visualize the expression of the 630 statistically significant DE genes (adjusted p-value < 0.05; permutation test) in the BRCA tumor samples (Fig. 6e).We found that most of our DE genes do not only agree with those by DESeq2 but also exhibit CTS patterns.Notably, the most DE genes correspond to the Luminal_2 cell type (Fig. 6e), which exhibit the larger difference between ER + and basal (Additional file 1: Fig. S26).Over representation analysis (ORA) of these CTS DE genes against Hallmark pathways from MSigDb revealed several meaningful pathways.As expected, estrogen response (early) and (late) pathways are highly upregulated in the ER + phenotype, mainly in the Luminal_2 cell type (Fig. 6f ).Similarly, most DE genes in the basal phenotype are upregulated for typical pathways involved in cancer, such as G2M checkpoint, E2F targets, and mitotic spindle.This reflects the aggressive nature of basal cell type as the origin for the cancer subtype (Fig. 6f ).The contribution of sparse genes (i.e., genes with zero counts due to sparsification) to CTS topics and DE analysis is described in Additional file 1 Section S7 and illustrated in Additional file 1: Fig. S28.We obtained similar results comparing the 2 histological subtypes-ductal carcinoma and lobular carcinoma (Additional file 1: Fig. S29).
To further demonstrate the phenotype-guided and phenotype + cell-type-guided functionality, we applied GTM-decon to the same scRNA-seq data from breast cancer tumors using phenotypes (i.e., ER + and TNBC) and cell-type labels as the guides and then used the inferred topics to deconvolve the bulk TCGA breast tumor transcriptome data.Detailed analyses are presented in Additional file 1 Section S8 and Fig. S30.This was feasible because we have scRNA-seq references that were collected from similar tissue sites from patients of the same disease phenotypes as the target bulk transcriptomes.

Discussion
In this study, we developed a Bayesian approach called GTM-decon to infer CTS gene topic distributions from scRNA-seq reference data.During the topic inference of each cell, we introduce the guidance by setting the topic hyperparameter for the cell type of that cell to be relatively larger than the hyperparameters for other topics.This enables us to anchor each topic to a specific cell type and subsequently guide the inference of the global topic distributions over genes to automatically prioritize cell-type marker genes.The resulting topic distributions can then be used to infer the relative cell-type proportions from bulk RNA-seq datasets (i.e., cell-type deconvolution).
Through our analysis of the pancreatic and breast tissue datasets, we observe that for those cell types, where marker gene information is available, most of the top genes under the CTS topics correspond to known marker genes (Fig. 3a; Additional file 1: Fig. S24a).Because GTM-decon infers a distribution over all the genes under each cell-type-guided topic, it can be used to not only quantify the contribution of the known marker genes but also score novel marker genes.In terms of cell-type deconvolution, GTM-decon confers comparable performance to the existing state-ofthe-art methods (Fig. 2; Additional file 1: Fig. S10-15).The deconvolved cell-type proportions can be used to distinguish healthy and diseased samples as shown in the case of diabetic patients (Fig. 3c,e) as well as cancer subtypes from pancreatic and breast tumors (Fig. 4 and Additional file 1: Fig. S23).This enables investigation of molecular contribution to the phenotypic differences.Phenotypic differences between healthy and diabetic patients were captured even when the scRNA-seq reference datasets were generated from different platforms (e.g., Smart-seq and Drop-seq) (Fig. 3d, f ).
Using GTM-decon, we revisited two cancer datasets from TCGA, namely pancreatic adenocarcinoma (PAAD) and breast cancer (BRCA).To dissect the heterogeneous tumor microenvironment, we deconvolved these datasets based on scRNA-seq reference sets from pancreatic cancer and breast cancer, respectively.As a result, we identified the ductal and acinar origin of PAAD, the endocrine origin of pancreatic neuroendocrine tumors (PNET) (Fig. 4b), and enrichment of subtype-specific cells for the BRCA subtypes (Additional file 1: Fig. S23a).Interestingly, using scRNA-seq references from pancreatic and breast tissues of healthy individuals is also sufficient to identify the cell type of origin for all subtypes in pancreatic cancer (Additional file 1: Fig. S22), as well as the basal origin of basal subtype and the luminal origin of ER + breast cancer (Additional file 1: Fig. S24).However, using a cancerspecific scRNA-seq dataset improves the resolution of deconvolution in identifying more subtypes (Additional file 1: Fig. S23).By combining the de novo topics inferred directly from the bulk RNA-seq data with the scRNA-guided topics, we identified putative prognostic biomarkers that correlate with survival time (Fig. 4c; Additional file 1: Fig. S21, S22c).
We further extended GTM-decon by modeling the sparsified bulk RNA-seq data using the patient phenotype labels as the guide rather than cell types.In contrast to the traditional differential analysis approach, the phenotype-guided GTM-decon provides a different way to investigate gene signatures and molecular pathways underpinning the phenotypes of interest (Fig. 5).To leverage the scRNA-seq reference data, we further extended this framework to a nested-guided topic model by fine-tuning a dedicated set of CTS topic distributions for each phenotypic state (e.g., BRCA subtypes) of the patients from the bulk RNA-seq data.This enables learning not only intra-phenotype changes of cell-type distributions but inter-phenotype changes of gene expression.The latter allowed us to identify CTS DE genes directly from bulk RNA-seq data (Fig. 6).We extended this approach to infer phenotype and cell-type guided topics from single-cell breast cancer RNA-seq data with cancer subtypes as the phenotype guide.This led to accurate deconvolution of cancer subtypes from bulk TCGA-BRCA data, as well as identification of phenotype-specific and CTS DE genes from the single-cell data (Additional file 1: Fig. S30).Only a few methods can perform both deconvolution and CTS DE analysis.For example, CIBERSORTx [18] uses a non-negative matrix factorization approach based on partial observations to identify CTS DE genes across phenotypes.Other methods such as TOAST [24] and bMIND [23] that can estimate CTS DE require precomputed cell-type proportions by an external deconvolution method.
As future works, we can adapt GTM-decon to leverage other single-cell omic data such as scATAC-seq for reference and deconvolve the equivalent omic in bulk samples.It can also be extended to work with different cell states, like in BayesPrism [22], by modeling the topics based on cell states instead of cell types.Like all other deconvolution approaches, GTM-decon alone is unable to identify novel cell types from bulk RNA-seq datasets (i.e., cell types that are not present in the reference scRNAseq data GTM-decon is trained on), while it is able to capture perturbed cell types based on the phenotypes (e.g., Fig. 6c).This can be addressed by training GTM-decon on an atlas-level scRNA-seq data such as the Human Cell Landscape [49] and Tabula Sapiens [50], which comprehensively covers most of the cell types in the primary tissues.The resulting model can then be used to deconvolve bulk samples of any given target tissue.Lastly, cell types are not independent entities but rather form a lineage.One future direction is to exploit the relations among the cell types, which may better capture the underlying phenotypic states of the subjects.A more recently developed method called CeDAR [51] uses known cell-type hierarchy as prior to infer CTS expression in bulk data as opposed to our de novo sub-cell-type inference and will leave a more detailed comparison as future work.Moreover, we can also extend GTM-decon to modeling multi-omic single-cell data to identify multi-omic CTS topic distributions and then use them to deconvolve multi-omic bulk data.To this end, while several multi-omic modeling methods have been developed [52][53][54][55], their benefits in deconvolution are not fully realized.Lasty, deep-learning-based methods such as Scaden [22] can train on simulated or real bulk RNA-seq datasets to predict cell-type proportions.While Scaden can confer accurate deconvolution results, it compromises interpretability because of its non-linear distributed representation of the gene expression features.Some recently developed variational autoencoder and embedded topic modeling frameworks [56,57] may be extended to strike a balance between deconvolution accuracy and model interpretability.

Conclusions
Computational cell-type deconvolution of heterogeneous bulk transcriptome is highly cost-effective in revealing the underlying phenotypic states and identifying CTS differentially expressed genes.GTM-decon represents a significant advance in the deconvolution methods with 3 prominent contributions: (1) automatic inference of interpretable CTS topic distributions by directly modeling large single-cell RNA-seq reference data without using known marker genes, therefore providing a principled and amenable reference map for the subsequent deconvolution; (2) identifying sub-CTS gene expression distributions by inferring multiple topics anchored at the same cell type, leading to a finer resolution of the deconvolution results; (3) detecting CTS DE genes directly from bulk or single-cell samples via an extended nested-guided topic design leveraging both the phenotype states and cell-type label information.Our comprehensive experiments on pancreatic and breast datasets demonstrated the utilities of all 3 contributions.Together, GTM-decon is an efficient marker-free deconvolution method that takes the full advantage of the single-cell RNA-seq reference data for cell-type deconvolution.
The conditional distribution of the topic assignment for read i and cell m has a closed form expression: where the second last equality exploits the property of the Gamma function, i.e., Ŵ(x + 1) = Ŵ(x)x .Here n (−i)  .,m,k is the total number of scRNA-seq reads allocated for topic k for cell m without counting the current ith read, and n −(i,m) g,.,k is the total read counts for gene g under topic k across all of the M cells, without counting the current ith read in the mth cell: From here, the topic inference can be done by collapsed Gibbs sampling from p z i,m = k|z −(i,m) , x , while fixing the topic assignments for all other reads [61].For a large number of cells in the scRNA-seq data, the collapsed Gibbs sampling approach tends to be slow in reaching an equilibrium state.Therefore, we took a deterministic mean-field variational inference approach, known as the collapsed variational Bayes (CVB) [62].Specifically, we approximate the posterior distribution of the cell-type assignment p(z i.m |x, α m ) via the variational categorical distribution q z i,m x i,m = g , where Using the variational parameters for the topic assignments, the above sufficient statistics are replaced by the soft counts: Here in updating the global gene distribution in the second equation, we further make use of the CTS prior α m to obtain more interpretable results.
The above topic inference formulation operates at the level of read.For computational efficiency, our actual implementation of the topic inference was simplified to operate at the level of gene instead of the level of read: Similar to the above sufficient statistics, n (−g) .,m,k= g′� =g γ g′,m,k is the total number of scRNA-seq reads allocated for topic k for cell m, and n (−m) g,.,k = m′� =m α m,k γ g,m′,k is the total read counts for gene g under topic k across all of the M cells, without counting the gth gene for cell m.This is equivalent to a reasonable assumption that all the reads from the same gene for the same cell are originated from the same cell type, i.e., ∀ i,i′ z i,m = z i′,m if x i,m = x i′,m .
Together, the inference algorithm alternates between two simple steps: (1) for each cell and each gene, perform coordinate ascent by computing γ g,m,k while fixing the variational parameters γ g′,m,k for other genes g′ ; (2) update the sufficient statistics.This algorithm maximizes the evidence lower bound ELBO = E q [logp(x|z)] + E q [logp(z|α)] − E q [logq(z|γ )] [62].The model is deemed converged when ELBO stops improving by a small threshold (1e −6 by default).
Upon convergence, the expected values for θ m,k and φ g,k are: where n .,m,k= N m i=1 γ i,m,k and n g,.,k = M m=1 [x i,m = g]α m,k γ i,m,k .Here { θ m,k } M×K = � can be used to assess the "purity" of the single cells as a quality control step and { φ g,k } G×K = probabilities are used as the CTS topics in the subsequent deconvolution step.

Inferring multiple topics per cell type
Suppose we use L topics per cell type for K cell types, the hyperparameter α m for cell m can be formulated into a K × L matrix.Given that the cell-type label for cell m is y m = k , we set the kth row of α m to relatively high values and the rest of the K-1 rows to relatively low values.For example, suppose we have 5 cell types and 3 sub-topics per cell type.If cell m is labeled with cell type 2, then the topic prior hyperparameter matrix α m can be set to the following values: [0.01, 0.01, 0.01; 0.9, 0.9, 0.9; 0.01, 0.01, 0.01; 0.01, 0.01, 0.01; 0.01, 0.01, 0.01], where comma separates the columns and semicolons separate the rows.Here, the 3 topic prior values in the second row corresponding to cell type 2 are set to 0.9 and the values in the remaining rows are set to 0.01.
The data generative process is identical to the basic GTM-decon except having K × L topics instead of K topics.Specifically, to sample the cell-type mixture θ m , we flatten the ≡ θ m,k ; E q φ g,k = β + n g,.,k Gβ + g n g,.,k ≡ φ g,k K × L matrix for α m to have a row vector of 1 × (K × L) so that the θ m will have rela- tively high expected value for the y th m consecutive L values that correspond to the labeled cell type and relatively low expected value for the rest of the entries.We experimented modeling each cell type using L ∈ {2, 3, 4, 5} topics per cell type, with the hyperparam- eters α m,k for each cell of cell type k set to 0.45, 0.3, 0.22, and 0.18, respectively.The prior values for the remaining topics were assigned with random values between 0.001 and 0.01.These priors were heuristically chosen based on the hyperparameter of value 0.9 for one topic divided by the number of topics per cell type.

Inferring mixing cell-type proportions in bulk transcriptome
We assume a similar data generative process of the bulk transcriptome as the single-cell transcriptome described above.In particular, each bulk sample j ∈ {1, .., D} is a mixture of K cell types.Its cell-type mixture θ j is sampled from a K-dimensional symmetric Dir- ichlet distribution θ j ∼ Dir(α) with the hyperparameter fixed at a constant value across all K cell types (default: α k = 0.1∀k ).The flat hyperparameter value is used here since we typically do not have any prior information about the cell-type mixtures in the bulk RNA-seq data.For N j total RNA-seq reads of bulk sample j, each read i ∈ {1, . . ., N j } originates from one of the K cell types with the categorical rates set to be θ j : z i,j ∼ Cat(θ j ) , where z i,j ∈ {1, . . ., K } , and maps to a specific gene indexed by x i,j ∈ {1, . . ., G} with a known CTS categorical rates φ z i,j : x i,j ∼ Cat( φ z i,j ).
Performing deconvolution on a bulk transcriptome profile is equivalent to inferring the posterior distribution of the CTS topic mixture given its gene expression and the CTS topic distributions: p(θ j |x j , � ).To this end, we used the G × K genes-by-CTS-topic estimates inferred from the scRNA-seq reference data (described in section "Modeling scRNA-seq reference data via topic inference guided by cell-type labels") and perform variational inference to infer the cell-type mixture θ j for the jth bulk RNA-seq profile.Implementation-wise, similar to the scRNA-seq topic modeling, we also use the simplified topic inference algorithm at the gene level g ∈ {1, . . ., G} as opposed to at read level.This involves alternating between the topic assignment inference for γ g,j,k and comput- ing the sufficient statistics n −(g) .,j,kwhile fixing .Algorithmically, for each gene, we infer the topic assignments: where n (−g) .,j,k= g′� =g γ g′,j,k .Upon convergence, we compute the expected CTS-topic mixture: The bulk sample is transformed in the same way as the scRNA-seq reference data as described in the "Preprocessing the reference scRNA-seq data" section.
We also show that although GTM-decon infers RNA fractions instead of cell-type fractions, the correlation between the RNA fractions and cell-fractions is strong across cell types in multiple datasets, suggesting that RNA fractions per cell type can serve as a good surrogate to the cell fraction per cell type despite the potential differences in cell sizes among cell types (described in Additional file 1: Section S9 and illustrated in Fig. S31).

Sparsification of the bulk data to directly infer topic distributions from them
In order to identify de novo topics that are not present in the reference scRNA-seq data, we applied standard LDA using the CVB implementation from MixEHR [59] to the sparsified bulk RNA-seq data.However, bulk RNA-seq data is a dense matrix with most genes having non-zero entries while topic models excel at modeling sparse matrices (e.g., scRNA-seq data).To make the bulk RNA-seq data amenable to our approach, we sparsified the dense matrix by setting all values below the 75th percentile to 0. This cutoff was derived from scRNA-seq datasets, where on average 25% of genes in a cell have non-zero count values.While sparsifying works well in our applications, as a caveat, we acknowledge that it will lead to information loss.We also experimented with two other approaches to sparsify the matrix: (1) training GTM-decon only using HVG genes in bulk RNA-seq data; (2) training GTM-decon using differentially expressed genes identified between the phenotypes using DESeq2 [64].
Note that the sparsification procedure was done on the bulk data only when we directly inferred gene topic distributions from them, which pertains to the de novo topic inference from bulk samples, phenotype-guided topic inference from the bulk, and nestguided CTS-phenotype topic inference.All of the deconvolution experiments, where we first inferred topics from a single-cell reference dataset and then applied the inferred topics to deconvolve bulk data, does not involve the sparsification procedure (i.e., deconvolving the original bulk transcriptomes as they are).

Identifying statistically significant marker genes per cell type
After GTM-decon topic inference, marker genes for each cell type were identified using permutation test.Specifically, for gene g under topic k, we computed the difference of its topic score φ g,k from the average topic score over the rest of the K-1 top- ics φ g,k′� =k .For example, for 3 cell types, the test statistic for cell type 1 is calculated as φ g,1 − φ g,2 + φ g,3 /2 .More generally, for K cell types and T topics per cell topic, the test statistic for cell type k and gene g is The significance of the observed statistic is compared against the same statistic calculated from 100,000 permutations.The empirical p-value is computed as fraction of permutations, where the test statistic is greater than the observed value.

Evaluation of deconvolution accuracy using simulated and real bulk data
We evaluated the deconvolution accuracy by comparing the inferred cell-type proportions against the ground truth values for the datasets.First, we simulated bulk RNAseq data using the scRNA-seq dataset.We summed the gene expression counts of each sample from the scRNA-seq data to represent the bulk data of that sample (artificial bulk transcriptome).The ground-truth cell-type proportions are the fraction of cells for each cell type.To avoid information bias in the evaluation, we performed leave-one-out crossvalidation (LOOCV) by inferring topics from scRNA-seq data for N − 1 subjects as the training examples and deconvolving the held-out subject as the validation example.The results are shown in Additional file 1: Fig. S10.
In addition, we also used real bulk data with known cell-type proportion to benchmark our methods.To conduct different benchmarking and qualitative experiments, we used scRNA-seq datasets from several tissues for training GTM-decon (Additional file 1: Table S1): a human pancreas (E-MTAB-5061, GSE81433) (with 4 type 2 diabetes and 3 healthy subjects) and mouse (GSE81433); b Peripheral blood mononucleocytes (PBMC) of healthy human (GSE132044); c human blood cells (HBC) of healthy humans (GSE149938); d post-mortem brain tissue of frontal cortex from adult human (GSE97930); e Breast tissue from healthy individuals (GSE113197).Apart from healthy individuals, scRNA-seq references from patients with a pancreatic cancer (CRA001160) and b breast cancer (GSE176078) were used to deconvolve cancer bulk RNA-seq datasets.
Bulk RNA-seq datasets with known ground truth values were chosen for benchmarking (Additional file 1: Table S2).Datasets with known ground truth proportions from flow cytometry include a whole blood from 12 individuals (obtained from CIBERSORTx webpage), b PBMC from a cohort of 13 individuals (GSE107011), c PBMC from a cohort of 346 individuals (SDY67).For brain tissue, ground truth proportions from immunohistochemistry were available for a cohort of 41 individuals from the Religious Orders Study / Memory and Aging Project (ROSMAP) study (CortexCellDeconv).A unique dataset with both bulk RNA-seq data and scRNA-seq data from pancreas was accessed from E-MTAB-5060 and E-MTAB-5061, respectively, with the cell type proportions from scRNA-seq considered as ground truth values.
For the 3 immune (SDY67, whole blood, PBMC S13 cohort) and brain prefrontal cortex (ROSMAP) bulk datasets, we used two independent single-cell references with the most closely matched tissues of origin (Additional file 1: Table S1).For the pancreatic dataset (Segerstolpe), paired single-cell and bulk data from the same individuals were used in the LOOCV manner, where we used the cell-type proportions from the singlecell dataset to compare the estimated proportions from the paired bulk data in the same held-out subject.
For the qualitative analyses on the cancer datasets, the bulk RNA-seq datasets for pancreatic cancer (PAAD) and breast cancer (BRCA) datasets from TCGA were downloaded from the GDC data portal (https:// portal.gdc.cancer.gov/).Similarly, bulk RNA-seq data from the pancreas of a cohort of 89 normal and diabetic individuals was obtained from GSE50244.

Implementation of the existing deconvolution methods
We compared GTM-decon with other state-of-the-art methods, including BSEQ-sc, BISQUE, MuSiC, CIBERSORTx, and BayesPrism.For BSEQ-sc, marker genes were selected from CellmarkerDB for the brain and immune datasets, while the built-in pancreatic marker genes were used for the Segerstolpe dataset.BISQUE requires at least two paired reference bulk and reference single-cell samples, which is the case for the Segerstolpe dataset.When using human blood cell (HBC) scRNA-seq data as a reference, in order to use BISQUE, artificial bulk samples were constructed using single-cell data.For the other 3 bulk datasets, since we used only one scRNA-seq reference, we left out BISQUE from the evaluation.For CIBERSORTx, all genes were provided to the web portal (https:// ciber sortx.stanf ord.edu/) for Signature Matrix generation and Cell Fraction imputation.For BayesPrism, all genes were provided to the web portal (https:// www.bayes prism.org/) for cell type composition estimation, with the metadata column for tumor status set to 0 for all cells.

Preprocessing the reference scRNA-seq data
The gene expression profiles of scRNA-seq data were used as training data.Since the performance of GTM-decon may vary depending on how the scRNA-seq count data are processed, we explored different gene selection and transformations of the scRNA-seq data.Specifically, the following gene selection were considered: (i) all: all genes without removal of any gene; (ii) pp: preprocessed genes to remove uninformative genes (frequently expressed genes-found in ≥ 80% of cells, infrequently expressed genes-found in ≤ 5 cells); (iii) hvg: highly variable genes identified using the highly_variable_genes (HVG) function of scanpy [65].
Furthermore, for each of these gene sets, the following transformation were considered: (i) raw count (all / pp / hvg)-scRNA-seq read counts per gene; (ii) normr (all_normr / pp_normr / hvg_normr)-normalize counts (while excluding highly expressed genes for calculating the normalization factor) as counts divided by the sum of counts per cell multiplied by a scaling factor of 10,000 (a commonly used factor for scRNA-seq data [66]), and round the values to their nearest integer to make the input suitable for topic modeling; (iii) normr_log1p (all_normr_log1p / pp_normr_log1p / hvg_normr_log1p): log-transform normalized counts in (ii), and round the values to their nearest integer to make the input suitable for topic modeling.

Gene set enrichment analysis (GSEA)
GSEA was performed using the fgsea package from R, on two different gene sets: (a) gene sets corresponding to specific cell types from CellMarkerDB [30]; (b) gene set corresponding to the HALLMARK pathways from MSigDb using msigdbr [67].

Survival analysis
For TCGA datasets, after cell-type proportions are inferred using GTM-decon, survival analysis is performed using the survival and survminer R packages in order to assess if there is any correlation between survival probability of the cancer subjects and cell-type proportions for the cell types.Kaplan-Meier curves were generated for those cell types, where the association is deemed statistically significant at p-value < 0.05 based on logrank test.

Learning phenotype-specific gene signatures from bulk RNA-seq data
To identify phenotype-specific genes, we applied GTM-decon to directly infer phenotype-topics from the sparsified bulk RNA-seq data (Fig. 1b).To evaluate phenotype prediction accuracy, we randomly split the bulk RNA-seq samples into training and test datasets in 80:20 ratio.The training dataset is guided in a manner similar to GTM-decon for the scRNA-seq datasets.Briefly, for each subject, the hyperparameter(s) for the topic(s) corresponding to the observed phenotype was (were) set to the prior value of 0.9, and the hyperparameters for the rest of the topics were set to a small value between 0.01 and 0.1.Since a model of 5 topics per cell type worked well for several scRNA-seq datasets, we opted to model each phenotype by 5 topics as well.For the subjects in the 20% test data, we summed up the inferred phenotype mixture θ d,k values for all topics corresponding to the same phenotype.The predicted phenotype was the one with the highest summed up topic score.As a comparison, we also evaluated two other common machine learning methods namely logistic regression and random forest.We used their scikit-learn implementations with the default settings [68].

Identifying CTS DE genes from bulk transcriptomes from nested-guided topics
In identifying phenotype-specific differentially expressed genes, we developed a way to leverage the CTS topics inferred from the scRNA-seq reference data by fine-tuning the CTS topics based on gene expression from the sparsified bulk RNA-seq data for different phenotypes (Fig. 1c).Specifically, we initialized the genes-by-topic matrix d for each phenotype d.For example, for D = 3 phenotypes in a tissue with K = 5 cell types, we will have 15 topics, comprising of 3 sets of CTS d matrices of 5 columns each.These matrices are guided by the phenotype labels during the variational inference.For subject j, suppose his/her phenotype label is d d ∈ {1, .., D} .The topic hyperparam- eters α j,d,k 's for all the K topics corresponding to the phenotype label d were set to 0.9, and the α j,d′,k for the other phenotypes were set to a small value between 0.01 and 0.1.These values were propagated throughout the variational inference, guiding the phenotypic inference appropriately.The inference algorithm is identical to the one described in "Modeling scRNA-seq reference data via topic inference guided by cell-type labels" section for modeling the scRNA-seq data.This approach also works with single-cell transcriptomes from a disease study such as the single-cell breast cancer study, where we not only have the cell type information but also phenotype states of the subjects (i.e., ER + vs TNBC) (Additional file 1: Section S8 and Fig. S30).
From the learned matrix, the test statistic of a DE candidate gene g between phenotypes d and d′ � = d per cell type k were identified by subtracting the φ g,d,k value for phenotype d from the φ g,d′,k value for phenotype d′ .We identify statistically significant genes with a p-value < 0.05 by permutation test calculated from the 100,000 randomly shuffled d matrices.The p-value is the fraction of times the null statistic from the permutations is greater than the observed test statistic.As a reference, we compared our approach against the DE genes identified from the same samples using DESeq2 [64].We identified hallmark pathways from MSigDb which were enriched for the DE genes by Over Representation Analysis (ORA) using the ClusterProfiler package from R [69].

Fig. 1
Fig. 1 GTM-decon overview.a Inferring cell-type-specific (CTS) topics from scRNA-seq reference data.In brief, GTM-decon infers CTS topics from scRNA-seq data by using a guided topic modeling approach utilizing cell-type labels from the reference.High prior values are assigned to the topic corresponding to the cell type, and lower prior values are assigned to the other topics, enabling it to learn a genes-by-CTS topics matrix, with each topic anchored to a specific cell type.This matrix is used to infer cell-type proportions in bulk RNA-seq data using standard topic modeling, capturing variations in cell type proportions between healthy and diseased tissue.The probabilistic graphical model (PGM) diagram depicts the data generative process assumed by the proposed guided topic model.Suppose there are K cell types in the scRNA-seq data.For each cell indexed by m ∈ {1, . . ., M} , we use K-dimensional Dirichlet-distributed cell-type topic mixture θ m ∼ Dir(α m ) to represent the statistical uncertainty of the noisy cell-type label y m ∈ {1, . . ., K } .Specifically, we clamp the Dirichlet hyperparameter α m,ym of the Dirichlet variable to a relatively high value while setting the rest of the values of α m,k′ ( y m = k′ ) to relatively low values (i.e., 0.9 and [0.01, 0.1], respectively in the cartoon illustration of M = 8 cells and K = 3 cell types).The non-zero prior values for the K -1 unobserved cell types allow the cell-type mixture variable θ m to have non-zero density over those cell types as dictated by the scRNA-seq data likelihood and therefore account for potentially mislabeled cell types.Suppose there are in total N m reads in cell m .Each scRNA-seq read i ∈ {1, . . ., N m } is assumed to be originated from one of the K CTS topics with the categorical rates fixed to the cell-type mixture, i.e., z i,m ∼ Cat(θ m ) .Given cell-type topic assignment z i,m ∈ {1, . . ., K } , the ith read is then mapped to one of the G genes as indexed by x i,m with categorical rates set to be φ zi,m , which itself is a G-dimensional Dirichlet variable of flat hyperparameter β , i.e., x i,m ∼ Cat(φ zi,m ) .To infer the latent variables, namely cell-type mixture proportion θ m ∼ Dir(α) , CTS topic assignments for each read z i,m , and CTS topic distributions , we employ an efficient collapsed variational Bayes algorithm as detailed in the "Methods" section.The genes-by-CTS-topic matrix estimated from the scRNA-seq reference then serves as a template when it comes to infer the cell-type mixing proportions θ j of a bulk RNA-seq sample j using essentially the same inference algorithm as in the scRNA-seq data modeling except for having a flat hyperparameter for the prior (e.g., α k = 1∀k by default) while fixing and only inferring the expected total reads allocated for each CTS topics (i.e., E q [n .,j,k] = E q [ i [z i,j = k] ]).b Phenotype-guided modeling of bulk RNA-seq data.GTM-decon can also use phenotype labels as a guide for topic inference to model sparsified bulk transcriptomes in a disease study.In this design, instead of having each row as a cell and each column as a cell type, each row corresponds to a bulk sample and each column to a phenotype class.For each subject j, we set the topic hyperparameter α j,yj based on the noisy phenotype label y j of the subject.The inference algorithm is the same as in modeling the scRNA-seq reference data.Given a test subject j′ , the inferred topic mixture θ j′ represents the phenotypic probabilities of the subject.c Nested-guided topic model for detecting cell-type-specific differentially expressed genes between phenotypes.In this nested design, we treat the phenotype as level 1 and the cell types as level 2. The pretrained genes-by-CTS-topic distribution learned from panel a are used to initialize the topic distributions for each phenotype in a sparsified bulk transcriptome disease study.As illustrated in the cartoon, for example, for 2 phenotypes and 3 cell types, there are 6 topics.GTM-decon then fine-tunes the combined cell-type-specific topic distribution by running the same algorithm described in panel b.The resulting topic distributions reflect the phenotypic influences on CTS gene distributions, which are the statistics for conducting differential expression analysis in a case-control study design

Fig. 2 (
Fig. 2 (See legend on previous page.) Fig.3Cell-type-specific topic inference and deconvolution of pancreatic tissue.a Gene signatures of cell-type-specific topics in pancreas.We trained GTM-decon on the PI-Segerstolpe scRNA-seq dataset of pancreas tissue.We used 5 topics per cell type, allowing sub-cell-type inference.For the inferred genes-by-cell-type matrix , we took the top 20 genes under each topic and visualized their topic distributions in heatmap.Whenever available from CellMarkerDB and PanglaoDB, cell-type marker genes are indicated on the left.For the cell types where marker genes are not available, "NA" were indicated on the left.The number of statistically significantly different genes in each cell type based on their topic scores (p-value < 0.05; permutation test) is shown below.b Gene set enrichment analysis (GSEA) of inferred topics based on known marker genes.Cell-type-specific topics for acinar, alpha, and beta were evaluated based on whether the top genes are enriched for the known marker genes under that cell type.The bar plots show the − log 10 (p.adj values of enrichment score) for the gene set enrichment analysis for each of the 5 topics.The leading-edge plot for the topic with the best adj.p-value for that cell type is shown on the right.In each of the leading-edge plots, genes were ordered in decreasing order from left to right.The green curves indicate the running scores of enrichments.The barcode bars indicate cell-type marker genes.Adjusted p-values based on the GSEA enrichment scores are indicated in each panel.The three large panels display the most significantly enriched topic of among the five topics for each cell type and the 12 small panels display the remaining topics.c, e Deconvolution of bulk RNA-seq samples of 89 human pancreatic islet donors.The GTM-decon models separately trained on the Segerstolpe pancreas islet dataset (i.e., panel c) and Baron pancreas islet data (i.e., panel e) reference datasets were used to deconvolve the 89 bulk transcriptomes.As indicated by the legend, the 89 subjects consist of 51 normal, 15 impaired glucose tolerance, and 12 T2D individuals.In the heatmap, the rows represent subjects, and the columns represent cell types; the color intensity are proportional to the inferred cell-type proportions.d, f Deconvolved cell-type proportions as a function of Hemoglobin A1c (HbA1c) level.GTM-decon were trained on Segerstolpe (i.e., panel d) and Baron scRNA-seq (i.e., panel f) reference datasets.Each of the 10 panels displays a scatter plot of inferred cell-type proportion (y-axis) and HbA1c level (x-axis).The color legend indicates the 3 phenotypes.The heatmap on the right shows the deconvolved proportion of 3 most indicative cell types with subjects (rows) ordered on the basis of inferred beta cell-type proportions

Fig. 4
Fig.4 Deconvolution of bulk RNA-seq samples for pancreatic cancer from TCGA-PAAD.GTM-decon was first trained on an scRNA-seq dataset from individuals with pancreatic cancer.The trained GTM-decon model was then used to infer the cell-type proportions of the 174 TCGA-PAAD bulk RNA-seq profiles.a The average inferred cell-type proportion across the TCGA-PAAD tumor samples.We summed up inferred cell-type proportions over all samples followed by normalization.The pie chart displays the resulting percentage of cell-type proportions.b Inferred cell-type proportions of individual TCGA-PAAD tumor samples.To complement the inferred proportions of known cell types, we also ran unguided topic model (i.e., LDA) on the TCGA-PAAD bulk RNA-seq profiles directly to detect de novo topics that are not present in scRNA-seq reference.The heatmap visualizes the combined deconvolution results based on the 10 pancreatic cell types, and 10 de novo topics (i.e., columns).Each of the 174 rows represents a subject.Three types of demographic or clinical phenotypes were shown in the legend to aid result interpretation.These include "days to death, " cancer subtype, and whether the cancer type is PNET or not.The regions in the highlighted boxes were discussed in more details in the main text.c Survival analysis of the CTS and de novo topics using inferred cell-type proportions.The 174 subjects were divided into two groups based on K*-means clustering with K* set to 2 (not to be confused with the K cell types or topics).Kaplan-Meier curves were generated for these groups and compared using log-rank test.The plot shows the − log 10 (p-value) from the log-rank test for all the CTS and de novo topics, in decreasing order of significance.d Kaplan-Meier curve for endocrine cell-type proportion.The curve and shaded area represent the mean and standard deviation of the cell-type proportions in the two groups, respectively.The number of subjects for each cluster was indicated in the bottom panel

Fig. 6
Fig.6 Identification of cell-type-specific differentially expressed genes from bulk RNA-seq data for basal vs. ER + subtypes.a Top cell-type-specific gene signatures for basal and ER + .GTM-decon was pretrained on a scRNA-seq reference dataset from normal breast tissue to infer the expression distribution of 5 cell types, namely basal, basal myoepithelial, luminal 1-1, luminal 1-2, and luminal 2. The resulting genes-by-cell-type estimates were then used as the initial topic distributions for another GTM-decon, which is guided by the basal and ER + cancer subtypes in modeling the sparsified TCGA-BRCA bulk data.This led to a 10-topic distribution, each of which was specifically tailored for a combination of cell type and cancer subtype.The heatmap displays the probabilities of the top 20 genes for each topic.The left half displays the cell-type-specific topic distribution for basal and the right half for ER + .b Predicted differentially expressed (DE) genes for each cell type between basal and ER + .The top DE genes for basal in contrast to ER + were identified by subtracting the gene topic scores for ER + from the gene topic score for basal under the same cell type.The resulting DE scores were shown in the top half of the heatmap.The bottom half displays the DE scores of the top genes for ER + in contrast to basal.The pairwise Wilcox signed-rank tests were performed to compare the gene topic scores across all genes between the two subtypes for the same cell type.All tests yielded p-values lower than 2.2e −16 .c Classification of basal and ER + based on the phenotype probabilities.As a validation for our nested phenotype-cell-type guided approach, we evaluated the classification accuracy on the 160 held-out sparsified breast tumor samples.For each subtype, we summed the cell-type-specific topic probabilities from bottom heatmap for each sample to obtain the phenotype scores, which are shown in the top heatmap.d Comparison of DE genes detected by our approach and by DESeq2.DESeq2 was applied to the bulk RNA-seq gene expression data to compare gene expression between ER + and basal samples.In total, 6815 DE genes were deemed significant by adjusted p-value < 0.05 (Wald test) with 2952 upregulated and 3863 downregulated genes in ER + relative to basal.The grey bar and the heatmap on the left display the − log adjusted p-value for all of the upregulated genes (top half ) and the downregulated genes (bottom half ).Genes were ordered in decreasing order of the absolute test statistic for each half.The corresponding log 2 fold-change of ER + over basal was also shown as heatmap.The heatmap on the right displays the change of gene topic score from basal subtype to ER + subtype.e Cell-type-specific DE genes identified by nested-guided topic approach.The top and bottom part of the heatmap displays the topic scores for the upregulated and downregulated genes in basal relative to ER + , respectively (p-value < 0.05; permutation test).Genes that were also detected by DESeq2 were labeled in the color bar.f ORA was applied to the differential topic scores of upregulated and downregulated genes in ER + relative to basal.MSigDb HALLMARK pathway gene sets were used in ORA.The − log p-values for the significant pathways were shown in the bar plot