WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Bowtie2 + Samtools pipeline in nf-core module may use double the intended threads #9401

@fbnrst

Description

@fbnrst

Have you checked the docs?

Description of the bug

In the nf-core Bowtie2 alignment module, the pipeline runs something like:

bowtie2 ... --threads $task.cpus ... | samtools ... --threads $task.cpus ...

see

bowtie2 \\
-x \$INDEX \\
$reads_args \\
--threads $task.cpus \\
$unaligned \\
$args \\
2>| >(tee ${prefix}.bowtie2.log >&2) \\
| samtools $samtools_command $args2 --threads $task.cpus ${reference} -o ${prefix}.${extension} -

Because Bowtie2 and Samtools are piped, both programs seem to independently use $task.cpus threads.

I observed this when I was running nf-core/atacseq, and the bowtie_align step was using more cores than it is supposed to use. When inspecting processes with htop, I saw a bowtie2 process and a samtools process, both using 12 threads, and I had only given 12 threads to this process. I scheduled the process with slurm on our cluster.

Should this be solved by making sure that bowtie2 and samtools both ask for less threads than $task.cpus?

Command used and terminal output

Relevant files

No response

System information

nextflow 25.10.0
run on our HPC with slurm executor
container engine: singularity
CentOS Linux release 7.4
running the dev branch of nf-core/atacseq, which uses the bowtie2_align module

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions