mag icon indicating copy to clipboard operation
mag copied to clipboard

--host_fasta_bowtie2index path taken for bowtie -S output file

Open MeriamOs opened this issue 1 year ago • 2 comments

Description of the bug

When I run nf-core/mag with the

--host_fasta_bowtie2index "/path/to/references/"

The bowtie log file gives me the following warning

Warning: Output file './references/reference_name' was specified without -S.  This will not work in future Bowtie 2 versions.  Please use -S instead.

It creates an additional file './references/reference_name', directly in the directory I specified with the --host_fasta_bowtie2index parameter.

Bowtie2 doesn't give a direct error, but I assume the rest of the command can't find the -S output. There are no reads written to the mapped.fastq.gz and unmapped.fastq.gz files, resulting in the rest of the pipeline to fail because there are no reads to analyse.

So it actually failed with Prodigal with the following error:

Command executed:

  pigz -cdf MEGAHIT-sample.contigs.fa | prodigal \
      -p meta \
      -f gff \
      -d "sample.fna" \
      -o "sample.gff" \
      -a "sample.faa" \
      -s "sample_all.txt"
  
  pigz -nm sample*
  
  cat <<-END_VERSIONS > versions.yml
  "NFCORE_MAG:MAG:PRODIGAL":
      prodigal: $(prodigal -v 2>&1 | sed -n 's/Prodigal V\(.*\):.*/\1/p')
      pigz: $(pigz -V 2>&1 | sed 's/pigz //g')
  END_VERSIONS

Command exit status:
  18

Command output:
  (empty)

It runs fine when I remove the --host_fasta_bowtie2index parameter.

Command used and terminal output

nextflow run nf-core/mag \
    -r 3.1.0 \
    -profile singularity \
    -c tower.config \
    -with-tower \
    --input "samplesheet.csv" \
    --outdir "/path/to/04-analysis/mag/" \
    --multiqc_title "test_mag" \
    --host_fasta "/path/to/references/reference.fna" \
    --host_fasta_bowtie2index "/path/to/references/" \
    --save_hostremoved_reads \
    --bbnorm \
    --reads_minlength 30 \
    --ancient_dna \
    --refine_bins_dastool \
    --binning_map_mode own \
    --skip_spades \
    --skip_metaeuk \
    --busco_db "/patho/to/busco/bacteria_odb10/" \
    --run_gunc \
    --gunc_db "/path/to/diamond/database/gunc_db_progenomes2.1.dmnd" \
    --postbinning_input both \
    --gtdb_db "/path/to/gtdbtk_220/" \
    --save_assembly_mapped_reads \
    -resume

Relevant files

No response

System information

Nextflow version 24.04.4 nf-core/mag version 3.1.0 Singularity

MeriamOs avatar Oct 16 '24 12:10 MeriamOs

When I go into one of the work directories where the bowtie command gets executed and run

INDEX=`find -L ./ -name "*.rev.1.bt2" | sed "s/\.rev.1.bt2$//"`
[ -z "$INDEX" ] && INDEX=`find -L ./ -name "*.rev.1.bt2l" | sed "s/\.rev.1.bt2l$//"`
[ -z "$INDEX" ] && echo "Bowtie2 index files not found" 1>&2 && exit 1

echo $INDEX

It outputs:

./references/.             ./references/reference_name

So I think the problem lies in that part?

MeriamOs avatar Oct 16 '24 12:10 MeriamOs

Hrm, this is a confusing one because:

Warning: Output file './references/reference_name' was specified without -S.  This will not work in future Bowtie 2 versions.  Please use -S instead.

is a deprecation warning not an error...

But agreed it looks like the module is not handling this well with the find command as you've identified.

I want to strip out the local module and use the nf-core one which should+ be using a more recent version of bowtie2 and also more robust, but haven't had time yet. But we should indeed check the new module also handles -S as expeted!

jfy133 avatar Oct 17 '24 13:10 jfy133

OK I started this but then I hit a an issue I didn't resolve https://github.com/nf-core/mag/pull/754, and since we have reconstructed everything so I will need to start again

jfy133 avatar Aug 15 '25 13:08 jfy133