diff --git a/DESCRIPTION b/DESCRIPTION index 5962df3..ddb28a1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -15,12 +15,14 @@ Description: This package provides a graphical user interface for analyzing License: AGPL (>= 3) Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.1.2 +RoxygenNote: 7.2.0 Imports: + bslib, data.table, disgenet2r, DT, geposan, + glue, gprofiler2, plotly, purrr, diff --git a/R/data.R b/R/data.R deleted file mode 100644 index 2305228..0000000 --- a/R/data.R +++ /dev/null @@ -1,8 +0,0 @@ -# All available methods from [geposan] and additional information on them. -methods <- geposan::all_methods() - -# IDs of methods for geposan. -method_ids <- sapply(methods, function(method) method$id) - -# Names of methods for geposan. -method_names <- sapply(methods, function(method) method$name) diff --git a/R/methods.R b/R/methods.R index 20d2783..0775f8d 100644 --- a/R/methods.R +++ b/R/methods.R @@ -21,7 +21,7 @@ methods_ui <- function(id) { "Customize weights" = "custom" ) ), - lapply(methods, function(method) { + lapply(geposan::all_methods(), function(method) { verticalLayout( checkboxInput( NS(id, method$id), @@ -52,7 +52,7 @@ methods_ui <- function(id) { methods_server <- function(id, analysis, comparison_gene_ids) { moduleServer(id, function(input, output, session) { # Observe each method's enable button and synchronise the slider state. - lapply(methods, function(method) { + lapply(geposan::all_methods(), function(method) { observeEvent(input[[method$id]], { shinyjs::toggleState( sprintf("%s_weight", method$id), @@ -89,7 +89,7 @@ methods_server <- function(id, analysis, comparison_gene_ids) { included_methods <- NULL - for (method in methods) { + for (method in geposan::all_methods()) { if (input[[method$id]]) { included_methods <- c(included_methods, method$id) } @@ -105,7 +105,7 @@ methods_server <- function(id, analysis, comparison_gene_ids) { }) |> bindCache( analysis(), optimization_gene_ids(), - sapply(methods, function(method) input[[method$id]]), + sapply(geposan::all_methods(), function(method) input[[method$id]]), input$optimization_target ) @@ -114,7 +114,7 @@ methods_server <- function(id, analysis, comparison_gene_ids) { if (length(optimization_gene_ids()) < 1 | input$optimization_target == "custom") { - for (method in methods) { + for (method in geposan::all_methods()) { if (input[[method$id]]) { weight <- input[[sprintf("%s_weight", method$id)]] weights[[method$id]] <- weight diff --git a/R/results.R b/R/results.R index afeb31d..3e9ee76 100644 --- a/R/results.R +++ b/R/results.R @@ -51,6 +51,10 @@ results_server <- function(id, filtered_results) { ) }) + methods <- geposan::all_methods() + method_ids <- sapply(methods, function(method) method$id) + method_names <- sapply(methods, function(method) method$name) + columns <- c( "rank", "gene",