From 8a9408a754d951e6052cb566d5c5791536ec2f23 Mon Sep 17 00:00:00 2001 From: Sebastian Uhrig Date: Tue, 18 Jul 2023 02:01:03 -0700 Subject: [PATCH 1/2] leave some spare memory for samtools --- CHANGELOG.md | 1 + modules/nf-core/samtools/sort/main.nf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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..d7e73090 100644 --- a/modules/nf-core/samtools/sort/main.nf +++ b/modules/nf-core/samtools/sort/main.nf @@ -21,7 +21,7 @@ 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 \\ From 69f7e4cc0243112cbc716a000608379c661fec23 Mon Sep 17 00:00:00 2001 From: Sebastian Uhrig Date: Tue, 18 Jul 2023 02:01:50 -0700 Subject: [PATCH 2/2] $args should go last to let users overwrite arguments --- modules/nf-core/samtools/sort/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/samtools/sort/main.nf b/modules/nf-core/samtools/sort/main.nf index d7e73090..909bdcd0 100644 --- a/modules/nf-core/samtools/sort/main.nf +++ b/modules/nf-core/samtools/sort/main.nf @@ -25,11 +25,11 @@ process SAMTOOLS_SORT { 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