-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdependency_check.R
More file actions
33 lines (28 loc) · 918 Bytes
/
dependency_check.R
File metadata and controls
33 lines (28 loc) · 918 Bytes
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
# List of CRAN and Bioconductor packages
cran_packages <- c(
"ggplot2", "patchwork", "dplyr", "readxl", "plot3D", "fmsb", "ggrepel",
"fs", "plotrix", "plyr", "philentropy", "reshape2", "ggplotify", "grid",
"cowplot", "parallel", "stringr", "data.table", "getopt"
)
bioc_packages <- c("waddR", "prada", "rhdf5", "limma")
# Install CRAN packages if missing
install_if_missing <- function(pkgs) {
for (pkg in pkgs) {
if (!requireNamespace(pkg, quietly = TRUE)) {
install.packages(pkg)
}
}
}
# Install Bioconductor packages if missing
install_bioc_if_missing <- function(pkgs) {
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
for (pkg in pkgs) {
if (!requireNamespace(pkg, quietly = TRUE)) {
BiocManager::install(pkg, ask = FALSE)
}
}
}
# Run installations
install_if_missing(cran_packages)
install_bioc_if_missing(bioc_packages)