# Format input file for Lefse

**URL:** <https://forum.biobakery.org/t/format-input-file-for-lefse/5518>\
**Category:** LEfSe\
**Created:** [June 22, 2023, 6:36pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518 "2023-06-22T18:36:02Z")\
**Posts on this page:** 14\
**Page:** 2

<div class="post-metadata">

**Author:** ![Josias](https://avatars.discourse-cdn.com/v4/letter/j/6a8cbe/32.png) [@Josias](https://forum.biobakery.org/u/Josias)\
**Post date:** [June 30, 2023, 10:52am UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/21 "2023-06-30T10:52:00Z")

</div>

Dear Sagun,  
I 'd already changed comma for dots and had no sucess. It seems clear that there are something wrong with the files, but I have been unable to detect exactly what. Since last Galaxy update(?) adjustments seem to the formats are needed. I’ve tried to solve this for over a week!  
Regards  
Josias

---

<div class="post-metadata">

**Author:** ![Lauren](https://avatars.discourse-cdn.com/v4/letter/l/b4bc9f/32.png) [@Lauren](https://forum.biobakery.org/u/Lauren)\
**Post date:** [June 30, 2023, 8:44pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/22 "2023-06-30T20:44:29Z")

</div>

I take back what I said. I have now tried a couple of the things mentioned here - I replaced all commas with periods, and even though I do not have a subgroup, I included a row of just NAs to select for that.

The problem is not fixed - I am getting the same error.

---

<div class="post-metadata">

**Author:** ![Lauren](https://avatars.discourse-cdn.com/v4/letter/l/b4bc9f/32.png) [@Lauren](https://forum.biobakery.org/u/Lauren)\
**Post date:** [June 30, 2023, 8:48pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/23 "2023-06-30T20:48:07Z")

</div>

Were there any other modifications you made to @Josias 's file to get it to work, since apparently switching commas to dots was not the only problem?

---

<div class="post-metadata">

**Author:** ![Josias](https://avatars.discourse-cdn.com/v4/letter/j/6a8cbe/32.png) [@Josias](https://forum.biobakery.org/u/Josias)\
**Post date:** [July 1, 2023, 9:33am UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/24 "2023-07-01T09:33:34Z")

</div>

Some strange characters were seen in the file. At least for a while I think I will give up using Galaxy

---

<div class="post-metadata">

**Author:** ![Josias](https://avatars.discourse-cdn.com/v4/letter/j/6a8cbe/32.png) [@Josias](https://forum.biobakery.org/u/Josias)\
**Post date:** [July 2, 2023, 12:55pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/25 "2023-07-02T12:55:22Z")

</div>

The issue that I had with my files is now solved! To work in (this new version of) Galaxy, the columns headings of the table must be filled with all three parameters (Class, Subclass and Subject - brackets in the attached print), regardless they are necessary for your analysis (if they are the same, I thought they were not necessary, such as in the Subclass line in the attached print (arrow). Not providing info in this line was my error!).

 ![Sem título](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/9/9872eea5e1630f0fca9032b56481ffc56f28df0b.png)

---

<div class="post-metadata">

**Author:** ![Karie\_Chin](https://avatars.discourse-cdn.com/v4/letter/k/45deac/32.png) [@Karie\_Chin](https://forum.biobakery.org/u/Karie_Chin)\
**Post date:** [July 3, 2023, 11:03am UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/26 "2023-07-03T11:03:39Z")

</div>

Hello @sagunmaharjann ,  
I also faced difficulties when uploading my previous data when running LEfSe although I have already chosen the Class, subclass and ID when formatting the data.

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/d/d8d943ff5f07f96e06c3067f173115ef45ffcba2.png)

Would you please also help me to check with my dataset please?  
Thank you very much for your passionate and kind assistance!

Best regards,  
Karie  
[Abundance input\_error.txt](https://forum.biobakery.org/uploads/short-url/lYeLY4c3QFloXAtiQaFJTHqsrm3.txt) (110.7 KB)

---

<div class="post-metadata">

**Author:** ![Josias](https://avatars.discourse-cdn.com/v4/letter/j/6a8cbe/32.png) [@Josias](https://forum.biobakery.org/u/Josias)\
**Post date:** [July 3, 2023, 2:34pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/27 "2023-07-03T14:34:18Z")

</div>

As I mentioned in previous message, what I did for the stuff to work was to fill all 3 lines/cells of the colummns headings. I did not do this before because one of them was not relevant for my analysis.

---

<div class="post-metadata">

**Author:** ![Josias](https://avatars.discourse-cdn.com/v4/letter/j/6a8cbe/32.png) [@Josias](https://forum.biobakery.org/u/Josias)\
**Post date:** [July 3, 2023, 2:43pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/28 "2023-07-03T14:43:18Z")

</div>

![1](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/b/b64b85b8aa9c37c16baf5e77617efa01a2014fbb.png)  
[Abundance input.txt](https://forum.biobakery.org/uploads/short-url/ixJi7QWlU4LsPT2GbNXrOjxTuQW.txt) (109.6 KB)

---

<div class="post-metadata">

**Author:** ![Karie\_Chin](https://avatars.discourse-cdn.com/v4/letter/k/45deac/32.png) [@Karie\_Chin](https://forum.biobakery.org/u/Karie_Chin)\
**Post date:** [August 15, 2023, 4:25am UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/29 "2023-08-15T04:25:29Z")

</div>

Hi @Josias , thank you very much for your help last time. I experienced another issue that I got the Lefse result but there is error when I plot them into bar chart. This makes me frustrated as I successfully run lefse result on hand. Would you mind help me to take a look as well please?

Error message:  
Traceback (most recent call last):  
File “/usr/bin/lefse\_plot\_res.py”, line 8, in   
sys.exit(plot\_res())  
File “/usr/lib/python3.6/site-packages/lefse/lefse\_plot\_res.py”, line 177, in plot\_res  
else: plot\_histo\_hor(params[‘output\_file’],p

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/f/f6ec50b98cfd16c2d7ac1da4dd8723f8f072a32c.png)

Thank you very much for your kind assistance!

---

<div class="post-metadata">

**Author:** ![Faezeh\_Ebrahimi](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/faezeh_ebrahimi/32/2659_2.png) [@Faezeh\_Ebrahimi](https://forum.biobakery.org/u/Faezeh_Ebrahimi)\
**Post date:** [January 19, 2024, 7:46am UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/30 "2024-01-19T07:46:34Z")

</div>

Hi!  
I keep getting this error as well:  
raceback (most recent call last):  
File “/usr/bin/lefse\_format\_input.py”, line 7, in   
from lefsebiom.ConstantsBreadCrumbs import \*  
ModuleNotFoundError: No module named ‘lefsebiom’

Thanks!

---

<div class="post-metadata">

**Author:** ![Rashmi\_Ira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/rashmi_ira/32/2662_2.png) [@Rashmi\_Ira](https://forum.biobakery.org/u/Rashmi_Ira)\
**Post date:** [January 20, 2024, 8:03am UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/31 "2024-01-20T08:03:24Z")

</div>

Hi @Josias!

I tried working with all the changes suggested on this page, but still getting the error.

Even used the same file as the provided

> [@sagunmaharjann](#):
>
> Here is your initial input file(after changes) which works. Please try it out and let me know if any issues.  
> [test.txt](https://forum.biobakery.org/uploads/short-url/amROmteO3ifTQvSS5H7newPquop.txt) (531.3 KB)

Still getting error

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

Would you mind helping me in resolving this issue with data, please?  
I am attaching my file, for the kind reference.  
[genus\_input\_relat\_abun.txt](https://forum.biobakery.org/uploads/short-url/bxOlW3AhvEhSqUXMbCW7Q98Skk0.txt) (99.0 KB)

Any sort of help or suggestion will be appreciated.  
Thanks and Regards,  
Rashmi

---

<div class="post-metadata">

**Author:** ![ayaabobakr](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/ayaabobakr/32/2667_2.png) [@ayaabobakr](https://forum.biobakery.org/u/ayaabobakr)\
**Post date:** [January 21, 2024, 12:31pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/32 "2024-01-21T12:31:42Z")

</div>

Hi!  
I have the same error @Faezeh_Ebrahimi encountered and I hope anyone can help me solve this issue.

Regards,  
Aya

---

<div class="post-metadata">

**Author:** ![sagunmaharjann](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/sagunmaharjann/32/168_2.png) [@sagunmaharjann](https://forum.biobakery.org/u/sagunmaharjann)\
**Post date:** [January 22, 2024, 4:10pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/33 "2024-01-22T16:10:49Z")

</div>

Hi all,

Apologies for the issue. We are currently working on fixing the lefse issue. We will keep you posted.

Regards,  
Sagun

---

<div class="post-metadata">

**Author:** ![celia\_silva](https://avatars.discourse-cdn.com/v4/letter/c/3ab097/32.png) [@celia\_silva](https://forum.biobakery.org/u/celia_silva)\
**Post date:** [March 7, 2024, 7:32pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/34 "2024-03-07T19:32:15Z")

</div>

I have been using LEfSe in the past and was successfully able to run the full pipeline with the Galaxy LEfSe tool. Now when I am trying to run the pipeline using new tabular files (I believe to be formatted correctly) and even old ones that successfully worked in the past I run into this error:  
Traceback (most recent call last):  
File “/usr/bin/lefse\_format\_input.py”, line 10, in   
from importlib.metadata import distribution  
ModuleNotFoundError: No module named ‘importlib.metadata’  
Can you please help me?

[Previous page](https://forum.biobakery.org/t/format-input-file-for-lefse/5518.md?page=1)
