mirror of
https://github.com/johrpan/geposanui.git
synced 2025-10-26 11:17:24 +01:00
results: Adapt to preset methods
This commit is contained in:
parent
bb15771f22
commit
d325486d95
1 changed files with 31 additions and 12 deletions
43
R/results.R
43
R/results.R
|
|
@ -7,14 +7,6 @@
|
||||||
#'
|
#'
|
||||||
#' @noRd
|
#' @noRd
|
||||||
results_ui <- function(id, options) {
|
results_ui <- function(id, options) {
|
||||||
ranking_choices <- purrr::lmap(geposan::all_methods(), function(method) {
|
|
||||||
l <- list()
|
|
||||||
l[[method[[1]]$name]] <- method[[1]]$id
|
|
||||||
l
|
|
||||||
})
|
|
||||||
|
|
||||||
ranking_choices <- c(ranking_choices, "Combined" = "combined")
|
|
||||||
|
|
||||||
sidebarLayout(
|
sidebarLayout(
|
||||||
sidebarPanel(
|
sidebarPanel(
|
||||||
width = 3,
|
width = 3,
|
||||||
|
|
@ -56,7 +48,9 @@ results_ui <- function(id, options) {
|
||||||
selectInput(
|
selectInput(
|
||||||
NS(id, "ranking_y"),
|
NS(id, "ranking_y"),
|
||||||
label = NULL,
|
label = NULL,
|
||||||
choices = ranking_choices
|
choices = list(
|
||||||
|
"Combined" = "combined"
|
||||||
|
)
|
||||||
),
|
),
|
||||||
span(
|
span(
|
||||||
style = paste0(
|
style = paste0(
|
||||||
|
|
@ -69,8 +63,9 @@ results_ui <- function(id, options) {
|
||||||
selectInput(
|
selectInput(
|
||||||
NS(id, "ranking_x"),
|
NS(id, "ranking_x"),
|
||||||
label = NULL,
|
label = NULL,
|
||||||
choices = ranking_choices,
|
choices = list(
|
||||||
selected = "combined"
|
"Combined" = "combined"
|
||||||
|
)
|
||||||
),
|
),
|
||||||
div(
|
div(
|
||||||
style = paste0(
|
style = paste0(
|
||||||
|
|
@ -251,6 +246,30 @@ results_server <- function(id, options, analysis) {
|
||||||
geposan::plot_rankings(rankings, gene_sets)
|
geposan::plot_rankings(rankings, gene_sets)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
observe({
|
||||||
|
ranking_choices <- c(
|
||||||
|
purrr::lmap(preset()$methods, function(method) {
|
||||||
|
l <- list()
|
||||||
|
l[[method[[1]]$name]] <- method[[1]]$id
|
||||||
|
l
|
||||||
|
}),
|
||||||
|
"Combined" = "combined"
|
||||||
|
)
|
||||||
|
|
||||||
|
updateSelectInput(
|
||||||
|
session,
|
||||||
|
"ranking_y",
|
||||||
|
choices = ranking_choices
|
||||||
|
)
|
||||||
|
|
||||||
|
updateSelectInput(
|
||||||
|
session,
|
||||||
|
"ranking_x",
|
||||||
|
choices = ranking_choices,
|
||||||
|
selected = "combined"
|
||||||
|
)
|
||||||
|
}) |> bindEvent(preset())
|
||||||
|
|
||||||
output$ranking_correlation_plot <- plotly::renderPlotly({
|
output$ranking_correlation_plot <- plotly::renderPlotly({
|
||||||
preset <- preset()
|
preset <- preset()
|
||||||
ranking <- ranking()
|
ranking <- ranking()
|
||||||
|
|
@ -281,7 +300,7 @@ results_server <- function(id, options, analysis) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
method_names <- geposan::all_methods() |> purrr::lmap(function(method) {
|
method_names <- preset$methods |> purrr::lmap(function(method) {
|
||||||
l <- list()
|
l <- list()
|
||||||
l[[method[[1]]$id]] <- method[[1]]$name
|
l[[method[[1]]$id]] <- method[[1]]$name
|
||||||
l
|
l
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue