# The way microorganisms are named affect the final results of lefse

**URL:** <https://forum.biobakery.org/t/the-way-microorganisms-are-named-affect-the-final-results-of-lefse/3876>\
**Category:** LEfSe\
**Created:** [July 27, 2022, 4:31am UTC](https://forum.biobakery.org/t/the-way-microorganisms-are-named-affect-the-final-results-of-lefse/3876 "2022-07-27T04:31:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![hlsw](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@hlsw](https://forum.biobakery.org/u/hlsw)\
**Post date:** [July 27, 2022, 4:31am UTC](https://forum.biobakery.org/t/the-way-microorganisms-are-named-affect-the-final-results-of-lefse/3876/1 "2022-07-27T04:31:14Z")

</div>

Hey, I encountered an issue: I was working on [Galaxy](http://huttenhower.sph.harvard.edu/galaxy/) and trying to run lefse but the output files were different when I changed the way microorganisms are named.  
The lef\_usual.txt is the input file whose microorganisms are named like “Clostridium\_sp\_DL\_VIII”. Underscore is the only special character in the input file.  
[lef\_usual.txt](https://forum.biobakery.org/uploads/short-url/kIpqSPR0GaRePGd3bF5KqG18Kd3.txt) (423.5 KB)  
The result is uploaded here.

 ![lef_usual](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/7/7ab28ce1f20da463a0ed2b1efe43cd9c31d576cf.png)  
Then I cleaned up the data to the most basic of formats like “ClostridiumspDLVIII” and ran it again. The input file named lef\_basic.txt is uploaded here.  
[lef\_basic.txt](https://forum.biobakery.org/uploads/short-url/9jJ9TWLcPGCZWCvCJ3EPGWmlCrP.txt) (423.4 KB)  
The new result is uploaded here and it is different from the first one.  
 ![lef_basic](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/b/be386143692cbc1e1bab515873e7236950de9a8a.png)  
The relevant parameters of the two tasks are the same, and only the naming method of the first column of the input file has changed.  
 ![process](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/f/f0353216d18ea73995870df00b06d3e226f65b5a.jpeg)  
So, why does just changing the way microorganisms are named affect the final results? Do we need to turn the data into the most basic way like “ClostridiumspDLVIII” to get the most correct results? If so, cleaning up to the most basic of formats like “ClostridiumspDLVIII” is hard to read and it is also difficult to search “ClostridiumspDLVIII” on the Internet. So, can Galaxy solve this problem thoroughly? Can the program of Lefse analysis be optimized?

---

<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:** [August 30, 2022, 3:46pm UTC](https://forum.biobakery.org/t/the-way-microorganisms-are-named-affect-the-final-results-of-lefse/3876/2 "2022-08-30T15:46:30Z")

</div>

Hello,  
Thank you for bringing up this issue, I apologize for the delay but I am looking into it now.  
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:** [August 30, 2022, 6:43pm UTC](https://forum.biobakery.org/t/the-way-microorganisms-are-named-affect-the-final-results-of-lefse/3876/3 "2022-08-30T18:43:07Z")

</div>

This issue has been resolved for the pypi version of LEfSe, and needs to be resolved still on Galaxy. In the meantime, I recommend using the pypi version downloadable [here](https://pypi.org/project/lefse/), with the following commands:

```auto
lefse_format_input.py Downloads/lef_usual.txt Downloads/lef_usual.in -c 2 -s -1 -u 1 -o 1000000
lefse_run.py Downloads/lef_usual.in Downloads/lef_usual.res
lefse_plot_res.py Downloads/lef_usual.res Downloads/lef_usual.png

```

When I run the above, and then re-run using lef\_basic.txt, I get the same results. The results are similar to (though not identical–this is a version difference between pypi and Galaxy versions) the results you saw for the lef\_basic run on the Galaxy version. I hope that helps, and we are working to resolve the problem on the Galaxy version.

---

<div class="post-metadata">

**Author:** ![Md.Ishtiak\_Rashid](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/md.ishtiak_rashid/32/1639_2.png) [@Md.Ishtiak\_Rashid](https://forum.biobakery.org/u/Md.Ishtiak_Rashid)\
**Post date:** [September 6, 2022, 7:51am UTC](https://forum.biobakery.org/t/the-way-microorganisms-are-named-affect-the-final-results-of-lefse/3876/4 "2022-09-06T07:51:02Z")

</div>

Dear Meg

Thanks. During the execution of the 3rd line “lefse\_plot\_res.py lefse/collapse.frequency.table.with.meta.res lefse/collapse.frequency.table.with.meta.png” , I found the following error:

Traceback (most recent call last):  
File “/opt/anaconda3/envs/thelefse/bin/lefse\_plot\_res.py”, line 10, in   
sys.exit(plot\_res())  
File “/opt/anaconda3/envs/thelefse/lib/python3.9/site-packages/lefse/lefse\_plot\_res.py”, line 177, in plot\_res  
else: plot\_histo\_hor(params[‘output\_file’],params,data,len(data[‘cls’]) == 2,params[‘report\_features’])  
File “/opt/anaconda3/envs/thelefse/lib/python3.9/site-packages/lefse/lefse\_plot\_res.py”, line 104, in plot\_histo\_hor  
if len(rr) \> params[‘max\_feature\_len’]: rr = rr[:params[‘max\_feature\_len’]/2-2]+" […]"+rr[-params[‘max\_feature\_len’]/2+2:]  
TypeError: slice indices must be integers or None or have an **index** method

I cannot figure it out. Can you check please?

Best  
Rashid

---

<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:** [September 20, 2022, 2:31pm UTC](https://forum.biobakery.org/t/the-way-microorganisms-are-named-affect-the-final-results-of-lefse/3876/5 "2022-09-20T14:31:00Z")

</div>

Hi Rashid,  
I haven’t come across this particular error before. Is there a dataset you could send me that reproduces the error, and I can try to troubleshoot?  
Thanks,  
Meg

---

<div class="post-metadata">

**Author:** ![hlsw](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@hlsw](https://forum.biobakery.org/u/hlsw)\
**Post date:** [December 20, 2022, 4:41am UTC](https://forum.biobakery.org/t/the-way-microorganisms-are-named-affect-the-final-results-of-lefse/3876/6 "2022-12-20T04:41:46Z")

</div>

Dear Meg

I have difficulty installing pypi version of LEfSe on [lefse · PyPI](https://pypi.org/project/lefse/). Should I download the lefse-1.1.2-py3-none-any.whl? And what is the difference between the lefse-1.1.2-py3-none-any.whl and the LEfSe installed on linux by “conda install -c biobakery lefse” or “conda install -c bioconda lefse”? Which of the three LEfSe installation methods is the pypi version that solves the previous problem?

And if lefse-1.1.2-py3-none-any.whl is the pypi version of LEfSe, how can I install it on my ubuntu? I downloaded the lefse-1.1.2-py3-none-any.whl and tried “pip install lefse-1.1.2-py3-none-any.whl” in my ubuntu, but I got an error, “ERROR: Could not build wheels for biom-format which use PEP 517 and cannot be installed directly”. My environment of ubuntu is python 3.10.6 and R 4.2.2. I would like to know how to install lefse-1.1.2-py3-none-any.whl. In particular, how do I configure the environment to successfully install it?

Thank you very much!

---

<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:** [December 20, 2022, 3:37pm UTC](https://forum.biobakery.org/t/the-way-microorganisms-are-named-affect-the-final-results-of-lefse/3876/7 "2022-12-20T15:37:14Z")

</div>

Hello, the command to install is:  
`pip install lefse`  
Here is some background info on installing python packages this way:  
[https://packaging.python.org/en/latest/tutorials/installing-packages/](https://packaging.python.org/en/latest/tutorials/installing-packages/)  
I hope that helps!  
Best,  
Meg

---

<div class="post-metadata">

**Author:** ![hlsw](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@hlsw](https://forum.biobakery.org/u/hlsw)\
**Post date:** [May 25, 2023, 11:40am UTC](https://forum.biobakery.org/t/the-way-microorganisms-are-named-affect-the-final-results-of-lefse/3876/9 "2023-05-25T11:40:46Z")

</div>

Hi！  
Now I have another question about LEfSe.  
Your code was “lefse\_format\_input.py Downloads/lef\_usual.txt Downloads/lef\_usual.in -c 2 -s -1 -u 1 -o 1000000”. Why should the -o parameter be set to 1000000? Can it not be set, so that the value is not standardized?(since my lef\_usual.txt is relative abundance table, which has alrerady been normalized between samples) If normalization is necessary, how should the -o value be set? How does it relate to the abundance table? Should I set it according to the value in the relative abundance table(lef\_usual.txt)?  
Thanks!
