InstaPrismSourceCode

May 15, 2024 · View on GitHub

Built-in Reference for InstaPrism

reference nametumor type#cells used for reference construction#cell types/cell statesumapcitationdownload
BRCA_refPhibreast cancer100,0648/76UMAPWu et al. 2021
CRC_refPhicolorectal cancer371,22315/98UMAPPelka et al. 2021
GBM_refPhiglioblastoma338,56410/57cellxgeneLink, UMAPRuiz et al. 2022
LUAD_refPhilung adenocarcinomas118,29313/77UMAPXing et al. 2021
OV_refPhiovarian cancer929,6909/40cellxgeneLink, UMAPVazquez et al. 2022
RCC_refPhiclear cell renal cell carcinoma270,85511/106cellxgeneLink, UMAPLi et al. 2022
SKCM_refPhiskin cutaneous melanoma4,6458/23UMAPTirosh et al. 2016

Reference validation pipeline

  1. To reproduce the reference validation results from the paper or to test the reference performance with your own data, clone the repository and go into the InstaPrismSourceCode directory.
git clone https://github.com/humengying0907/InstaPrismSourceCode.git && cd InstaPrismSourceCode
  1. Make sure that all the packages in scripts/libraries.R are installed
# To install InstaPrism & deconvBenchmarking package
library("devtools");
install_github("humengying0907/InstaPrism")
install_github("humengying0907/deconvBenchmarking")
  1. Make simulated bulk samples for reference validation. Code to reproduce bulk simulation for each cancer type is listed in ./analysis/bulk_simulation/"cancer type". A sim_bulk.RDS file will be generated and used in the subsequent validation step. Single cell data used for bulk simulation is downloaded from 3CA repository.

  2. Reference validation. The script used for deconvolution and performance evaluation is ./analysis/refPhi_validation/evalu_pipeline.R

cd analysis/refPhi_validation
Rscript evalu_pipeline.R -h
## usage: evalu_pipeline.R [-h] [--tumorType <character>]
##                         [--refName <character> [<character> ...]]
##                         [--output <character>] [--niter <integer>]
##                         [--ncore <integer>] [--updateReference <logical>]
##                         [--key <character>] [--saveDeconvRes <logical>]
## 
## InstaPrism reference evaluation pipeline
## 
## optional arguments:
##   -h, --help            show this help message and exit
##   --tumorType <character>, -t <character>
##                         Folder name of the bulk dataset for evaluation. The
##                         'sim_bulk.RDS' file located within
##                         '../bulk_simulation/<tumorType>' will be utilized for
##                         deconvolution.
##   --refName <character> [<character> ...], -n <character> [<character> ...]
##                         Name of the reference to test. The reference stored in
##                         '../../refPhi/<refName>_refPhi.RDS' will be loaded as
##                         the reference. To test multiple references, separate
##                         each name by a blank space.
##   --output <character>, -o <character>
##                         Output folder name. A 'performance/<output>/'
##                         directory will be created to store the deconvolution
##                         results and plots. If not specified, a
##                         'performance/<tumorType>/' directory will be created
##                         to store the results
##   --niter <integer>     Number of iterations for InstaPrism() function.
##                         [default: 400]
##   --ncore <integer>     Number of threads. [default: 16]
##   --updateReference <logical>
##                         A logical variable to determine whether to include
##                         updated reference in the evaulation. [default: FALSE]
##   --key <character>     Name of the malignant cell type in the reference,
##                         required only when updateReference = TRUE. When
##                         evaluating multiple references, these references need
##                         to have the same key.
##   --saveDeconvRes <logical>
##                         A logical variable to determine whether to save the
##                         deconvolution results. [default: FALSE]

Run the following commands to generate the performance summary object theta_performance.RDS and the associated pdf files that visualize the performance of the deconvolution results. An example output is listed in ./analysis/refPhi_validation/performance/CRC. A summarized performance plot can be found at ./analysis/refPhi_validation/performance/performance_summary.png

Rscript evalu_pipeline.R -t BRCA -n BRCA --updateReference TRUE --key "Cancer Epithelial"
Rscript evalu_pipeline.R -t CRC -n CRC --updateReference TRUE --key EpiT
Rscript evalu_pipeline.R -t GBM -n GBM --updateReference TRUE --key Malignant
Rscript evalu_pipeline.R -t LUAD -n LUAD --updateReference TRUE --key Malignant
Rscript evalu_pipeline.R -t OV -n OV --updateReference TRUE --key malignant
Rscript evalu_pipeline.R -t RCC -n RCC --updateReference TRUE --key Malignant
Rscript evalu_pipeline.R -t SKCM -n SKCM --updateReference TRUE --key "Melanoma cells"

Citation

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