install and commands

1,258 views
Skip to first unread message

Robert P

unread,
Sep 13, 2017, 11:37:37 AM9/13/17
to LEfSe-users
UNIX newbie here.  I have been running LEfSE on Galaxy (very nice - thanks so much for that service!) but I would like to run it locally now.  I think I can install LEfSE as a standalone (without installing Biobakery using homebrew, correct?  But neither the standalone or Biobakery provide a GUI or web-based interface, correct?  I am not a command-line person.  How much of that stuff do I need to know to get LEfSE to run locally?

jfg

unread,
Sep 13, 2017, 12:20:32 PM9/13/17
to LEfSe-users
Hey Robert,

   There are a number of ways to install LEfSe locally, and it's much less hassle to run. 

Easiest way: just download it from nsegata's bitbucket:

I'm sure homebrew works perfectly well, but I installed LEfSe using mercurial (click for a longer intro): to do this, first open up a terminal (i.e. command line) window and install git (you may need to be admin etc) by typing:
sudo apt-get update
sudo apt-get install mercurial
then let apt-get do what it wants to do (say yes if it asks)...

When it's finished and you're back in control: go to the folder you want to "install" LEfSe in: this just means the folder you want to keep the files in, and it can be deleted when you don't need LEfSe anymore. It could be something like a folder on your desktop called 'programs', and could have a path (location) like: /home/robertp/Desktop/programs. In your terminal window, navigate to that folder by typing:
cd /home/robertp/Desktop/programs
then, copy LEfSe to that location using git by typing:
hg clone https://bitbucket.org/nsegata/lefse/

Pointers:
  • You'll need R to run LEfSE, so make sure that's set up and working - definitely worth having!
  • Have a look at the run.sh file in the 'example' folder: Nicola has done a nice job of explaining almost everything in there. To explore the options for each command, add '-h' to the end of your command: e.g. make_input.py -h : this will give you a text output that will make things a little clearer.
  • Pay special attention to the format of the example dataset file: correct format make all the difference. 
  • Also, you may need to put 'python2.7' in front of your lefse commands (ending in .py): - 
  • FInally, I never got the individual feature graph-plots to work - so good luck with that! 
I've attached an example workflow (four commands!) to this post that you can check & adapt yourself.


best
jfg
lefse_exemplar.txt

Robert P

unread,
Sep 14, 2017, 12:41:36 PM9/14/17
to LEfSe-users
Wow - extensive and illuminating!  Thanks!  

Leah Reshef

unread,
Sep 24, 2017, 9:30:33 AM9/24/17
to LEfSe-users
Thanks, this is very helpful!
Could you possibly demonstrate how to run this from a Windowns Merucrial installation (they recommend TortoiseHG Workbench, am having trouble figuring it out..)

jfg

unread,
Oct 17, 2017, 12:32:40 PM10/17/17
to LEfSe-users
Leah, 

   Sorry for the slow reply. There's a lot in the TortoiseHg intro, so it can be hard to find the section you need in order to just 'install something': it's in section 4.8, 'Fetching from the Group Repository'. 

   Also, TortoiseHg is just for installing and updating LEfSe (and other programs). To actually run LEfSe on Windows we need to have python2.7numpyand R at least (I think). Describing how to install those has been done elsewhere (see linked) so if you need to get those too, a little internet crawling should get you where you need to be. If you can access a linux computer, it may already have these or be easier to install to: I would advise doing so if you can. If you can't, it'll take a little longer but you'll get there!


I N S T A L L I N G 
  Mercurial is a program for managing/installing programs (like LEfSe) using the command line (CLI) and your keyboard. You can use mercurial to install LefSe. You could install mercurial following the instructions from the mercurial website, and then probably install and do a LEfSe as described above if you can work your keyboard okay.

   TortoiseHg (click for better intro) is a graphical point-and-click adventure interface for using Mercurial to install the same programs using your mouse instead (i.e. GUI). 

   To install Mercurial and TortoiseHg onto a windows machine, and then install LEfSe
  • Open TortoiseHg Workbench from the Start menu and go File > Clone repository....

OR:

  • right click in your lefse folder and select 'Clone...' in the menu that pops up
    • In the new 'Clone' window that opens, enter the location of your lefse folder (e.g. C:\Users\Leah\Desktop\lefse)
    • Enter the address of NSegata's LEfSe repository: https://bitbucket.org/nsegata/lefse/
    • Then click Options, make sure 'Do not update the new working directory' is unchecked.
    • Finally click clone. This should copy LEfSe to your folder in a way that makes it easy to use, and if you have HgWorkbench open you'll see it show up in a sidebar.. 



R U N N I N G    L E f S e   O N   W I N D O W S

You'll need to use python and have it in your path so your computer can use it to run LEfSe - see above. 

Once you've gotten to this stage, the commands are the same as in the post above (the commands are in python and python should work more-or-less the same in windows, mac and linux).  





PS: Additionally, can I point out that at a number of places in the first post I mention 'git' (i.e.: 'install git ', 'copy LEfSe to that location using git') when I mean mercurial. Git is, among other things, a different program for managing installations but I didn't use it above. 

  -  -  -  -  -
PhD guy, Bioenergy & Biofuels Research Group
412a School of Microbiology
University College Cork
p :: 086 349 1828

Leah Reshef

unread,
Oct 26, 2017, 6:04:10 AM10/26/17
to LEfSe-users

Thanks jfg. 
 Your explanations are invaluable! In fact they should be pinned.
I did indeed get lost in the murky depths of tortiosehg tutorials. In the meanwhile have been experimenting with Docker, and if i can solve the mounting problem (have raised that in a separate issue ) that'll do it for me. But its great to have this option outlined too.
BTW I do have access to a linux server, but was also searching for a quick&easy windows based solution to which I can direct other  people and students I work with. 
Best
Leah
Reply all
Reply to author
Forward
0 new messages