-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.R
194 lines (158 loc) · 7.24 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
shinyUI(pageWithSidebar(
headerPanel("binQTL: Mapping Quantitative Trait Loci using Binned Genotypes",
tags$head(tags$style(type="text/css", "label.radio { display: inline-block; }", ".radio input[type=\"radio\"] { float: none; }"),
tags$style(type="text/css", "select { max-width: 200px; }"),
tags$style(type="text/css", "textarea { max-width: 185px; }"),
tags$style(type="text/css", ".jslider { max-width: 200px; }"),
tags$style(type='text/css', ".well { max-width: 330px; }"),
tags$style(type='text/css', ".span4 { max-width: 330px; }"))
),
sidebarPanel(
conditionalPanel(condition="input.tabs1=='About'",
h4("Introduction")
),
conditionalPanel(condition="input.tabs1=='Genotype Data'",
h4("Enter genotype data"),
radioButtons("dataGInput", "", list("Load sample data"=1,"Upload file"=2)),
conditionalPanel(condition="input.dataGInput=='1'",
radioButtons("sampleDataG", "Load sample genotype data", list("Data of 210 RILs"=1,
"Data of 278 IMF2s"=2,
"Data of 458 MAGIC mouse"=3))
),
conditionalPanel(condition="input.dataGInput=='2'",
h5("Upload genotype data: "),
fileInput("uploadG", "", multiple = FALSE),
HTML('<p>Data in .csv format</p>')
),
HTML('<br>'),
h4("Plot options"),
checkboxInput("genoTitle", "Modify labels and title", FALSE),
conditionalPanel(condition="input.genoTitle",
textInput("geXlab", "X-axis label:", value=c("Genomic position")),
textInput("geYlab", "Y-axis label:", value=c("")),
textInput("geTitle", "Main title:", value=c("Genetic binmap"))
),
checkboxInput("binmapSize", "Adjust plot size", FALSE),
conditionalPanel(condition="input.binmapSize",
numericInput("binHeight", "Plot height:", value=550),
numericInput("binWidth", "Plot width:", value=750)
),
HTML('<br>'),
actionButton("submit2", strong("Go!"))
),
conditionalPanel(condition="input.tabs1=='Phenotype Data'",
h4("Enter phenotype data"),
radioButtons("dataPInput", "", list("Load sample data"=1,"Upload file"=2)),
conditionalPanel(condition="input.dataPInput=='1'",
radioButtons("sampleDataP", "Load sample phenotype data", list("Data of 210 RILs"=1,
"Data of 278 IMF2s"=2,
"Data of 458 MAGIC mouse"=3))
),
conditionalPanel(condition="input.dataPInput=='2'",
h5("Upload phenotype data: "),
fileInput("uploadP", "", multiple = FALSE),
HTML('<p>Data in .csv format</p>')
),
HTML('<br>'),
h4("Plot options"),
checkboxInput("phenoTitle", "Modify labels and title", FALSE),
conditionalPanel(condition="input.phenoTitle",
textInput("pheXlab", "X-axis label:", value=c("")),
textInput("pheYlab", "Y-axis label:", value=c("Frequency")),
textInput("pheTitle", "Main title:", value=c("Phenotype distribution"))
),
checkboxInput("pheSize", "Adjust plot size", FALSE),
conditionalPanel(condition="input.pheSize",
numericInput("pheHeight", "Plot height:", value=550),
numericInput("pheWidth", "Plot width:", value=750)
),
HTML('<br>'),
actionButton("submit3", strong("Go!"))
),
conditionalPanel(condition="input.tabs1=='QTL mapping'",
h4("Algorithm for QTL mapping"),
radioButtons("qtlApp", "", list("ANOVA"=1, "binQTL"=2)),
HTML('<br>'),
conditionalPanel(condition="input.qtlApp=='2'",
h4("Population type"),
radioButtons("popInput", "", list("RIL population"=1, "F2 population"=2,
"MAGIC population"=3))
),
HTML('<br>'),
actionButton("submit1", strong("Go!"))
),
conditionalPanel(condition="input.tabs1=='QTL visualization'",
h4("Plot options"),
textInput("qtlCol", "Colour(s):", value=c("grey30, grey70")),
# h5("Y-axis range (eg., '0,10'):"),
# textInput("ylimit", "", value=""),
checkboxInput("labelsTitle", "Modify labels and title", FALSE),
conditionalPanel(condition="input.labelsTitle",
textInput("myXlab", "X-axis label:", value=c("")),
textInput("myTitle", "QTL title:", value=c("")),
textInput("mySubtitle", "QTL subtitle:", value=c(""))
),
checkboxInput("plotSize", "Adjust plot size", FALSE),
conditionalPanel(condition="input.plotSize",
numericInput("myHeight", "Plot height:", value=550),
numericInput("myWidth", "Plot width:", value=750)
),
checkboxInput("fontSizes", "Change font sizes", FALSE),
conditionalPanel(condition="input.fontSizes",
numericInput("cexTitle", "Title font size:", value=14),
numericInput("cexAxislabel", "Axis label size:", value=14),
numericInput("cexAxis", "Axis font size:", value=12)
),
HTML('<br>'),
actionButton("submit4", strong("Go!"))
)
),
mainPanel(
tabsetPanel(
# Welcome tab
tabPanel("About",
h4("Software references"),
HTML('<p>R Development Core Team. <i><a href="http://www.r-project.org/">R</a>: A Language and Environment for Statistical Computing.</i> R Foundation for Statistical Computing, Vienna (2013) <br>
RStudio and Inc. <i><a href="http://www.rstudio.com/shiny/">shiny</a>: Web Application Framework for R.</i> R package version 0.5.0 (2013) <br>
Neuwirth, E. <i><a href="http://cran.r-project.org/web/packages/RColorBrewer/index.html">RColorBrewer</a>: ColorBrewer palettes.</i> R package version 1.0-5. (2011)</p>'),
h4("Further references"),
h6("This application was created by ", a("Wen Yao", href="https://www.researchgate.net/profile/Wen_Yao"), " and ", a("Shizhong Xu", href="http://cepceb.ucr.edu/people/xu-s.html"),
" . Please send bugs and feature requests to Wen Yao (ywhzau at gmail.com). This application uses the ",
a("shiny package from RStudio", href="http://www.rstudio.com/shiny/"), ".")
),
# Genotype Data upload tab
tabPanel("Genotype Data",
plotOutput("binmap", height='100%', width='100%'),
downloadButton("downloadGenoRes", "Download genotype data as .CSV file"),
dataTableOutput("genotable")
),
# Phenotype Data upload tab
tabPanel("Phenotype Data",
plotOutput("pheno", height='100%', width='100%'),
downloadButton("downloadPheRes", "Download phenotype data as .CSV file"),
dataTableOutput("phenotable")
),
# QTL mapping
tabPanel("QTL mapping",
downloadButton("downloadQtlRes", "Download QTL mapping results as .CSV file"),
dataTableOutput("qtltable")
),
# QTL visualization
tabPanel("QTL visualization",
downloadButton("downloadPlotPDF", "Download pdf-file"),
downloadButton("downloadPlotSVG", "Download svg-file"),
plotOutput("qtlfigure", height='100%', width='100%')
),
# FAQ
# tabPanel("FAQ",
# h5("Q:"),
# p("A:"),
#
# h6("This application was created by ", a("Wen Yao", href="https://www.researchgate.net/profile/Wen_Yao"), " and ", a("Shizhong Xu", href="http://cepceb.ucr.edu/people/xu-s.html"),
# " . Please send bugs and feature requests to Wen Yao (ywhzau at gmail.com). This application uses the ",
# a("shiny package from RStudio", href="http://www.rstudio.com/shiny/"), ".")
# ),
id="tabs1"
)
)
))