From 67f5c42cc30d974cfe556b0219553156673dc106 Mon Sep 17 00:00:00 2001
From: Dominik <dominik.brilhaus@hhu.de>
Date: Wed, 10 Aug 2022 21:19:58 +0200
Subject: [PATCH] polish installation notes

---
 workflows/_dependencies/install_r_packages.R  | 43 -------------------
 .../install_cwl.md                            |  0
 .../install_kallisto.md                       |  0
 .../install_dependencies/install_r_packages.R | 31 +++++++++++++
 4 files changed, 31 insertions(+), 43 deletions(-)
 delete mode 100644 workflows/_dependencies/install_r_packages.R
 rename workflows/{_dependencies => install_dependencies}/install_cwl.md (100%)
 rename workflows/{_dependencies => install_dependencies}/install_kallisto.md (100%)
 create mode 100644 workflows/install_dependencies/install_r_packages.R

diff --git a/workflows/_dependencies/install_r_packages.R b/workflows/_dependencies/install_r_packages.R
deleted file mode 100644
index ce4e643..0000000
--- 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 0000000..fdb1eb1
--- /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)
-- 
GitLab