mirror of
https://github.com/johrpan/geposanui.git
synced 2025-10-25 20:07:23 +02:00
Remove global methods data
This commit is contained in:
parent
13b5efc1e3
commit
421bb79a0b
4 changed files with 12 additions and 14 deletions
|
|
@ -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,
|
||||
|
|
|
|||
8
R/data.R
8
R/data.R
|
|
@ -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)
|
||||
10
R/methods.R
10
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
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue