Commit b9695b0e authored by mmassaviol's avatar mmassaviol
Browse files

Update agregate params with param file from WAW

Remove download button
Add cores input to use in run command
parent e2bd3abb
......@@ -559,33 +559,6 @@ generate_pages_server <- function() {
res <- res + '\n\n'
# res <- res + '\tsystem(paste(" '
# res <- res + run$program + '", '
# for(o in 1:length(run$options)) {
# option = run$options[[o]]
# if(option$type == "value") {
# res <- res + '"' + option$name + '", "' + option$value + '" '
# } else if (option$type == "shiny") {
# res <- res + '"' + option$name + '", input$' + option$value + ' '
# } else if(option$type == "shiny-file") {
# res <- res + '"' + option$name + '", input$' + option$value + '$datapath '
# } else if(option$type == "panel") {
# res <- res + '"' + option$name + '", "' + APP$project + '/params/params_' + APP$pages[[x]]$name + '.yml"'
# }
# if(o < length(run$options)) {
# res <- res + ', '
# }
# }
# res <- res + ', sep = " " ))\n\n'
res <- res + '})\n\n'
}
......@@ -598,12 +571,30 @@ generate_pages_server <- function() {
res <- '#\' Event when use '+ run$shiny_button$name +' button\n'
res <- res + 'observeEvent(input$'+run$shiny_button$name+', {\n\n'
panel_path <- APP$project + '/params/' + 'params_' + APP$pages[[x]]$name + '.yml'
res <- res + '\tpath_param <- "' + APP$project + '/params/' + 'params' + '.yml' + '"\n\n'
res <- res + '\tpath_param <- "/results/' + 'params.yml' + '"\n\n'
res <- res + '\tres <- ""'
res <- res + resG # Add content
# concatenate params
res <- res + '\ta = yaml.load_file("/workflow/params.total.yml")\n'
res <- res + '\tb = yaml.load(res)\n'
res <- res + '\tanotb = subset(names(a), !(names(a)%in%names(b)))\n'
res <- res + '\tc = c(a[anotb],b)\n'
res <- res + '\tlogical = function(x) {\n'
res <- res + '\t\tresult <- ifelse(x, "True", "False")\n'
res <- res + '\t\tclass(result) <- "verbatim"\n'
res <- res + '\t\treturn(result)\n'
res <- res + '\t}\n'
res <- res + '\twrite_yaml(c,"/results/params.yml",handlers=list(logical = logical))\n'
res <- res + '\t '
res <- res + '\twrite(res, file=path_param)'
#res <- res + '\twrite(res, file=path_param)'
res <- res + '\n\n'
......@@ -631,37 +622,13 @@ generate_pages_server <- function() {
}
}
res <- res + ', sep = " " ))\n\n'
res <- res + '\n\n'
res <- res + '})\n\n'
# Event Download
download = APP$download
res <- res + '#\' Event when use '+ download$shiny_button$name +' button\n'
res <- res + 'output$'+download$shiny_button$name+' <- downloadHandler(filename = function(){return("pipeline.zip")},content = function(file){\n'
panel_path <- APP$project + '/params/' + 'params_' + APP$pages[[x]]$name + '.yml'
res <- res + '\tpath_param <- "' + APP$project + '/res/' + '"\n\n'
res <- res + '\tres <- ""'
res <- res + resG # Add content
res <- res + '\tsetwd(path_param)\n'
res <- res + '\twrite(res, file="params.yml")\n'
res <- res + '\tsystem("python3 /home/mbb/Documents/waw/main.py",wait=TRUE)\n'
res <- res + '\tsetwd("/home/mbb/Documents/waw")\n'
# create zip file
res <- res + '\t file.copy("pipe.zip", file)\n'
res <- res + '},\n'
res <- res + 'contentType = "application/zip"\n'
res <- res + ')\n\n'
write(res, APP$project+"/server/opt_global.R")
}
......@@ -685,12 +652,20 @@ generate_menu <- function() {
}
res <- res + ' tags$br(),\n\n'
res <- res + ' numericInput("cores", label = "Threads availaible", min = 1, max = NA, step = 1, width = "auto", value = 4),\n'
res <- res + ' tags$br(),\n'
res <- res + ' actionButton("'+ APP$run$shiny_button$name +'", "'+ APP$run$shiny_button$label +'", icon("'+ APP$run$shiny_button$icon +'"), class="'+ APP$run$shiny_button$class +'"),\n\n'
res <- res + ' tags$br(),\n\n'
if("download" %in% names(APP)){
res <- res + ' downloadButton("'+ APP$download$shiny_button$name +'", "'+ APP$download$shiny_button$label +'", class="'+ APP$download$shiny_button$class +'", style="color:black;margin: 6px 5px 6px 15px;"),\n\n'
res <- res + ' tags$br(),\n\n'
res <- res + ' downloadButton("'+ APP$download$shiny_button$name +'", "'+ APP$download$shiny_button$label +'", class="'+ APP$download$shiny_button$class +'", style="color:black;margin: 6px 5px 6px 15px;"),\n\n'
}
res <- res + ' tags$br(),tags$br(),\n\n'
......@@ -700,7 +675,6 @@ generate_menu <- function() {
write(res, file = path_file)
}
#============================================================
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment