Skip to content

Commit

Permalink
Add catch for no reads being left after fastp filtering (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
BioWilko authored Oct 18, 2024
1 parent 0f4a158 commit adc958d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion docs/errorcodes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 Kraken report formatting error
10 No reads left after fastp, either no reads passed filtering or read files are misformatted
10 changes: 8 additions & 2 deletions modules/preprocess.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
"""

Expand All @@ -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
Expand All @@ -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
"""
}
Expand Down
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit adc958d

Please sign in to comment.