diff --git a/subworkflows/quality_check.nf b/subworkflows/quality_check.nf index ef20927..1136163 100644 --- a/subworkflows/quality_check.nf +++ b/subworkflows/quality_check.nf @@ -22,9 +22,9 @@ process fastQC { label 'fastqc' tag { name } publishDir "${params.output_dir}/qc/fastqc", mode: 'copy' - cpus { 4 * task.attempt } - memory { 8.GB * task.attempt } - errorStrategy 'retry' + cpus { task.attempt == 1 ? 4 : 8 } + memory { 4.GB * (Math.pow(2, task.attempt - 1)) } + errorStrategy { task.exitStatus in 137..140 ? 'retry' : 'finish' } maxRetries 3 when: @@ -42,7 +42,8 @@ process fastQC { fastqc \ ${reads} \ -o fastqc_${name} \ - -t ${task.cpus} --memory ${task.memory.toGiga()}GB + -t ${task.cpus} \ + --memory ${task.memory.toMega() / task.cpus} """ } @@ -52,6 +53,9 @@ process nanoPlot { tag { name } publishDir "${params.output_dir}/qc/nanoplot", mode: 'copy' cpus 4 + memory { 8.GB * task.attempt } + errorStrategy { task.exitStatus in 137..140 ? 'retry' : 'finish' } + maxRetries 3 when: 'nanoplot' in params.qc_tools @@ -79,6 +83,7 @@ process nanoq { tag { name } publishDir "${params.output_dir}/qc/nanoq", mode: 'copy' cpus 1 + memory 2.GB when: 'nanoq' in params.qc_tools diff --git a/subworkflows/reports.nf b/subworkflows/reports.nf index edb47e1..7798986 100644 --- a/subworkflows/reports.nf +++ b/subworkflows/reports.nf @@ -47,7 +47,9 @@ process multiQC { process toulligQC { label 'toulligqc' publishDir "${params.output_dir}/reports/toulligqc", mode: 'copy' - memory 4.GB + memory { 8.GB * task.attempt } + errorStrategy { task.exitStatus in 137..140 ? 'retry' : 'finish' } + maxRetries 3 when: 'toulligqc' in params.qc_tools @@ -64,7 +66,7 @@ process toulligQC { script: if (params.experiment_name) { report_filename = "${slugify(params.experiment_name)}_toulligqc.html" - name_opt = "--report-name ${params.experiment_name}" + name_opt = "--report-name '${params.experiment_name}'" } else { report_filename = "toulligqc.html" name_opt = ''