diff --git a/workflow/qhtcp-workflow b/workflow/qhtcp-workflow index 6cde3ffc..58fe0b42 100755 --- a/workflow/qhtcp-workflow +++ b/workflow/qhtcp-workflow @@ -433,7 +433,7 @@ install_dependencies() { depends_r=(BiocManager ontologyIndex ggrepel tidyverse sos openxlsx ggplot2 plyr extrafont gridExtra gplots stringr plotly ggthemes pandoc rmarkdown plotly htmlwidgets) - depends_bioc=(org.Sc.sgd.db) + depends_bioc=(UCSC.utils org.Sc.sgd.db) [[ $1 == "--get-depends" ]] && return 0 # if we just want to read the depends vars @@ -478,9 +478,18 @@ install_dependencies() { } depends_r_to_string - debug "$RSCRIPT -e install.packages(c(\"$depends_r_str), dep=TRUE, repos=\"https://cloud.r-project.org\")" - "$RSCRIPT" -e "install.packages(c(\"$depends_r_str), dep=TRUE, repos=\"https://cloud.r-project.org\")" - "$RSCRIPT" -e "BiocManager::install(\"${depends_bioc[0]}\")" + + # Install R packages + for d in "${depends_r[@]}"; do + debug "$RSCRIPT -e \"if (!require(\"$d\", quietly = TRUE)); install.packages(\"$d\", dep=TRUE, repos=\"https://cloud.r-project.org\")\"" + "$RSCRIPT" -e "if (!require(\"$d\", quietly = TRUE)); install.packages(\"$d\", dep=TRUE, repos=\"https://cloud.r-project.org\")" + done + + # Install Bioc packages + for d in "${depends_bioc[@]}"; do + debug "$RSCRIPT -e \"BiocManager::install(\"$d\")\"" + "$RSCRIPT" -e "BiocManager::install(\"$d\")" + done hash "$MATLAB" &>/dev/null || echo "You will also need MATLAB installed for GUI modules" }