Commit ead0152a authored by mmassaviol's avatar mmassaviol
Browse files

Add radio button gestion and dl pipeline

parent 10455e1a
source("tools.R")
library(yaml)
path_yml <- "/home/mbb/Documents/sag/pipeline.yml"
path_yml <- "/home/mbb/Documents/waw/workflows/RNAseq/sag.yaml"
path_tools <- "/home/mbb/Documents/sag/predefined_tools/"
......@@ -425,8 +425,8 @@ generate_pages_server <- function() {
if(length(boxes) > 0) {
#resG <- resG + '\t\tres <- paste(res, "outil_' + APP$pages[[x]]$name + '_' + panel$name + ':", paste0(\'\"\', input$select' + panel$name + ', \'\"\'), "\\n", sep = " ")\n'
resG <- resG + '\t\tres <- paste(res, "'+APP$pages[[x]]$name + ':", paste0(\'\"\', input$select' + APP$pages[[x]]$name + ', \'\"\'), "\\n", sep = " ")\n'
#resG <- resG + '\t\tres = res + paste("outil_' + APP$pages[[x]]$name + '_' + panel$name + ':", paste0(\'\"\', input$select' + panel$name + ', \'\"\'), "\\n", sep = " ")\n'
resG <- resG + '\t\tres = res + paste("'+APP$pages[[x]]$name + ':", paste0(\'\"\', input$select' + APP$pages[[x]]$name + ', \'\"\'), "\\n", sep = " ")\n'
for(b in 1:length(boxes)) { # list boxes
box <- boxes[[b]]
......@@ -463,36 +463,36 @@ generate_pages_server <- function() {
if(type == 'text') {
genR <- genR + '\t\tif(!is.na(as.numeric(input$' + id + '))) {\n'
genR <- genR + '\t\t\tres <- paste(res, "' + id + ':", input$' + id + ', "\\n", sep = " ")\n'
genR <- genR + '\t\t\tres = res + paste("' + id + ':", input$' + id + ', "\\n", sep = " ")\n'
genR <- genR + '\t\t} else {\n'
genR <- genR + '\t\t\tres <- paste(res, "' + id + ':", paste0(\'\"\', input$' + id + ', \'\"\'), "\\n", sep = " ")\n'
genR <- genR + '\t\t\tres = res + paste("' + id + ':", paste0(\'\"\', input$' + id + ', \'\"\'), "\\n", sep = " ")\n'
genR <- genR + '\t\t}'
genR <- genR + '\t\n\n'
} else if(cnt$type == "slider") {
if(length(cnt$value) == 1) {
genR <- genR + '\t\tres <- paste(res, "' + id + ':", input$' + id + ', "\\n", sep = " ")'
genR <- genR + '\t\tres = res + paste("' + id + ':", input$' + id + ', "\\n", sep = " ")'
genR <- genR + '\t\n\n'
} else {
genR <- genR + '\t\tres <- paste(res, "' + id + '_min:", input$' + id + '[1], "\\n", sep = " ")\n'
genR <- genR + '\t\tres <- paste(res, "' + id + '_max:", input$' + id + '[2], "\\n", sep = " ")\n'
genR <- genR + '\t\tres <- paste(res, "' + id + '_step:", "' + cnt$step + '", "\\n", sep = " ")\n'
genR <- genR + '\t\tres = res + paste("' + id + '_min:", input$' + id + '[1], "\\n", sep = " ")\n'
genR <- genR + '\t\tres = res + paste("' + id + '_max:", input$' + id + '[2], "\\n", sep = " ")\n'
genR <- genR + '\t\tres = res + paste("' + id + '_step:", "' + cnt$step + '", "\\n", sep = " ")\n'
genR <- genR + '\t\n\n'
}
} else if(cnt$type == "select") {
genR <- genR + '\t\tif(!is.na(as.numeric(input$' + id + '))) {\n'
genR <- genR + '\t\t\tres <- paste(res, "' + id + ':", input$' + id + ', "\\n", sep = " ")\n'
genR <- genR + '\t\t\tres = res + paste("' + id + ':", input$' + id + ', "\\n", sep = " ")\n'
genR <- genR + '\t\t} else {\n'
genR <- genR + '\t\t\tres <- paste(res, "' + id + ':", paste0(\'\"\', input$' + id + ', \'\"\'), "\\n", sep = " ")\n'
genR <- genR + '\t\t\tres = res + paste("' + id + ':", paste0(\'\"\', input$' + id + ', \'\"\'), "\\n", sep = " ")\n'
genR <- genR + '\t\t}'
genR <- genR + '\t\n\n'
} else if(cnt$type == "file") {
genR <- genR + '\t\t\tres <- paste(res, "' + id + ':", paste0(\'\"\', input$' + id + '$datapath, \'\"\'), "\\n", sep = " ")'
genR <- genR + '\t\t\tres = res + paste("' + id + ':", paste0(\'\"\', input$' + id + '$datapath, \'\"\'), "\\n", sep = " ")'
genR <- genR + '\t\n\n'
} else if(cnt$type == "checkbox") {
genR <- genR + '\t\tif(input$' + id + ') {\n'
genR <- genR + '\t\t\tres <- paste(res, "' + id + ':", "true", "\\n", sep = " ")\n'
genR <- genR + '\t\t\tres = res + paste("' + id + ':", "true", "\\n", sep = " ")\n'
genR <- genR + '\t\t} else {\n'
genR <- genR + '\t\t\tres <- paste(res, "' + id + ':", "false", "\\n", sep = " ")\n'
genR <- genR + '\t\t\tres = res + paste("' + id + ':", "false", "\\n", sep = " ")\n'
genR <- genR + '\t\t}'
genR <- genR + '\t\n\n'
} else if(cnt$type == "chooser") {
......@@ -520,8 +520,16 @@ generate_pages_server <- function() {
genR <- genR + '\t\t} \n'
genR <- genR + '\t\tres <- paste0(res, "]", "\\n")\n\n'
} else {
} else if(cnt$type == "radio") {
genR <- genR + '\t\tif(!is.na(as.numeric(input$' + id + '))) {\n'
genR <- genR + '\t\t\tres = res + paste("' + id + ':", input$' + id + ', "\\n", sep = " ")\n'
genR <- genR + '\t\t} else {\n'
genR <- genR + '\t\t\tres = res + paste("' + id + ':", paste0(\'\"\', input$' + id + ', \'\"\'), "\\n", sep = " ")\n'
genR <- genR + '\t\t}'
genR <- genR + '\t\n\n'
}
else {
#TODO
}
......@@ -633,20 +641,16 @@ generate_pages_server <- function() {
res <- res + resG # Add content
res <- res + 'setwd(path_param)\n'
res <- res + '\tsetwd(path_param)\n'
res <- res + '\twrite(res, file="params.yml")\n'
res <- res + 'fs = c("params.yml")\n'
# generate snakefile
res <- res + ''
# generate container file
res <- res + ''
res <- res + '\tsystem("python3 /home/mbb/Documents/waw/main.py",wait=TRUE)\n'
res <- res + '\tsetwd("/home/mbb/Documents/waw")\n'
res <- res + '\tfs = c("Snakefile","params.total.yml","recipe.singularity","report.rmd")\n'
# create zip file
res <- res + 'zip(zipfile=file, files=fs)\n'
res <- res + '\tzip(zipfile=file, files=fs)\n'
res <- res + '},\n'
res <- res + 'contentType = "application/zip"\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