-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
173 lines (149 loc) · 9.67 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
# This app is supposed to plot multiple data sets based on the selection of another plot
if(!require("colourpicker")) {
install.packages("colourpicker")
library("colourpicker")
} # for colourInput
if (!require("ggplot2")) {
install.packages("ggplot2")
library("ggplot2")
}
if (!require("scales")) {
install.packages("scales")
library("scales")
} # for oob=squish
if (!require("shiny")) {
install.packages("shiny")
library("shiny")
}
# Define UI for application that draws a histogram
shinyUI(fluidPage(
# Application title
titlePanel("Multiplotter"),
# Sidebar with a slider input for 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')
), # end of get data
#==============================================================================
tabPanel( "Options",
checkboxInput("background_theme",
"Show white background",
value = FALSE),
selectInput("sample_select",
label = "Select samples to plot",
choices = NULL,
selected = NULL,
multiple = TRUE
)
), # end of options
#==============================================================================
tabPanel( "Gate",
# get the parameters to plot
# uiOutput("generate_column_name_x_axis_selector"),
selectInput("column_select_x_axis",
label = "Select a column to plot on x axis of selector",
choices = NULL,
selected = NULL),
selectInput("column_select_y_axis",
label = "Select a column to plot on y axis of selector",
choices = NULL,
selected = NULL),
# uiOutput("generate_column_name_y_axis_selector"),
checkboxInput("colorPlot",
"Use third column to colour selector",
value = FALSE),
selectInput("column_select_z_axis",
label = "Select a column to plot on z axis of selector",
choices = NULL,
selected = NULL),
# uiOutput("generate_column_name_z_axis_selector"),
numericInput("colour_select_min",
"Colour scale min value",
value = 0),
numericInput("colour_select_max",
"Colour scale max value",
value = 100),
colourInput("colour_select_min_colour",
"Choose a colour for gradient min",
value = "#FF0000",
palette = "limited"),
colourInput("colour_select_max_colour",
"Choose a colour for gradient max",
value = "#0000FF",
palette = "limited"),
checkboxInput("controlSelectLogScaleCheck",
"Log-scale colour scaling",
value = FALSE),
checkboxInput("controlExperimentCheck",
"Use only one experiment as control for gating",
value = FALSE),
# uiOutput("generate_column_control_experiment"),
selectInput("control_experiment",
label = "Select an experiment as control",
choices = NULL,
selected = NULL),
# download the plot
downloadButton('downloadSelectPlot', 'Download Select Plot')
),
tabPanel( "Target",
#===========================================
# here there should be a horizontal line
# uiOutput("generate_column_name_x_axis_target"),
# uiOutput("generate_column_name_y_axis_target"),
selectInput("column_target_x_axis",
label = "Select a column to plot on x axis of target",
choices = NULL,
selected = NULL),
selectInput("column_target_y_axis",
label = "Select a column to plot on y axis of target",
choices = NULL,
selected = NULL),
checkboxInput("colorTargetPlot",
"Use third column to colour target",
value = FALSE),
# uiOutput("generate_column_name_z_axis_target"),
selectInput("column_target_z_axis",
label = "Select a column to plot on z axis of target",
choices = NULL,
selected = NULL),
numericInput("colour_target_min",
"Colour scale min value",
value = 0),
numericInput("colour_target_max",
"Colour scale max value",
value = 100),
colourInput("colour_target_min_colour",
"Choose a colour for gradient min",
value = "#FF0000",
palette = "limited"),
colourInput("colour_target_max_colour",
"Choose a colour for gradient max",
value = "#0000FF",
palette = "limited"),
checkboxInput("controlTargetLogScaleCheck",
"Log-scale colour scaling",
value = FALSE),
checkboxInput("facetTargetPlot",
"Split plot by experiment",
value = FALSE),
#=================================================
# here there should be another horizontal line
downloadButton('downloadTargetPlot', 'Download Target Plot')
) # end of plotting parameters
)
),
# Show a plot of the generated distribution
mainPanel(
plotOutput("selectorPlot", brush = "plot_brush"),
uiOutput("generate_targetPlotArea")
)
)
))