-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathserver.R
110 lines (86 loc) · 3.3 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
################################################################################
# Options, default settings, and load packages
################################################################################
# By default, the file size limit is 5MB. It can be changed by
# setting this option. Here we'll raise limit to 9MB.
options(shiny.maxRequestSize = 100 * 1024^2)
options(shiny.usecairo = FALSE)
library(magrittr)
modules_tbl <- MODULES_TBL %>%
dplyr::mutate(
"server_function" = purrr::map(.data$server_function_string, get),
)
ici_modules_tbl <- dplyr::filter(modules_tbl, .data$type == "ici")
cg_modules_tbl <- dplyr::filter(modules_tbl, .data$type == "cg")
sc_modules_tbl <- dplyr::filter(modules_tbl, .data$type == "scRNA")
tool_modules_tbl <- dplyr::filter(modules_tbl, .data$type == "tool")
################################################################################
# Begin Shiny Server definition.
################################################################################
shiny::shinyServer(function(input, output, session) {
shiny::observe({
query <- shiny::parseQueryString(session$clientData$url_search)
if (!is.null(query[['module']])) {
shinydashboard::updateTabItems(
session,
"explorertabs",
query[['module']]
)
}
})
# ICI Modules ----------------------------------------------------------
ici_cohort_obj <- call_iatlas_module(
"ici_cohort_selection",
iatlas.modules2::cohort_selection_server,
input,
session,
default_datasets = shiny::reactive(c("Gide_Cell_2019", "HugoLo_IPRES_2016")),
default_group = shiny::reactive("Responder"),
dataset_type = shiny::reactive("ici"),
display_module_availibility_string = shiny::reactive(F)
)
ici_modules_tbl %>%
dplyr::select("name", "server_function") %>%
purrr::pwalk(iatlas.app::call_iatlas_module, input, session, ici_cohort_obj)
# CG Modules ----------------------------------------------------------
cg_cohort_obj <- call_iatlas_module(
"cg_cohort_selection",
iatlas.modules2::cohort_selection_server,
input,
session
)
cg_modules_tbl %>%
dplyr::select("name", "server_function") %>%
purrr::pwalk(iatlas.app::call_iatlas_module, input, session, cg_cohort_obj)
# Tool Modules --------------------------------------------------------------
tool_modules_tbl %>%
dplyr::select("name", "server_function") %>%
purrr::pwalk(iatlas.app::call_iatlas_module, input, session)
# Single cell Modules --------------------------------------------------------------
sc_cohort_obj <- call_iatlas_module(
"sc_cohort_selection",
iatlas.modules2::cohort_selection_server,
input,
session,
default_datasets = shiny::reactive(c("MSK", "Vanderbilt")),
default_group = shiny::reactive("Responder"),
dataset_type = shiny::reactive("scrna"),
display_module_availibility_string = shiny::reactive(F)
)
sc_modules_tbl %>%
dplyr::select("name", "server_function") %>%
purrr::pwalk(iatlas.app::call_iatlas_module, input, session, sc_cohort_obj)
# Other ---------------------------------------------------------------------
call_iatlas_module(
"ici_overview",
ici_overview_server,
input,
session
)
call_iatlas_module(
"data_info",
data_info_server,
input,
session
)
})