# Bacteria is returned as significant when it's the only Kingdom present

**URL:** <https://forum.biobakery.org/t/bacteria-is-returned-as-significant-when-its-the-only-kingdom-present/851>\
**Category:** LEfSe\
**Created:** [August 13, 2020, 8:54pm UTC](https://forum.biobakery.org/t/bacteria-is-returned-as-significant-when-its-the-only-kingdom-present/851 "2020-08-13T20:54:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samantha](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/samantha/32/260_2.png) [@Samantha](https://forum.biobakery.org/u/Samantha)\
**Post date:** [August 13, 2020, 8:54pm UTC](https://forum.biobakery.org/t/bacteria-is-returned-as-significant-when-its-the-only-kingdom-present/851/1 "2020-08-13T20:54:56Z")

</div>

Hello!

I’m using lefse to analyze a dataset comparing two groups and the Kingdom, Bacteria, was returned as significant. I think this in error because the only Kingdom in the dataset is “Bacteria.” The feature plot (below) for that hit shows 8/10 samples have an abundance of 1, but when I add up the values for the columns in the table manually I get 1 for all 10 samples (as expected for a relative abundance plot). I do have one Taxon that couldn’t be assigned past Bacteria (the rest are Bacteria|Phylum|…|family/genus), but the abundance of of the one assignment is not 1 in any of my samples (though it is 0 in two control samples), so I’m not sure if that assignment is the issue.

Can you help me understand why this hit is coming back as significant and why it’s not counting the abundance appropriately? And if it is the lone Bacteria assignment could you explain why it’s not being included in the overall Kingdom calculation of LEfSe?

Thanks,  
Samantha

 ![1_Bacteria](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/1X/ab406c412ef7be2e42d5d418fc0790e08911ac15.png)

Here is my relative abundance table: [rel\_freq\_col\_LF100\_SI\_min2\_L6\_lefse.txt](https://forum.biobakery.org/uploads/short-url/4YRSHp1MmKyYGv4YrD1KtRCwAT0.txt) (12.4 KB)

These are the commands I ran to get to this figure (I’m using the conda install of LEfSe):

> format\_input.py rel\_freq\_col\_LF100\_SI\_min2\_L6\_lefse.txt formatted\_LF100-SI\_min2\_L6.in -c 1 -o 1000000

> run\_lefse.py formatted\_LF100-SI\_min2\_L6.in lefse\_out\_LF100-SI\_min2\_L6.res -w 1

> plot\_res.py --dpi 300 --format png lefse\_out\_LF100-SI\_min2\_L6.res lda\_out\_LF100-SI\_min2\_L6.png --width 10

> plot\_features.py --dpi 300 --format png -f diff formatted\_LF100-SI\_min2\_L6.in lefse\_out\_LF100-SI\_min2\_L6.res sig\_features\_SI-LF100/

---

<div class="post-metadata">

**Author:** ![sma](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@sma](https://forum.biobakery.org/u/sma)\
**Post date:** [August 14, 2020, 3:08pm UTC](https://forum.biobakery.org/t/bacteria-is-returned-as-significant-when-its-the-only-kingdom-present/851/2 "2020-08-14T15:08:33Z")

</div>

Hi -

I’d guess your data is from 16S sequencing? The issue here is that the feature named “Bacteria” confuses LEfSe - it won’t know it’s for an OTU classified under that taxon, vs. it’s the total abundance of Bacteria. Relabeling the feature to “Bacteria|OTU1” solved the issue on my end.

Let me know if this makes sense!  
Siyuan

---

<div class="post-metadata">

**Author:** ![Samantha](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/samantha/32/260_2.png) [@Samantha](https://forum.biobakery.org/u/Samantha)\
**Post date:** [August 14, 2020, 3:23pm UTC](https://forum.biobakery.org/t/bacteria-is-returned-as-significant-when-its-the-only-kingdom-present/851/3 "2020-08-14T15:23:33Z")

</div>

Yes, the data is 16S. That does make sense, thank you for the help!

~Samantha

---

<div class="post-metadata">

**Author:** ![Samantha](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/samantha/32/260_2.png) [@Samantha](https://forum.biobakery.org/u/Samantha)\
**Post date:** [August 14, 2020, 4:57pm UTC](https://forum.biobakery.org/t/bacteria-is-returned-as-significant-when-its-the-only-kingdom-present/851/4 "2020-08-14T16:57:32Z")

</div>

Hello, I have a follow up question on this. Will something farther in the taxonomic chain cause the same problem? For example:

Bacteria|Tenericutes|Mollicutes|Mollicutes\_RF39|uncultured\_bacterium|uncultured\_bacterium  
Bacteria|Tenericutes|Mollicutes|Mollicutes\_RF39|unidentified|unidentified  
Bacteria|Tenericutes|Mollicutes|Mollicutes\_RF39

Will LEfSe have a problem as counting all three of these as Mollicutes\_RF39 when it runs on Order? Should I be adding something to everything that terminates? I collapsed the table to the genus level before running in LEfSe, would I be needing to put |OTU# after each genus as well?

Thanks,  
Samantha

---

<div class="post-metadata">

**Author:** ![sma](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@sma](https://forum.biobakery.org/u/sma)\
**Post date:** [August 21, 2020, 3:27pm UTC](https://forum.biobakery.org/t/bacteria-is-returned-as-significant-when-its-the-only-kingdom-present/851/5 "2020-08-21T15:27:41Z")

</div>

Hi -

I believe so. However, if I understood you correctly, the table collapsed at genus level should only have two types of features a) genera and b) OTUs not classifiable to genus level and hence assigned to higher taxa. In this case, you can  
a) assign OTU #s to those unclassified at genus, so that LEfSe doesn’t get confused with, say, family level abundances, or  
b) simply replace taxonomy separators with something LEfSe won’t recognize. I believe “;” instead of “|” does the trick. In this way LEfSe will only test for these features, and not, say, family level features calculated from genus level abundances.  
Hope this is helpful,  
Siyuan

---

<div class="post-metadata">

**Author:** ![Samantha](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/samantha/32/260_2.png) [@Samantha](https://forum.biobakery.org/u/Samantha)\
**Post date:** [August 24, 2020, 3:59pm UTC](https://forum.biobakery.org/t/bacteria-is-returned-as-significant-when-its-the-only-kingdom-present/851/6 "2020-08-24T15:59:34Z")

</div>

I think I understand a, but I’m not sure about b.  
From my example able above:

Bacteria|Bacteroidetes|Bacteroidia|Bacteroidales|Muribaculaceae;\_\_

a) would be Bacteria|Bacteroidetes|Bacteroidia|Bacteroidales|Muribaculaceae|otu1  
b) would be to leave it with the “;”? Bacteria|Bacteroidetes|Bacteroidia|Bacteroidales|Muribaculaceae;\_\_

I’ve had problems with this where LEfSe thinks Muribaculaceae;\_\_ is a different family from the other two Muribaculaceae and won’t include it in the family calculation for Muribaculaceae.

Could you please verify I am correct with a and expand on b?  
Thanks,  
Samantha

---

<div class="post-metadata">

**Author:** ![sma](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@sma](https://forum.biobakery.org/u/sma)\
**Post date:** [August 26, 2020, 3:43pm UTC](https://forum.biobakery.org/t/bacteria-is-returned-as-significant-when-its-the-only-kingdom-present/851/7 "2020-08-26T15:43:11Z")

</div>

Hi -

a) Yep, you got it exactly right.

b) I was suggesting something more like  
Bacteria|Bacteroidetes|Bacteroidia|Bacteroidales|Muribaculaceae -\>  
Bacteria;Bacteroidetes;Bacteroidia;Bacteroidales;Muribaculaceae

Because LEfSe doesn’t recognize “;” as taxonomy delimiter, it will think “Bacteria;Bacteroidetes;Bacteroidia;Bacteroidales;Muribaculaceae” is its own feature, separate from something like, say, “Bacteria;Bacteroidetes;Bacteroidia;Bacteroidales;Muribaculaceae;some\_genus”.

So each feature will be tested on its own. LEfSe won’t know to aggregate abundances for higher taxonomy ranks though. For example, you would only get results for “Bacteria” if you have an OTU unclassified under Bacteria. You won’t get testing results for the kingdom Bacteria.

Thanks,  
Siyuan
