From 585053013e1f1510008fe0817e42b2917373d83b Mon Sep 17 00:00:00 2001 From: TernovojD Date: Thu, 20 Jun 2024 10:53:54 +0200 Subject: [PATCH] bugfix: exiting the workflow --- eval.nf | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/eval.nf b/eval.nf index 108d7da..99f30d7 100644 --- a/eval.nf +++ b/eval.nf @@ -5,12 +5,16 @@ GroovyObject help = (GroovyObject) HelppagesClass.newInstance(); if (params.help) { exit 0, help.helpEval(workflow.manifest.version, params) } + +if (params.callsets_dir == "" && params.sample_sheet == "" || params.callsets_dir != "" && params.sample_sheet != ""){ + exit 1, "Data input incorrect - please supply only one of the following parameters: sample_sheet, callsets_dir\n" +} + // include modules - here, modules are single processes include { SAMTOOLS_FAIDX } from './modules/samtools/faidx/main.nf' include { HAPPY } from './modules/happy/main.nf' include { SOMPY_SUMMARY } from './modules/misc/main.nf' - workflow{ // ------------------ // | Input channels | @@ -18,7 +22,7 @@ workflow{ ch_ref = Channel.value("$baseDir/" + params.reference) ch_ref_idx = SAMTOOLS_FAIDX(ch_ref) - if (params.callsets_dir != "" && params.sample_sheet == "") { + if (params.callsets_dir != "") { ch_callsets = Channel.fromPath(params.callsets_dir + "/" + "*.{vcf,vcf.gz}", checkIfExists: true) ch_callsets @@ -36,7 +40,7 @@ workflow{ .set {ch_variantsets_map} // ch_variantsets_map.view() - } else if (params.sample_sheet != "" && params.callsets_dir == "") { + } else { ch_variantsets_map = Channel .fromPath(params.sample_sheet, checkIfExists: true) @@ -44,10 +48,6 @@ workflow{ .map {row -> [row["index"] as Integer, row["truthset"], row["callset"]]} // .view() - } else { - - exit 1, "ERROR: Data input incorrect - please supply only one of the following parameters: sample_sheet, callsets_dir\n" - } // ------------------