-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
193 lines (143 loc) · 7.54 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
193
library(shiny)
logo.formats <- c("pdf", "eps", "png", "png_print", "svg", "jpeg")
names(logo.formats) = c("pdf", "eps", "png", "hi-res png", "svg", "jpeg")
#if (!system.file("gs") & !system.file("")
shinyUI(
fluidPage(
tags$head(
),
# titlePanel("LASSIE: Longitudinal Antigenic Swarm Selection from Intrahost Evolution"),
tabsetPanel(id="tabset", type="tabs",
tabPanel("Step 1: Select Sites", id="sites",
sidebarLayout(
sidebarPanel(
strong("Input Options"),
checkboxInput('demo_data', 'Use CH505 example data',
FALSE), #TRUE),
c("or choose your own"),
fileInput("aas_file", "Protein Alignment File"),
sliderInput("tf_loss_cutoff",
"Exclude sites with % peak TF loss below:",
min = 0, max = 100, value = 100),
hr(),
checkboxInput('sites_advanced',
'Show more options', FALSE),
conditionalPanel("input.sites_advanced",
sliderInput("tf_loss_when_up",
"Order sites by when they first reach this % TF loss:",
min = 0, max = 100, value = 10),
radioButtons("aln.format", "Alignment Format",
c("fasta", "clustal", "phylip", "msf", "mase"),
inline=T )),
conditionalPanel("input.sites_advanced",
checkboxInput('map.pngs2o',
'Map N to O in Nx[ST] PNG motifs.',
TRUE)),
conditionalPanel("input.sites_advanced",
p(strong("Timepoint Parsing"))),
conditionalPanel("input.sites_advanced",
radioButtons("tp.sep", "Field separator",
c(".", "_", "-", "|"), inline=T )),
conditionalPanel("input.sites_advanced",
numericInput("tp.pos",
"Which field contains timepoint",
value=1, min=1, max=6, step=1))#,
#hr(),
# strong("Review selected sites then check"),
# checkboxInput('select_seqs',
# 'Send Selected Sites to Step 2', FALSE)
),
mainPanel(
strong("Results: Selected Sites"),
p(textOutput("nSelectedSites")),
dataTableOutput("selectedSites"),
conditionalPanel("output.selectedSites",
hr(),
p(strong("Review timepoint parsing"),
checkboxInput('by_timepoint',
'Tabulate sequence counts by timepoint', FALSE)),
conditionalPanel("input.by_timepoint",
tableOutput("tabulateByTimepoint")),
# conditionalPanel("output.selectedSites",
hr(),
p(strong("Review selected sites and check the box below"),
checkboxInput('select_seqs',
'Send selected sites to Step 2', FALSE)
),
hr()
) # end of conditional panel
) # end of main panel
) # end of sidebar layout
), # end of tab panel
tabPanel("Step 2: Select Sequences", id="seqs",
sidebarLayout(
sidebarPanel(
strong(p(textOutput("showSummary"))),
conditionalPanel("input.select_seqs",
checkboxInput('seqs_advanced',
'Show more options', FALSE),
conditionalPanel("input.seqs_advanced",
numericInput("mv.count",
"Minimum variant count",
value=2, min=1, max=20, step=1),
#Explanation: The minimum variant count
p("Requires each mutation to occur in
the alignment at least this many times
for inclusion, e.g. 2 omits
singleton mutations.")
# from swarm selection
# numericInput("mv.count",
# "Maximum tolerated insertion length",
# value=2, min=1, max=20, step=1),
# numericInput("mv.count",
# "Maximum tolerated deletion length",
# value=2, min=1, max=20, step=1),
# p("To do: specify indel lengths that would be tolerated for inclusion."),
# p("Could also add support to include and exclude sequences by name.")
), # end of advanced options conditional panel
hr(),
p(strong("Download Results")),
p(downloadButton('downloadSelectedSites',
"Table of selected sites")),
p(downloadButton('downloadSwarmsetNames',
"Selected sequence names")),
p(downloadButton('downloadSwarmsetSequences',
"Selected sequences in Raw/Table format")),
p(downloadButton('downloadFastaSwarmsetSequences',
"Selected sequences in Fasta format")),
p(downloadButton('downloadSwarmsetConcatamers',
"Selected concatamers in Raw/Table format")),
p(downloadButton('downloadMessages',
'Output messages')),
p(downloadButton('downloadSwarmsetLogos',
"Logos plot of selected concatamers")),
p("Options for Logos"),
radioButtons("logo.format", label=NA,
choices = logo.formats, inline=T),
checkboxInput("logo.dotify",
"Use blank for TF states", T),
checkboxInput("logo.stratify",
"Make one plot per timepoint", T),
checkboxInput("logo.sort",
"Sort sites from N- to C-term", T)
) # end of select_seqs conditional panel
),
mainPanel(
conditionalPanel("input.select_seqs",
code("Selected Sequences",
tableOutput("selectSequences")))
)
)
), # end of tab panel
tabPanel("About LASSIE", id="basics",
includeMarkdown("basics.Rmd")
), # end of tab panel
tabPanel("Detailed Help", id="details",
includeMarkdown("details.Rmd")
), # end of tab panel
tabPanel("License", id="license",
includeMarkdown("legalese.Rmd")
) # end of tab panel
) # end of tabset
) # end of page
)