-
Notifications
You must be signed in to change notification settings - Fork 8
/
setup.R
executable file
·37 lines (31 loc) · 1.25 KB
/
setup.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env Rscript
# To install to a non-default library location, set the environment variable
# R_LIBS_USER. Set Ncpus option to devtools::install with environment
# variable INSTALL_NCPUS. If not set Ncpus will default to 4.
ncpus <- as.numeric(Sys.getenv("INSTALL_NCPUS"))
if (is.na(ncpus)) {
ncpus <- 4
}
deps_only <- as.logical(Sys.getenv("DEPS_ONLY"))
if (is.na(deps_only)) {
deps_only <- FALSE
}
print(paste("Ncpus =", ncpus))
print(paste("Only install dependencies =", deps_only))
# Install devtools
if (!requireNamespace("devtools", quietly=TRUE)) {
install.packages("devtools", repos='http://cran.us.r-project.org')
}
# Install BiocManager
if (!requireNamespace("BiocManager", quietly=TRUE)) {
install.packages("BiocManager", repos='http://cran.us.r-project.org')
}
# Install flowCore and flowDensity separately with biocManger because it may fail
# when only using devtools::install to install bioconductor deps.
if (deps_only) {
BiocManager::install(c("flowCore", "flowDensity"), update = FALSE, ask = FALSE)
devtools::install_deps(dependencies=TRUE, upgrade="never", Ncpus=ncpus)
} else {
BiocManager::install(c("flowCore", "flowDensity"), update = FALSE, ask = FALSE)
devtools::install(dependencies=TRUE, upgrade="never", Ncpus=ncpus)
}