-
Notifications
You must be signed in to change notification settings - Fork 73
lefse
LEfSe (Linear discriminant analysis Effect Size) determines the features (organisms, clades, operational taxonomic units, genes, or functions) most likely to explain differences between classes by coupling standard tests for statistical significance with additional tests encoding biological consistency and effect relevance.
LEfSe is available as a Galaxy module, a Conda recipe, a Docker image, and included in bioBakery (VM and cloud). For additional information, please refer to the LEfSe paper.
We provide support for LEfSe users. Please join our bioBakery Support Forum designated specifically for LEfSe users.
Table of contents
The following figure shows LEfSe's workflow.
For the purpose of this tutorial we will be using a sample input file (hmp_small_aerobiosis.txt).
- Go to the Huttenhower Galaxy Server: http://huttenhower.sph.harvard.edu/galaxy/
- Click on the
Get Data -> Upload File
link on the left pane and upload the demo file (hmp_small_aerobiosis.txt). You can do this by clicking on theBrowse
button, selecting the demo file, and then pressing theStart
button. Select the formattabular
.
- Click on the
LEfSe -> Format Data for LEfSe
link on the left pane, and select the specific rows for Class, Subclass and Subjects in your file, and press theExecute
button as shown below:
- Click on the
LEfSe -> LDA Effect Size (LEfSe)
link on the left pane, and select parameter values according to your analysis requirements. PressExecute
, when done.
- Once complete, you may now plot the LEfSe results, by click on the
LEfSe -> Plot LEfSe Results
link on the left pane, and press theExecute
button as shown below:
- This will produce a figure, that will look like as shown below (To
visualize the figure in the browser, click on the
Eye
symbol against the resulting output in the right pane).
- To plot a cladogram of your results, you may click on the
Plot Cladogram
link on the left pane, and press theExecute
button when ready.
- This action will produce a cladogram, as shown below:
You may also plot differential features or one feature. Please refer to the LEfSe documentation for more information.
LEfSe can be installed with Conda or run from a Docker image. Please note, if you are using bioBakery (Vagrant VM or cloud) you do not need to install LEfSe because the tool and its dependencies are already installed.
Install with Conda: $ conda install -c bioconda lefse
Install with Docker: $ docker run -it biobakery/lefse bash
For the purpose of this tutorial we will be using a sample input file: hmp_small_aerobiosis.txt depicting the general format of the input file (two rows of metadata, one row of sample names and the corresponding microbial abundance table).
-
Run the following command to format the input file (hmp_small_aerobiosis.txt). This will generate a file (hmp_aerobiosis_small.in). :
$ lefse_format_input.py hmp_aerobiosis_small.txt hmp_aerobiosis_small.in -c 1 -s 2 -u 3 -o 1000000
-
Run the following command, passing the file generated in the previous step as input. This will generate a file (hmp_aerobiosis_small.res) consisting of LEfSe analysis results.:
$ lefse_run.py hmp_aerobiosis_small.in hmp_aerobiosis_small.res
To visualize the results, LEfSe provides a couple of options. For all the options you will need the output from lefse_run.py (in this case: hmp_aerobiosis_small.res)
-
To plot the results of the LEfSe analysis generated from the previous step, run the following command.:
$ lefse_plot_res.py hmp_aerobiosis_small.res hmp_aerobiosis_small.png
-
This will produce a figure as shown below:
-
You may also choose to visualize the results in a Cladogram. Run the following command to generate the Cladogram figure. This will use the LEfSe results file generated previously.:
$ lefse_plot_cladogram.py hmp_aerobiosis_small.res hmp_aerobiosis_small.cladogram.png --format png
-
The resulting figure is shown below.
- HUMAnN 2.0
- HUMAnN 3.0
- MetaPhlAn 2.0
- MetaPhlAn 3.0
- MetaPhlAn 4.0
- MetaPhlAn 4.1
- PhyloPhlAn 3
- PICRUSt 2.0
- ShortBRED
- PPANINI
- StrainPhlAn 3.0
- StrainPhlAn 4.0
- MelonnPan
- WAAFLE
- MetaWIBELE
- MACARRoN
- FUGAsseM
- HAllA
- HAllA Legacy
- ARepA
- CCREPE
- LEfSe
- MaAsLin 2.0
- MaAsLin 3.0
- MMUPHin
- microPITA
- SparseDOSSA
- SparseDOSSA2
- BAnOCC
- anpan
- MTXmodel
- MTX model 3
- PARATHAA