forked from p2m2/docker-XcmsViewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.R
executable file
·69 lines (59 loc) · 1.68 KB
/
server.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
library(xcmsViewer)
library(omicsViewer)
source("/home/shiny/app/landingPage.R")
# source("landingPage.R")
ll <- list(
list(
tabName = "Annotation",
moduleName = "xcmsannot",
moduleUi = xcmsViewer:::xcmsAnnotationTab_ui,
moduleServer = xcmsViewer:::xcmsAnnotationTab_module
)
)
returnValueOrNULL <- function(x, v) {
r <- x$header[x$axis == v]
if (is.na(r))
return(NULL)
r
}
server <- function(input, output, session) {
ns <- session$ns
v <- callModule(landingPage_module, id = "test")
showLanding <- reactiveVal(TRUE)
observe({
showLanding ( length(v()) != 1 )
})
output$uis <- renderUI({
req(showLanding())
landingPage_ui("test")
})
observe(print(v()))
callModule(
omicsViewer:::app_module, id = "app", .dir = v,
filePattern = ".RDS$|.DB$",
esetLoader = function(x) {
if (grepl(".db$", x, ignore.case = TRUE)) {
obj <- RSQLite::dbConnect(RSQLite::SQLite(), x)
x <- RSQLite::dbGetQuery(obj, 'SELECT * FROM defaultVis;')
attr(obj, "fx") <- returnValueOrNULL(x, "fx")
attr(obj, "fy") <- returnValueOrNULL(x, "fy")
attr(obj, "sx") <- returnValueOrNULL(x, "sx")
attr(obj, "sy") <- returnValueOrNULL(x, "sy")
} else if (grepl("RDS", x, ignore.case = TRUE)) {
obj <- readRDS(x)
}
obj
},
exprsGetter = getFeatureExprs,
pDataGetter = getPheno,
fDataGetter = getFeatureMeta,
defaultAxisGetter = function(x, what) attr(x, what),
additionalTabs = ll,
appName = "XcmsViewer",
appVersion = packageVersion("xcmsViewer")
)
output$aout <- renderUI({
req(!showLanding())
omicsViewer:::app_ui("app")
})
}