forked from Penncil/Xmeta_online_platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.R
557 lines (499 loc) · 22.8 KB
/
ui.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
library(shinydashboard)
library(shinyjs)
library(shinyBS)
library(metafor)
library(metasens)
library(datasets)
library(shiny)
library(netmeta)
library(knitr)
library(datasets)
library(DT)
library(RMySQL)
source('unimod.R')
# binary outcomes
source('unimod_bi.R')
## multivariate meta-analysis
# continuous outcomes
source('mulmod.R')
# binary outcomes
source('mulmod_bi.R')
## network meta-analysis
# continuous outcomes
source('netmod.R')
# binary outcomes
source('netmod_bi.R')
faq <- source("faq.R", local=TRUE)[[1]]
jsCode <- '
shinyjs.getcookie = function(params) {
var cookie = Cookies.get("id");
if (typeof cookie !== "undefined") {
Shiny.onInputChange("jscookie", cookie);
} else {
var cookie = "";
Shiny.onInputChange("jscookie", cookie);
}
}
shinyjs.setcookie = function(params) {
Cookies.set("id", escape(params), { expires: 0.5 });
Shiny.onInputChange("jscookie", params);
}
shinyjs.rmcookie = function(params) {
Cookies.remove("id");
Shiny.onInputChange("jscookie", "");
}
'
passwdInput <- function(inputId, label) {
tagList(
tags$label(label),
tags$input(id = inputId, type="password", value="")
)
}
ui <- dashboardPage(
#===========================================================
###############################
#### jessie changed here, 1229#
################################
# change the color of the theme
skin = "blue",
dashboardHeader(title = "XMETA Online Analysis",
tags$li(
class="dropdown",
actionLink("login", label="Log In")
),
tags$li(
class="dropdown",
actionLink("signup", label="Sign Up")
),
tags$li(
class="dropdown",
useShinyjs(),
extendShinyjs(text = jsCode),
includeScript(path = "www/passwdInputBinding.js",type="text/javascript"),
includeScript(path = "www/md5.js",type="text/javascript"),
includeScript(path = "www/js.cookie.js")
),
# this should be added when the user are logged in
# to be updated
dropdownMenu(type = "messages",
messageItem(
from = "Sales Dept",
message = "Sales are steady this month."
),
messageItem(
from = "New User",
message = "How do I register?",
icon = icon("question"),
time = "13:45"
),
messageItem(
from = "Support",
message = "The new server is ready.",
icon = icon("life-ring"),
time = "2014-12-01"
)
),
dropdownMenu(type = "notifications",
notificationItem(
text = "5 new users today",
icon("users")
),
notificationItem(
text = "12 items delivered",
icon("truck"),
status = "success"
),
notificationItem(
text = "Server load at 86%",
icon = icon("exclamation-triangle"),
status = "warning"
)
),
dropdownMenu(type = "tasks", badgeStatus = "success",
taskItem(value = 90, color = "green",
"Documentation"
),
taskItem(value = 17, color = "aqua",
"Project X"
),
taskItem(value = 75, color = "yellow",
"Server deployment"
),
taskItem(value = 80, color = "red",
"Overall project"
)
)
###############################
#### changes end here, 1229#
################################
),
dashboardSidebar(
sidebarMenu(
id = "tabs",
#===========================================================
###############################
#### jessie changed here, 1229#
################################
sidebarSearchForm(textId = "search", buttonId = "searchButton",
label = "Search..."),
menuItem("Introduction",tabName = 'intro',icon = icon("list")),
###############################
#### changes end here, 1229#
################################
menuItem("Tutorials", tabName = 'tutorials',icon = icon("graduation-cap")),
menuItem('dashboard',icon=icon("dashboard"),
menuItem("Univariate MA dashboard", tabName = "Uni_dashboard", icon = icon("list-alt"),
menuSubItem("Continuous outcomes", tabName = "uni_continuous"),
menuSubItem("Binary outcomes",tabName = "uni_binary"),
menuSubItem('Survival outcomes', tabName = 'uni_sur')),
menuItem("Multivariate MA dashborad", tabName = "Mul_dashboard", icon = icon("list-alt"),
menuSubItem("Continuous outcomes", tabName = "mul_continuous"),
menuSubItem("Binary outcomes",tabName = "mul_binary"),
menuSubItem('Survival outcomes', tabName = 'mul_sur')),
menuItem("Network MA dashborad", tabName = "Net_dashboard", icon = icon("list-alt"),
menuSubItem("Continuous outcomes", tabName = "net_continuous"),
menuSubItem("Binary outcomes",tabName = "net_binary"),
menuSubItem('Survival outcomes', tabName = 'net_sur'))
),
menuItem("Information", icon=icon("info-circle"), tabName="info"),
#===========================================================
###############################
#### jessie changed here, 1229#
################################
menuItem(
text = "My Search Form",
icon = shiny::icon("search"),
shinydashboard::sidebarSearchForm(
textId = "txtSearch",
buttonId = "btnSearch",
label = "Search..."
)
),
tags$a(href="https://www.xmeta.wiki/", target="_blank", icon("home"),
"Back to XMETA Homepage", style="padding: 5px; margin: 15px; font-size: 12px; margin-top: 10px;")
###############################
#### changes end here, 1229#
################################
# actionButton("help", "Take tour", style="margin: 10px 15px 10px 15px; width: 200px",
# class="btn-flat action-button btn-block", icon=icon("question-circle"))
# menuItem("Log in", icon=icon("info-circle"), tabName="Loggin")
)
),
dashboardBody(
tabItems(
# First tab content
tabItem(tabName = "intro",
h2(strong("Welcome to X-META Online Analysis Platform")),
br(),
br(),
h4(p("This platform is an interactive toolbox for meta-analysis.
It allows you to use meta-analysis methods written in R programming
language to get statistical results from your data. Click on either of the tabs on the side bar to access the corresponding Online Analysis platform or
keep scrolling to learn more about how to use the tool and get started."),style="text-align: justify;"),
br(),
h3("Here is the pipeline diagram for the plarform:"),
HTML('
<div style="clear: left;"><img src="http://oi63.tinypic.com/w2dijo.jpg"
width="80%" height="80%" /></div>'
)
),
# Second tab content
tabItem(tabName = "tutorials",
h3(strong("How to use our ONLINE ANALYSIS platform?")),
br(),
h4(strong("I: Using Our Sample Data")),
h4("1. Before uploading your own data, you can download our sample datasets to explore the functions of our platform."),
br(),
h4("UMA:"),
h4("Univariate Meta-analysis with Continuous Outcomes: ",a("sample dataset",
href="https://drive.google.com/open?id=1zIOVrWe9fD-QCsLGA2bF025AHkjxxflT",
target="_blank")),
h4("Univariate Meta-analysis with Binary Outcomes: ",a("sample dataset",
href="https://drive.google.com/open?id=1VJyyTfozRs_kfLqT_CXueV-hWd6EQ2A0",
target="_blank")),
h4("Univariate Meta-analysis with Survival Outcomes: ",a("coming soon")),
br(),
h4("MMA:"),
h4("Multivariate Meta-analysis with Continuous Outcomes: ",a("coming soon")),
h4("Multivariate Meta-analysis with Binary Outcomes: ",a("coming soon")),
h4("Multivariate Meta-analysis with Survival Outcomes: ",a("coming soon")),
br(),
h4("NMA:"),
h4("Network Meta-analysis with Continuous Outcomes: ",a("sample dataset",
href="https://drive.google.com/file/d/1FdFbjO5VZWevICLpKWhPLWe0N6VvOT09/view",
target="_blank")),
h4("Network Meta-analysis with Binary Outcomes: ",a("coming soon")),
h4("Network Meta-analysis with Survival Outcomes: ",a("coming soon")),
br(),
h4("2. Once you have the CSV file on your laptop, choose the corresponding method of meta-analysis you would like to conduct.
In this example, we selected univariate meta-analysis and reached the following website:"),
HTML('
<div style="clear: left;"><img src="https://static.wixstatic.com/media/81a271_fba0e970fc82444aa53b8acfb93c8ead~mv2_d_2582_1468_s_2.png/v1/fill/w_1494,h_852,al_c,usm_0.66_1.00_0.01/81a271_fba0e970fc82444aa53b8acfb93c8ead~mv2_d_2582_1468_s_2.png"
width="70%" height="70%" /></div>'
),
h4("3. Click the 'Browse' button and keep 'Header' checked. Upload 'dataset_umeta.csv'.
Once the file is uploaded, the system will automatically display the following screen:"),
HTML('
<div style="clear: left;"><img src="https://static.wixstatic.com/media/81a271_e2d4938bca5140d595930d4e46448e30~mv2.png/v1/fill/w_1494,h_378,al_c,usm_0.66_1.00_0.01/81a271_e2d4938bca5140d595930d4e46448e30~mv2.png"
width="70%" height="70%" /></div>'
),
h4("4. On the left side bar, you will see the outputs of the Online Analysis,
including various plots and other results. You can also download the analysis report in PDF."),
HTML('
<div style="clear: left;"><img src="http://oi68.tinypic.com/23jqw0i.jpg"
width="30%" height="30%" /></div>'
),
h4("5. On the panel, you can choose to download the analysis report in PDF."),
HTML('
<div style="clear: left;"><img src="http://oi64.tinypic.com/wbe13d.jpg"
width="30%" height="30%" /></div>'
),
br(),
h4(strong("II: Get Started: Using Your Own Data")),
h4("1. Our online platform requires a fixed format of Excel files. Results cannot be presented if a file with different formatting is uploaded.
Please download the following templates and fill them in your own data:"),
br(),
h4("UMA:"),
h4("Univariate Meta-analysis with Continuous Outcomes: ",a("sample template",
href="https://drive.google.com/file/d/19QGLbmTPeQatOqNVi7-xcr6x6eGmh7s6/view",
target="_blank")),
h4("Univariate Meta-analysis with Binary Outcomes: ",a("coming soon")),
h4("Univariate Meta-analysis with Survival Outcomes: ",a("coming soon")),
br(),
h4("MMA:"),
h4("Multivariate Meta-analysis with Continuous Outcomes: ",a("coming soon")),
h4("Multivariate Meta-analysis with Binary Outcomes: ",a("coming soon")),
h4("Multivariate Meta-analysis with Survival Outcomes: ",a("coming soon")),
br(),
h4("NMA:"),
h4("Network Meta-analysis with Continuous Outcomes: ",a("sample template",
href="https://drive.google.com/file/d/1SHI7ZHfm47QmAcnovuhCfyin6NMaK9L-/view",
target="_blank")),
h4("Network Meta-analysis with Binary Outcomes: ",a("coming soon")),
h4("Network Meta-analysis with Survival Outcomes: ",a("coming soon")),
br(),
h4("2. Repeat step 2,3,4 from the Tutorial above.")
),
###############################################
#################### UMA ######################
###############################################
# continuous outcomes
tabItem(tabName = "uni_continuous",
tabBox(
id = "unicon",
side = "left", height = "600px",width = "1000px",
selected = "Task 1",
tabPanel("Task 1", uniModUI("first")),
tabPanel("Task 2", uniModUI("second")),
tabPanel("Task 3", uniModUI("third")),
tabPanel("Task 4", uniModUI("fourth")),
tabPanel("Task 5", uniModUI("fifth"))
)
),
# binary outcomes
tabItem(tabName = "uni_binary",
tabBox(
id = "unibinary",
side = "left", height = "600px",width = "1000px",
selected = "Task 1",
tabPanel("Task 1", uniModBiUI("first_bi")),
tabPanel("Task 2", uniModBiUI("second_bi")),
tabPanel("Task 3", uniModBiUI("third_bi")),
tabPanel("Task 4", uniModBiUI("fourth_bi")),
tabPanel("Task 5", uniModBiUI("fifth_bi"))
)#########
),
# survival outcomes
tabItem(tabName = "uni_sur",
h2("Coming soon!")
),
###############################################
#################### MMA ######################
###############################################
# continuous outcomes
tabItem(tabName = "mul_continuous",
tabBox(
id = "mulcon",
side = "left", height = "600px",width = "1000px",
selected = "Task 1",
tabPanel("Task 1", mulModUI("mul_first")),
tabPanel("Task 2", mulModUI("mul_second")),
tabPanel("Task 3", mulModUI("mul_third")),
tabPanel("Task 4", mulModUI("mul_fourth")),
tabPanel("Task 5", mulModUI("mul_fifth"))
)
),
# binary outcomes
tabItem(tabName = "mul_binary",
tabBox(
id ="mulbinary",
side = "left", height = "600px",width = "1000px",
selected = "Task 1",
tabPanel("Task 1", mulModBiUI("mul_first_bi")),
tabPanel("Task 2", mulModBiUI("mul_second_bi")),
tabPanel("Task 3", mulModBiUI("mul_third_bi")),
tabPanel("Task 4", mulModBiUI("mul_fourth_bi")),
tabPanel("Task 5", mulModBiUI("mul_fifth_bi"))
)
),
# survival outcomes
tabItem(tabName = "mul_sur",
h2("Coming soon!")
),
###############################################
#################### NMA ######################
###############################################
# continuous outcomes
tabItem(tabName = "net_continuous",
tabBox(
id = "netcon",
side = "left", height = "600px",width = "1000px",
selected = "Task 1",
tabPanel("Task 1", netModUI("n_first")),
tabPanel("Task 2", netModUI("n_second")),
tabPanel("Task 3", netModUI("n_third")),
tabPanel("Task 4", netModUI("n_fourth")),
tabPanel("Task 5", netModUI("n_fifth"))
)
),
# binary outcomes
tabItem(tabName = "net_binary",
tabBox(
id = "netbinary",
side = "left", height = "600px",width = "1000px",
selected = "Task 1",
tabPanel("Task 1", netModBiUI("n_first_bi")),
tabPanel("Task 2", netModBiUI("n_second_bi")),
tabPanel("Task 3", netModBiUI("n_third_bi")),
tabPanel("Task 4", netModBiUI("n_fourth_bi")),
tabPanel("Task 5", netModBiUI("n_fifth_bi"))
#tabPanel("Log in",uiOutput("uiLogin"),textOutput("pass"))
)
),
# survival outcomes
tabItem(tabName = "net_sur",
h2("Coming soon!")
),
# Fourth tab content
tabItem(tabName = "info",
h2("About this application"),
p("This online analysis platform works with different available methods and a variety of formats of data,
enabling users to quickly obtain the meta-analysis results without writing any code.", style="text-align:justify"),
h2("Frequently asked questions"),
faq,
h2("Contact information"),
HTML('
<div style="clear: left;"><img src="http://oi66.tinypic.com/2m3nrpc.jpg"
alt="" style="float: left; margin-right:5px" width="12%" height="12%" /></div>
<p>Yong Chen<br/>
Assistant Professor<br/>
Department of Biostatistics<br/>
The Perelman School of Medicine, University of Pennsylvania<br/>
<a href="https://dbe.med.upenn.edu/biostat-research/YongChen" target="_blank">Website.io</a>
</p>'
),
p("For questions about this application, please email [email protected]")
),
#===========================================================
###############################
#### jessie changed here, 1229#
################################
tabItem(tabName = "homepage",
'https://www.xmeta.wiki/'
)
###############################
#### changes end here, 1229#
################################
# tabItem(tabName = "Loggin",
# tabBox(
# side = "left", height = "600px",width = "1000px",
# selected = "Log in",id ="Loginout",
# tabPanel("Log in",wellPanel(
# textInput("userName", "User Name:"),
# passwdInput("passwd", "Pass word:"),
# br(),
# actionButton("Login", "Log in"),
# h2("Don't have a acconut? Join in!"),
# actionButton("Signup", "Sign up"),
# textOutput("pass")
# )),
# tabPanel("Sign Up",wellPanel(
# h2("Create your own profile"),
# textInput("userName1", "User Name:"),
# passwdInput("passwd1", "Pass word:"),
# br(),
# actionButton("Signupcommit", "Sign up"),
# actionButton("BacktoLogin","Back to Log in Page"),
# verbatimTextOutput('Status_Sign')
#
# )),
# # tabPanel("Log in",tags$div(uiOutput("uiLogin")),textOutput("pass")),
# tabPanel("Log Out",wellPanel(
#
# br(),
# actionButton("Logout", "Log Out")
#
# )),
# tabPanel("Log status",mainPanel(
# verbatimTextOutput('inpass')
# ))
#
# )
# )
)
)
)
ui_DashHeader <-
dashboardHeader(title = "XMETA Online Analysis",
tags$li(class="dropdown",
tags$a(href="https://www.xmeta.wiki/", target="_blank",
"X-META HOMEPAGE",align = "right", style="padding: 15px; margin: 0px;")
)
)
ui1 = dashboardPage(
dashboardHeader(title = "XMETA Online Analysis"
,
tags$li(class="dropdown",
tags$a(href="https://www.xmeta.wiki/", target="_blank",
"X-META HOMEPAGE",align = "right", style="padding: 15px; margin: 0px;")
)
),
(uiOutput("sideBar")),
uiOutput("DashBody")
)
ui2 <- dashboardPage(
dashboardHeader(title = "XMETA Online Analysis"
,
#uiOutput("test",container =tags$li,class="dropdown")
tags$li(class="dropdown",uiOutput("test"))
),
(uiOutput("sideBar")),
uiOutput("DashBody")
)
UI <- bootstrapPage(
# Add custom CSS & Javascript;
tagList(
tags$head(
tags$link(rel="stylesheet", type="text/css",href="style.css"),
tags$script(type="text/javascript", src = "md5.js"),
tags$script(type="text/javascript", src = "passwdInputBinding.js")
)
),
## Login module;
div(class = "login",
uiOutput("uiLogin"),
textOutput("pass")
)
)
shinyUI(
ui)
# shinyUI(
#
# UI
#
# )
#tagList(HTML(
# '<body class="skin-blue" style="min-height: 611px;">
# '
# ),,HTML('</body>')
# )