Skip to content

Commit

Permalink
Merge pull request #47 from hoelzer/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
hoelzer committed Sep 30, 2020
2 parents 67c2918 + 47eaf9a commit 7f12d99
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
4 changes: 2 additions & 2 deletions configs/node.config
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
Expand Down
1 change: 1 addition & 0 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ if (params.host) {
.view()
}


/**************************
* MODULES
**************************/
Expand Down
14 changes: 7 additions & 7 deletions modules/spades.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down
14 changes: 11 additions & 3 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 7f12d99

Please sign in to comment.