I struggled with similar issues described here when trying to get humann4 v4.0.0.alpha.1 running in my compute environment. I eventually got it working and these were the key things that helped me:
-
setup conda channels
conda config --add channels defaults
conda config --add channels conda-forge
conda config --add channels bioconda
conda config --add channels biobakery -
specify versions when installing via conda
conda create -n humann4 python=3.12
conda activate humann4
conda install humann=4.0.0a1
conda install metaphlan=4.1.1 -
Download the correct database versions to specific paths
metaphlan --install --db_dir metaphlan_databases/vOct22 --index mpa_vOct22_CHOCOPhlAnSGB_202403
humann_databases --download uniref uniref90_ec_filtered_diamond humann4_dbs/
humann_databases --download chocophlan full humann4_dbs/
humann_databases --download utility_mapping full humann4_dbs/ -
Specify database paths for both humann and metaphlan in the command
humann -r -i SAMPLE.fq.gz -o ./SAMPLE/ --threads 16 --protein-database humann4_dbs/uniref --nucleotide-database humann4_dbs/chocophlan --metaphlan-options "-t rel_ab_w_read_stats --bowtie2db metaphlan_databases/vOct22 --index mpa_vOct22_CHOCOPhlAnSGB_202403" -
For me it was critical to include
-t rel_ab_w_read_statsin the--metaphlan-optionsstring, otherwise metaphlan reverted to the default -t value which causes humann4 to not recognize it as a valid taxonomic profile
Hopefully this will all be outdated when a non-alpha release of Humann4 drops soon!