server: Cache analysis transiently

This commit is contained in:
Elias Projahn 2022-02-24 15:58:24 +01:00
parent 0ca4063429
commit 40164ebf84

View file

@ -22,21 +22,20 @@ server <- function(input, output, session) {
# Compute the results according to the preset. # Compute the results according to the preset.
analysis <- reactive({ analysis <- reactive({
preset <- preset() withProgress(
# Perform the analysis cached based on the preset's hash.
analysis <- withProgress(
message = "Analyzing genes", message = "Analyzing genes",
value = 0.0, value = 0.0,
{ # nolint { # nolint
geposan::analyze(preset, function(progress) { geposan::analyze(
preset(),
progress = function(progress) {
setProgress(progress) setProgress(progress)
}) },
include_results = FALSE
)
} }
) )
}) |> bindCache(preset())
analysis
})
# Rank the results. # Rank the results.
ranking <- methods_server("methods", analysis, comparison_gene_ids) ranking <- methods_server("methods", analysis, comparison_gene_ids)