-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.R
executable file
·38 lines (38 loc) · 874 Bytes
/
run.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
#!/usr/bin/env Rscript
suppressPackageStartupMessages({
lapply(c(
"shiny",
"yaml",
"AnnotationHub",
"clusterProfiler",
"DOSE",
"AnnotationDbi",
"ggplot2",
"stringr",
"magrittr",
"dplyr",
"plyr",
"purrr",
"rstatix",
"FSA",
"lattice",
"car",
"emmeans",
"corrplot",
"rentrez",
"DT",
"lattice"
), require, character.only = TRUE)
})
cmdArgs <- commandArgs(trailingOnly = FALSE)
root_dir <- normalizePath(dirname((sub("^--file=", "", cmdArgs[grep("^--file=", cmdArgs)]))))[1]
config <- yaml::read_yaml(file.path(root_dir, "config.yml"))
port <- cmdArgs[length(cmdArgs)]
if (is.na(port) || grepl("^--file=", port, fixed = F)) {
port <- config$port
} else {
port <- as.numeric(port)
}
options(shiny.port = port)
options(shiny.host = "0.0.0.0")
runApp(appDir = root_dir, launch.browser = F)