From fcd9b4ee056d4cbb0c3357b797a260a113f7b33e Mon Sep 17 00:00:00 2001 From: Elias Projahn Date: Fri, 15 Oct 2021 11:46:15 +0200 Subject: [PATCH] Rearrange user interface --- server.R | 10 +++++++--- ui.R | 49 ++++++++++++++++++++----------------------------- 2 files changed, 27 insertions(+), 32 deletions(-) diff --git a/server.R b/server.R index f5f426b..d302ac8 100644 --- a/server.R +++ b/server.R @@ -86,17 +86,21 @@ server <- function(input, output) { output$genes <- renderDT({ method_ids <- sapply(methods, function(method) method$id) method_names <- sapply(methods, function(method) method$name) - columns <- c("rank", "gene", "name", method_ids, "score") - column_names <- c("", "Gene", "", method_names, "Score") + columns <- c("rank", "gene", "name", "chromosome", method_ids, "score") + column_names <- c("", "Gene", "", "Chromosome", method_names, "Score") dt <- datatable( results()[, ..columns], rownames = FALSE, colnames = column_names, style = "bootstrap", + extensions = "Scroller", options = list( rowCallback = js_link, - columnDefs = list(list(visible = FALSE, targets = 2)) + columnDefs = list(list(visible = FALSE, targets = 2)), + deferRender = TRUE, + scrollY = 200, + scroller = TRUE ) ) diff --git a/ui.R b/ui.R index 46c948b..4e03b5b 100644 --- a/ui.R +++ b/ui.R @@ -8,9 +8,9 @@ source("methods.R") ui <- fluidPage( rclipboardSetup(), titlePanel("TPE-OLD candidates"), - column( - width = 3, - wellPanel( + sidebarLayout( + sidebarPanel( + width = 3, h3("Filter criteria"), selectInput( "species", @@ -20,9 +20,16 @@ ui <- fluidPage( "All qualified" = "all" ) ), - uiOutput("n_species_slider") - ), - wellPanel( + uiOutput("n_species_slider"), + sliderInput( + "cutoff", + "Cut-off score", + post = "%", + min = 0, + max = 100, + step = 1, + value = 50 + ), h3("Ranking"), lapply(methods, function(method) { sliderInput( @@ -35,21 +42,12 @@ ui <- fluidPage( value = 100 ) }), - sliderInput( - "cutoff", - "Cut-off score", - post = "%", - min = 0, - max = 100, - step = 1, - value = 50 - ), checkboxInput( "penalize", "Penalize missing values" - ) + ), ), - wellPanel( + mainPanel( h3("Results"), textOutput("synposis"), div( @@ -57,18 +55,13 @@ ui <- fluidPage( uiOutput("copy") ), div( - style = "overflow-x: auto; overflow-y: auto; margin-top: 16px", + style = "margin-top: 16px", DTOutput("genes") - ) - ) - ), - column( - width = 8, - wellPanel( + ), h3("Gene positions"), p("This plot shows the selected genes' distance to the telomeres \ - across species. It visualizes how certain genes have \ - evolutionary conserved positions."), + across species. It visualizes how certain genes have \ + evolutionary conserved positions."), div( style = "overflow-x: auto", div( @@ -79,9 +72,7 @@ ui <- fluidPage( height = "600px" ) ) - ) - ), - wellPanel( + ), h3("Gene set enrichment analysis"), checkboxInput( "enable_gost",