| 1 | ## script changed from original by for bioconda-lefse by jfg 2017.10.31 |
| 2 | ## adapted from the original lefse run.sh available at: |
| 3 | ## https://bitbucket.org/nsegata/lefse/src/54694b4b0d9e335ff1ecafff8db4f1e0cf7004da/example/run.sh?at=default&fileviewer=file-view-default |
| 4 | ## |
| 5 | ## |
| 6 | |
| 7 | |
| 8 | # Download a 3-classes example (with subclasses and subjects) from huttenhower.sph.harvard.edu |
| 9 | # It is a small subset of the HMP 16S dataset for finding biomarkers characterizing |
| 10 | # different level of oxygen availability in different bodysites |
| 11 | wget https://github.com/biobakery/biobakery/raw/master/demos/biobakery_demos/data/lefse/input/hmp_small_aerobiosis.txt -O hmp_aerobiosis_small.txt |
| 12 | |
| 13 | # As using LEfSe through bioconda, need to activate the LEfSe installation: |
| 14 | conda activate lefse |
| 15 | |
| 16 | # Running the LEfSe commands with -h gives the list of available options |
| 17 | |
| 18 | # lefse-format_input.py convert the input data matrix to the format for LEfSe. |
| 19 | # |
| 20 | # In this example we use the class information in the first line (-c 1) |
| 21 | # the subclass in the second line (-s 2) and the subject in the third (-u 3). |
| 22 | # If the subclass or the subject are not present in the data you need to set |
| 23 | # the value -1 for them. |
| 24 | # -o 1000000 scales the feature such that the sum (of the same taxonomic leve) |
| 25 | # is 1M: this is done only for obtaining more meaningful values for the LDA score |
| 26 | lefse_format_input.py hmp_aerobiosis_small.txt hmp_aerobiosis_small.in -c 1 -s 2 -u 3 -o 1000000 |
| 27 | |
| 28 | # run_lefse.py performs the actual statistica analysis |
| 29 | # |
| 30 | # Apply LEfSe on the formatted data producing the results (to be further processed |
| 31 | # for visualization with the other modules). The option available |
| 32 | # can be listed using the -h option |
| 33 | run_lefse.py hmp_aerobiosis_small.in hmp_aerobiosis_small.res |
| 34 | |
| 35 | # lefse_plot_res.py visualizes the output |
| 36 | # |
| 37 | # Plot the list of biomarkers with their effect size |
| 38 | # Severak graphical options are available for personalizing the output |
| 39 | lefse_plot_res.py hmp_aerobiosis_small.res hmp_aerobiosis_small.png |
| 40 | |
| 41 | # lefse_plot_cladogram.py visualizes the output on a hierarchical tree |
| 42 | # |
| 43 | # Plot the representation of the biomarkers on the hierarchical tree |
| 44 | # specified in the input data (using | in the name of the features) |
| 45 | # In this case we will obtain the RDP taxonomy. |
| 46 | # This is an early implementation of the module. I'm working on an improved version |
| 47 | # that will be released independently from LEfSe |
| 48 | lefse_plot_cladogram.py hmp_aerobiosis_small.res hmp_aerobiosis_small.cladogram.png --format png |
| 49 | |
| 50 | # Create a directory for storing the raw-data representation of the discovered biomarkers |
| 51 | mkdir biomarkers_raw_images |
| 52 | |
| 53 | # lefse_plot_features.py visualizes the raw-data features |
| 54 | # |
| 55 | # The module for exporting the raw-data representation of the features. |
| 56 | # With the default options we will obtain the images for all the features that are |
| 57 | # detected as biomarkers |
| 58 | lefse_plot_features.py hmp_aerobiosis_small.in hmp_aerobiosis_small.res biomarkers_raw_images/ |
| 59 | |
| 60 | ## Turn lefse back off |
| 61 | conda deactivate lefse |
| 62 | |
| 63 | ## bonus: seasonal greetings |
| 64 | # echo '~ Oíche Shamhna féile dhuit!' |