Repository navigation
Expand file tree
/
Copy pathui.R
More file actions
272 lines (269 loc) · 23.6 KB
/
Copy pathui.R
File metadata and controls
272 lines (269 loc) · 23.6 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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
library(shiny)
ui <- navbarPage(title = "PrIntMap-R",
tabPanel("Documentation",
includeMarkdown("Documentation/Documentation.md"),
"Version 0.1.15"), #update version here for each push
tabPanel("Run",
flowLayout(
fileInput(inputId = "database_file", label = "Upload fasta database file",
accept = c(".fasta", ".fa")),
fileInput(inputId = "peptide_file1", label = "Upload csv/tsv peptide output",
accept = c(".csv", ".tsv", ".txt", ".psmtsv")),
tipify(textInput(inputId = "sample_name1",
label = "Input sample display name",
value = "Sample 1"), "This is only for labelling on plots"),
tipify(radioButtons(inputId = "combinedbool1",
label = "Type of input file",
choices = c("Individual Sample", "Combined"),
selected = "Individual Sample"), "Combined files contain data from multiple samples/replicates. Individual files contain data from one sample/replicate."),
tipify(textInput(inputId = "sample_regex1",
label = "For combined files, input sample name (RegEx)"), "Only used for Combined files. The RegEx pattern here will be searched for in the input data, and only columns matching the pattern will be included."),
uiOutput("combined_method_display"),
selectInput(inputId = "file_type",
label = "Search Software",
choices = c("PEAKS", "DIA-NN", "MSFragger", "MaxQuant", "MetaMorpheus", "Proteome Discoverer", "Generic csv"),
selected = "PEAKS"),
tipify(textInput(inputId = "AccessionID",
label = "Input Protein Accession ID",
value = ""), "Protein Accession ID must match characters before the first space in the fasta database file."),
uiOutput("intensity"),
radioButtons(inputId = "y_axis_scale",
label = "y-Axis Scale",
choices = c("Linear", "log"),
selected = "Linear")
),
flowLayout(
textOutput("AccessionID"),
tipify(textOutput("peptides1_sample_count"), "How many samples were combined based on the RegEx pattern above.")
),
hr(),
flowLayout(
dropdown(
label = "Annotations",
flowLayout(
checkboxInput(inputId = "displayAnnotations",
label = "Display Annotation"),
tipify(selectInput(inputId = "annotation",
selectize = F,
label = "Annotation",
choices = c("Trypsin", "LysC",
"N_glycosylation",
"CUSTOM"),
selected = "Trypsin"), "Select a preset annoation option, or select CUSTOM to put in your own"),
tipify(textInput(inputId = "custom_annotation",
label = "Custom sequence annotation in RegEx"), "If 'CUSTOM' is selected, all matching values within the protein sequence of interest will be annotated. Uses RegEx."),
tipify(textOutput("annotation_regex"), "This is the pattern that is currently being annotated."),
selectInput(inputId = "annot_color",
label = "Color",
choices = c("red",
"yellow",
"green",
"pink",
"purple"),
selected = "red"),
checkboxInput("diplayAAs",
label = "Show Amino Acids")),
),
dropdown(
label = "PTMs",
flowLayout(
fluidRow(
checkboxInput(inputId = "displayPTMs",
label = "Display PTMs"),
tipify(checkboxGroupInput(inputId = "PTM",
label = "PTMs",
choiceNames = c("Carbamidomethylation",
"Deamidation",
"Oxidation" ,
"Pyro_glu_from_E" ,
"Pyro_glu_from_Q",
"Sodium_adduct"
),
choiceValues = c("(+57.02)",
"(+0.98)",
"(+15.99)",
"(-18.01)",
"(-17.03)",
"(+21.98)"
)), "Select one or more PTMs to annotate"),
checkboxInput(inputId = "custom_PTM_check",
label = "CUSTOM", value = F),
tipify(textInput(inputId = "custom_PTM",
label = "Custom PTM"), "Enter a custom PTM (CUSTOM checkbox must be selected. Enter the PTM as a string as it is seen in the peptide column of your sample input."),))
),
tipify(checkboxInput(inputId = "disp_origin",
label = "Display Origin Peptides",
value = F), "Whether to display the peptides on plots that contributed to the intensity at a particular amino acid position. Mouse over the plots to see this information if selected.")
),
hr(),
tabsetPanel(selected = "One Sample",
tabPanel("One Sample",
navlistPanel(widths = c(3,9),
tabPanel("Intensity Trace",
withSpinner(
plotlyOutput("plot_intensity1")
)),
tabPanel("Stacked Peptides",
tipify(radioButtons(inputId = "stacked_peptides_yunits",
label = "Units for y-axis",
choices = c("AA Position", "Intensity"),
selected = "AA Position"), "Choose the y-axis for the stacked peptide plot. AA position simply plots peptides by the order they are mapped to the sequence. Intensity plots peptides by their corresponding intensity value."),
withSpinner(
plotlyOutput("stacked_plotly"))),
tabPanel("Unique Peptides",
textOutput("unique_text"),
tipify(actionButton(inputId = "run_unique",
label = "Run/Update"), "Run the unique peptide analysis. This may take several minutes."),
withSpinner(
plotlyOutput("unique_peps")
)),
tabPanel("Percent Coverage",
textOutput("total_AA"),
textOutput("covered_AA"),
textOutput("percent_coverage"),
textOutput("coverage_message"))
)),
tabPanel("Two Samples",
br(),
bsCollapse(
bsCollapsePanel("2nd Sample Input (Click Here)", style = "primary",
flowLayout(
selectInput(inputId = "file_type2",
label = "2nd Search Software",
choices = c("PEAKS","DIA-NN", "MSFragger", "MaxQuant", "MetaMorpheus", "Proteome Discoverer", "Generic csv"),
selected = "PEAKS"),
fileInput(inputId = "peptide_file2", label = "Upload 2nd peptide output",
accept = c(".csv", ".tsv", ".txt", ".psmtsv")),
tipify(textInput(inputId = "sample_name2",
label = "Input 2nd sample display name",
value = "Sample 2"), "For plot labelling only"),
radioButtons(inputId = "combinedbool2",
label = "Type of input file",
choices = c("Individual Sample", "Combined"),
selected = "Individual Sample"),
tipify(textInput(inputId = "sample_regex2",
label = "For combined files, input sample name (RegEx)"), "Same as above"),
uiOutput("combined_method_display2"),
tipify(checkboxInput(inputId = "duplicate_file2",
label = "Use same peptide output file?",
value = F), "If this box is checked, the same peptide file from above will be used for the second sample. Useful for combined files where different columns will be compared."),
uiOutput("intensity2"),
tipify(radioButtons(inputId = "two_sample_comparison",
label = "Type of Comparison",
choices = c("Overlay", "Difference", "Fold Change"),
selected = "Overlay"), "Comparison types. Difference subtracts the first sample from the second. Fold Change divides the second sample by the first and displays the ratio."),
tipify(textOutput("peptides2_sample_count"), "How many samples were combined based on the RegEx pattern for sample 2."))
)),
navlistPanel(widths = c(3,9),
tabPanel("Intensity Traces",
withSpinner(
plotlyOutput("plot_intensity2")
)),
tabPanel("Stacked Peptides",
radioButtons(inputId = "stacked_peptides_yunits2",
label = "Units for y-axis",
choices = c("AA Position", "Intensity"),
selected = "AA Position"),
withSpinner(
plotlyOutput("stacked_plotly2")
)),
tabPanel("Volcano Plot",
bsCollapse(
bsCollapsePanel("Volcano Plot Settings (Click Here)", style = "primary",
flowLayout(
tipify(numericInput("p_cutoff", "p-value cutoff",
value = 0.05, min = 0, max = 1, step = 0.05), "The set value for significance. This draws a horizontal line at the equivalent value on the y-axis"),
tipify(numericInput("l2fc_cutoff", "log2 fold-change cutoff",
value = 1, min = 0, max = 100), "The set value for log2 fold change cutoff. Draws vertical lines at the positive and negative values."),
tipify(numericInput("min_valid_sample", "Miniumum number of observations per sample",
value = 2, min = 1), "Sets the minimum number of observations per sample for a peptide to be considered valid. Peptides with less than this number of non-NA values in both samples will be discarded."),
tipify(checkboxInput("equal_var", "Equal Variance",
value = T), "Whether or not to assume equal variance in the t-test calculation."),
tipify(checkboxInput("remove_na", "Remove NA values",
value = T), "If this box is checked, the average intensity value for each peptide will not include the NA values. If it is unchecked, the NA values will be replaced by whatever value is in the next field."),
tipify(numericInput("set_na_value", "Set NA values",
value = 0), "If the previous box is unchecked, NA (i.e. not detected) values in the data will be replaced by this number for average and significance calculation purposes."),
tipify(checkboxInput("BH_correction", "Apply Benjamini-Hochburg correction",
value = F), "If this box is checked, a Benjamini-Hochburg correction will be applied to the significance data. This is a correction commonly used in proteomics to reduce false discovery rate."),
tipify(checkboxInput("display_comp_vals", "Display compromised values",
value = T), "Compromised values are peptides that contain more than the minimum required observations in one condition, but less than the minimum required observations in the other (but more than 0 observations). These values can either be included in the calucluations (and displayed) or not."),
tipify(checkboxInput("display_infinite_vals", "Display Infinite Fold Changes",
value = T), "Infinite values are peptides that contain more than the minimum required observations in one conditions, but 0 observations in the other. Signifincance cannot be caluclated in this case, but they may be of interest. These values are displayed in the top corners of the plot within dotted rectangles, but can be hidden if desired.")
))
),
withSpinner(
plotlyOutput("volcano", height = 600)
),
downloadButton("download_volcano_df",
"Download Volcano Plot CSV"),
textOutput("volcano_text"))),
),
tabPanel("Multiple Samples",
fluidPage(
fluidRow(column(3, tipify(numericInput(inputId = "number_sample", label = "Choose number of samples",
value = 3,min =2, step = 1), "How many samples will you be comparing?")),
column(2, radioButtons(inputId = "mult_sample_comparison",
label = "Type of Comparison",
choices = c("Overlay", "Difference", "Fold Change"),
selected = "Overlay")),
column(1, tipify(actionButton(inputId = "mult_go", label = "Run/Update"), "You must click this button to update the plot."))
),
bsCollapse(
bsCollapsePanel("Multiple Sample Input (Click Here)", style = "primary",
uiOutput("sample_numbers"))
)
),
fluidRow(withSpinner(
plotlyOutput("plot_intensity_mult")
))
),
tabPanel("Export",
flowLayout(
downloadButton("download_intensity_df",
"Download Intensity CSV"),
radioButtons(inputId = "download_sample_number",
label = "Download which samples?",
choices = c("One sample", "Both samples",
"Multiple Samples"),
selected = "One sample")
)))),
tabPanel("Examples",
tags$h1("Example Database"),
downloadButton("downloadHSdatabase",
"Download Human Proteome Database"),
tags$br(),
downloadButton("downloadHSdatabaseBgalBSAfusion",
"Download Human Proteome Database with B-Gal/BSA fusion entry"),
tags$h1("Example Combined Files"),
downloadButton("downloadBGalBSAfusion",
"Download BSA/BGal fusion protein PEAKS LFQ Search"),
tags$br(),
downloadButton("downloadPhosphoNoPTM",
"Download PO4ase MSFragger Search - No Phospho PTM"),
tags$br(),
downloadButton("downloadPhosphoWithPTM",
"Download PO4ase MSFragger Search - With Phospho PTM"),
tags$br(),
downloadButton("downloadHXMS",
"Download HXMS PEAKS Search"),
tags$br(),
downloadButton("downloadDeglycoLFQ",
"Download PNGaseF PEAKS LFQ Search"),
tags$br(),
downloadButton("downloadDeglycoDB",
"Download PNGaseF PEAKS DB Search"),
tags$h1("Example Individual Files"),
downloadButton("downloadDeglycoCTRL",
"Download Control Injection PEAKS"),
tags$br(),
downloadButton("downloadDeglycoPNGaseF",
"Download PNGaseF Injection PEAKS"),
tags$h1("Generic CSV Templates"),
tags$h4("The following can be filled out and used for custom data analysis. Any numbers can go in the intensity column for versatility."),
downloadButton("downloadIndividualGeneric",
"Download Individual Generic Template"),
tags$br(),
downloadButton("downloadCombinedGeneric",
"Download Combined Generic Template")
)
)