diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ea33412..a1c1dc66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Pipeline Updates ### Bug fixes & refactoring +- 🐛 leave some spare memory for samtools sort (again) #81 ## [v2.4.0](https://github.com/nf-core/methylseq/releases/tag/2.4.0) - 2023-06-02 diff --git a/modules/nf-core/samtools/sort/main.nf b/modules/nf-core/samtools/sort/main.nf index 1e5181d4..909bdcd0 100644 --- a/modules/nf-core/samtools/sort/main.nf +++ b/modules/nf-core/samtools/sort/main.nf @@ -21,15 +21,15 @@ process SAMTOOLS_SORT { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def sort_memory = (task.memory.mega/task.cpus).intValue() + def sort_memory = (task.memory.mega-6000/task.cpus).intValue() if ("$bam" == "${prefix}.bam") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" """ samtools sort \\ - $args \\ -@ $task.cpus \\ -m ${sort_memory}M \\ -o ${prefix}.bam \\ -T $prefix \\ + $args \\ $bam cat <<-END_VERSIONS > versions.yml