# HUMANn 4 + MetaPhlAn 4

**URL:** <https://forum.biobakery.org/t/humann-4-metaphlan-4/8093>\
**Category:** HUMAnN\
**Created:** [May 30, 2025, 3:11pm UTC](https://forum.biobakery.org/t/humann-4-metaphlan-4/8093 "2025-05-30T15:11:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![drelo](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/drelo/32/566_2.png) [@drelo](https://forum.biobakery.org/u/drelo)\
**Post date:** [May 30, 2025, 3:11pm UTC](https://forum.biobakery.org/t/humann-4-metaphlan-4/8093/1 "2025-05-30T15:11:28Z")

</div>

**I fixed this… SEE SOLUTION BELOW**

Hi all sorry to bother you again,

MetaPhlAn version 4.1.1 (11 Mar 2024)  
humann v4.0.0.alpha.1

I need to run MetaPhlAn 4 + HUMANn 4 (I want to run StrainPhlAn after that).

I had to install diamond, bowtie2, and glpk  
I also provided the route to the databases with `humann_config`  
I am using a SRR file from a human metagenome as a demo.

**I used this for MetaPhlAn 4**

```auto
metaphlan RAW/SRR14076335_1.fastq.gz --input_type fastq -s SAMS/SRR14076335.sam.bz2 --bowtie2out BOWTIE2/SRR14076335.bowtie2.bz2 -o BUGS/SRR14076335_profile.tsv --add_viruses --unclassified_estimation --index mpa_vOct22_CHOCOPhlAnSGB_202403 --bowtie2db ./CHOCO/mpa_vOct22_CHOCOPhlAnSGB_202403

```

**Then I uncompressed the sam file**

bzip2 -d ./SAMS/SRR\*

**then I run humann**

`humann --input ./SAMS/SRR14076335.sam.bz2 --output ./OUT/SRR14076335 --threads 22 --metaphlan-options "--bowtie2db ./CHOCO" --nucleotide-database "./HUMANn/chocophlan"`

I got this after that in the gene families file

> Gene Family HUMAnN v4.0.0.alpha.1 Adjusted CPMs SRR14076335  
> READS\_UNMAPPED 461337.0000000000

**Edited to add the solution**

My fault on this side I added `-t rel_ab_w_read_stats` and removed the `--metaphlan-options` from the humann run

```auto
metaphlan RAW/SRR14076335_1.fastq.gz --input_type fastq -s SAMS/SRR14076335.sam.bz2 --bowtie2out BOWTIE2/SRR14076335.bowtie2.bz2 -o BUGS/SRR14076335_profile.tsv --add_viruses --unclassified_estimation --index mpa_vOct22_CHOCOPhlAnSGB_202403 --bowtie2db ./CHOCO/ -t rel_ab_w_read_stats --nproc 6 

humann --input ./RAW/SRR14076335_1.fastq.gz --taxonomic-profile ./BUGS/SRR14076335_profile.tsv --output ./FromBUGS/ --nucleotide-database "./HUMANn/chocophlan" --threads 2

```

---

<div class="post-metadata">

**Author:** ![franzosa](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/franzosa/32/3511_2.png) [@franzosa](https://forum.biobakery.org/u/franzosa)\
**Post date:** [June 13, 2025, 7:43pm UTC](https://forum.biobakery.org/t/humann-4-metaphlan-4/8093/3 "2025-06-13T19:43:09Z")

</div>

Thanks for following up with your solution!

---

<div class="post-metadata">

**Author:** ![klomp030](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/klomp030/32/3297_2.png) [@klomp030](https://forum.biobakery.org/u/klomp030)\
**Post date:** [June 20, 2025, 2:34pm UTC](https://forum.biobakery.org/t/humann-4-metaphlan-4/8093/4 "2025-06-20T14:34:42Z")

</div>

Hi,

I have a problem with running the demofile as provided by HUMANn v4.0.0.alpha.1 while using MetaPhlan 4.2 and using the newest database: mpa\_vJan25\_CHOCOPhlAnSGB\_202503\_VSG

When I summitted the job i got an error, because the flag `--bowtie2out` is changed to `--mapout` in metaphlan, but this is not yet updated in HUMANn. I have adjusted the prescreen.py code to correct for that. So that is working now.

However, now i received the following error:

```auto
PM - humann.search.prescreen - ERROR: The relative abundance and coverage were not found in the MetaPhlAn taxonomic profile

```

It seems that HUMANn expects different headers do differ when I run the demo file for both MetaPhlan and HUMANn independently:

Output:  
`#clade_name	NCBI_tax_id	relative_abundance	additional_species`

Expected:  
`#clade_name	clade_taxid	relative_abundance	coverage	estimated_number_of_reads_from_the_clade`

the flag `-t rel_ab_w_read_stats` within MetaPhlan helps that error as described above:

```auto
humann --input ./05_HUMAnN/demo_humann_v4.fastq --output ./output_humann_demo_humann_2025DB_flag2 --metaphlan-options "--db_dir ./python3.9/site-packages/metaphlan/metaphlan_databases -t rel_ab_w_read_stats"

```

Next, It seems that the newest database 2025, does not work well with HUMANn as it expects the db:

```auto
humann.search.prescreen - ERROR: The MetaPhlAn taxonomic profile provided does not contain the database version vOct22_CHOCOPhlAnSGB_202403 in any of its header lines.

```

Anyone has an idea on how to solve this?

---

<div class="post-metadata">

**Author:** ![franzosa](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/franzosa/32/3511_2.png) [@franzosa](https://forum.biobakery.org/u/franzosa)\
**Post date:** [June 20, 2025, 8:07pm UTC](https://forum.biobakery.org/t/humann-4-metaphlan-4/8093/5 "2025-06-20T20:07:15Z")

</div>

The HUMAnN 4 alpha is designed to work with MetaPhlAn’s `vOct22_CHOCOPhlAnSGB_202403` marker set. It sounds like there is also an interface change in MetaPhlAn 4.2 that we will accommodate in the next HUMAnN 4 release. For now I would stick with an earlier MetaPhlAn 4 + the aforementioned marker database when running HUMAnN 4.

---

<div class="post-metadata">

**Author:** ![brockels](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/brockels/32/3259_2.png) [@brockels](https://forum.biobakery.org/u/brockels)\
**Post date:** [June 29, 2025, 2:04am UTC](https://forum.biobakery.org/t/humann-4-metaphlan-4/8093/6 "2025-06-29T02:04:49Z")

</div>

Just trying to get to grips with this too. Metaphlan 4 can use the new database for taxonomy but humann 4 uses the old Oct22 database and so I cant use metaphlan.tsv files that were generated from running metaphlan? I would have to run it all again using the fastq files for humann and let humann 4 reference to the Oct22 metaphlan database? I have been trying this for a couple of weeks now since i returned from the biobakery workshop. When I went, i was using an older metaphlan and humann, everything worked, I upgraded both and now they dont seem to work together.

---

<div class="post-metadata">

**Author:** ![franzosa](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/franzosa/32/3511_2.png) [@franzosa](https://forum.biobakery.org/u/franzosa)\
**Post date:** [June 30, 2025, 3:14pm UTC](https://forum.biobakery.org/t/humann-4-metaphlan-4/8093/7 "2025-06-30T15:14:29Z")

</div>

I have replied to the new post you created here:

> [@Humann 4 cant work with metaphlan 4](https://forum.biobakery.org/t/humann-4-cant-work-with-metaphlan-4/8201/2):
>
> We will be adding support for MetaPhlAn 4.2 + the Jan25 SGBs in the next release of HUMAnN. Right now the HUMAnN 4 alpha does not yet support these latest versions. My recommendation would be to stick with running HUMAnN 4 with MetaPhlAn 4.1 + the Oct22 SGBs for now. If you’d like to also experiment with MetaPhlAn 4.2, you could do so in a separate conda environment. If you would like to use MetaPhlAn 4.2 output with HUMAnN, you could run MetaPhlAn outside of HUMAnN including the following flag…

---

<div class="post-metadata">

**Author:** ![brockels](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/brockels/32/3259_2.png) [@brockels](https://forum.biobakery.org/u/brockels)\
**Post date:** [July 24, 2025, 8:46pm UTC](https://forum.biobakery.org/t/humann-4-metaphlan-4/8093/8 "2025-07-24T20:46:40Z")

</div>

I still cant get anything to work, humann will not run it just says Running metaphlan …

ERROR: The MetaPhlAn taxonomic profile provided does not contain the database version vOct22\_CHOCOPhlAnSGB\_202403 in any of its header line  
This is more than frustrating. i have half a pipeline. using version 4 alpha of humann and 4.1 metaphlan with vOct22 database for metaphlan.  
I was at the biobakery workshop and upgraded to humann4 there an it has not worked since.  
version of humann v4.0.0.alpha.1  
MetaPhlAn version 4.1.1 (11 Mar 2024)

---

<div class="post-metadata">

**Author:** ![barbarahelena](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/barbarahelena/32/2725_2.png) [@barbarahelena](https://forum.biobakery.org/u/barbarahelena)\
**Post date:** [July 27, 2025, 9:08am UTC](https://forum.biobakery.org/t/humann-4-metaphlan-4/8093/9 "2025-07-27T09:08:05Z")

</div>

Hi,

Could you head -n1 the MetaPhlAn taxonomy profile? Which database version does it state in the first line of the file? From the error, it looks like you used a newer database than the vOct22\_CHOCOPhlAnSGB\_202403.

Did you specify the MetaPhlAn database that should be used when running MetaPhlAn? I think you can do that using --index, to prevent it from using the newer database that you also might have installed.

From the --help:  
-x INDEX, --index INDEX  
_Specify the id of the database version to use. If “latest”, MetaPhlAn will get the latest version. If an index name is provided, MetaPhlAn will try to use it, if available, and skip the online check. If the database files are not found on the local MetaPhlAn installation they will be automatically downloaded [default latest]_

If this doesn’t work it would be helpful to see the code you’re using, without code it is difficult to reproduce or solve an error.

Best, Barbara
