-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.R
More file actions
32 lines (28 loc) · 812 Bytes
/
server.R
File metadata and controls
32 lines (28 loc) · 812 Bytes
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
shinyServer(function(input, output, session) {
### switch query type between kinase and inhibitor
querySelection <- reactive({
if (input$selection == "kinase") {
sort(unique(kid$kinase))
} else {
sort(unique(kid$compound))
}
})
### update query selection based on query type
observe({
updateSelectInput(session, "query", choices = querySelection() )
})
### update exclusion selection based on query type
observe({
updateSelectInput(session, "exclusion", choices = querySelection() )
})
### render output as DataTable
output$table = renderDataTable({
if (input$selection == "kinase") {
queryKinase(input, kid)
} else {
queryInhibitor(input, kid)
}
},
options = list(pageLength = 20, lengthMenu = c(10, 20, 50))
)
})