Abstract
1. Introduction
The cellular composition of a tumor specimen is a prognostic factor (Ansell and Vonderheide, 2013; Junttila and de Sauvage, 2013). Single-cell RNA sequencing (scRNA-Seq; Wu et al., 2013) can be used to assess this composition experimentally. Digital tissue deconvolution (DTD) emerged as a computational alternative (Cobos et al., 2018). It can be applied retrospectively to bulk gene-expression data without experimental costs.
Let y be a bulk gene expression profile, X a matrix with cell-type specific reference profiles in its columns, and c a vector of cellular proportions. DTD reconstructs c through X and y by
An important observation is that genes can be weighted to obtain better estimates (Görtler et al., 2018). This is particularly the case (1) if not all cells in the bulk are represented in X, (2) if we want to estimate contributions from small cell populations, and (3) if we want to disentangle highly similar cell types. Genes weights can be introduced by replacing the residual sum of squares by
with a vector g of gene weights
Loss-function learning (Görtler et al., 2018) detects this problem and adapts g to a tissue context. It increases deconvolution accuracy, as shown exemplarily for the deconvolution of bulk melanoma specimens (Görtler et al., 2018).
2. Methods
Loss-function learning uses training data to optimize DTD models. These training data are bulk gene-expression measurements Y (rows: genes/features, columns: measurements) with known cellular compositions C (rows: cellular proportions, columns: measurements). The rational behind loss-function learning is to obtain the vector g by minimizing a loss function L on the training data.
The package DTD incorporates a correlation-based loss function:
Here,
3. Application
3.1. Basic function calls
The R package DTD has the basic function call
Here, X is a matrix with reference profiles in its columns, and train.data is a list containing “mixtures” Y and “quantities” C, defined as earlier. train_deconvolution_model returns a deconvolution model that can be applied through the function estimate_c(DTD.model = trained.model, new.data = y) on new data y, which is a vector or matrix with bulk gene-expression levels. The function estimate_c returns estimated cellular proportions for the bulk profiles y. The workflow is summarized in Figure 1.

Workflow of a digital tissue deconvolution (DTD) analysis with loss-function learning. Input: an expression matrix, where each sample is labeled with its cell type. Processing: the labeled samples are used to build both a reference matrix and artificial mixtures of known cellular composition. Model learning: the algorithm iteratively searches for parameters g, which maximize the correlation between the estimated and the true cellular compositions, where the training data and the reference matrix are used. Here, functions visualize the result and assess the performance of the DTD model. Predicting bulks: the DTD model is applied to bulk gene expression data to estimate the underlying cellular composition.
3.2. Generate artificial training data from scRNA-Seq data
Loss-function learning requires training data. These data can be generated experimentally, for example, through fluorescence-activated cell sorting (FACS)-based cell counting combined with bulk RNA sequencing. Alternatively, these data can be generated artificially from scRNA-Seq experiments. For this purpose, we implemented functions that automatically generate training mixtures Y and their corresponding compositions C. An example for such a function call is mix_samples(exp.data = sc.counts, pheno = sc.pheno, …). This function uses, for example, raw counts from scRNA-Seq (sc.counts), where columns correspond to cells and rows to genes. Furthermore, the vector sc.pheno ascribes cell types to the respective columns in sc.counts. The function returns a list with the components Y and C, which correspond to artificial mixtures and their underlying cellular compositions, respectively. A similar function is provided to generate a reference matrix X.
4. Summary
We provide software for the digital deconvolution of bulk gene-expression data. We take into account that DTD needs to be adapted to a specific type of tissue. It is not likely that there is a universal deconvolution formula, which performs consistently well in all settings. The most reliable results might be obtained by optimized models that have been trained within a machine learning framework.
In this study, we provide software for such a framework, called loss-function learning, and for the application of the learned deconvolution models to bulk data. It is computationally tractable and easy to use.
A DTD tutorial is available as Supplementary Data. There, we give a comprehensive example that shows how data need to be processed and how results can be visualized.
In summary, we provide the R package DTD that contains software to systematically improve the performance of DTD algorithms.
Footnotes
References
Supplementary Material
Please find the following supplemental material available below.
For Open Access articles published under a Creative Commons License, all supplemental material carries the same license as the article it is associated with.
For non-Open Access articles published, all supplemental material carries a non-exclusive license, and permission requests for re-use of supplemental material or any part of supplemental material shall be sent directly to the copyright owner as specified in the copyright notice associated with the article.
