Add more optimization targets

This commit is contained in:
Elias Projahn 2021-10-21 11:43:34 +02:00
parent 2aed917478
commit 365cf13dcb
2 changed files with 22 additions and 8 deletions

View file

@ -4,11 +4,6 @@ methods_ui <- function(id) {
verticalLayout(
h3("Methods"),
actionButton(
NS(id, "optimize_button"),
"Find optimal weights",
icon = icon("check-double")
),
div(style = "margin-top: 16px"),
lapply(methods, function(method) {
verticalLayout(
@ -30,7 +25,21 @@ methods_ui <- function(id) {
value = initial_weight
)
)
})
}),
radioButtons(
NS(id, "target"),
"Optimization target",
choices = list(
"Mean rank of reference genes" = "mean",
"First rank of reference genes" = "min",
"Last rank of reference genes" = "max"
)
),
actionButton(
NS(id, "optimize_button"),
"Optimize weights",
class = "btn-primary"
)
)
}
@ -54,7 +63,8 @@ methods_server <- function(id, analysis) {
weights <- geposan::optimize_weights(
analysis(),
method_ids,
genes_tpe_old
genes_tpe_old,
target = input$target
)
for (method_id in method_ids) {