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.
analysis <- reactive({
preset <- preset()
# Perform the analysis cached based on the preset's hash.
analysis <- withProgress(
withProgress(
message = "Analyzing genes",
value = 0.0,
{ # nolint
geposan::analyze(preset, function(progress) {
geposan::analyze(
preset(),
progress = function(progress) {
setProgress(progress)
})
},
include_results = FALSE
)
}
)
analysis
})
}) |> bindCache(preset())
# Rank the results.
ranking <- methods_server("methods", analysis, comparison_gene_ids)