# Sgb\_to\_gtdb\_profile.py bacterial abundances raised to 100%

**URL:** <https://forum.biobakery.org/t/sgb-to-gtdb-profile-py-bacterial-abundances-raised-to-100/6471>\
**Category:** MetaPhlAn\
**Created:** [January 16, 2024, 5:54pm UTC](https://forum.biobakery.org/t/sgb-to-gtdb-profile-py-bacterial-abundances-raised-to-100/6471 "2024-01-16T17:54:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carl\_Belger](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/carl_belger/32/2652_2.png) [@Carl\_Belger](https://forum.biobakery.org/u/Carl_Belger)\
**Post date:** [January 16, 2024, 5:54pm UTC](https://forum.biobakery.org/t/sgb-to-gtdb-profile-py-bacterial-abundances-raised-to-100/6471/1 "2024-01-16T17:54:44Z")

</div>

Dear MetaPhlAn developers. I have just used the sgb\_to\_gtdb\_profile.py script and noticed there might be some issues and I was wondering if you could help. Firstly with running the script, we noticed that parsing the database name uses the following code  
` def get\_database\_name(self):  
“”"Gets database name

```
    Returns:
        str: the database name
    """
    return self.database.split('/')[-1][:-4]`

```

This meant that when specifying the database we had to give `metaphlan_db_vOct22/mpa_vOct22_CHOCOPhlAnSGB_202212.bt2` instead of a general link to the database directory `metaphlan_db_vOct22`. I’m not sure if this was intentional?

Secondly, after successfully running the script, we noticed that the SGB to GTDB conversions raised the bacterial classification to 100. In my samples a large percentage of reads were unclassified so using the MetaPhlAn database we got this as an example:

```auto
|taxonomy|C178B|
|---|---|
|UNCLASSIFIED|32.23385|
|k__Bacteria|67.76615398125996|
|k __Bacteria|p__ Fusobacteria|33.96444381171528|
|k __Bacteria|p__ Proteobacteria|16.390565780370355|
|k __Bacteria|p__ Firmicutes|14.516940048634888|
|k __Bacteria|p__ Bacteroidetes|2.8942043405394373|

```

However after converting to GTDB we got this:

```auto
#clade_name	relative_abundance
UNCLASSIFIED	32.23385
d__Bacteria	100.0
d __Bacteria;p__ Fusobacteriota	50.12007
d __Bacteria;p__ Proteobacteria	22.51449
d __Bacteria;p__ Firmicutes_A	21.422109999999996
d __Bacteria;p__ Bacteroidota	4.45885
d __Bacteria;p__ Campylobacterota	1.48448

```

The samples no longer summed to 100. I think that perhaps the ratios between the phyla abundances are correct but they just to be changed to be in proportion to the bacterial abundance which should not be 100 but rather UNCLASSIFIED-100. Let me know if this seems correct or if you think the error came from elsewhere.

Thanks in advance.
