Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Remove any R package installation from notebooks or scripts, especially with BiocManager #690

Closed
jaclyn-taroni opened this issue May 14, 2020 · 9 comments · Fixed by #704
Assignees
Labels
in progress Someone is working on this issue, but feel free to propose an alternative approach!

Comments

@jaclyn-taroni
Copy link
Member

Context: #689 - which is adding a script to specifically install Bioconductor packages on the project Docker container.

Having logic that checks whether or not a package is installed and if not installs it is reasonable if someone were to run an analysis outside the Docker container. But if we were to miss something in the Docker image and then run an analysis it could end up unpinning versions (as discovered on the journey of #684). So, we should remove any package installation from notebooks or scripts, especially any installation via BiocManager.

Here's a list from @sjspielman:

focal-cn-file-preparation/04-prepare-cn-file.R:  install.packages("BiocManager")
focal-cn-file-preparation/04-prepare-cn-file.R:  BiocManager::install("GenomicRanges", update = FALSE)
focal-cn-file-preparation/04-prepare-cn-file.R:  BiocManager::install("IRanges", update = FALSE)
focal-cn-file-preparation/04-prepare-cn-file.R:  BiocManager::install("annotatr", update = FALSE)
focal-cn-file-preparation/04-prepare-cn-file.R:  BiocManager::install("TxDb.Hsapiens.UCSC.hg38.knownGene", update = FALSE)
focal-cn-file-preparation/04-prepare-cn-file.R:  BiocManager::install("org.Hs.eg.db", update = FALSE)
focal-cn-file-preparation/04-prepare-cn-file.R:  BiocManager::install("AnnotationDbi", update = FALSE)
gene-set-enrichment-analysis/01-conduct-gsea-analysis.R:## Load and/or install libraries ##
gene-set-enrichment-analysis/01-conduct-gsea-analysis.R:  install.packages("msigdbr")
gene-set-enrichment-analysis/01-conduct-gsea-analysis.R:  install.packages("BiocManager")
gene-set-enrichment-analysis/01-conduct-gsea-analysis.R:  BiocManager::install("GSVA")
molecular-subtyping-ATRT/02-ATRT-molecular-subtyping-plotting.R:  install.packages("ComplexHeatmap")
molecular-subtyping-ATRT/02-ATRT-molecular-subtyping-plotting.R:  install.packages("matrixStats")
molecular-subtyping-ATRT/02-ATRT-molecular-subtyping-plotting.R:  install.packages("ggfortify")
oncoprint-landscape/01-plot-oncoprint.R:  install.packages("BiocManager")
oncoprint-landscape/01-plot-oncoprint.R:  BiocManager::install("maftools")
cnv-chrom-plot/gistic_plot.Rmd:  install.packages("BiocManager")
cnv-chrom-plot/gistic_plot.Rmd:  BiocManager::install("ggbio")
cnv-comparison/01-cnv-comparison-plotting.Rmd:  install.packages("BiocManager")
cnv-comparison/01-cnv-comparison-plotting.Rmd:  BiocManager::install("GenVisR")
cnv-comparison/01-cnv-comparison-plotting.Rmd:  install.packages("cowplot")
molecular-subtyping-ATRT/01-ATRT-molecular-subtyping-data-prep.Rmd:  install.packages("DT")
molecular-subtyping-ATRT/01-ATRT-molecular-subtyping-data-prep.Rmd:  install.packages("htmlwidgets")
mutational-signatures/mutational_signatures.Rmd:  BiocManager::install("BSgenome.Hsapiens.UCSC.hg38")
mutational-signatures/mutational_signatures.Rmd:  install.packages("deconstructSigs")
mutect2-vs-strelka2/01-set-up.Rmd:    install.packages("BiocManager")
mutect2-vs-strelka2/01-set-up.Rmd:  BiocManager::install("maftools")
mutect2-vs-strelka2/01-set-up.Rmd:  install.packages("hexbin")
mutect2-vs-strelka2/01-set-up.Rmd:  install.packages("R.utils")
mutect2-vs-strelka2/02-analyze-concordance.Rmd:  install.packages("hexbin")
mutect2-vs-strelka2/02-analyze-concordance.Rmd:  devtools::install_github("clauswilke/colorblindr")
mutect2-vs-strelka2/02-analyze-concordance.Rmd:  install.packages("R.utils")
mutect2-vs-strelka2/02-analyze-concordance.Rmd:  install.packages("VennDiagrams")
snv-callers/compare_snv_callers_plots-tcga.Rmd:  install.packages("ggupset", repos = "http://cran.us.r-project.org")
snv-callers/compare_snv_callers_plots-tcga.Rmd:  install.packages("UpSetR", repos = "http://cran.us.r-project.org")
snv-callers/compare_snv_callers_plots-tcga.Rmd:  install.packages("GGally", repos = "http://cran.us.r-project.org")
snv-callers/compare_snv_callers_plots.Rmd:  install.packages("ggupset", repos = "http://cran.us.r-project.org")
snv-callers/compare_snv_callers_plots.Rmd:  install.packages("UpSetR", repos = "http://cran.us.r-project.org")
snv-callers/compare_snv_callers_plots.Rmd:  install.packages("GGally", repos = "http://cran.us.r-project.org")
snv-callers/vaf_cutoff_experiment.Rmd:  install.packages("GGally")
snv-callers/vaf_cutoff_experiment.Rmd:  install.packages("ggupset")
@cansavvy
Copy link
Collaborator

mutect2-vs-strelka2 is long retired and isn't run in CircleCI tests, do we still want to update it?

@cansavvy
Copy link
Collaborator

I started working on this with some of the notebooks I originally created, I can go ahead and remove the R package installations for all of these listed (and if I find any others).

@jaclyn-taroni jaclyn-taroni added the in progress Someone is working on this issue, but feel free to propose an alternative approach! label May 18, 2020
@cbethell
Copy link
Contributor

I have removed the package installation steps from oncoprint-landscape/01-plot-oncoprint.R in the open PR #666 (I can revert this change if we would prefer that these steps be removed all in one PR however).

@cansavvy
Copy link
Collaborator

@cbethell No need to change it. I will do multiple PRs for these anyway. I'll keep track of which modules are revised here as I open PRs for them.

@cansavvy
Copy link
Collaborator

Should I be ignoring deprecated/retired analyses, I assume?

@jaclyn-taroni
Copy link
Member Author

What is the downside to fixing those? Lots of time to rerun I assume?

@cansavvy
Copy link
Collaborator

What is the downside to fixing those? Lots of time to rerun I assume?

Yes but mainly I’m encountering other errors not related to install.packages due to data release changes that haven’t been fixed since they’ve been deprecated. So it will involved me fixing errors that are outside this issue.

@jaclyn-taroni
Copy link
Member Author

Ah, makes sense - skip 'em!

@cansavvy
Copy link
Collaborator

cansavvy commented May 18, 2020

Keeping track of the changes I make here as I do them. (TBD means I haven't gotten to it yet.)

Module Status PR ref
chromosomal-instability No changes needed NA
cnv-chrom-plot In gistic_plot.Rmd got rid of: install.packages("BiocManager") and BiocManager::install("ggbio") and refreshed gistic_plot.Rmd only. #698
cnv-comparison Skipped because deprecated NA
collapse-rnaseq No changes needed NA
comparative-RNASeq-analysis No changes needed NA
copy_number_consensus_call No changes needed NA
create-subset-files No changes needed NA
focal-cn-file-preparation Got rid of series of installs in 04-prepare-cn-file.R, re-ran run-prepare-cn.sh #698
fusion_filtering No changes needed NA
fusion-summary No changes needed NA
gene-set-enrichment-analysis Got rid of installations and re-in 01-conduct-gsea-analysis.R and re-ran run-gsea.sh #703
immune-deconv No changes needed NA
independent-samples No changes needed NA
interaction-plots No changes needed NA
molecular-subtyping-ATRT Removed installs from 02-ATRT-molecular-subtyping-plotting.R and 01-ATRT-molecular-subtyping-data-prep.Rmd and re ran bash run-molecular-subtyping-ATRT.sh #703
molecular-subtyping-EPN No changes needed NA
molecular-subtyping-EWS No changes needed NA
molecular-subtyping-HGG No changes needed NA
molecular-subtyping-LGAT No changes needed NA
molecular-subtyping-SHH-tp53 Skipped because deprecated NA
molecular-subtyping-chordoma No changes needed NA
molecular-subtyping-embryonal No changes needed NA
molecular-subtyping-pathology No changes needed NA
mutational-signatures Got rid of installs in mutation_signatures.Rmd and reran TBD
mutect2-vs-strelka2 Skipped because deprecated NA
oncoprint-landscape Got rid of maftools install in 01-plot-oncoprint.R and reran run-oncoprint.sh #704
rna-seq-composition No changes needed NA
run-gistic No changes needed NA
sample-distribution-analysis No changes needed NA
selection-strategy-comparison Skipped because deprecated NA
sex-prediction-from-RNASeq No changes needed NA
snv-callers Got rid of installs in the compare_snv_callers_plots.Rmd and compare_snv_callers_plots-tcga.Rmd notebooks and reran on AWS #701
ssgsea-hallmark Skipped because deprecated NA
sv-analysis No changes needed NA
survival-analysis Got rid of install in util/survival_models.R and reran survival-analysis_template.Rmd #704
telomerase-activity-prediction No changes needed NA
tmb-compare-tcga No changes needed NA
tp53_nf1_score No changes needed NA
transcriptomic-dimension-reduction Get rid of package installations in run-dimension-reducion.R and reran ./dimension-reduction-plots.sh #704
tcga-capture-kit-investigation No changes needed NA

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
in progress Someone is working on this issue, but feel free to propose an alternative approach!
Projects
None yet
3 participants