# Problme with LEfSe using command line interface

**URL:** <https://forum.biobakery.org/t/problme-with-lefse-using-command-line-interface/2283>\
**Category:** LEfSe\
**Created:** [June 22, 2021, 3:05pm UTC](https://forum.biobakery.org/t/problme-with-lefse-using-command-line-interface/2283 "2021-06-22T15:05:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![1112](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/1112/32/883_2.png) [@1112](https://forum.biobakery.org/u/1112)\
**Post date:** [June 22, 2021, 3:05pm UTC](https://forum.biobakery.org/t/problme-with-lefse-using-command-line-interface/2283/1 "2021-06-22T15:05:56Z")

</div>

Hi,

I am trying to analyze my dataset with LEfSe in ubuntu terminal.

There are no errors when I formatting and running LEfSe analysis from my feature table.

However, after the analysis (specifically, after the ‘run\_lefse.py’ step), LDA difference was compared among ‘subjects’, not ‘classes’.

When I tested using tutorial data (hmp\_small\_aerobiosis.txt), same situation still occurred.

I installed LEfSe by conda with following command:  
$ conda install -c biobakery lefse

and running LEfSe with :  
$ lefse-format\_input.py hmp\_small\_aerobiosis.txt hmp\_small\_aerobiosis.in -c 1 -s 2 -u 3 -o 1000000

$ run\_lefse.py hmp\_small\_aerobiosis.in hmp\_small\_aerobiosis.res

$ lefse-plot\_res.py hmp\_small\_aerobiosis.res hmp\_small\_aerobiosis.png

Resulting plot: It seems like LEfSe comparing among ‘subject’, not ‘class’.

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

I have no idea how to solve this problem.

---

<div class="post-metadata">

**Author:** ![mishort](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/mishort/32/556_2.png) [@mishort](https://forum.biobakery.org/u/mishort)\
**Post date:** [June 22, 2021, 5:42pm UTC](https://forum.biobakery.org/t/problme-with-lefse-using-command-line-interface/2283/2 "2021-06-22T17:42:39Z")

</div>

Hello,  
Thanks for your question. The problem is in the values you supplied after the options -c -s and -u when you ran format\_input.py. To see the documentation on these options, run the following:  
$ format\_input.py -h

Whichever row in your data corresponds to the class variable should be supplied after -c, and the ID variable row should be supplied after -u. If there is no subclass, you do not need to supply the option “-s” at all.

I hope that helps!  
-Meg

---

<div class="post-metadata">

**Author:** ![1112](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/1112/32/883_2.png) [@1112](https://forum.biobakery.org/u/1112)\
**Post date:** [June 23, 2021, 10:40am UTC](https://forum.biobakery.org/t/problme-with-lefse-using-command-line-interface/2283/3 "2021-06-23T10:40:02Z")

</div>

Thank you for your kind reply!

I think I poorly explained my situation.

Exact problem is, though I set -c and -u options appropriately, LEfSe compared differences among “subject”, not “class”.

In the case of tutorial data which I analyzed for a test (the resulting plot was uploaded previously) ([https://github.com/biobakery/biobakery/raw/master/demos/biobakery\_demos/data/lefse/input/hmp\_small\_aerobiosis.txt](https://github.com/biobakery/biobakery/raw/master/demos/biobakery_demos/data/lefse/input/hmp_small_aerobiosis.txt)), classes were in the first row and subjects were in the third row. According to the row position in the input file, I put the options -c 1 and -u 3 to set “row 1” as “class” and “row 3” as “subject”.  
\*Classes in the tutorial data are ‘High\_O2’, ‘Mid\_O2’, and ‘Low\_O2’. Subjects are 158398106, 158742018, 158984779 etc…

As I understand, $lefse-plot\_res.py supposed to plot differences among classes (High\_O2, Mid\_O2, Low\_O2).  
However, as you can see in the above resulting plot I previously uploaded, it plotted differences among subjects (158398106, 158742018, 158984779 etc…).

Is there anything I am missing? or would it be a problem with my computer settings?

---

<div class="post-metadata">

**Author:** ![mishort](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/mishort/32/556_2.png) [@mishort](https://forum.biobakery.org/u/mishort)\
**Post date:** [June 23, 2021, 2:55pm UTC](https://forum.biobakery.org/t/problme-with-lefse-using-command-line-interface/2283/4 "2021-06-23T14:55:48Z")

</div>

Ah I see, thanks for clarifying. Let me take a look at the example data and get back to you.  
Best,  
Meg

---

<div class="post-metadata">

**Author:** ![mishort](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/mishort/32/556_2.png) [@mishort](https://forum.biobakery.org/u/mishort)\
**Post date:** [June 24, 2021, 9:15pm UTC](https://forum.biobakery.org/t/problme-with-lefse-using-command-line-interface/2283/5 "2021-06-24T21:15:00Z")

</div>

Hello,  
I ran through the tutorial and it works as intended for me (the grouping variable is correct), and I wanted to check that you’re using the latest version of lefse and the tutorial. Here is the link to the tutorial I was following:

> **[biobakery/biobakery](https://github.com/biobakery/biobakery/wiki/lefse#2-lefse-condadockervm)**
>
> bioBakery tools for meta'omic profiling. Contribute to biobakery/biobakery development by creating an account on GitHub.

I ask because the commands you pasted above are slightly different from the ones used in the tutorial ("lefse-format\_input.py vs format\_input.py, for instance).  
Could you try running “conda update lefse” and then re-following the tutorial linked above, and letting me know if it works?  
Thanks,  
Meg

---

<div class="post-metadata">

**Author:** ![hina](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@hina](https://forum.biobakery.org/u/hina)\
**Post date:** [May 25, 2023, 2:20am UTC](https://forum.biobakery.org/t/problme-with-lefse-using-command-line-interface/2283/6 "2023-05-25T02:20:53Z")

</div>

Hellow everyone, i am following the same protocol, but my cladogram has no symbol abbreviation on side what is should do.

 ![fecal4c1](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/7/78cd2b0f46179a9f4bf9b7c3761f7d033795c5b9.png)
