-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathglobal.R
54 lines (47 loc) · 2.01 KB
/
global.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
47
48
49
50
51
52
53
54
# ------------------------------------------------------------------------------
# Simple Shiny template for annotations utils
# search, select, merge and download prototype
# ------------------------------------------------------------------------------
usePackage <- function(p, github, repos = getOption("repos"), ...) {
if (!missing(github)) {
## Install from github -- devtools::install_github will automatically skip
## if SHA of most recent commit matches what's installed already
devtools::install_github(paste(github, p, sep = "/"), ...)
}
if (!is.element(p, installed.packages()[,1])) {
install.packages(p, repos = repos, dependencies = TRUE)
}
library(p, character.only = TRUE)
}
usePackage("devtools")
usePackage("dplyr")
usePackage("tidyr")
usePackage("shiny")
usePackage("shinyBS", github = "ebailey78")
usePackage("shinythemes")
usePackage("ggplot2")
usePackage("shinydashboard")
usePackage("jsonlite")
usePackage("data.table")
usePackage("DT")
usePackage("syndccutils", github = "Sage-Bionetworks", subdir = "R")
usePackage("synapser", repos = "https://sage-bionetworks.github.io/ran")
# ----------------------------------------------------------------------
# login to synapse
# synLogin('me@nowhere.com', 'secret', rememberMe = TRUE)
# or caching credentials can also be done from the command line client:
# synapse login -u me@nowhere.com -p secret --rememberMe
# ----------------------------------------------------------------------
synLogin()
# ----------------------------------------------------------------------
options(stringsAsFactors = FALSE)
# by replacing the global dat variable
# you may use this app using the standard schema but your own melted data
dat <- get_synapse_annotations()
print(head(dat))
categories <- lapply(unique(dat$module), function(x) {x})
key <- unique(dat$key)
value <- unique(dat$value)
dat <- dat %>% mutate_all(as.character)
# Get release version from syanpe table annotations
release.version <- synGetAnnotations("syn10242922")$annotationReleaseVersion[[1]]