Commit 9c7cf884 authored by mmassaviol's avatar mmassaviol
Browse files

Clean old commented parts

parent b9a65556
......@@ -325,67 +325,10 @@ generate_pages_server <- function() {
content <- APP$pages[[x]]
# if(length(content) > 0) {
# boxes = content$boxes
# if(length(boxes) > 0) {
# for(b in 1:length(boxes)) {
# box <- boxes[[b]]
# #if(box$defined == TRUE) {
# # box <- get_predefined_box(box, APP$pages[[x]]$name)
# #}
# panel_content = box$content
# if(length(panel_content) > 0) {
# for(z in 1:length(panel_content)) {
# cnt <- panel_content[[z]]
# type <- cnt$type
# id <- cnt$name
# if(type == "button") {
# res <- res + '#\' Event when use '+ id +' button\n'
# res <- res + 'observeEvent(input$'+id+', {\n\n'
# res <- res + '})\n\n'
# }
# }
# }
# }
# }
# }
run <- APP$run
if(length(run$options) > 0) {
# res <- res + '#\' Event when use '+ run$shiny_button$name +' button\n'
# res <- res + 'observeEvent(input$'+ run$shiny_button$name+', {\n\n'
# page_path <- output_dir + '/params/' + 'params_' + APP$pages[[x]]$name + '.yml'
# file.replace(page_path)
# res <- res + '# Params \n'
# res <- res + '\tpath_param <- "' + page_path + '"\n\n'
# res <- res + '\tres <- ""\n'
# res <- res + '\n\t# Page : ' + APP$pages[[x]]$name+ '\n'
boxes = APP$pages[[x]]$boxes
if(length(boxes) > 0) {
......@@ -395,17 +338,6 @@ generate_pages_server <- function() {
box <- boxes[[b]]
# res <- res + '\n\t# Tool : ' + box$name+ '\n'
# if (length(boxes) > 1){
# verif = "input$select" + APP$pages[[x]]$name + ' == "' + box$name + '"'
# }
# else{
# verif = "TRUE"
# }
# res <- res + '\n\tif('+verif+') {\n'
panel_content = box$content
if(length(panel_content) > 0) {
......@@ -513,34 +445,21 @@ generate_pages_server <- function() {
#TODO
}
# res <- res + genR
resG <- resG + genR
}
}
# res <- res + '\t}\n'
# res <- res + '\n'
}
}
# res <- res + '\twrite(res, file=path_param)'
# res <- res + '\n\n'
# res <- res + '})\n\n'
}
#write(res, file=path_opt)
}
save_params <- "save_params <- function(path_param){\n"
save_params <- save_params + '\tres = ""'
save_params <- save_params + resG
#save_params <- save_params + '\t\tres = paste0(res, paste("final_step:", paste0(\'\"\', input$final_step, \'\"\'), "\\n", sep = " "))\n\n'
save_params <- save_params + '\ta = yaml.load_file("/workflow/params.total.yml", handlers=list("float#fix"=function(x){ format(x,scientific=F)}))\n'
save_params <- save_params + '\tp = a[["params"]]\n'
save_params <- save_params + '\ta["params"] = NULL\n'
......@@ -554,9 +473,6 @@ generate_pages_server <- function() {
save_params <- save_params + '\t\treturn(result)\n'
save_params <- save_params + '\t}\n'
save_params <- save_params + '\td = c(d,a)\n'
#save_params <- save_params + '\tget_samples = yaml.load(system(paste0("python3 /workflow/get_samples.py ",input$sample_dir," ",input$SeOrPe),intern = T))\n'
#save_params <- save_params + '\td$samples = get_samples$samples\n'
#save_params <- save_params + '\td$params$sample_suffix = get_samples$suffix\n'
save_params <- save_params + '\twrite_yaml(d,path_param,handlers=list(logical = logical,"float#fix"=function(x){ format(x,scientific=F) }))\n'
save_params <- save_params + '\t}\n\n'
......@@ -582,29 +498,7 @@ generate_pages_server <- function() {
res <- res + '\t}\n'
res <- res + '}\n'
# # Compare parameters (give rules that need to be re-runned)
# res <- res + 'compare_params = function(dossierAnalyse){\n'
# res <- res + '\tif (!file.exists(paste0(dossierAnalyse,"/lastrun/params.yml"))){\n'
# res <- res + '\t\treturn(c())\n'
# res <- res + '\t}\n'
# res <- res + '\telse{\n'
# res <- res + '\t\tnew_params = yaml.load_file(paste0(dossierAnalyse,"/params.yml"))\n'
# res <- res + '\t\told_params = yaml.load_file(paste0(dossierAnalyse,"/workflow/params.yml"))\n'
# res <- res + '\t\tchanged = new_params[!(new_params %in% old_params)]\n'
# res <- res + '\t\trules = c()\n'
# res <- res + '\t\tif (length(changed)>=1){\n'
# res <- res + '\t\t\tfor (param in names(changed)){\n'
# res <- res + '\t\t\t\tif (!grepl("_threads$",param)){\n'
# res <- res + '\t\t\t\t\trules = c(rules, new_params$params_info[[param]]$rule)\n'
# res <- res + '\t\t\t\t}\n'
# res <- res + '\t\t\t}\n'
# res <- res + '\t\t}\n'
# res <- res + '\t\treturn(unique(rules))\n'
# res <- res + '\t}\n'
# res <- res + '}\n'
file.replace(output_dir+"/server/opt_global.R")
#res <- ""
# Event RULEGRAPH
if ("RULEGRAPH" %in% names(APP)){
res <- res + '#\' Event when use RULEGRAPH button\n'
......@@ -681,7 +575,6 @@ generate_pages_server <- function() {
res <- res + '\t\ttoggle_inputs(input_list,F,F)\n'
res <- res + '\t\tupdateTabsetPanel(session, "sidebarmenu", selected = "run_out")\n'
#panel_path <- output_dir + '/params/' + 'params_' + APP$pages[[x]]$name + '.yml'
res <- res + '\t\tpath_param <- paste0(input$results_dir,"/params.yml")\n\n'
res <- res + '\t\t\tsave_params(path_param)\n'
......@@ -701,19 +594,6 @@ generate_pages_server <- function() {
res <- res + '\t\t\t\tfile.remove(paste0(input$results_dir,"/logs/workflow_end.error"))\n'
res <- res + '\t\t\t}\n'
# res <- res + '\t\tforcerun = compare_params(input$results_dir)\n'
# res <- res + '\t\tif (length(forcerun>1)){\n'
# res <- res + '\t\t\trules = paste(forcerun, collapse=" ")\n'
# res <- res + '\t\t\tforcerun = paste(" --forcerun ",rules)\n'
# res <- res + '\t\t\tshowModal(modalDialog(\n'
# res <- res + '\t\t\t\ttitle = "Params have changed since the last run",\n'
# res <- res + '\t\t\t\tforcerun\n'
# res <- res + '\t\t\t))\n'
# res <- res + '\t\t}\n'
# res <- res + '\t\telse{\n'
# res <- res + '\t\t\tforcerun = ""\n'
# res <- res + '\t\t}\n'
res <- res + '\t\t\tsystem(paste0("touch ",input$results_dir,"/logs/workflow.running"),wait = T)\n'
# RULEGRAPH
......@@ -744,7 +624,6 @@ generate_pages_server <- function() {
for(cnt in box$content){
if ("prompt" %in% names(cnt)){
#res <- res + '\t\t'
res <- res + '\t\tobserveEvent({input$'+cnt$name+'},{showModal(modalDialog(title = "Info","'+cnt$prompt+'",easyClose = TRUE))},ignoreInit=TRUE)\n'
}
......@@ -898,12 +777,6 @@ generate <- function() {
print("Generate Start")
#YML_TOOLS <<- get_predefined_tool(files_tools)
if(dir.exists(output_dir)) {
#unlink(output_dir, recursive=TRUE)
}
dir.create.not.exist(output_dir)
generate_app()
......@@ -912,7 +785,6 @@ generate <- function() {
dir.create.not.exist(output_dir + "/pages")
dir.create.not.exist(output_dir + "/server")
#dir.create.not.exist(output_dir + "/params")
generate_pages_server()
......@@ -958,7 +830,6 @@ generate_app <- function() {
res <- res + 'library(stringr)\n'
res <- res + 'library(shinyFiles)\n'
res <- res + 'library(tools)\n'
#res <- res + 'library(knitr)\n'
res <- res + 'library(DT)\n'
res <- res + '\n\n'
......@@ -996,7 +867,6 @@ generate_app <- function() {
res <- res + ' dashboardBody(\n\n'
res <- res + ' shinyjs::useShinyjs(),\n\n'
res <- res + ' tags$head(tags$link(rel="stylesheet", type="text/css", href="bootstrap.min.readable.css")),\n\n'
#tags$head(tags$script(src="message-handler.js")),
res <- res + 'tags$head(style),\n\n'
res <- res + '\ttabItems(\n\n'
......@@ -1202,11 +1072,6 @@ generate_app <- function() {
res <- res + 'source("./server/opt_global.R", local=T)\n'
#for(x in 1:length(APP$pages)) {
# name <- APP$pages[[x]]$name
# res <- res + 'source("./server/opt_'+tolower(name)+'.R", local=T)\n'
#}
res <- res + '\n\n'
......
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