diff --git a/workflows/_dependencies/install_r_packages.R b/workflows/_dependencies/install_r_packages.R deleted file mode 100644 index ce4e6435f14284a6d89d7003aa1514b01e62e06a..0000000000000000000000000000000000000000 --- a/workflows/_dependencies/install_r_packages.R +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env Rscript - -######################## -# Installation of R dependencies -######################## - -### sleuth installation - -if (!requireNamespace("BiocManager", quietly = TRUE)){install.packages("BiocManager")} -if(!"BiocManager" %in% row.names(installed.packages())){BiocManager::install()} -if(!"devtools" %in% row.names(installed.packages())){BiocManager::install("devtools")} - -# BiocManager::install("pachterlab/sleuth") -# There's currently (early 2022) an issue with sleuth installation. -# Using this workaround from https://github.com/pachterlab/sleuth/issues/259#issuecomment-1001076030 - -if(!"sleuth" %in% row.names(installed.packages())){remotes::install_github("pachterlab/sleuth#260")} - -library(sleuth) - -### other packages - -library(tidyverse) -library(jsonlite) -library(openxlsx) - -required_packages <- - c('tidyverse', ## data wrangling and plotting - 'jsonlite', ## read/write json files - 'openxlsx') ## read/write xlsx files - -for(package in required_packages) -{ - ## Check if package is installed. If not, install - if(!package %in% row.names(installed.packages())){install.packages(package, - repos ="https://cran.uni-muenster.de/")} - # ## Check if package is up to date. If not, update - # update.packages(package, repos = "https://cran.uni-muenster.de/") - ## Load package - library(package, character.only = T) - print(paste("installed R package", package)) -} - diff --git a/workflows/_dependencies/install_cwl.md b/workflows/install_dependencies/install_cwl.md similarity index 100% rename from workflows/_dependencies/install_cwl.md rename to workflows/install_dependencies/install_cwl.md diff --git a/workflows/_dependencies/install_kallisto.md b/workflows/install_dependencies/install_kallisto.md similarity index 100% rename from workflows/_dependencies/install_kallisto.md rename to workflows/install_dependencies/install_kallisto.md diff --git a/workflows/install_dependencies/install_r_packages.R b/workflows/install_dependencies/install_r_packages.R new file mode 100644 index 0000000000000000000000000000000000000000..fdb1eb1afb2ded3fb31d9f59a4487ce6a028163b --- /dev/null +++ b/workflows/install_dependencies/install_r_packages.R @@ -0,0 +1,31 @@ +#!/usr/bin/env Rscript + +################################################ +### Installation of R dependencies ############# +################################################ + +### Default (CRAN) + +if(!"tidyverse" %in% row.names(installed.packages())){install.packages("tidyverse")} +if(!"jsonlite" %in% row.names(installed.packages())){install.packages("jsonlite")} +if(!"openxlsx" %in% row.names(installed.packages())){install.packages("openxlsx")} +if(!"kableExtra" %in% row.names(installed.packages())){install.packages("kableExtra")} +if(!"shiny" %in% row.names(installed.packages())){install.packages("shiny")} +if(!"RColorBrewer" %in% row.names(installed.packages())){install.packages("RColorBrewer")} + +### From BiocManager + +if (!requireNamespace("BiocManager", quietly = TRUE)){install.packages("BiocManager")} +if(!"BiocManager" %in% row.names(installed.packages())){BiocManager::install()} +if(!"devtools" %in% row.names(installed.packages())){BiocManager::install("devtools")} +if(!"sleuth" %in% row.names(installed.packages())){BiocManager::install("pachterlab/sleuth")} + +### Test load packages + +library(tidyverse) +library(jsonlite) +library(openxlsx) +library(sleuth) +library(kableExtra) +library(shiny) +library(RColorBrewer)