This package provides a common interface to run 45 deconvolution methods.
This package requires R
version 4.0 or later.
We run each deconvolution in a separate container.
Therefore, a container engine (i.e., docker
or singularity
) needs to be installed.
Follow instructions at https://docs.docker.com/engine/install/ to install docker
.
Note that docker needs root privileges to install or and to be added to the docker
group to run.
Users that do not have root privileges can use singuarity
instead.
To install singularity
, follow instructions at https://docs.sylabs.io/guides/3.3/user-guide/installation.html.
To check ifdocker
or singularity
is installed and R can communicate with it, run:
if (!requireNamespace("babelwhale", quietly = TRUE)) {
install.packages("babelwhale")
}
# For docker
babelwhale::test_docker_installation(detailed = TRUE)
# OR for singularity, make sure singularity binary is in PATH
babelwhale::test_singularity_installation(detailed = TRUE)
if (!requireNamespace("devtools", quietly = TRUE)) {
install.packages("devtools")
}
devtools::install_github("tinnlab/DeconBenchmark")
library(DeconBenchmark)
List of supported methods, their required inputs beside bulk data and their original package.
The dockerfile for each method is located in the DeconBenchmark-docker repository. Please cite the original publications if you use the methods in your work.
Get the list of all available methods.
allSupportMethods <- getSupportedMethods() # Get the list of supported methods
print(allSupportMethods)
Select methods to run and get their required inputs.
methodsToRun <- c("ReFACTor", "scaden", "DeconRNASeq") # Select methods to run (must be in the list of supported methods)
# Get the required inputs for each method.
# ContainerEngine is "docker" by default. Change containerEngine to "singularity" if you want to use singularity instead
requiredInputs <- getMethodsInputs(methodsToRun, containerEngine = "docker")
print(requiredInputs) # list(ReFACTor = c("bulk", "nCellTypes"), scaden = c("bulk", "singleCellExpr", "singleCellLabels"), DeconRNASeq = c("bulk", "signature"))
Load example data
data(BloodExample) # Load example data
print(names(BloodExample)) # c("bulk", "singleCellExpr", "singleCellLabels")
bulk <- BloodExample$bulk
Run each method separately.
# Run ReFACTor only
deconvolutionResult <- runDeconvolution(methods = "ReFACTor", bulk = bulk, nCellTypes = 8, containerEngine = "docker")
proportion <- deconvolutionResult$ReFACTor$P
print(head(proportion))
# Run scaden only
singleCellExpr <- BloodExample$singleCellExpr
singleCellLabels <- BloodExample$singleCellLabels
deconvolutionResult <- runDeconvolution(methods = "scaden", bulk = bulk, singleCellExpr = singleCellExpr, singleCellLabels = singleCellLabels)
proportion <- deconvolutionResult$scaden$P
print(head(proportion))
# Run DeconRNASeq only
reference <- generateReference(singleCellExpr, singleCellLabels, type="signature") # Generate reference
deconvolutionResult <- runDeconvolution(methods = "DeconRNASeq", bulk = bulk, signature=reference$signature)
proportion <- deconvolutionResult$DeconRNASeq$P
print(head(proportion))
Run all three methods
deconvolutionResults <- runDeconvolution(methodsToRun, bulk = bulk, singleCellExpr = singleCellExpr, singleCellLabels = singleCellLabels, signature=reference$signature)
proportions <- lapply(deconvolutionResults, function(res) res$P)
print(head(proportions$ReFACTor))
print(head(proportions$DeconRNASeq))
print(head(proportions$scaden))
BayesCCE
, Deblender
, and DecOT
require a MATLAB license to run.
Visit the Matlab license center at https://www.mathworks.com/licensecenter/licenses to obtain a license file.
The hostid
of this license is the same as the hostid
of the host machine.
If docker
is used, the user of this license must be root
.
If singularity
is used, the user of this license is the same as the user of the host machine.
To run these methods, pass matlabLicenseFile=PATH_TO_YOUR_MATLAB_LICENSE
as an argument to runDeconvolution
.