From 2c2ea1e6bc44d96078af5cbc832883c9c5a7bc5f Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 17 Aug 2023 11:53:39 +0200 Subject: [PATCH] test if paired end samplesheet when not --single_end --- workflows/ampliseq.nf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/workflows/ampliseq.nf b/workflows/ampliseq.nf index adad11cf..edb459c3 100644 --- a/workflows/ampliseq.nf +++ b/workflows/ampliseq.nf @@ -225,6 +225,7 @@ workflow AMPLISEQ { .map{ meta, readfw, readrv -> meta.single_end = single_end.toBoolean() def reads = single_end ? readfw : [readfw,readrv] + if ( !meta.single_end && !readrv ) { error("Entry `reverseReads` is missing in $params.input for $meta.id, either correct the samplesheet or use `--single_end`, `--pacbio`, or `--iontorrent`") } // make sure that reverse reads are present when single_end isnt specified return [meta, reads] } } else if ( params.input_fasta ) { ch_input_fasta = Channel.fromPath(params.input_fasta, checkIfExists: true) @@ -232,7 +233,7 @@ workflow AMPLISEQ { PARSE_INPUT ( params.input_folder, single_end, params.multiple_sequencing_runs, params.extension ) ch_input_reads = PARSE_INPUT.out.reads } else { - error "One of --input, --input_fasta, --input_folder must be provided!" + error("One of `--input`, `--input_fasta`, `--input_folder` must be provided!") } //Filter empty files