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

...

parent b49b5845
No related branches found
No related tags found
No related merge requests found
...@@ -33,7 +33,7 @@ create_stub_gui <- function() { ...@@ -33,7 +33,7 @@ create_stub_gui <- function() {
gui <- list() gui <- list()
shiny::isolate({ shiny::isolate({
gui$compounds <- shiny::reactiveValues(lists=character(), gui$compounds <- shiny::reactiveValues(lists=character(),
set=character()) sets=character())
gui$datatab <- shiny::reactiveValues(file=character(), gui$datatab <- shiny::reactiveValues(file=character(),
tag=character(), tag=character(),
adduct=character(), adduct=character(),
...@@ -83,10 +83,10 @@ r2taadse <- function(tablist,sets) { ...@@ -83,10 +83,10 @@ r2taadse <- function(tablist,sets) {
r2compounds <- function(rcompounds) { r2compounds <- function(rcompounds) {
shiny::isolate({ shiny::isolate({
cmpd_lists <- rcompounds$lists cmpd_lists <- rcompounds$lists
cmpd_set <- rcompounds$set cmpd_set <- rcompounds$sets
}) })
list(lists=cmpd_lists,set=cmpd_set) list(lists=cmpd_lists,sets=cmpd_set)
} }
...@@ -211,9 +211,22 @@ app_state2state <- function(input,gui) { ...@@ -211,9 +211,22 @@ app_state2state <- function(input,gui) {
m <- new_project(gui$paths$project) m <- new_project(gui$paths$project)
m$run$paths <- shiny::reactiveValuesToList(gui$paths) m$run$paths <- shiny::reactiveValuesToList(gui$paths)
m$conf <- input2conf(input) m$conf <- input2conf(input)
m$input$tab$mzml <- data.table(tag=gui$datatab$tag,
adduct=gui$datatab$adduct,
set=gui$datatab$set,
file=gui$datatab$file)
m m
} }
gen_comp_state <- function(input,gui) {
m <- app_state2state(input,gui)
run(m=m,phases=c("setup","mk_comp_tab"))
}
get_sets <- function(gui) {
fn_set <- file.path(gui$paths$project,gui$compounds$sets)
df <- fread(file=fn_sets)
df[,unique(set)]
}
...@@ -439,7 +439,7 @@ mk_shinyscreen_server <- function(projects,init) { ...@@ -439,7 +439,7 @@ mk_shinyscreen_server <- function(projects,init) {
## Update with data-files. ## Update with data-files.
rv_dfile <- reactiveVal(def_datafiles) rv_dfile <- reactiveVal(def_datafiles)
## TODO: think about the connection of rv_dfile to the rest.
## Data-file table when loading. ## Data-file table when loading.
rv_datatab <- reactiveVal(def_datatab) rv_datatab <- reactiveVal(def_datatab)
rv_flag_datatab <- reactiveVal(-.Machine$integer.max) rv_flag_datatab <- reactiveVal(-.Machine$integer.max)
...@@ -654,24 +654,37 @@ mk_shinyscreen_server <- function(projects,init) { ...@@ -654,24 +654,37 @@ mk_shinyscreen_server <- function(projects,init) {
## REACTIVE FUNCTIONS ## REACTIVE FUNCTIONS
rf_compound_input_state <- reactive({ ## rf_compound_input_state <- reactive({
sets <- rvs$m$run$paths$compounds$sets ## sets <- rvs$m$run$paths$compounds$sets
lst <- as.list(rvs$m$run$paths$compounds$lists) ## lst <- as.list(rvs$m$run$paths$compounds$lists)
## TODO XXX ## ## TODO XXX
validate(need(length(lst)>0, ## validate(need(length(lst)>0,
message = "Load the compound lists(s) first.")) ## message = "Load the compound lists(s) first."))
validate(need(length(sets)>0 && nchar(sets)>0, ## validate(need(length(sets)>0 && nchar(sets)>0,
message = "Load the setid table first.")) ## message = "Load the setid table first."))
isolate({ ## isolate({
state <- rev2list(rvs$m) ## state <- rev2list(rvs$m)
m <- load_compound_input(state) ## m <- load_compound_input(state)
## Side effect! This is because my pipeline logic does not ## ## Side effect! This is because my pipeline logic does not
## work nicely with reactive stuff. ## ## work nicely with reactive stuff.
rvs$m$input$tab$cmpds <- list2rev(m$input$tab$cmpds) ## rvs$m$input$tab$cmpds <- list2rev(m$input$tab$cmpds)
rvs$m$input$tab$setid <- m$input$tab$setid ## rvs$m$input$tab$setid <- m$input$tab$setid
m ## m
## })
## })
rf_comp_state <- reactive({
app_state2state(input=input,
gui = rvs$gui)
}) })
rf_get_sets <- reactive({
req(rvs$gui$paths$project)
req(rvs$gui$paths$sets)
get_sets(gui)
}) })
rf_conf_proj <- reactive({ rf_conf_proj <- reactive({
......
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