diff --git a/configs/node.config b/configs/node.config index d4078e7..d044c25 100644 --- a/configs/node.config +++ b/configs/node.config @@ -2,8 +2,8 @@ process { withLabel: basics { cpus = 2 ; memory = '16 GB' } withLabel: bbmap { cpus = 24 ; memory = '16 GB' } withLabel: fastp { cpus = 12 ; memory = '16 GB' } - withLabel: prodigal { cpus = 8 ; memory = '16 GB' } - withLabel: diamond { cpus = 12 ; memory = '16 GB' } + withLabel: prodigal { cpus = 1 ; memory = '4 GB' } + withLabel: diamond { cpus = 24 ; memory = '16 GB' } withLabel: ggplot2 { cpus = 2 ; memory = '4 GB' } withLabel: nanoplot { cpus = 8 ; memory = '14 GB' } withLabel: spades { cpus = 32 ; memory = '80 GB' } diff --git a/main.nf b/main.nf index ab33aa5..d87ca04 100755 --- a/main.nf +++ b/main.nf @@ -93,6 +93,7 @@ if (params.host) { .view() } + /************************** * MODULES **************************/ diff --git a/modules/spades.nf b/modules/spades.nf index 9afdafa..f5bcddb 100644 --- a/modules/spades.nf +++ b/modules/spades.nf @@ -2,19 +2,19 @@ process spades { label 'spades' publishDir "${params.output}/${name}/assembly/", mode: 'copy', pattern: "${name}_raw_assembly.fasta" - errorStrategy { 'retry' } - cpus { 36 } - memory { 400.GB * task.attempt } - clusterOptions { '-P bigmem' } - maxRetries 3 - input: tuple val(name), file(ont), file(illumina) output: tuple val(name), file("${name}_raw_assembly.fasta") script: """ - MEM=\$(echo ${task.memory} | sed 's/ GB//g') + SIZE=\$(echo ${task.memory} | awk 'BEGIN{FS=" "};{print \$2}') + if [ \$SIZE == "TB" ]; then + MEM=\$(echo ${task.memory} | sed 's/ TB//g') + MEM=\$(echo \$MEM*1000 | bc | awk 'BEGIN{FS="."};{print \$1}') + else + MEM=\$(echo ${task.memory} | sed 's/ GB//g') + fi spades.py --only-assembler -1 ${illumina[0]} -2 ${illumina[1]} --nanopore ${ont} --meta -o spades_output -t ${task.cpus} -m \${MEM} mv spades_output/contigs.fasta ${name}_raw_assembly.fasta """ diff --git a/nextflow.config b/nextflow.config index 41572db..2686cbf 100755 --- a/nextflow.config +++ b/nextflow.config @@ -175,11 +175,15 @@ profiles { } includeConfig 'configs/container.config' + /* - process { + process { withLabel: spades { cpus = 32; - memory = '200 GB'; - clusterOptions = '-P bigmem' } + memory = 90.GB * task.attempt; + clusterOptions = '-P bigmem'; + errorStrategy { task.exitStatus in 130..140 ? 'retry' : 'terminate' }; + maxRetries 4 } + withLabel: flye { cpus = 30; memory { 120.GB * task.attempt }; clusterOptions = '-P bigmem'; @@ -209,6 +213,10 @@ profiles { cacheDir = params.cachedir } includeConfig 'configs/container.config' + + process { + withLabel: spades { cpus = 32; memory = {1600.GB * task.attempt}; clusterOptions = '-P bigmem'; errorStrategy = { task.exitStatus in 1 || 130..140 ? 'retry' : 'terminate' }; maxRetries = 4; } + } } ara {