-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.R
More file actions
212 lines (164 loc) · 8.4 KB
/
Copy pathui.R
File metadata and controls
212 lines (164 loc) · 8.4 KB
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
# VisualizeTRACS: A Browser-based tool for TRACS data
# Visualize and explore your data from TRACS (https://github.com/developerpiru/TRACS)
# input: a TRACS output file (csv)
# See Github for more info & ReadMe: https://github.com/developerpiru/VisualizeTRACS
app_version = "3.0.1"
#function to check for required packages and install them if not already installed
installReqs <- function(package_name, bioc){
if (requireNamespace(package_name, quietly = TRUE) == FALSE) {
install.packages(package_name)
}
}
#check if required libraries are installed, and install them if needed
installReqs("shiny")
installReqs("shinydashboard")
installReqs("scatterD3")
installReqs("plotly")
installReqs("DT")
installReqs('shinyjqui')
installReqs('colourpicker')
library(shiny)
library(shinydashboard)
library(scatterD3)
library(plotly)
library(DT)
library("shinyjqui")
library("colourpicker")
ui <- dashboardPage(
dashboardHeader(title = "VisualizeTRACS"),
dashboardSidebar(
tags$style(".skin-purple .sidebar
a {
color: #444;
}"),
tags$style(".skin-purple .sidebar
a.sidebarlink:link, a.sidebarlink:visited {
color: #FFF;
}"),
tags$style(".skin-purple .sidebar
a.sidebarlink:hover {
color: #777;
}"),
tags$style(".skin-purple .sidebar
.center {
text-align: center;
}"),
tags$style(".skin-purple .sidebar
.borderbox {
border: 2px solid #666;
padding: 5px 5px 5px 5px;
margin: 5px;
}"),
conditionalPanel("input.navigationTabs == 'LoadDataTab'",
div(id = 'LoadDataTab_SideBar',
tags$div('class'="center",
h4("Welcome to VisualizeTRACS!"),
HTML('This is the browser-based data visualization and exploration tool for TRACS<br><br>'),
tags$p(
tags$a(href="https://github.com/developerpiru/VisualizeTRACS",
target="_blank",
class ="sidebarlink",
"Check GitHub for help & info")
))
)),
conditionalPanel("input.navigationTabs == '3DPlotTab'",
div(id = '3DPlotTab_SideBar',
tags$div('class'="center",
tags$br(),
#buttons
actionButton("btnshowall", "Show all genes"),
actionButton("btndefault", "Default values")
),
h4("Filtering options"),
tags$div('class'="borderbox",
#Min Initial ES input
numericInput("Library.ES",
"Min Library ES",
value = 0),
#Min Initial ES input
numericInput("Initial.ES",
"Min Initial ES",
value = 0),
#Min Final ES input
numericInput("Final.ES",
"Max Final ES",
value = 500000),
#Min ER
numericInput("Min.ER",
"Min Enrichment Ratio",
value = -100),
#Max ER
numericInput("Max.ER",
"Max Enrichment Ratio",
value = 0),
#p value
numericInput("pval",
"Max P value (genes above this are dropped)",
value = 1),
#q value
numericInput("qval",
"Max q value (genes above this are dropped)",
value = 0.05)
),
h4("Colors"),
tags$div('class'="borderbox",
colourInput("threeDfilteredColor", "Filtered color", "#2714FC", allowTransparent = FALSE),
colourInput("threeDUnfilteredColor", "Unfiltered color", "#B8B4B4", allowTransparent = FALSE)
)
)),
conditionalPanel("input.navigationTabs == '2DPlotTab'",
div(id = '2DPlotTab_SideBar',
h4("Colors"),
tags$div('class'="borderbox",
colourInput("filteredColor", "Filtered color", "#2714FC", allowTransparent = FALSE),
colourInput("UnfilteredColor", "Unfiltered color", "#B8B4B4", allowTransparent = FALSE)
)
)),
conditionalPanel("input.navigationTabs == 'DataTableTab'",
div(id = 'DataTableTab_SideBar',
HTML("<p align='center'><br>"),
downloadButton("downloadData_CELL_LINE_1", "Download Filtered Genes"),
#HTML("<p align='center'><br>"),
downloadButton("downloadSelectedData", "Download Selected Genes")
))
), #end dashboard Sidebar
dashboardBody(
tags$head(tags$style(HTML('
.main-header .logo {
font-family: "Arial";
font-weight: bold;
font-size:20px;
}
.content-wrapper {
background-color: #FFFFFF !important;
}
'))),
tabsetPanel(
id = "navigationTabs",
tabPanel("Load data", id = "LoadDataTab", value= "LoadDataTab", fluidRow(
#Load TRACS analysis file
fileInput("TRACSfile1", "Select TRACS output file",
multiple = FALSE,
accept = c(".csv"))
)),
# full 3D plot tab
tabPanel("3D Plot", id = "3DPlotTab", value= "3DPlotTab", fluidRow(
HTML("<h3><p align='center'>Plot of all genes</p></h3>"),
column(12, jqui_resizable( #jqui resizable canvas,
plotlyOutput("full3Dplot_CELL_LINE_1", height = "100%", width = "100%"))
))),
# Plotly graph with polygon select
tabPanel("2D Plot", id = "2DPlot", value= "2DPlotTab", jqui_resizable(plotlyOutput("filteredPlotlyColour_CELL_LINE_1", height = "800", width="100%")),
#verbatimTextOutput("plotly_select")
#downloadButton("downloadSelectedData", "Download Table"),
DT::dataTableOutput("plotly_select")
),
# Filtered table tab for CELL_LINE_1
tabPanel("Data Table", id = "DataTableTab", value= "DataTableTab",
#HTML("</p>"),
DT::dataTableOutput("filteredtable_CELL_LINE_1")
)
)
), #end dashboardBody
skin = "blue"
) #end dashboardPage