# 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:** 20
**Page:** 1

<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 22, 2023, 6:36pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/1 "2023-06-22T18:36:02Z")

</div>

Hi,  
Even using the website suggested input file, I was unable to pass from the format step: Error:  
error  
An error occurred with this dataset:  
Traceback (most recent call last):  
File “/usr/bin/lefse\_format\_input.py”, line 8, in   
sys.exit(format\_input())  
File “/usr/lib/python3.6/site-packages/lefse/lefse\_format\_input.py”, line 441, in format\_input  
feats = add\_missing\_levels(f

---

<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: [June 23, 2023, 4:00pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/2 "2023-06-23T16:00:47Z")

</div>

Hello @Josias ,  
Please make sure that you are passing the subclass and subjectId parameters as well in the lefse galaxy run.

Regards,  
Sagun

---

<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 24, 2023, 12:17pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/3 "2023-06-24T12:17:19Z")

</div>

Dear Sagun,  
Thanks for your quick response. Yet, it seems no to be the case. I have running galaxy tools for over one year, facing no major issue. I am having problems with the workflow just now.  
Josias

---

<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 26, 2023, 12:56pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/4 "2023-06-26T12:56:51Z")

</div>

![Sem título](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/5/539b5020c4dd8b0a8d6bfdfa48a9a8919dbdf811.png)  
 ![Sem título1](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/f/fd375caa4e92ae754539454da8126e7f49b6a682.png)

---

<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 26, 2023, 6:44pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/5 "2023-06-26T18:44:12Z")

</div>

I am also having the same issue. I have run Lefse many times in the last 2 years, and like @Josias I am only now running into this error.

I cannot identify any formatting issue on my end.

Please let me know if I can supply any information to help you identify the problem.

---

<div class="post-metadata">

### Author: ![archaea](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@archaea](https://forum.biobakery.org/u/archaea)
#### Post date: [June 27, 2023, 4:07pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/6 "2023-06-27T16:07:18Z")

</div>

Hi,  
I have the same problem. I cannot get past the LEfSe formatting step. I used previous files that used to work perfectly on here. I even tried to use the example file that is given on the galaxy module, and it does not work either.  
Thanks.

---

<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: [June 27, 2023, 5:56pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/7 "2023-06-27T17:56:14Z")

</div>

Hello @archaea , @Lauren and @Josias ,

Can you please attach your lefse input file? I can check the formatting from my side. Please note that the galaxy LEfSe version was updated from [v1.1](https://github.com/SegataLab/lefse/releases/tag/1.1) to [v1.1.2](https://github.com/SegataLab/lefse/releases/tag/1.1.2).

Regards,  
Sagun

---

<div class="post-metadata">

### Author: ![archaea](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@archaea](https://forum.biobakery.org/u/archaea)
#### Post date: [June 27, 2023, 6:18pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/8 "2023-06-27T18:18:12Z")

</div>

Here is a file that used to work and does not at the moment.  
Thanks for your help!  
[crbac\_genus\_sex.txt](https://forum.biobakery.org/uploads/short-url/2gWxtus9ZHKwlfgbX3FhOTQ7fN2.txt) (287.3 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: [June 27, 2023, 6:18pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/9 "2023-06-27T18:18:46Z")

</div>

[test.txt](https://forum.biobakery.org/uploads/short-url/opscc9Ptav94faiSMG6p2umtgd1.txt) (531.3 KB)

---

<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 27, 2023, 9:03pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/10 "2023-06-27T21:03:23Z")

</div>

My data is working again today for some reason, not sure why if others are still having issues, but it appears fixed on my end for now.

---

<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: [June 28, 2023, 5:02am UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/11 "2023-06-28T05:02:19Z")

</div>

Hello @Josias ,

Please replace all the “,” with “.” in the input file.  
`Error: ValueError: could not convert string to float: '4,34E-01'`  
eg. 4,34E-01 =\> 4.34E-01

Regards,  
Sagun

---

<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: [June 28, 2023, 5:07am UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/12 "2023-06-28T05:07:13Z")

</div>

Hello @archaea ,

Can you make sure that you are selecting the all 3 options parameters for input columns i.e.

- Select which row to use as class
- Select which row to use as subclass
- Select which row to use as subject  
When you provide the column names for each one of the above options in galaxy LEfSe, your input file works fine.

Regards,  
Sagun

---

<div class="post-metadata">

### Author: ![archaea](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@archaea](https://forum.biobakery.org/u/archaea)
#### Post date: [June 28, 2023, 9:36am UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/13 "2023-06-28T09:36:24Z")

</div>

It still isn’t working for me. I have no subclass and subject rows. When I leave it as ‘no subclass’ and ‘no subject’, I get the error message. Should I add empty rows to my input files ?  
Thanks.

---

<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 28, 2023, 10:46am UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/14 "2023-06-28T10:46:02Z")

</div>

![2](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/3/32f9c480e54bcf89dcfb0e8a66c7c5ccad05895b.png)  
 ![1](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/f/fae1756a5bb44b741c8f203ba23b2ede6392ec5f.png)

---

<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: [June 28, 2023, 3:00pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/15 "2023-06-28T15:00:24Z")

</div>

Hi @Josias ,

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)

 ![Screen Shot 2023-06-28 at 10.58.38 AM](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/1/1e25917901326d0f4015c67807d5de1bd9fe7ec9.jpeg)

Regards,  
Sagun

---

<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: [June 28, 2023, 3:02pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/16 "2023-06-28T15:02:17Z")

</div>

Hi @archaea,  
Yes, both subclass and subject rows are required parameters. Try adding empty rows please.

Regards,  
Sagun

---

<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 28, 2023, 3:32pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/17 "2023-06-28T15:32:26Z")

</div>

Great Sagun!  
It really worked on my end, as well. Now I need to work on my own file. So, could you please inform was was wrong with the “test.txt”?  
regards

---

<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: [June 28, 2023, 4:51pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/18 "2023-06-28T16:51:59Z")

</div>

Hello @Josias ,  
I replaced all the “,” (commas) with “.” (dot) for you input file that worked out for me.

Regards,  
Sagun

---

<div class="post-metadata">

### Author: ![archaea](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@archaea](https://forum.biobakery.org/u/archaea)
#### Post date: [June 28, 2023, 6:58pm UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/19 "2023-06-28T18:58:05Z")

</div>

Yes it works now. FYI, empty rows don’t work, they have to be filled.  
Thanks!

---

<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: [June 30, 2023, 12:45am UTC](https://forum.biobakery.org/t/format-input-file-for-lefse/5518/20 "2023-06-30T00:45:09Z")

</div>

Hlo guys, i am running the same problem. It’s not working for me also. Can someone tell me what’s the problem in my file also?  
[fecal galaxy3.txt](https://forum.biobakery.org/uploads/short-url/8LSk3GeYCZGC2NGczzMNFi5RbaB.txt) (41.7 KB)  
I have run this file one time and it worked but now its not working. couldn’t pass formating in galaxy.

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