Commit bcdb133b authored by mmassaviol's avatar mmassaviol
Browse files

Add numeric inputs and links and change radio button choices.

Remove predefined tools (concatenated in yaml production in waw)
parent ead0152a
......@@ -3,11 +3,11 @@ library(yaml)
path_yml <- "/home/mbb/Documents/waw/workflows/RNAseq/sag.yaml"
path_tools <- "/home/mbb/Documents/sag/predefined_tools/"
path_tools <- "/home/mbb/Documents/waw/tools"
APP <<- yaml.load_file(path_yml)$App
files_tools <- paste0(path_tools, list.files(path_tools))
files_tools <- paste0(path_tools,'/', list.files(path_tools,pattern = "sag.yml",recursive = TRUE))
#============================================================
......@@ -84,6 +84,10 @@ generate_page_input <- function(res, cnt) {
res <- res + '\t\ttextInput("'+ cnt$name +'", label = "'+ cnt$label +'", value = "'+ cnt$value +'", width = "'+ 'auto' +'")'
} else if(cnt$type == "numeric") {
res <- res + '\t\tnumericInput("'+ cnt$name +'", label = "'+ cnt$label +'", min = '+ cnt$min +', max = '+ cnt$max +', step = '+ cnt$step +', width = "'+ 'auto' +'", value = '+ cnt$default +')'
} else if(cnt$type == "slider") {
if(length(cnt$value) == 1) {
res <- res + '\t\tsliderInput("'+ cnt$name +'", label = "'+ cnt$label +'", min = '+ cnt$min +', max = '+ cnt$max +', step = '+ cnt$step +', width = "'+ 'auto' +'", value = '+ cnt$value +')'
......@@ -92,6 +96,8 @@ generate_page_input <- function(res, cnt) {
}
} else if(cnt$type == "help") {
res <- res + '\t\tp("'+cnt$label+'")'
} else if(cnt$type == "link") {
res <- res + '\t\tp("'+cnt$label+'",a(href="'+cnt$href+'","'+cnt$href+'"))'
} else if(cnt$type == "select") {
......@@ -123,22 +129,16 @@ generate_page_input <- function(res, cnt) {
res <- res + '\t\tradioButtons("'+ cnt$name +'", label = "'+ cnt$label +'", choices = list('
cpt = 1
if(length(cnt$choices) > 0) {
for(ch in 1:length(cnt$choices)){
choices = cnt$choices[[ch]]
for(ch in cnt$choices){
value = choices
if(is.character(choices)) {
value = '"' + choices+ '"'
}
if(ch < length(cnt$choices)) {
res <- res + '"' + choices + '"' + ' = ' + value + ', '
if(cpt < length(cnt$choices)) {
res <- res + '"' + names(ch) + '" = "' + ch[names(ch)] + '", '
} else {
res <- res + '"' + choices + '"' + ' = ' + value + '), '
res <- res + '"' + names(ch) + '" = "' + ch[names(ch)] + '"), '
}
cpt = cpt + 1
}
}
......@@ -332,9 +332,9 @@ generate_pages_server <- function() {
res <- res + "\nconditionalPanel(condition = \"input.select"+content$name+" == '"+box$name+"'\","
}
if(box$defined == TRUE) {
box <- get_predefined_box(box, APP$pages[[x]]$name)
}
#if(box$defined == TRUE) {
# box <- get_predefined_box(box, APP$pages[[x]]$name)
#}
res <- generate_page_box(panel, box, res)
......@@ -370,9 +370,9 @@ generate_pages_server <- function() {
box <- boxes[[b]]
if(box$defined == TRUE) {
box <- get_predefined_box(box, APP$pages[[x]]$name)
}
#if(box$defined == TRUE) {
# box <- get_predefined_box(box, APP$pages[[x]]$name)
#}
panel_content = box$content
......@@ -426,14 +426,14 @@ generate_pages_server <- function() {
#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'
resG <- resG + '\t\tres = paste0(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]]
if(box$defined == TRUE) {
box <- get_predefined_box(box, APP$pages[[x]]$name)
}
#if(box$defined == TRUE) {
# box <- get_predefined_box(box, APP$pages[[x]]$name)
#}
res <- res + '\n\t# Tool : ' + box$name+ '\n'
......@@ -463,36 +463,43 @@ generate_pages_server <- function() {
if(type == 'text') {
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\tres = paste0(res, paste("' + id + ':", input$' + id + ', "\\n", sep = " "))\n'
genR <- genR + '\t\t} else {\n'
genR <- genR + '\t\t\tres = paste0(res, paste("' + id + ':", paste0(\'\"\', input$' + id + ', \'\"\'), "\\n", sep = " "))\n'
genR <- genR + '\t\t}'
genR <- genR + '\t\n\n'
} else if(type == 'numeric') {
genR <- genR + '\t\tif(!is.na(as.numeric(input$' + id + '))) {\n'
genR <- genR + '\t\t\tres = paste0(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\tres = paste0(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 = res + paste("' + id + ':", input$' + id + ', "\\n", sep = " ")'
genR <- genR + '\t\tres = paste0(res, paste("' + id + ':", input$' + id + ', "\\n", sep = " "))'
genR <- genR + '\t\n\n'
} else {
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\tres = paste0(res, paste("' + id + '_min:", input$' + id + '[1], "\\n", sep = " "))\n'
genR <- genR + '\t\tres = paste0(res, paste("' + id + '_max:", input$' + id + '[2], "\\n", sep = " "))\n'
genR <- genR + '\t\tres = paste0(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 = res + paste("' + id + ':", input$' + id + ', "\\n", sep = " ")\n'
genR <- genR + '\t\t\tres = paste0(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\tres = paste0(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 = res + paste("' + id + ':", paste0(\'\"\', input$' + id + '$datapath, \'\"\'), "\\n", sep = " ")'
genR <- genR + '\t\t\tres = paste0(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 = res + paste("' + id + ':", "true", "\\n", sep = " ")\n'
genR <- genR + '\t\t\tres = paste0(res, paste("' + id + ':", "true", "\\n", sep = " "))\n'
genR <- genR + '\t\t} else {\n'
genR <- genR + '\t\t\tres = res + paste("' + id + ':", "false", "\\n", sep = " ")\n'
genR <- genR + '\t\t\tres = paste0(res, paste("' + id + ':", "false", "\\n", sep = " "))\n'
genR <- genR + '\t\t}'
genR <- genR + '\t\n\n'
} else if(cnt$type == "chooser") {
......@@ -522,9 +529,9 @@ generate_pages_server <- function() {
} 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\tres = paste0(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\tres = paste0(res, paste("' + id + ':", paste0(\'\"\', input$' + id + ', \'\"\'), "\\n", sep = " "))\n'
genR <- genR + '\t\t}'
genR <- genR + '\t\n\n'
}
......@@ -647,10 +654,9 @@ generate_pages_server <- function() {
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 + '\tzip(zipfile=file, files=fs)\n'
res <- res + '\t file.copy("pipe.zip", file)\n'
res <- res + '},\n'
res <- res + 'contentType = "application/zip"\n'
......
App:
project: /home/mbb/Documents/sag/app2
project: /home/mbb/Documents/test
general: {title: RNAseq pipeline, skin: blue, menu_width: 230}
pages:
- icon: pencil
......@@ -11,24 +11,93 @@ App:
status: success
defined: false
content:
- {name: sample_directory, type: text, value: /, label: 'Samples directory: '}
- {name: sample_dir, type: text, value: /, label: 'Samples directory: '}
- {name: sample_suffix, type: text, value: .fastq.gz, label: 'Samples suffix: '}
- {name: transcripts_adress, type: text, value: transcripts.fasta.gz, label: 'Transcripts address: '}
- {name: results_dir, type: text, value: /home/mbb/Documents/results, label: 'Results
directory: '}
- name: SeOrPe
type: radio
selected: PE
choices:
- {Single end: SE}
- {Paired end: PE}
label: 'Single end reads (SE) or Paired end reads (PE): '
- icon: pencil
label: Quality check
name: quality_check
boxes:
- {name: fastqc, defined: true, concat_name_param: false}
- name: fastqc
title: FastQC
status: success
content:
- {name: fastqc, type: help, label: A quality control tool for high throughput
raw sequence data.}
- {name: fastqc, type: link, label: 'Website : ', href: 'https://www.bioinformatics.babraham.ac.uk/projects/fastqc/'}
- {name: fastqc_threads, prefix: -t, type: numeric, default: 1, min: 1, max: NA,
step: 1, label: Number of threads to use}
- icon: pencil
label: Quantification
name: quantification
boxes:
- {name: kallisto, defined: true, concat_name_param: false}
- {name: salmon, defined: true, concat_name_param: false}
- name: kallisto
title: kallisto
status: success
content:
- {name: kallisto, type: help, label: 'kallisto is a program for quantifying
abundances of transcripts from RNA-Seq data, or more generally of target
sequences using high-throughput sequencing reads.'}
- {name: kallisto, type: link, label: 'Website : ', href: 'https://pachterlab.github.io/kallisto/'}
- {name: kallisto, type: link, label: 'Paper : ', href: 'https://doi.org/10.1038/nbt.3519'}
- {name: kallisto_quant_threads, prefix: -t, type: numeric, default: 1, min: 1,
max: NA, step: 1, label: Number of threads to use}
- name: kallisto_quant_pe_stranded
type: radio
choices:
- {Not stranded: ''}
- {Forward Reverse: --fr-stranded}
- {Reverse Forward: --rf-stranded}
default: ''
label: For strand specific mode choose --fr-stranded if the first read is
forward and choose --rf-stranded if the first read is reverse
- name: salmon
title: Salmon
status: success
content:
- {name: salmon, type: help, label: 'Salmon is a tool for quantifying the expression
of transcripts using RNA-seq data. '}
- {name: salmon, type: link, label: 'Website : ', href: 'https://combine-lab.github.io/salmon/'}
- {name: salmon, type: link, label: 'Paper : ', href: 'https://doi.org/10.1038/nmeth.4197'}
- {name: salmon_index_threads, prefix: -p, type: numeric, default: 1, min: 1,
max: NA, step: 1, label: Number of threads to use for index creation}
- {name: salmon_quant_threads, prefix: -t, type: numeric, default: 1, min: 1,
max: NA, step: 1, label: Number of threads to use}
- icon: pencil
label: Differential expression
name: DE
boxes:
- name: edger
title: edgeR
status: success
content:
- {name: edger, type: help, label: Empirical Analysis of Digital Gene Expression
Data.}
- {name: edger, type: link, label: 'Website : ', href: 'http://bioconductor.org/packages/release/bioc/html/edgeR.html'}
- {name: edger, type: link, label: 'Paper : ', href: 'https://doi.org/10.18129/B9.bioc.edgeR'}
- name: deseq2
title: DESeq2
status: success
content:
- {name: deseq2, type: help, label: Differential gene expression analysis based
on the negative binomial distribution. Using normalized count data.}
- {name: deseq2, type: link, label: 'Website : ', href: 'https://bioconductor.org/packages/release/bioc/html/DESeq2.html'}
- {name: deseq2, type: link, label: 'Paper : ', href: 'https://doi.org/10.1186/s13059-014-0550-8'}
run:
shiny_button: {name: RunPipeline, type: button, icon: pencil, class: btn btn-info, label: Run pipeline}
program: snakemake
shiny_button: {name: RunPipeline, type: button, icon: pencil, class: btn btn-info,
label: Run pipeline}
program: singularity exec /home/mbb/Documents/singularities/pipelineRNA.simg snakemake
-s /home/mbb/Documents/waw/workflows/RNAseq/RNAseq.snakefile --configfile /home/mbb/Documents/test/params/params.yml
options:
- {name: '-v', type: value, value: ""}
- {name: '', type: value, value: ''}
download:
shiny_button: {name: DownloadPipeline, type: button, class: btn btn-light, label: Download pipeline}
shiny_button: {name: DownloadPipeline, type: button, class: btn btn-light, label: Download
pipeline}
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