MetaPhlAn unrecognized argument --bowtie2out

I am trying to run MetaPhlAn on the demo dataset, but it keeps giving me the error that --bowtie2out is an unrecognized argument. When I ran MetaPhlAn the first time and it downloaded the MetaPhlAn database, it also gave me the warning that “[Warning] Downloaded indexes are not compatible with the installed version of Bowtie2”. I have HUMAnN downloaded in its own conda environment, so there shouldn’t be anything interfering with it. I installed it from bioconda.

I am using MetaPhlAn version 4.2.2 (4 Jun 2025) and Bowtie2 version 2.2.3.

The only arguments I specified when running MetaPhlAn were the input type and the demo fastq file.

metaphlan --input_type fastq /scratch/trytten.e/demo_humann/examples/demo.fastq 

I tried updating Bowtie2 but 2.2.3 was the newest version that I could download. Is there a different version of Bowtie2 that I should be using to fix this?

Here is the full error message it gave me in the log file:

06/13/2025 04:00:47 PM - humann.store - DEBUG: Initialize Alignments class instance to minimize memory use
06/13/2025 04:00:47 PM - humann.store - DEBUG: Initialize Reads class instance to minimize memory use
06/13/2025 04:01:06 PM - humann.humann - INFO: Load pathways database part 1: /home/trytten.e/.local/lib/python3.12/site-packages/humann/data/pathways/metacyc_reactions_level4ec_only.uniref.bz2
06/13/2025 04:01:06 PM - humann.humann - INFO: Load pathways database part 2: /home/trytten.e/.local/lib/python3.12/site-packages/humann/data/pathways/metacyc_pathways_structured_filtered_v24_subreactions
06/13/2025 04:01:06 PM - humann.search.prescreen - INFO: Running metaphlan ........
06/13/2025 04:01:06 PM - humann.utilities - DEBUG: Using software: /projects/vollmer/software/.conda/envs/humann/bin/metaphlan
06/13/2025 04:01:06 PM - humann.utilities - INFO: Execute command: /projects/vollmer/software/.conda/envs/humann/bin/metaphlan /scratch/trytten.e/demo_humann/examples/demo.fastq -t rel_ab -o /scratch/trytten.e/demo_humann/demo_humann_temp/demo_metaphlan_bugs_list.tsv --input_type fastq --bowtie2out /scratch/trytten.e/demo_humann/demo_humann_temp/demo_metaphlan_bowtie2.txt
06/13/2025 04:01:08 PM - humann.utilities - CRITICAL: Error executing: /projects/vollmer/software/.conda/envs/humann/bin/metaphlan /scratch/trytten.e/demo_humann/examples/demo.fastq -t rel_ab -o /scratch/trytten.e/demo_humann/demo_humann_temp/demo_metaphlan_bugs_list.tsv --input_type fastq --bowtie2out /scratch/trytten.e/demo_humann/demo_humann_temp/demo_metaphlan_bowtie2.txt

Error message returned from metaphlan :
usage: metaphlan --input_type {fastq,fasta,mapout,sam} [--force]
                 [--db_dir METAPHLAN_DB] [-x INDEX] [--mapout FILE_NAME]
                 [--min_mapq_val MIN_MAPQ_VAL] [--no_map] [--tmp_dir]
                 [--bt2_ps BowTie2 presets] [--bowtie2_exe BOWTIE2_EXE]
                 [--bowtie2_build BOWTIE2_BUILD] [--tax_lev TAXONOMIC_LEVEL]
                 [--min_alignment_len] [--ignore_eukaryotes]
                 [--ignore_bacteria] [--ignore_archaea] [--ignore_ksgbs]
                 [--ignore_usgbs] [--stat_q] [--perc_nonzero]
                 [--ignore_markers IGNORE_MARKERS] [--avoid_disqm] [--stat]
                 [-t ANALYSIS TYPE] [--nreads NUMBER_OF_READS]
                 [--pres_th PRESENCE_THRESHOLD] [-o output file]
                 [--sample_id_key name] [--use_group_representative]
                 [--sample_id value] [-s sam_output_file]
                 [--CAMI_format_output] [--skip_unclassified_estimation]
                 [--biom_format_output] [--biom_mdelim mdelim] [--profile_vsc]
                 [--vsc_out VSC_OUT] [--vsc_breadth VSC_BREADTH]
                 [--long_reads] [--max_gcsd MAX_GCSD]
                 [--minimap2_exe MINIMAP2_EXE]
                 [--minimap2_ps minimap2 presets] [--nbases NUMBER_OF_BASES]
                 [--split_reads] [--split_readlen SPLIT_READLEN] [--nproc N]
                 [--subsampling SUBSAMPLING] [--mapping_subsampling]
                 [--subsampling_seed SUBSAMPLING_SEED]
                 [--subsampling_output SUBSAMPLING_OUTPUT]
                 [--subsampling_paired SUBSAMPLING_PAIRED] [-1 FORWARD_READS]
                 [-2 REVERSE_READS] [--install] [--offline] [--force_download]
                 [--read_min_len READ_MIN_LEN] [--verbose] [-v] [-h]
                 [INPUT_FILE]
