diff --git a/docs/errorcodes.txt b/docs/errorcodes.txt index 092bf7e..2f72b22 100644 --- a/docs/errorcodes.txt +++ b/docs/errorcodes.txt @@ -7,4 +7,5 @@ 6 Spike in not understood/not in reference JSON 7 No output files for one half of a read-pair 8 Mismatching paired read FASTQ headers -9 Kraken report formatting error \ No newline at end of file +9 Kraken report formatting error +10 No reads left after fastp, either no reads passed filtering or read files are misformatted \ No newline at end of file diff --git a/modules/preprocess.nf b/modules/preprocess.nf index 645b30f..12d703a 100644 --- a/modules/preprocess.nf +++ b/modules/preprocess.nf @@ -6,7 +6,7 @@ process fastp_paired { container "${params.wf.container}:${params.wf.container_version}" - errorStrategy {task.exitStatus == 255 ? "ignore" : "terminate"} + errorStrategy {task.exitStatus in [255, 10] ? "ignore" : "terminate"} input: val unique_id @@ -31,10 +31,14 @@ process fastp_paired { if [ -s ${unique_id}_1.fastp.fastq ]; then bgzip --threads $task.cpus -c ${unique_id}_1.fastp.fastq > ${unique_id}_1.fastp.fastq.gz + else + exit 10 fi if [ -s ${unique_id}_2.fastp.fastq ]; then bgzip --threads $task.cpus -c ${unique_id}_2.fastp.fastq > ${unique_id}_2.fastp.fastq.gz + else + exit 10 fi """ @@ -48,7 +52,7 @@ process fastp_single { container "${params.wf.container}:${params.wf.container_version}" - errorStrategy {task.exitStatus == 255 ? "ignore" : "terminate"} + errorStrategy {task.exitStatus in [255, 10] ? "ignore" : "terminate"} input: val unique_id @@ -73,6 +77,8 @@ process fastp_single { if [ -s ${unique_id}.fastp.fastq ]; then bgzip --threads $task.cpus -c ${unique_id}.fastp.fastq > ${unique_id}.fastp.fastq.gz + else + exit 10 fi """ } diff --git a/nextflow.config b/nextflow.config index 651885b..1354222 100644 --- a/nextflow.config +++ b/nextflow.config @@ -32,7 +32,7 @@ manifest { description = 'Classify metagenomic sequence data from human respiratory infections.' mainScript = 'main.nf' nextflowVersion = '>=20.10.0' - version = 'v1.3.1' + version = 'v1.3.2' } profiles {