Humann3 compatibility problem with Metaphlan4

I am trying to run humann v3.6 with Metaphlan version 4.0.5. After installing humann with conda, the default Metaphlan version was 3.0, which caused some issues downloading the MetaPhlan database.
I then updated Metaphlan using
conda install -c conda-forge -c bioconda metaphlan
and got the following error message:

Preparing transaction: done
Verifying transaction: /
SafetyError: The package for humann located at /mnt/volume/miniconda3/pkgs/humann-3.6-pyh7cba7a3_2
appears to be corrupted. The path ‘site-packages/humann/humann.cfg’
has an incorrect size.
reported size: 655 bytes
actual size: 728 bytes

humann_test looks fine and I can run the demo file in Metaphlan. But when I try to run the demo file in humann I get the following output:

humann -i demo.fasta -o humann_output/
Output files will be written to: /mnt/volume/metaphlan_test/humann_output

Running metaphlan …

Traceback (most recent call last):
File “/mnt/volume/miniconda3/envs/humann3/bin/humann”, line 10, in
File “/mnt/volume/miniconda3/envs/humann3/lib/python3.7/site-packages/humann/”, line 979, in main
custom_database = prescreen.create_custom_database(config.nucleotide_database, bug_file)
File “/mnt/volume/miniconda3/envs/humann3/lib/python3.7/site-packages/humann/search/”, line 215, in create_custom_database
config.metaphlan_v3_db_version+" or “+metaphlan_v4_db_version+” . Please update your version of MetaPhlAn to at least v3.0."
NameError: name ‘metaphlan_v4_db_version’ is not defined

I assume this problem has to do with the updated Metaphlan version I want to use, but I am confused since I was able to run Metaphlan4 and humann3 together on a different machine. Can you help me figure out and fix the problem?
Thank you already!

It looks very much like my question for your info: Status of HUMAnN with respect to MetaPhlAn 4.0.5

Also we have a working docker if you want, take a look at Docker, be careful to use version to get HUMAnN working.

If you look into our Dockerfile source (which is linked from above), you’ll find our conda install line that works fine with us:

micromamba install -c conda-forge -c bioconda -c biobakery metaphlan=4.0.3 humann=3.6 seqtk=1.3

PS sorry do not use metaphlan=4.0.5 it does not work AFAIK.

Just to clarify, I edited my previous post which at one point included a mistake, make sure to use metaphlan=4.0.3 and not 4.0.5

Thank you very much for the quick and helpful reply. Downgrading Metaphlan to v 4.0.3 really got rid of the initial problem. Anyhow, I still can’t stop Metaphlan from downloading the new database when I run it, even when I safe the “v21” database in the right folder. Do you know how to stop it from doing so?
I already tried running it like

humann -i demo.fasta -o sample_results --metaphlan-options “–mpa3 --index mpa_vJan21_CHOCOPhlAnSGB”

but it did not do the trick.

Hello, Yes you are right. Using the Jan21 MetaPhlAn database is currently required by HUMAnN. Sorry for the confusing error message. The error message has been improved in the latest release (HUMAnN v3.6.1).

Have you tried running with the latest MetaPhlAn version, removing the “–mpa” option (which is no longer needed), but specifing the vJan21 database (see below)?

humann -i demo.fasta -o sample_results --metaphlan-options “–index mpa_vJan21_CHOCOPhlAnSGB”

Thank you,

metaphlan --install --index mpa_vJan21_CHOCOPhlAnSGB_202103 --bowtiedb <path/to/metaphlan/database>

Thank you for posting the command! If you install the database at the default location or if you install it in a custom location and add --bowtiedb <path/to/metaphlan/database> to your --metaphlan-options it should stop MetaPhlAn from trying to download the latest database.