# Merge\_metaphlan\_tables.py with absolute abundance

**URL:** <https://forum.biobakery.org/t/merge-metaphlan-tables-py-with-absolute-abundance/1839>\
**Category:** MetaPhlAn\
**Created:** [March 23, 2021, 10:50pm UTC](https://forum.biobakery.org/t/merge-metaphlan-tables-py-with-absolute-abundance/1839 "2021-03-23T22:50:12Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![rsteinbaer](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@rsteinbaer](https://forum.biobakery.org/u/rsteinbaer)\
**Post date:** [March 9, 2023, 8:05am UTC](https://forum.biobakery.org/t/merge-metaphlan-tables-py-with-absolute-abundance/1839/22 "2023-03-09T08:05:15Z")

</div>

Hi,  
Thank you very much for the script- this was really helpful!

I would like to also add the clade\_ids / tax\_ids to the merged table (in the single profiles they are present, but in the merged table not anymore). Do you know, how I can do this? I tried the script added here and it gives me around 1/3 of the IDs but most rows stay empty…

Best and thank you again

Ruth

[6d\_merge\_metaphlan\_tables\_V4absID.txt](https://forum.biobakery.org/uploads/short-url/iSKtwKyAwlbgjI2hZx9DpaHD4un.txt) (3.5 KB)

---

<div class="post-metadata">

**Author:** ![timyerg](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/timyerg/32/959_2.png) [@timyerg](https://forum.biobakery.org/u/timyerg)\
**Post date:** [March 9, 2023, 9:13am UTC](https://forum.biobakery.org/t/merge-metaphlan-tables-py-with-absolute-abundance/1839/23 "2023-03-09T09:13:57Z")

</div>

Hi!  
Could you try to use a modified script from my [comment above](https://forum.biobakery.org/t/merge-metaphlan-tables-py-with-absolute-abundance/1839/18), and modify line 34 as:  
`iIn = pd.read_csv(f, sep='\t', skiprows=len(headers), names=names, usecols=[0,1,4] if not gtdb else range(4), index_col=[0,1])`

This should be enough to do the job.

Best,

---

<div class="post-metadata">

**Author:** ![rsteinbaer](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@rsteinbaer](https://forum.biobakery.org/u/rsteinbaer)\
**Post date:** [March 9, 2023, 1:36pm UTC](https://forum.biobakery.org/t/merge-metaphlan-tables-py-with-absolute-abundance/1839/24 "2023-03-09T13:36:51Z")

</div>

Thank you very very much for the fast response! I will let you know 🙂

[Previous page](https://forum.biobakery.org/t/merge-metaphlan-tables-py-with-absolute-abundance/1839.md?page=1)
