From db8c5a2880f1899b524ccb649051f304a2824e24 Mon Sep 17 00:00:00 2001 From: "Lataretu, Marie" Date: Wed, 15 Apr 2026 11:36:25 +0200 Subject: [PATCH] ignore artic-medaka fails with exit status 20 - when no reads map to the reference, ARTIC medaka fails with a segfault while reading an empty VCF file (see vcfcheck.log in workdir) - I would have liked to catch such samples before the ARTIC step, however Kraken2 classifies some reads as SC2, however no reads map in the end --- poreCov.nf | 2 +- workflows/process/artic.nf | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/poreCov.nf b/poreCov.nf index 7fe30ca..4c02a64 100755 --- a/poreCov.nf +++ b/poreCov.nf @@ -313,7 +313,7 @@ workflow { // rename barcodes based on --samples input.csv if (params.samples) { fastq_input_ch = fastq_input_raw_ch.join(samples_input_ch).map { it -> tuple(it[2],it[1])} - fastq_input_raw_ch.join(samples_input_ch).ifEmpty{ exit 2, "Could not match barcode numbers from $params.samples to the read files, some typo?"} + fastq_input_raw_ch.join(samples_input_ch).ifEmpty{ exit 2, "Could not match barcode numbers from $params.samples to the read files, some typo?"} } else if (!params.samples) { fastq_input_ch = fastq_input_raw_ch } diff --git a/workflows/process/artic.nf b/workflows/process/artic.nf index f8c871e..d5ff8eb 100755 --- a/workflows/process/artic.nf +++ b/workflows/process/artic.nf @@ -1,5 +1,6 @@ process artic_medaka { label 'artic' + errorStrategy {task.exitStatus == 20 ? 'ignore' : 'retry'} publishDir "${params.output}/${params.genomedir}/${name}/", mode: 'copy', pattern: "*.consensus.fasta" publishDir "${params.output}/${params.genomedir}/${name}/", mode: 'copy', pattern: "${name}_mapped_*.primertrimmed.sorted.bam*" publishDir "${params.output}/${params.genomedir}/${name}/", mode: 'copy', pattern: "${name}.trimmed.rg.sorted.bam" @@ -68,6 +69,7 @@ process artic_medaka { process artic_medaka_custom_bed { label 'artic' + errorStrategy {task.exitStatus == 20 ? 'ignore' : 'retry'} publishDir "${params.output}/${params.genomedir}/${name}/", mode: 'copy', pattern: "*.consensus.fasta" publishDir "${params.output}/${params.genomedir}/${name}/", mode: 'copy', pattern: "${name}_mapped_*.primertrimmed.sorted.bam*" publishDir "${params.output}/${params.genomedir}/${name}/", mode: 'copy', pattern: "${name}.trimmed.rg.sorted.bam"