-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage_tblsRNA.R
executable file
·48 lines (41 loc) · 1.33 KB
/
page_tblsRNA.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
library(shiny)
library(plotly)
source("page_tablesAvailable.R")
### Prepare components ----
tblsRNA.ui <- function(id){
ns <- NS(id)
fluidPage(
fluidRow(
column(2, selectInput(inputId=NS(id, "tableSelection"), label = "", choices=c("Markers","Detected"), selected = "Markers", selectize = TRUE),
)),
fluidRow(
DT::dataTableOutput(ns("tbl_RNA")) %>% withSpinner(color="#0dc5c1")
)
)
}
### Build page ----
page_tblsRNA <- tblsRNA.ui("tab_RNAmarkers")
### Server ----
tblsRNA.server <- function(input, output, session, dataPath, tablesAlreadyLoaded) {
observe({
# Get settings
tableSelection <- input$tableSelection
if(!is.null(tableSelection)) {
# Load table if needed:
if(tableSelection=="Markers"){
dtContent <- tableLoad(filePath=paste0(dataPath,"/tbl_RNAmarkers.feather"), fileType="feather")
columnTooltip=NULL
columnFilters=NULL
}
if(tableSelection=="Detected"){
dtContent <- tableLoad(filePath=paste0(dataPath,"/tbl_RNAgenesDetected.feather"), fileType="feather")
columnTooltip=NULL
columnFilters=NULL
}
# Show table (but dont trigger this event again):
isolate({
output$tbl_RNA <- tableRender(dtContent, columnTooltip=columnTooltip, columnFilters=columnFilters)
})
}
})
}