forked from angy89/BMDx
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall_dependencies.R
More file actions
53 lines (51 loc) · 1.77 KB
/
install_dependencies.R
File metadata and controls
53 lines (51 loc) · 1.77 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#Universal Bioconductor package installation function
install.bioc <- function(pkg){
vers <- getRversion()
if (vers >= "3.6"){
if (!requireNamespace("BiocManager", quietly = TRUE)) {
install.packages("BiocManager")
}
BiocManager::install(pkg)
}else{
if (!requireNamespace("BiocInstaller", quietly = TRUE)){
source("https://bioconductor.org/biocLite.R")
biocLite(pkg, suppressUpdates=TRUE)
}else{
BiocInstaller::biocLite(pkg, suppressUpdates=TRUE)
}
}
}
#Install Bioconductor dependencies
bioc_pkgs <- c(
"org.Hs.eg.db", "org.Mm.eg.db", "org.Rn.eg.db", "KEGG.db",
"reactome.db", "GOSim", "GO.db"
)
bioc_pkgs.inst <- bioc_pkgs[!(bioc_pkgs %in% rownames(installed.packages()))]
if(length(bioc_pkgs.inst)>0){
print(paste0("Missing ", length(bioc_pkgs.inst), " Bioconductor Packages:"))
for(pkg in bioc_pkgs.inst){
print(paste0("Installing Package:'", pkg, "'..."))
install.bioc(pkg)
print("Installed!!!")
}
}
#Install CRAN dependencies
cran_pkgs <- c(
"drc", "bmd", "alr3", "jtools", "zeallot", "ggplotify", "RColorBrewer",
"reshape", "gplots", "ggplot2", "shiny", "shinyjs", "shinydashboard",
"shinyFiles", "tibble", "plotly", "rhandsontable", "gProfileR", "DT",
"randomcoloR", "readxl", "cellranger", "devtools", "scales", "xlsx",
"gtools", "shinycssloaders", "shinyBS", "tidyverse", "gridExtra",
"gtable", "grid","XLConnect", "igraph", "UpSetR"
)
cran_pkgs.inst <- cran_pkgs[!(cran_pkgs %in% rownames(installed.packages()))]
if(length(cran_pkgs.inst)>0){
print(paste0("Missing ", length(cran_pkgs.inst), " CRAN Packages:"))
for(pkg in cran_pkgs.inst){
print(paste0("Installing Package:'", pkg, "'..."))
install.packages(
pkg, repo="http://cran.rstudio.org", dependencies=TRUE
)
print("Installed!!!")
}
}