-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathui.R
More file actions
210 lines (173 loc) · 11.5 KB
/
ui.R
File metadata and controls
210 lines (173 loc) · 11.5 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
# source: https://github.com/imbforge/DistancePlotter
# description: Generic tool to produce various types of plots from tabular data.
# description: Mainly tailored to be run on microscopy data and meant to analyse distance data of FISH stained foci in nuclei.
# description: This tool is the Shiny-R user interface that is supposed to work together with the server.R located in the same folder.
# constrains : Input is tabular (tab delimited) data including headers. First three columns ("Row", "Column", "Timepoint") are used to construct an Experiment-ID
# author: IMB Bioinformatics Core Facility (Oliver Drechsel)
library(shiny)
library(shinyjs)
library(colourpicker)
library(ggplot2)
library(DT)
# Define UI for application that draws a histogram
shinyUI(fluidPage(
# Application title
titlePanel("Distance Plotter"),
# Sidebar with a slider input for the number of bins
sidebarLayout(
sidebarPanel(
tabsetPanel( type="tabs",
#===========================================================================================================
tabPanel ("Data",
# get the data file
fileInput('file_input', 'Choose Input File',
accept=c('text/txt', 'text/tsv')
),
# experiment IDs (from column 1-3) are transformed to meaningful names given in this file
fileInput('file_translation', 'Choose Translation File'
)
),
#===========================================================================================================
tabPanel ("Plot",
selectInput("method", label = "Choose a plot",
choices = c("violin",
"violin (coloured)",
"boxplot",
"boxplot (coloured)",
"jitter",
"jitter (coloured)",
"density",
"density (fill)",
"density (fill, coloured)",
"histogram (stack)",
"histogram (stack, coloured)",
"histogram (dodge)",
"histogram (dodge, coloured)",
"barplot",
"barplot (coloured)"
),
selected = "violin"
),
uiOutput("column_names"), # which column to plot
uiOutput("plot_title"), # manually select a plot title
textInput("y_label", label = "Choose a y axis label", value = "count"), # influence the label of the y axis
numericInput("lower_limit", label = "minimum value", value = "0"), # the minimum value of y axis
# uiOutput("y_maximum"),
numericInput("upper_limit", label="maximum value", value = 100),
radioButtons("axis_scaling",
label = "y scaling",
choices = list("linear" = "continuous", "log10" = "log10"),
selected = "continuous"),
uiOutput("selector_column"),
radioButtons("selector_moreless",
label = "Less or more",
choices = list("all" = "all", "<" = "<", ">" = ">", "=" = "="),
selected = "all"
),
uiOutput("selector_value"),
actionButton('addSelector', 'Add Filter'),
checkboxGroupInput("selector_list",
label = "Select selection criteria",
choices = c()
)
),
#===========================================================================================================
tabPanel ("Samples",
actionButton('selectAllSamples', 'select all'),
actionButton('selectNoSamples', 'select none'),
uiOutput("sample_names"), # which samples to plot
uiOutput("sample_colours")
)
)
),
# Show a plot of the generated distribution
mainPanel(
img(src='IMB_logo_small.png', align = "right"),
tabsetPanel( type="tabs",
tabPanel ("Usage",
includeMarkdown("README_viewInPlotter.md")),
tabPanel ("Plot & Table",
fluidRow(
column(12,
# show a density plot (influenced by "method"'s data set and measurement count)
plotOutput("densPlot"),
# produce a row of download button
fluidRow(
column(2,
# download the plot
downloadButton('downloadPlot', 'Download Plot (PDF)')
),
column(2,
# download the plot as png
downloadButton('downloadPlotPng', 'Download Plot (PNG)')
),
# download plot settings & input variables
column(2,
downloadButton('downloadSettings', 'Download Settings')
),
# download the input data or unzipped/shaped data
column(2,
downloadButton('downloadData', 'Download Raw Data')
),
# download filtered table
column(2,
downloadButton('downloadFilteredData', 'Download Filtered Data')
),
tags$br(),
tags$hr(),
tags$br(),
# show a head of the new data set (influenced by "method")
#tableOutput("view")
DT::dataTableOutput("viewData")
)
)
)
),
tabPanel ("Statistics",
tags$br(),
tags$div(tags$em("The following tables show some statistics and data properties of column: ", uiOutput("plot_column"))),
tags$br(),
tags$h4('Sample similarity'),
tags$div("Perform a 'Mann-Whitney' test on the column that was selected for plotting. The table contains p-values of an all against all comparison. "),
tags$br(),
# produce a table containing the p values of the respectively tested column
# DT::dataTableOutput("MannWitneyTest"),
tableOutput("MannWitneyTestSimple"),
# downlowad the stuff
downloadButton('downloadTable', 'Download Table'),
tags$br(),
tags$hr(),
tags$br(),
tags$h4("Filter statistics"),
tags$div("The plotting tab provides opportunity to filter data. How many nuclei survived the selection criteria is stated in the following table."),
tags$br(),
# produce a table containing some statistics on how many cells survived the filter criteria
# DT::dataTableOutput("FilterStats"),
tableOutput("FilterStatsSimple"),
downloadButton('downloadStats', 'Download Statistics'),
tags$br(),
tags$hr(),
tags$br(),
tags$h4("Data properties"),
tags$div("The plotted and filtered data can be used to calculate some properties of the data. ",
tags$br(),
"Please select what you want to have calculated."),
tags$br(),
# produce a table on the column properties
selectInput("prop_method", label = "Choose a calculation",
choices = c("mean" = "mean",
"median" = "median",
"standard deviation" = "sd"
),
selected = "mean"
),
# DT::dataTableOutput("DataProps"),
tableOutput("DataPropsSimple"), # simple version of table that doesn't look very nice
downloadButton('downloadProps', 'Download Properties')
)
) # end of tabsetPanel
# just report some debug messages
#textOutput("text1")
)
)
))