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

Adapt to previous changes

R/shiny-ui-config.R(server_conf): conf is transformed using
rv_lst2lst, file parsing is fixed and so on.
parent d2b8be2b
No related branches found
No related tags found
No related merge requests found
...@@ -174,7 +174,7 @@ server_conf <- function(input,output,session,rv,rf) { ...@@ -174,7 +174,7 @@ server_conf <- function(input,output,session,rv,rf) {
shinyFiles::shinyDirChoose(input, 'switchProjB',roots=volumes) shinyFiles::shinyDirChoose(input, 'switchProjB',roots=volumes)
obsrv_e(input$saveConfB, { obsrv_e(input$saveConfB, {
conf<-rv_conf2conf(rv) conf<-rv_lst2lst(rv)
vol <- vol_f() vol <- vol_f()
fn <- shinyFiles::parseSavePath(roots=vol_f,input$saveConfB)[["datapath"]] fn <- shinyFiles::parseSavePath(roots=vol_f,input$saveConfB)[["datapath"]]
validate1(fn,msg="Invalid file to save config to.") validate1(fn,msg="Invalid file to save config to.")
...@@ -182,12 +182,15 @@ server_conf <- function(input,output,session,rv,rf) { ...@@ -182,12 +182,15 @@ server_conf <- function(input,output,session,rv,rf) {
}) })
obsrv_e(input$restoreConfB,{ obsrv_e(input$restoreConfB,{
fn <- shinyFiles::parseSavePath(roots=vol_f,input$saveConfB)[["datapath"]] fn <- shinyFiles::parseFilePaths(roots=volumes,input$restoreConfB)[["datapath"]]
validate(need()) assert(file.exists(fn), msg="The file is unreadable.")
validate1(fn,msg="Something went wrong with the config file name.")
validate1(file.exists(fn),msg="The file is unreadable.")
conf <- read_conf(fn) conf <- read_conf(fn)
rv <- conf2rv_conf(conf,rv) rv$conf <- lst2rv_lst(conf)
for (nm in names(conf$compounds)) {
shiny::updateTextInput(session=session,
inputId=nm,
value=conf$compounds[[nm]])
}
}) })
...@@ -197,21 +200,21 @@ server_conf <- function(input,output,session,rv,rf) { ...@@ -197,21 +200,21 @@ server_conf <- function(input,output,session,rv,rf) {
## ***** Render ***** ## ***** Render *****
output$fnKnownLCtrl <- shiny::renderUI({ output$fnKnownLCtrl <- shiny::renderUI({
txt_file_input(inputId = 'fnKnownL', txt_file_input(inputId = 'known',
input = input, input = input,
label = html("The list of knowns. Required columns: <i>ID</i>, <i>SMILES</i>, <i>Name</i> and <i>RT</i> (the last two can be empty). Remember to quote <i>SMILES</i> and <i>Name</i> entries!"), label = html("The list of knowns. Required columns: <i>ID</i>, <i>SMILES</i>, <i>Name</i> and <i>RT</i> (the last two can be empty). Remember to quote <i>SMILES</i> and <i>Name</i> entries!"),
fileB = 'impKnownListB', fileB = 'impKnownListB',
volumes=volumes) volumes=volumes)
}) })
output$fnUnkLCtrl <- shiny::renderUI({ output$fnUnkLCtrl <- shiny::renderUI({
txt_file_input(inputId = 'fnUnkL', txt_file_input(inputId = 'unknown',
input = input, input = input,
label = html("The list of unknowns. Required columns: <i>ID</i>, <i>mz</i> and <i>RT</i> (<i>RT</i> can be empty)."), label = html("The list of unknowns. Required columns: <i>ID</i>, <i>mz</i> and <i>RT</i> (<i>RT</i> can be empty)."),
fileB = 'impUnkListB', fileB = 'impUnkListB',
volumes=volumes) volumes=volumes)
}) })
output$fnSetIdCtrl <- shiny::renderUI({ output$fnSetIdCtrl <- shiny::renderUI({
txt_file_input(inputId = 'fnSetId', txt_file_input(inputId = 'sets',
input = input, input = input,
label = html("Set table. Required columns <i>ID</i> and <i>set</i>."), label = html("Set table. Required columns <i>ID</i> and <i>set</i>."),
fileB = 'impSetIdB', fileB = 'impSetIdB',
......
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