metaphlan: error: unrecognized arguments: --bowtie2out /scratch/trytten.e/demo_humann/demo_humann_temp/demo_metaphlan_bowtie2.txt

06/13/2025 04:01:08 PM - humann.utilities - CRITICAL: TRACEBACK: 
Traceback (most recent call last):
  File "/home/trytten.e/.local/lib/python3.12/site-packages/humann/utilities.py", line 761, in execute_command
    p_out = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/projects/vollmer/software/.conda/envs/humann/lib/python3.12/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/projects/vollmer/software/.conda/envs/humann/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/projects/vollmer/software/.conda/envs/humann/bin/metaphlan', '/scratch/trytten.e/demo_humann/examples/demo.fastq', '-t', 'rel_ab', '-o', '/scratch/trytten.e/demo_humann/demo_humann_temp/demo_metaphlan_bugs_list.tsv', '--input_type', 'fastq', '--bowtie2out', '/scratch/trytten.e/demo_humann/demo_humann_temp/demo_metaphlan_bowtie2.txt']' returned non-zero exit status 2.

Hi @emilytrytten

For what concerns the parameters there have been some changes in the new version of MetaPhlAn 4.2.2, so for example the parameter --bowtie2out has been replaced with --mapout (see here for the updated wiki: MetaPhlAn 4.2 · biobakery/MetaPhlAn Wiki · GitHub)

Bowtie2 is required to be >= 2.3.0 to avoid issues in some parameters that changed name on their side and this is a requirement in the conda installation so I am not sure why it downloaded such an older version. Did you install MetaPhlAn in a new environment? I would suggest to do it like this to make sure you are using a fresh environemnt and no dependency issues arise:

conda create --name mpa -c bioconda metaphlan=4.2.2

Let me know if this solves it!

Hello,

I tried what you suggested and I was able to successfully run MetaPhlAn. However, I’m still having problems passing that output into HUMAnN. When I run:

sbatch \
    --output=/scratch/trytten.e/slurm/humann_updatedbowtie2_passedmetaphlan_%j.output --partition=short --job-name=humann --time=1-00:00:00 --nodes=1 --cpus-per-task=24 --mem=100G \
    humann --input /scratch/trytten.e/demo_humann/examples/demo.fastq \
    --output /scratch/trytten.e/demo_humann/humann_proper \
    --taxonomic-profile /scratch/trytten.e/demo_humann/metaphlan/fifo_map.mapout.txt

it gives me this error: “ERROR: The MetaPhlAn taxonomic profile provided was not generated with the database version v3 or vJun23 . Please update your version of MetaPhlAn to at least v3.0 or if you are using MetaPhlAn v4 please use the database vJun23.” I’m using MetaPhlAn version 4.2.2 (4 Jun 2025) and the MetaPhlAn database I’m using is mpa_vJan25_CHOCOPhlAnSGB_202503. I thought this newer database would also be compatible with MetaPhlAn v4 but do I need to use the Jun23 database instead of Jan25?

I’ve also tried running HUMAnN without passing it the output of MetaPhlAn:

sbatch \
    --output=/scratch/trytten.e/slurm/humann_updatedbowtie2_passedmetaphlan_%j.output --partition=short --job-name=humann --time=1-00:00:00 --nodes=1 --cpus-per-task=24 --mem=100G \
    humann --input /scratch/trytten.e/demo_humann/examples/demo.fastq \
    --output /scratch/trytten.e/demo_humann/humann_proper

and it’s still giving me the error “metaphlan: error: unrecognized arguments: --bowtie2out /scratch/trytten.e/demo_humann/humann_proper/demo_humann_temp/demo_metaphlan_bowtie2.txt”. I reinstalled HUMAnN in its own conda environment with

conda create --name humann -c bioconda humann=3.9

it’s humann v3.9 and MetaPhlAn version 4.2.2 (4 Jun 2025). It still defaulted to downloading bowtie v 2.2.3, but I was able to manually install a newer version so I have bowtie2 version 2.5.4 in this environment now. I thought that the outdated version of bowtie2 is what was giving the error with --bowtie2out so I’m not sure why it’s still failing when I’ve updated bowtie2.

I really appreciate your help with this!

Yes, the database vJun23 that HUMAnN is referring to is the database mpa_vJun23_CHOCOPhlAnSGB_202403. We are working with the Huttenhower lab to make a HUMAnN compatible version for vJan25 but for now if you are interested in HUMAnN I suggest you use the Jun23 database with v4 HUMAnN.

1 Like