Skip to content

BOWTIE2_ASSEMBLY_ALIGN fails with samtools "-@" option under conda profile #978

@Ruiqi-CUB

Description

@Ruiqi-CUB

Description of the bug

Description

Hi nf-core/mag team,

I’m encountering a reproducible failure in the binning preparation step when running nf-core/mag with the conda profile.

The pipeline fails at:

NFCORE_MAG:MAG:BINNING_PREPARATION:SHORTREAD_BINNING_PREPARATION:BOWTIE2_ASSEMBLY_ALIGN

with the following error:

view: invalid option -- '@'
sort: invalid option -- '@'
[main_samview] fail to open "2" for reading.
[bam_sort_core] fail to open file 2

This error originates from the command executed by the pipeline:

samtools view -@ 2 -bS | samtools sort -@ 2

samtools should support the -@ threading option, which has been available in samtools for many releases.

Despite having samtools 1.23 available in my active conda environment, the pipeline appears to use a different samtools binary from a pipeline-managed conda environment that does not support the -@ option, causing the step to fail.

It may help to explicitly pin or bump the samtools version in the conda environment used by the BOWTIE2_ASSEMBLY_ALIGN process (for example, samtools >= 1.10), to guarantee support for the -@ option.

Alternatively, guarding the use of -@ based on the detected samtools version could also prevent this failure.

I’m happy to provide additional logs or test a proposed fix if helpful.

Thanks for maintaining the pipeline.

Command used and terminal output

nextflow run nf-core/mag \
  -profile conda \
  --input samplesheet.csv \
  --outdir mag_outputs \
  --spades_fix_cpus 16 \
  --host_fasta Osedax_frankpressi.fna \
  --host_removal_verysensitive

Relevant files

execution_report_2026-02-07_17-41-30.html

execution_timeline_2026-02-07_17-41-30.html
execution_trace_2026-02-07_17-41-30.txt
nf_core_mag_software_mqc_versions.yml
params_2026-02-07_17-41-40.json
pipeline_dag_2026-02-07_17-41-30.html

System information

Environment on slurm

Pipeline: nf-core/mag 5.4.0
Profile: conda
Nextflow: 25.10.3

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