Commit b0d77f0f authored by khalid's avatar khalid
Browse files

Now a dryrun output for the entire WF is added to the report

parent a8eb7226
......@@ -480,6 +480,7 @@ generate_pages_server <- function() {
res <- res + '\t}\n'
res <- res + '\telse if (input$force_from=="all"){ return("--forcerun all") }\n'
res <- res + '\telse if (input$force_from=="multiqc"){ return("--forcerun multiqc") }\n'
res <- res + '\telse if (input$force_from=="prepare_report"){ return("--forcerun prepare_report") }\n'
res <- res + '\telse {\n'
res <- res + '\t\tparams = yaml.load_file(paste0(input$results_dir,"/params.yml"), handlers=list("float#fix"=function(x){ format(x,scientific=F)}))\n'
res <- res + '\t\toutputs = params[["outputs"]]\n'
......@@ -552,7 +553,7 @@ generate_pages_server <- function() {
res <- res + '\t\t\tsave_params(path_param)\n'
res <- res + '\n'
res <- res + '\t\t\tforce = force_rule(input$force_from)\n'
res <- res + '\t\t\tcommand = paste0("Command line to run the workflow:<br/>","snakemake -s /workflow/Snakefile --configfile ", paste0(input$results_dir,"/params.yml") ,\t" -d ", input$results_dir ,\t" --cores ", input$cores, " all ", force, " -n -p<br/>This snakemake command needs the Snakefile and the params file of the workflow (remove -n for execution)<br/><br/>What will be done :<br/>")\n'
res <- res + '\t\t\tcommand = paste0("Command line to run the workflow from the selected step:<br/>","snakemake -s /workflow/Snakefile --configfile ", paste0(input$results_dir,"/params.yml") ,\t" -d ", input$results_dir ,\t" --cores ", input$cores, " all ", force, "<br/>This snakemake command needs the Snakefile and the params file of the workflow <br/><br/>What will be done :<br/>")\n'
res <- res + '\t\t\tdry_out = system(paste0("snakemake -s /workflow/Snakefile --configfile ", paste0(input$results_dir,"/params.yml") ,\t" -d ", input$results_dir ,\t" --cores ", input$cores, " all ", force, " -n -p"),wait = T, intern=T)\n'
res <- res + '\t\t\tdryUI = tags$p(HTML(paste0(command, paste(dry_out, collapse = "<br/>"))))\n'
res <- res + '\n'
......@@ -601,8 +602,10 @@ generate_pages_server <- function() {
res <- res + '\t\t\trerun = if (input$rerun_incomplete) "--rerun-incomplete" else ""\n'
## DRY RUN
res <- res + '\t\t\t\tcommand = paste0("Command line to run the workflow:<br/>","snakemake -s /workflow/Snakefile --configfile ", paste0(input$results_dir,"/params.yml") ,\t" -d ", input$results_dir ,\t" --cores ", input$cores, " all ", force, " -n -p<br/>This snakemake command needs the Snakefile and the params file of the workflow (remove -n for execution)<br/><br/>What will be done :<br/>")\n'
res <- res + '\t\t\t\tsystem(paste0("snakemake -s /workflow/Snakefile --configfile ", paste0(input$results_dir,"/params.yml") ," -d ", input$results_dir ," --cores ", input$cores, " all ", force, " ", rerun, " -n -p > ", input$results_dir, "/Run_Summary_mqc.html"),wait = T)\n'
res <- res + '\t\t\t\tcommand = paste0("Command line to run the entire workflow:<br/>","snakemake -s /workflow/Snakefile --configfile ", paste0(input$results_dir,"/params.yml") ,\t" -d ", input$results_dir ,\t" --cores ", input$cores, " all<br/>This snakemake command needs the Snakefile and the params file of the workflow <br/><br/>What will be done :<br/>")\n'
res <- res + '\t\t\t\tsystem(paste0("cp ",input$results_dir,"/params.yml /tmp/dummyparams.yml && sed -i \'s/results_dir: [A-Za-z0-9_\\/]*/results_dir: NewResultsDir /\' /tmp/dummyparams.yml"))\n'
#run snakemeke on the dummyparams to see all the steps in final report even if the actual dir had all results !
res <- res + '\t\t\t\tsystem(paste0("snakemake -s /workflow/Snakefile --configfile /tmp/dummyparams.yml -d NewResultsDir --cores ", input$cores, " all -n -p > ", input$results_dir, "/Run_Summary_mqc.html"),wait = T)\n'
res <- res + '\t\t\t\tsystem(paste0("sed -i \'1 i\\\\<pre>",command,"\' ",input$results_dir,"/Run_Summary_mqc.html"))\n'
res <- res + '\t\t\tsystem2("python3",paste0("-u -m snakemake -s /workflow/Snakefile --configfile ", paste0(input$results_dir,"/params.yml") ,\t" -d ", input$results_dir ,\t" --cores ", input$cores, " all ", force, " ",rerun),wait = FALSE, stdout = paste0(input$results_dir,"/logs/runlog.txt"), stderr = paste0(input$results_dir,"/logs/runlog.txt"))\n'
......
Supports Markdown
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