InstaPrism is an R package for cell type composition and gene expression deconvolution in bulk RNA-Seq data. Based on the same conceptual framework as BayesPrism, InstaPrism significantly increases calculation speed while providing nearly identical deconvolution results.
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
if (!require("Biobase", quietly = TRUE))
BiocManager::install("Biobase")
if (!require("devtools", quietly = TRUE))
install.packages("devtools")
devtools::install_github("humengying0907/InstaPrism")
Quick start with the following example
# bulk input with genes in rows and samples in columns; this example data is from ovarian cancer
bulk_expr = read.csv(system.file('extdata','example_bulk.csv',package = 'InstaPrism'))
# load built-in reference; choose a reference that matches the tumor type of the bulk input
OV_ref = InstaPrism_reference('OV')
# deconvolution with InstaPrism
deconv_res = InstaPrism(bulk_Expr = bulk_expr,refPhi_cs = OV_ref)
# The deconvoled cell type fraction is now accessible with
estimated_frac = t(deconv_res@Post.ini.ct@theta)
head(estimated_frac)
# InstaPrism also returns the deconvolved gene expression Z
Z = get_Z_array(deconv_res) # a sample by gene by cell-type array
head(Z[,1:10,'malignant'])
Using either scRNA-based reference (update = F) or updated reference (update = T), InstaPrism achieves nearly identical deconvolution results as BayesPrism.
Below is a running time comparsion when running deconvolution on the tutorial data provided in BayesPrism.
InstaPrism significantly reduced the memory usaged during deconvolution. Below is a memory usage comparsion when running deconvolution on the tutorial data provided in BayesPrism.
We have provided precompiled reference tailored for a wide range of cancer types. The reference can be downloaded directly using the download link below, or loaded directly using the following command
BRCA_ref = InstaPrism_reference('BRCA')
reference name | tumor type | #cells used for reference construction | #cell types/cell states | umap | citation | download |
---|---|---|---|---|---|---|
BRCA_refPhi | breast cancer | 100,064 | 8/76 | UMAP | Wu et al. 2021 | ↓ |
CRC_refPhi | colorectal cancer | 371,223 | 15/98 | UMAP | Pelka et al. 2021 | ↓ |
GBM_refPhi | glioblastoma | 338,564 | 10/57 | cellxgeneLink, UMAP | Ruiz et al. 2022 | ↓ |
LUAD_refPhi | lung adenocarcinomas | 118,293 | 13/77 | UMAP | Xing et al. 2021 | ↓ |
OV_refPhi | ovarian cancer | 929,690 | 9/40 | cellxgeneLink, UMAP | Vazquez et al. 2022 | ↓ |
RCC_refPhi | clear cell renal cell carcinoma | 270,855 | 11/106 | cellxgeneLink, UMAP | Li et al. 2022 | ↓ |
SKCM_refPhi | skin cutaneous melanoma | 4,645 | 8/23 | UMAP | Tirosh et al. 2016 | ↓ |
To validate the performance of a reference, or to compare between different references, please refer to the Reference_evalu_pipeline we developed.
Check InstaPrism_tutorial for detailed implementation of InstaPrism and compare its performance with BayesPrism.
M. Hu and M. Chikina, “InstaPrism: an R package for fast implementation of BayesPrism.” bioRxiv, p. 2023.03.07.531579, Mar. 12, 2023. doi: https://doi.org/10.1101/2023.03.07.531579