-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.R
115 lines (102 loc) · 3.73 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
# # To lazy load the complex hypotheses
# library(devtools)
# install_github("PedrioliLab/SECprofiler",ref="peakpicker")
# library('SECprofiler')
jscode <- '
$(function() {
$(document).keypress(function(e) {
Shiny.onInputChange("keypress", [e.key, Math.random()]);
});
});
'
#Load data
ann_mode <- "all"
# traces <- readRDS("data/pepTracses.annotated.consec3.SibPepCorr.filtered.all.rda")
traces <- readRDS("data/protTraces_raw_a_cs3_spcf_fdr1pc_top2.rda")
if(traces$trace_type == "peptide"){
if(ann_mode == "features"){
# features <- readRDS("data/ProteinFeatures.tab.pcorr08.c05_subs.rds")
load("data/ProteinFeatures")
features <- ProteinFeatures
hyp_names <- unique(features$protein_name)
} else if(ann_mode == "all"){
# load("data/pepTracses.annotated.consec3.SibPepCorr.filtered")
hyp_names <- unique(traces$trace_annotation$protein_id)
}
} else {
# features <- filtered_corum_table
features <- readRDS("data/corum_table_filtered_subset_current.rda")
# Filter out those proteins that have no trace
features <- subset(features, protein_id %in% traces$traces$id)
hyp_names <- unique(features$complex_name)
}
ui <- fluidPage(
tags$head(tags$script(HTML(jscode))),
titlePanel("SEC-WATH MS Protein Annotator"),
fluidRow(
column(4,
wellPanel(
h3("Select Protein"),
br(),
selectizeInput("select", label = h5("UniprotID"),
choices = hyp_names,
options = list(maxOptions=10000)),
actionButton("prev","",icon = icon("arrow-left")),
actionButton("forw","",icon = icon("arrow-right")),
br(),
br(),
fluidRow(
# actionButton("zoom",label = "Zoom"),
actionButton("unzoom",label = "Reset Zoom")
),
br(),
fluidRow(
actionButton("save_sure", label = "Save Feature",icon = icon("thumbs-o-up")),
actionButton("save", label = "Save Feature",icon = icon("thumbs-o-down"))
),
actionButton("saveall", label = "Save Data Frame")
),
plotOutput("plot2",
dblclick = "plot2_dblclick",
brush = brushOpts(id = "plot2_brush",
direction = "x",
resetOnNew = TRUE),
height = 200
),
h4("How to annotate Features"),
tags$ul(
tags$li("Use small plot to zoom to desired region"),
tags$li("Drag your mouse over the peak boundaries"),
tags$li("Double-click the peak apex"),
tags$li("Press Save Feature and check the table"),
tags$li("Repeat for all features in a plot, then go to the next plot"),
tags$li("Delete wrong entries by selecting them and pressing delete"),
tags$li("Press Save Data Frame often, to save a copy of the table")
)
),
column(8,
# conditionalPanel(condition = "$('html').hasClass('shiny-busy')",
# h4("The data is loading...")
# ),
plotOutput("plot1",
# Equivalent to: click = clickOpts(id = "plot_click")
dblclick = "plot1_click",
brush = brushOpts(id = "plot1_brush",
direction = "x",
resetOnNew = TRUE)
),
# ## Debugging
# fluidRow(
# column(width = 6,
# h6("system vars"),
# verbatimTextOutput("click_info")
# )),
fluidRow(
div(actionButton("delete", "Delete",icon = icon("remove-sign",lib="glyphicon")), style="float:right")
),
# div(style="display:inline-block",actionButton("delete", "Delete"), style="float:right"),
br(),
DT::dataTableOutput("view")
)
)
)