From f0a86eaf5bf6ca73c5571193edd00c25bfa308f5 Mon Sep 17 00:00:00 2001 From: Matthieu Muffato Date: Mon, 26 Sep 2022 17:44:36 +0100 Subject: [PATCH] Multithreaded samtools commands (#2080) * Multithreaded samtools commands * Updated the checksums since the BAM files include the actual command line Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com> --- modules/samtools/ampliconclip/main.nf | 1 + modules/samtools/depth/main.nf | 1 + modules/samtools/idxstats/main.nf | 1 + tests/modules/samtools/ampliconclip/test.yml | 12 ++++++------ 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/samtools/ampliconclip/main.nf b/modules/samtools/ampliconclip/main.nf index 2b90c953..3a3bb852 100644 --- a/modules/samtools/ampliconclip/main.nf +++ b/modules/samtools/ampliconclip/main.nf @@ -31,6 +31,7 @@ process SAMTOOLS_AMPLICONCLIP { """ samtools \\ ampliconclip \\ + --threads ${task.cpus-1} \\ $args \\ $rejects \\ $stats \\ diff --git a/modules/samtools/depth/main.nf b/modules/samtools/depth/main.nf index e508a5f7..d5f2ba60 100644 --- a/modules/samtools/depth/main.nf +++ b/modules/samtools/depth/main.nf @@ -23,6 +23,7 @@ process SAMTOOLS_DEPTH { """ samtools \\ depth \\ + --threads ${task.cpus-1} \\ $args \\ -o ${prefix}.tsv \\ $bam diff --git a/modules/samtools/idxstats/main.nf b/modules/samtools/idxstats/main.nf index 4b245419..87618e5f 100644 --- a/modules/samtools/idxstats/main.nf +++ b/modules/samtools/idxstats/main.nf @@ -24,6 +24,7 @@ process SAMTOOLS_IDXSTATS { """ samtools \\ idxstats \\ + --threads ${task.cpus-1} \\ $bam \\ > ${prefix}.idxstats diff --git a/tests/modules/samtools/ampliconclip/test.yml b/tests/modules/samtools/ampliconclip/test.yml index cfc10dd1..dd9fdbb7 100644 --- a/tests/modules/samtools/ampliconclip/test.yml +++ b/tests/modules/samtools/ampliconclip/test.yml @@ -5,7 +5,7 @@ - samtools/ampliconclip files: - path: output/samtools/test.bam - md5sum: d270363a7fb3d96be2df211099efc75b + md5sum: 69e4ba713447864231f6cbbaf036c51d - name: samtools ampliconclip no stats with rejects command: nextflow run ./tests/modules/samtools/ampliconclip -entry test_samtools_ampliconclip_no_stats_with_rejects -c ./tests/config/nextflow.config -c ./tests/modules/samtools/ampliconclip/nextflow.config @@ -14,9 +14,9 @@ - samtools/ampliconclip files: - path: output/samtools/test.bam - md5sum: e7c4e64c259212e1670f6de96a5549b4 + md5sum: dd2ed9d7cc4ddc070ece2dccc577f94b - path: output/samtools/test.cliprejects.bam - md5sum: b7c057b11950c2271a0c92236bee94b7 + md5sum: 7d641f6da838f41d75eaabbd897f60bd - name: samtools ampliconclip with stats with rejects command: nextflow run ./tests/modules/samtools/ampliconclip -entry test_samtools_ampliconclip_with_stats_with_rejects -c ./tests/config/nextflow.config -c ./tests/modules/samtools/ampliconclip/nextflow.config @@ -25,8 +25,8 @@ - samtools/ampliconclip files: - path: output/samtools/test.bam - md5sum: e75992d4ff69cbaed9a089231be86b5e + md5sum: 6c19afc0873fba2f4e530eabf61c0735 - path: output/samtools/test.cliprejects.bam - md5sum: 729f03e7a2801d2c56c32bef8f3d6ead + md5sum: 1dfb61aa80d8e90add324ed61ed17061 - path: output/samtools/test.clipstats.txt - md5sum: fc23355e1743d47f2541f2cb1a7a0cda + md5sum: 05ead360a98fab6a678056e326c4f1f3