Switch to unified view

a b/code_final/install_renv.sh
1
#!/usr/bin/env bash
2
3
## Create environment w/ conda ## %%%%%%%%%%%%%%%%%%%%%%%%%%
4
# Check if environment exists in a conditinonal statement
5
if [[ -z $(conda env list | grep r_env) ]]; then
6
  mamba create -y -n r_env r-essentials r-base
7
fi
8
mamba activate r_env
9
10
## Set up renv ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
Rscript -e "
12
userdir <- unlist(strsplit(Sys.getenv('R_LIBS_USER'),':'))[1L]
13
repoloc <- 'https://cran.r-project.org/'
14
install.packages('renv', lib = userdir, repos = repoloc)
15
"
16
Rscript -e "renv::init()"
17
18
# Install specific packages ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
19
# Rscript -e "install.packages('NMF', repos='http://R-Forge.R-project.org')"
20
Rscript -e "
21
source('http://renozao.github.io/repotools/install.R')
22
if (!require('BiocManager', quietly = TRUE))
23
    install.packages('BiocManager')
24
BiocManager::install('Biobase')
25
repotools::install.pkgs('NMF', force=FALSE, quiet=FALSE)
26
"
27
28
# visutils and Seurat is a dependency
29
Rscript -e "
30
if (requireNamespace('devtools', quietly = TRUE)) {
31
  userdir <- unlist(strsplit(Sys.getenv('R_LIBS_USER'),':'))[1L]
32
  repoloc <- 'https://cran.r-project.org/'
33
  install.packages('devtools', lib = userdir, repos = repoloc)
34
}
35
install.packages("fftwtools")
36
BiocManager::install("EBImage")
37
devtools::install_github('iaaka/visutils')
38
"
39
40
# Rscript -e "
41
# if (requireNamespace('remotes', quietly = TRUE)) {
42
#   userdir <- unlist(strsplit(Sys.getenv('R_LIBS_USER'),':'))[1L]
43
#   repoloc <- 'https://cran.r-project.org/'
44
#   install.packages('remotes', lib = userdir, repos = repoloc)
45
# }
46
# remotes::install_github('satijalab/seurat', 'seurat5', quiet = TRUE)
47
# "