BowTie2 in the system path?

Hi,

I’m trying to run strainphlan ultimately but first having trouble with metaphlan.
I installed metaphlan through anaconda, and the version installed is: metaphlan 3.0 (pyh5ca1d4c_2).

First command I ran:
metaphlan 6A_R1_001.fastq.gz,6A_R2_001.fastq.gz -s metagenome6A.sam.bz2 --bowtie2out metagenome6A.bowtie2.bz2 --nproc 5 --input_type fastq -o profiled_metagenome6A.txt

This created 6 bt.2 files in the metaphlan database directory. But then gave this error:
Fatal error running BowTie2. Is BowTie2 in the system path?

Bowtie is installed at: /opt/anaconda3/bin/bowtie2

I also tried this:
metaphlan 6A_R1_001.fastq.gz,6A_R2_001.fastq.gz -s metagenome6A.sam.bz2 --bowtie2db /opt/anaconda3/lib/python3.7/site-packages/metaphlan/metaphlan_databases -x mpa_v30_CHOCOPhlAn_201901 --bowtie2out metagenome6A.bowtie2.bz2 --nproc 5 --input_type fastq -o profiled_metagenome6A.txt
which failed with the same error.

What could be the problem? Thank you already for your time on this!

MetaPhlAn is unable to find the bowtie2 executable, can you check if /opt/anaconda3/ is present in $PATH?

Otherwise, you can specify the executable’s location with the --bowtie2_exe parameter (--bowtie2_exe /opt/anaconda3/bin/bowtie2.

Thank you for the quick response but I’m still having the same issue.
I tried both of your suggestions but none worked. Here’s the error:

Possible unintended interpolation of @mac in string at /opt/anaconda3/lib/5.30.3/darwin-thread-multi-2level/Config_heavy.pl line 250.
Possible unintended interpolation of @mac in string at /opt/anaconda3/lib/5.30.3/darwin-thread-multi-2level/Config_heavy.pl line 1177.
Global symbol “@mac” requires explicit package name (did you forget to declare “my @mac”?) at /opt/anaconda3/lib/5.30.3/darwin-thread-multi-2level/Config_heavy.pl line 250.
Global symbol “@mac” requires explicit package name (did you forget to declare “my @mac”?) at /opt/anaconda3/lib/5.30.3/darwin-thread-multi-2level/Config_heavy.pl line 1177.
Compilation failed in require at /opt/anaconda3/lib/5.30.3/darwin-thread-multi-2level/Config.pm line 105.
OSError: “Command ‘[‘bowtie2’, ‘-h’]’ returned non-zero exit status 255.”
Fatal error running BowTie2. Is BowTie2 in the system path?

I can run bowtie2 by just calling it, so it must be in the system path…

What does it print if you run bowtie2 -h? Have you installed MetaPhlAn in an environment different than the “base” one?

Actually, that’s the problem. I cannot run it (bowtie2 -h). If I do:

Possible unintended interpolation of @mac in string at /opt/anaconda3/lib/5.30.3/darwin-thread-multi-2level/Config_heavy.pl line 250.
Possible unintended interpolation of @mac in string at /opt/anaconda3/lib/5.30.3/darwin-thread-multi-2level/Config_heavy.pl line 1177.
Global symbol “@mac” requires explicit package name (did you forget to declare “my @mac”?) at /opt/anaconda3/lib/5.30.3/darwin-thread-multi-2level/Config_heavy.pl line 250.
Global symbol “@mac” requires explicit package name (did you forget to declare “my @mac”?) at /opt/anaconda3/lib/5.30.3/darwin-thread-multi-2level/Config_heavy.pl line 1177.
Compilation failed in require at /opt/anaconda3/lib/5.30.3/darwin-thread-multi-2level/Config.pm line 105.

I’m not very sure but i don’t think i installed metaphlan in a different environment because when i run conda list, both are there.
bowtie2 2.4.1 py37h5e6fd57_3 bioconda
metaphlan 3.0 pyh5ca1d4c_2 bioconda

And this is how I installed metaphlan:

conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
conda install -c bioconda python=3.7 metaphlan=3.0=pyh5ca1d4c_2 --no-channel-priority

You should try to install MetaPhlAn in a new clean environment to avoid incompatibilities. In a new environment with just Python 3.7 (conda create -n metaphlan-3.0 python=3.7), install the latest MetaPhlAn build (conda activate metaphlan-3.0 && conda install metaphlan=3.0.3). This will install all the dependencies and the latest version, the build you forced the installation is quite old and affected by several bugs.

Yes!! It solved the problem! Thank you so much :slight_smile: