# Lefse galaxy and conda codes

**URL:** <https://forum.biobakery.org/t/lefse-galaxy-and-conda-codes/6099>\
**Category:** LEfSe\
**Created:** [October 20, 2023, 9:44pm UTC](https://forum.biobakery.org/t/lefse-galaxy-and-conda-codes/6099 "2023-10-20T21:44:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ishanmanandhar](https://avatars.discourse-cdn.com/v4/letter/i/c68b51/32.png) [@Ishanmanandhar](https://forum.biobakery.org/u/Ishanmanandhar)\
**Post date:** [October 20, 2023, 9:44pm UTC](https://forum.biobakery.org/t/lefse-galaxy-and-conda-codes/6099/1 "2023-10-20T21:44:59Z")

</div>

Dear all,

I am aware that Lefse galaxy module is having issues. However, I want to use conda codes to run the analysis. Could someone please share the codes and sample data to do the analysis? I tried to find codes from websites but they are very confusing. Any help is highly appreciated! Thank you

---

<div class="post-metadata">

**Author:** ![goober\_grape](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/goober_grape/32/2452_2.png) [@goober\_grape](https://forum.biobakery.org/u/goober_grape)\
**Post date:** [November 3, 2023, 4:56pm UTC](https://forum.biobakery.org/t/lefse-galaxy-and-conda-codes/6099/2 "2023-11-03T16:56:59Z")

</div>

this creates a conda environment called lefse:  
`conda create -n lefse`

this activates the environment:  
`conda activate lefse`

this will install the package using bioconda:  
`conda install -c bioconda lefse`

then replace the format script with the one here:

> [@Error in Format Data for LEfSe](https://forum.biobakery.org/t/error-in-format-data-for-lefse/5933/9):
>
> Managed to get it to run by downloading an updated “lefse\_format\_input.py” file from: [https://github.com/SegataLab/lefse/tree/master/lefse](https://github.com/SegataLab/lefse/tree/master/lefse)

this makes the new format script script accessible:  
`chmod + x lefse_format_input.py`

this formats your table, be sure to have your treatments in the first row (i.e. class) and your subtreatments in the second row if you have any (subclass; the following script assigns -1 to subclass meaning you have none, so change that number to the row containing your subclass if you have one; use lefse\_format\_input.py -h for a list of variables)  
`lefse_format_input.py lefse_matrix.txt lefse_matrix.in -c 1 -s -1 -u 2 -o 1000000`

this runs lefse:  
`lefse_run.py lefse_matrix.in lefse_matrix.res`

this creates the barplot:  
`lefse_plot_res.py lefse_matrix.res lefse_matrix.res.svg --format svg`

this creates the cladogram (still unsure why the shading wedges are not centered and would love to know how to fix that):  
`lefse_plot_cladogram.py lefse_matrix.res lefse_cladogram.svg --format svg`

I was similarly having troubles and this worked for me. I am a novice, just hoping to help.

---

<div class="post-metadata">

**Author:** ![Ishanmanandhar](https://avatars.discourse-cdn.com/v4/letter/i/c68b51/32.png) [@Ishanmanandhar](https://forum.biobakery.org/u/Ishanmanandhar)\
**Post date:** [November 30, 2023, 3:19pm UTC](https://forum.biobakery.org/t/lefse-galaxy-and-conda-codes/6099/3 "2023-11-30T15:19:53Z")

</div>

Thank you so much!  
I will try this
