-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathui.R
executable file
·187 lines (140 loc) · 4.95 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
# save as 'ui.R'
# shiny ui
# Load library ------------------------------------------------------------
library(magrittr)
library(ggplot2)
library(tibble)
# For shiny
library(shiny)
library(shinyjs)
library(shinyBS)
library(shinyWidgets)
library(shinycssloaders)
library(shinydashboard)
# For front end
library(DT)
library(grid)
# library(highcharter)
# For network
library(igraph)
library(networkD3)
# For analysis
# library(GSVA)
# library(maftools)
# Load configuration ------------------------------------------------------
source(file = "config.R", local = TRUE)
# Load ui function --------------------------------------------------------
source(file = file.path(config$ui, "functions_ui.R"), local = TRUE)
# Header Start ------------------------------------------------------------
header <- dashboardHeader(
# Title
title = HTML(paste(
img(
src = "./imgs/01.GSCA_logo_01.png",
align = "middle",
class = "img-responsvie",
style = "height:55px !important;"
), ""
)),
dropdownMenuOutput("infoMenu"),
dropdownMenuOutput("logMenu")
)
# Header End --------------------------------------------------------------
# Sidebar Start -----------------------------------------------------------
sidebar <- dashboardSidebar(
sidebarMenu(
# Welcome ----
menuItem("Welcome", tabName = "welcome", icon = icon("home")),
# TCGA ----
menuItem(
"TCGA Cancer",
tabName = "tcga",
icon = icon("user-md"),
collapsible = TRUE,
menuSubItem("mRNA Expression", tabName = "tcga_expr"),
menuSubItem("Single Nucleotide Variation", tabName = "tcga_snv"),
menuSubItem("Copy Number Variation", tabName = "tcga_cnv"),
menuSubItem("Methylation", tabName = "tcga_meth"),
menuSubItem("Pathway Activity", tabName = "tcga_rppa"),
menuSubItem("miRNA Network", tabName = "tcga_mirna")
),
# Drug ----
menuItem(
"Drug Sensitivity",
tabName = "drug",
icon = icon("medkit")
),
# GTEx ----
menuItem(
"GTEx Normal Tissue",
tabName = "gtex",
icon = icon("suitcase"),
collapsible = TRUE,
menuSubItem("GTEx Expression", tabName = "gtex_expr"),
menuSubItem("GTEx eQTL", tabName = "gtex_eqtl")
),
# Downloads ----
# menuItem("Report", tabName = "downloads", icon = icon("floppy-o")),
# Tutorial ----
menuItem("Help", tabName = "help", icon = icon("rocket")),
# Help ----
# menuItem("Document", tabName = "document", icon = icon('file-text')),
# About ----
menuItem("Contact", tabName = "contact", icon = icon("address-book"))
)
)
# Sidebar End -------------------------------------------------------------
# Body Start --------------------------------------------------------------
body <- dashboardBody(
# for html head
shiny::tags$head(
shinyWidgets::useSweetAlert(), # For sweet alert
shinyjs::useShinyjs(), # For shinyjs
shinyjs::extendShinyjs(script = file.path(config$wd, "www", "js", "gscalite.js")),
shiny::tags$link(rel = "stylesheet", type = "text/css", href = "css/main.css"),
shiny::tags$script(type = "text/javascript", src = "js/main.js")
),
# Main body ----
tabItems(
# Welcome ----
source(file = file.path(config$wd, "ui", "welcome_ui.R"), local = TRUE)$value,
# GTEx ----
source(file = file.path(config$wd, "ui", "GTEx_exp_ui.R"), local = TRUE)$value,
source(file = file.path(config$wd, "ui", "GTEx_eqtl_ui.R"), local = TRUE)$value,
# TCGA ----
# expr ----
source(file = file.path(config$wd, "ui", "tcga_expr_ui.R"), local = TRUE)$value,
# cnv ----
source(file = file.path(config$wd, "ui", "tcga_cnv_ui.R"), local = TRUE)$value,
# snv ----
source(file = file.path(config$wd, "ui", "tcga_snv_ui.R"), local = TRUE)$value,
# meth ----
source(file = file.path(config$wd, "ui", "tcga_meth_ui.R"), local = TRUE)$value,
# rppa ----
source(file = file.path(config$wd, "ui", "tcga_rppa_ui.R"), local = TRUE)$value,
# mirna ----
source(file = file.path(config$wd, "ui", "tcga_mirna_ui.R"), local = TRUE)$value,
# Drug ----
source(file = file.path(config$wd, "ui", "drug_ui.R"), local = TRUE)$value,
# Tutorial ----
source(file = file.path(config$wd, "ui", "tutorial_ui.R"), local = TRUE)$value,
# Document ----
# source(file = file.path(config$wd, "ui", "document_ui.R"), local = TRUE)$value,
# About ----
source(file = file.path(config$wd, "ui", "contact_ui.R"), local = TRUE)$value
)
)
# Body End ----------------------------------------------------------------
# dashboadpage ------------------------------------------------------------
page <- dashboardPage(
title = "GSCA - Gene Set Cancer Analysis",
header = header,
sidebar = sidebar,
body = body
)
# Shiny UI ----------------------------------------------------------------
ui <- tagList(
div(id = "loading-content",h2("Loading...")),
shinyjs::hidden(div(id = "app-content", page))
)
shinyUI(ui = ui)