# Compare Metaphlan4 output with CuratedMetagenomicData?

**URL:** <https://forum.biobakery.org/t/compare-metaphlan4-output-with-curatedmetagenomicdata/5643>\
**Category:** Data resource\
**Created:** [July 13, 2023, 3:24pm UTC](https://forum.biobakery.org/t/compare-metaphlan4-output-with-curatedmetagenomicdata/5643 "2023-07-13T15:24:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Minuzzi](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@Minuzzi](https://forum.biobakery.org/u/Minuzzi)\
**Post date:** [July 13, 2023, 3:24pm UTC](https://forum.biobakery.org/t/compare-metaphlan4-output-with-curatedmetagenomicdata/5643/1 "2023-07-13T15:24:25Z")

</div>

Hello everyone,  
I am analysing some stool samples from a non-westernized population and I would like to compare my profile with that reported in the CuratedMetagenomicData dataset.  
I run metaphlan4 on my samples and other samples from NCBI, with default parameters, and I merged the profile of my samples in a unique table. These are the commands used:

> metaphlan SAMPLE --input\_type fastq --nproc 3 --bowtie2out Metaphlan4/Sample.bowtie2.bz2 --bt2\_ps very-sensitive --read\_min\_len 30 \> Sample\_profile.txt

> merge\_metaphlan\_tables.py Metaphlan4/\*.txt \> DatasetMERGED\_Metaphlan4.txt

Than I started working on curated metagenomic data selecting stool samples from healthy adults in this way:

> cs\<-sampleMetadata |\>  
> filter(disease==“healthy”)|\> filter(body\_site ==“stool”) |\> filter(age\_category==“adult”)|\> filter(country==c(“ITA”,“GBR”,“IRL”,“DNK”,“TZA”,“CMR”,“ETH”,“IDN”,“PER”,“FJI”))|\>  
> returnSamples(“relative\_abundance”,rownames=“short”)  
> assayNames(cs) \<-“counts”  
> altExps(cs) \<-splitByRanks(cs)  
> cs.ps\<-makePhyloseqFromTreeSummarizedExperiment(cs,abund\_values=“relative\_abundance”)

> cs.species\<-tax\_glom(cs.ps,taxrank=“species”)

Than I introduced my dataset to R and phyloseq using this function ([Import a table of MetaPhlAn taxonomic abundances into phyloseq · GitHub](https://gist.github.com/lwaldron/512d1925a8102e921f05c5b25de7ec94))

> mphlanin ← read.csv(“DatasetMERGED\_Metaphlan4.txt”, sep = “\t”, strip.white = T, stringsAsFactors = F, row.names = 1)  
> metadata ← read.delim(“MappingDataset.txt”, header=TRUE, sep = “\t”)  
> metadatadf ← data.frame(metadata)  
> row.names(metadatadf) ← metadatadf$X  
> sample ← sample\_data(metadatadf)  
> ps= metaphlanToPhyloseq(mphlanin)  
> ps.species\<-tax\_glom(ps,taxrank=“species”)  
> pseq ← transform(ps.species, “compositional”)  
> ps.all\<-merge\_phyloseq(pseq,cs.ps)

But when I perform some beta-diversity analysis I get that all the samples I run with metaphlan4 create a separate clusters with respected to that of curatedMetagenomicData, which is not expected to me since I am analysing close populations to that present to the database and I got the idea that there is some inner bias in che merging part of the two dataset. Has anyone experienced the same issue and how can I solve that? Which is the right way to compare my data to that of curatedMetagenomicData ?  
thanks to everyone

---

<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:** [July 13, 2023, 8:12pm UTC](https://forum.biobakery.org/t/compare-metaphlan4-output-with-curatedmetagenomicdata/5643/2 "2023-07-13T20:12:15Z")

</div>

I believe curatedMetagenomicData (cMD) currently contains profiles from MetaPhlAn 3 (but an update to MetaPhlAn 4 is in progress). Since MetaPhlAn 4 outputs profiles using a totally different (SGB-based) taxonomy, it makes sense that those profiles would spuriously look totally different from the cMD profiles. If you did the comparison at the genus level you would probably see something more sensible, although there would still be a big batch effect from combining v3 and v4 profiles.

---

<div class="post-metadata">

**Author:** ![Minuzzi](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@Minuzzi](https://forum.biobakery.org/u/Minuzzi)\
**Post date:** [July 17, 2023, 9:06am UTC](https://forum.biobakery.org/t/compare-metaphlan4-output-with-curatedmetagenomicdata/5643/3 "2023-07-17T09:06:13Z")

</div>

Yes, indeed I have tried also at Genus level and it is more or less the same, the batch effect is still very visible. Ok so i have to wait for the update,  
thank you a lot for your reply

---

<div class="post-metadata">

**Author:** ![Asier\_Fernandez](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/asier_fernandez/32/2748_2.png) [@Asier\_Fernandez](https://forum.biobakery.org/u/Asier_Fernandez)\
**Post date:** [February 27, 2024, 12:24pm UTC](https://forum.biobakery.org/t/compare-metaphlan4-output-with-curatedmetagenomicdata/5643/4 "2024-02-27T12:24:31Z")

</div>

Hi,

I would like to ask if the Metaphlan4 profiles of curatedMetagenomicData (cMD) are already available.

Thanks a lot in advance!  
Asier

---

<div class="post-metadata">

**Author:** ![yvet\_lee](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/yvet_lee/32/3603_2.png) [@yvet\_lee](https://forum.biobakery.org/u/yvet_lee)\
**Post date:** [March 30, 2026, 9:59am UTC](https://forum.biobakery.org/t/compare-metaphlan4-output-with-curatedmetagenomicdata/5643/5 "2026-03-30T09:59:23Z")

</div>

We are very interested in your work. May I ask about the current progress of the cMD4 / MetaPhlAn 4 update for curatedMetagenomicData? Is there any tentative timeline for when the MetaPhlAn 4-based release might become available?

Thank you very much for your work and for any update you can share!!!
