-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage_tblsMotifEnrichment.R
executable file
·71 lines (62 loc) · 2.02 KB
/
page_tblsMotifEnrichment.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
library(shiny)
library(plotly)
source("page_tablesAvailable.R")
### Prepare components ----
tblsMotifEnr.ui <- function(id){
ns <- NS(id)
settingsNameChoices <- c(
"DARs (simplified)",
"DARs (all motifs)",
"Peaks",
"Topics"
)
fluidPage(
fluidRow(
column(2, selectInput(inputId=NS(id, "met2show"), label = "", choices=settingsNameChoices, selected="DARs (simplified)", selectize=TRUE),
)),
fluidRow(
# tableLoad.ui("tbl_MotifEnrichment") # does not reload...
DT::dataTableOutput(ns("tbl_MotifEnrichment")) %>% withSpinner(color="#0dc5c1")
)
)
}
### Build page ----
page_tblsMotifEnrichment <- tblsMotifEnr.ui("tab_motifEnrichment")
### Server ----
tblsMotifEnr.server <- function(input, output, session, dataPath, tablesAlreadyLoaded) {
observe({
# Get settings
met2show <- input$met2show
print(met2show)
print(names(output))
# Load table if needed:
if(met2show=="DARs (simplified)"){
print(met2show)
dtContent <- tableLoad(filePath=paste0(dataPath,"/tbl_motifEnr_DARs_auc01_simplified.Rds"), fileType="rds")
columnTooltip=NULL
columnFilters=NULL
}
if(met2show=="DARs (all motifs)"){
print(met2show)
dtContent <- tableLoad(filePath=paste0(dataPath,"/tbl_motifEnr_DARs.Rds"), fileType="rds")
columnTooltip=NULL
columnFilters=list(me_rocThr=c('["auc01","auc05"]')) # NES='5 ... 50'
}
if(met2show=="Peaks"){
print(met2show)
dtContent <- tableLoad(filePath=paste0(dataPath,"/tbl_motifEnr_peaks.Rds"), fileType="rds")
columnTooltip=NULL
columnFilters=NULL
}
if(met2show=="Topics"){
print(met2show)
dtContent <- tableLoad(filePath=paste0(dataPath,"/tbl_motifEnr_topics.Rds"), fileType="rds")
columnTooltip=NULL
columnFilters=NULL
}
# Show table (but dont trigger this event again):
isolate({
output$tbl_MotifEnrichment <- tableRender(dtContent, columnTooltip=columnTooltip, columnFilters=columnFilters)
})
})
}