-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.R
60 lines (44 loc) · 1.5 KB
/
app.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
library(shiny)
library(DT)
aa <- c("A", "C", "D", "E", "F", "G", "H", "I", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "V", "W", "Y")
### amino acids molecular weight
mass_aa <- c(89.047679, 121.019751, 133.037509, 147.053159, 165.078979,
75.032029, 155.069477, 131.094629, 146.105528, 131.094629,
149.051051,132.053493, 115.063329, 146.069143, 174.111676,
105.042594,119.058244, 117.078979,204.089878, 181.073894)
aa_mw <- setNames(mass_aa, aa)
### reaction elements
H2O <- 18.010565
H <- 1.007825
ionization_list = stats::setNames(c(H),c("H"))
# See above for the definitions of ui and server
ui <- fluidPage(
# App title ----
titlePanel("Oligopeptides Matching"),
# Sidebar layout with a input and output definitions ----
sidebarLayout(
# Sidebar panel for inputs ----
sidebarPanel(
# Input: Numeric entry for number of obs to view ----
numericInput(inputId = "od",
label = "Oligomerization degree:",
value = 3)
),
# Main panel for displaying outputs ----
mainPanel(
h3("Oligopeptides"),
# Output: HTML table with requested number of observations ----
DT::dataTableOutput("view")
)
)
)
server <- function(input, output) {
output$view <- DT::renderDataTable(
get_oligopeptides(
aminoacids = aa_mw,
chemical_reaction = H2O,
ionization = ionization_list,
oligomerization_degree = input$od)
)
}
shinyApp(ui = ui, server = server)