-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinstall.R
47 lines (41 loc) · 1.09 KB
/
install.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
38
39
40
41
42
43
44
45
46
pkgs <- c(
"Rhtslib",
"geneplotter",
"pheatmap",
"DESeq2",
"edgeR",
"limma",
"QUBIC",
"impute",
"preprocessCore",
"AnnotationDbi",
"RUVSeq",
"EDASeq",
"WGCNA",
"multtest",
"biomaRt",
"xml2",
"rvest",
"ComplexHeatmap",
"MAST")
versionSpecificPkgs <- c(
"org.Hs.eg.db" = "3.12",
"org.Mm.eg.db" = "3.12",
"GO.db" = "3.12"
)
# Install specific versions of packages
sapply(names(versionSpecificPkgs), function(pkg) {
pkgVersion <- versionSpecificPkgs[pkg]
BiocManager::install(pkgs = pkg, update = FALSE, ask = FALSE, version = pkgVersion)
})
ap.db <- available.packages(contrib.url(BiocManager::repositories()))
ap <- rownames(ap.db)
fnd <- pkgs %in% ap
pkgs_to_install <- pkgs[fnd]
ok <- BiocManager::install(pkgs_to_install, update=FALSE, ask=FALSE) %in% rownames(installed.packages())
if (!all(fnd))
message("Packages not found in a valid repository (skipped):\n ",
paste(pkgs[!fnd], collapse=" \n "))
if (!all(ok))
stop("Failed to install:\n ",
paste(pkgs_to_install[!ok], collapse=" \n "))