Skip to content
Snippets Groups Projects
Commit fec4858e authored by Todor Kondic's avatar Todor Kondic
Browse files

shiny-*, state: Streamline regeneration of m$run.

parent 9abcc7f2
No related branches found
No related tags found
No related merge requests found
Package: shinyscreen
Title: Pre-screening of Mass Spectrometry Data
Version: 1.2
Version: 1.2.1
Author: Todor Kondić
Maintainer: Todor Kondić <todor.kondic@uni.lu>
Authors@R:
......
......@@ -167,7 +167,7 @@ unpack_app_state <- function(session,input,top_data_dir,project_path,packed_stat
selected = packed_state$input[[inp]])
}
gui <- create_gui(project_path)
gui <- create_gui(project_path=project_path)
gui$compounds$lists <- packed_state$compounds$lists
gui$compounds$sets <- packed_state$compounds$sets
gui$datatab$file <- packed_state$datatab$file
......@@ -240,11 +240,14 @@ input2conf <- function(input,gui,conf=list()) {
app_state2state <- function(input,gui,m=NULL) {
if (is.null(m)) m <- new_project(gui$paths$project)
m$run$paths <- shiny::reactiveValuesToList(gui$paths)
## m$run$paths <- shiny::reactiveValuesToList(gui$paths)
m$conf <- input2conf_setup(input,gui=gui)
m$conf <- input2conf_prescreen(input=input,conf=m$conf)
m$conf <- input2conf_figures(input,conf=m$conf)
m$conf <- input2conf_report(input,conf=m$conf)
m$conf$paths$data <- gui$paths$data
m$run <- new_runtime_state(project=gui$paths$project,
conf=m$conf)
m$input$tab$mzml <- gui2datatab(gui)
m
}
......
......@@ -1004,10 +1004,6 @@ mk_shinyscreen_server <- function(projects,init) {
packed_state=pack)
## Load computational state.
rvs$m <- readRDS(file=fn_state)
rvs$m$run <- reinit_run_data(userdir=init$userdir,
top_data_dir=init$indir,
project=rvs$gui$project(),
run = rvs$m$run)
## If prescreen config invalid, reinit.
if (length(rvs$m$conf$prescreen)==0) rvs$m$conf <- input2conf_prescreen(input=input,conf=rvs$m$conf)
......@@ -1028,11 +1024,6 @@ mk_shinyscreen_server <- function(projects,init) {
} else {
message("Initialising project: ",wd)
rvs$gui <- create_gui(project_path=fullwd)
rvs$m$run <- new_runtime_state(fullwd)
}
message("project: ",rvs$gui$project())
}, label = "project-b")
......
......@@ -40,7 +40,7 @@ runtime_from_conf <- function(run,conf) {
run
}
reinit_run_data <- function(userdir,top_data_dir,project,run) {
reinit_run_data <- function(userdir,top_data_dir,project,run=NULL) {
if (!is.null(run)) {
olddata <- run$paths$data
oldproject <- basename(run$paths$project)
......@@ -48,8 +48,8 @@ reinit_run_data <- function(userdir,top_data_dir,project,run) {
message("Project has been renamed to: ",project)
message("Old project name was: ", oldproject)
}
if (isTruthy(olddata)) run$paths$data <- file.path(top_user_dir,basename(olddata))
}
if (isTruthy(olddata)) run$paths$data <- file.path(top_user_dir,basename(olddata))
run$project <- project
run$paths$project <- file.path(userdir,project)
run
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment