Skip to content

Commit

Permalink
Reworked check on required parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
renewiegandt committed Apr 16, 2019
1 parent 3caf997 commit 1b4d9c3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pipeline.nf
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,15 @@ val_missing = false
send_help = false
missing_params = []

//@TODO remove iteration over all parameter
params.each { key, value ->
req_params.each { key ->
if (req_params.contains(key)){
if (key == "gtf_annotation" && value == "" && params.gtf_merged == ""){
val_missing = true
missing_params.add("$key or gtf_merged")
if (key == "gtf_annotation") {
if (params[key] == "" && params.gtf_merged == "") {
val_missing = true
missing_params.add("$key or gtf_merged")
}
} else {
if (value == ""){
if (params[key] == ""){
val_missing = true
missing_params.add(key)
}
Expand All @@ -108,6 +109,7 @@ if (val_missing){
send_help = true
println("Error: Following required parameters are missing: $missing_params")
}

if (send_help || "${params.help}" != "0") {
log.info """
Usage: nextflow run pipeline.nf --bigwig [BigWig-file] --bed [BED-file] --genome_fasta [FASTA-file] --motif_db [MEME-file] --config [UROPA-config-file]
Expand Down

0 comments on commit 1b4d9c3

Please sign in to comment.