Forum:Making a mac book Bioinfo ready (El Capitan)
7
4
Entering edit mode
5.6 years ago

One of our students just got a brand new mac book running El Capitan. She's having trouble updating gcc and installing things like wget and vcftools. I need to help her set up her mac book so that she can use it in a bioinfo role for 'light analyses', although the laptop is pretty powerful.

I know lots of you top bioinfo users on Biostars are using macs, so here is the question:

What is the first thing or two you would do to make a Mac Book ready for bioinfo software installation?

What about things like:

• Developer tools
• XCode
• Home Brew
• MacPorts
• Something else that is trendy (and VERY stable) right now?

It seems that over the years package managers for Macs have gone in and out of fashion rapidly, thus I do not know which way to go. That plus the fact that I have personally little experience being in the driving seats of Macs.

Thanks for your input!

EDIT

Marking Chris Miller's answer as correct, although I used pieces of many answers, including some from Twitter. We ended up installing Xcode then homebrew (+ coreutils, wget...) and Anaconda for Python.

We also used the link provided by RAM https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/

Works like a charm so far. Looking forward (well, not really) to see if this will break at the next system upgrade.

Thanks everyone for your suggestions!

mac software installation Forum • 2.9k views
ADD COMMENT
5
Entering edit mode
5.6 years ago

After installing homebrew, it's wise to install the unix coretools package, as there are subtle differences between the OSX and *nix versions that are annoying. For example, "sort -V" doesn't exist on mac, and "uniq" only considers the first 8kb of lines (which is terrifying!)

To fix those two specific issues:

brew install coreutils
#add these to your .bashrc, or .bash_aliases file
alias uniq=guniq
alias sort=gsort

ADD COMMENT
4
Entering edit mode

the tweet mentions 8k per line.

ADD REPLY
1
Entering edit mode

You're right, I mistyped. It's still scary!

ADD REPLY
1
Entering edit mode

Really good to know, I didn't know that about the Mac uniq command at all. Luckily I never used it on my Mac, always when I was remote in to a linux server. That is pretty terrifying.

But yeah, I think Xcode w/command-line tools and Homebrew pretty much covers it for your base install and configuration.

ADD REPLY
0
Entering edit mode

Crap, I've been using the wrong uniq and sort all this while!

ADD REPLY
3
Entering edit mode
5.6 years ago
DG 7.2k

If your student will be doing anything with Python I highly recommend using Anaconda or Miniconda for setting up different environments. I recommend this on Unix too of course but found it particularly useful with OS X too. Anaconda is bigger but has the advantage of including all sorts of other command-line tools and packages as part of it, while Miniconda is basically just a Python environment manager.

Another suggestion that is specific for bioinformatics would be to start using Bioconda for installing bioinformatics programs/packages. It leverages the advantages of the conda installer, which is open source, and there is a publicaly maintained repo for packages. For similar reasons to using a python environment manager, you can maintain environments to control (and switch between) installed package versions of bioinformatics software. Plus it makes installing some things very, very easy.

ADD COMMENT
3
Entering edit mode
5.6 years ago
John 13k

Everyone uses their computer differently (vim vs emacs!) and its no different on OSX, so this is really just my opinion:

To compile anything worthwhile, you need XCode and Command Line Developer tools, but before you can get that you'll need a Developer Account. https://developer.apple.com/xcode/download/ You don't need to be part of the Apple Developer Program (which is \$99 a year), but rumor has it that's about to change as Swift2 becomes more mature. This should really be the absolute first thing anyone does, since many things get linked to XCode's libs, so installing XCode later may mean reinstalling things later. Once both are installed you need to agree to the XCode licencing agreements, stipulating that Apple may call upon you to sacrifice your first born son as a test of your faith. You can do this from the terminal by running "sudo xcodebuild -license"

With that done, you should really get Macports and then Homebrew. Macports, in my experience, is a pain to install from source. Far better to install the precompiled package. If that doesn't work, reboot, sleep on it, and try installing it again later, rather than from source. Source should be the last option, as you can easily half-install Macports, and that will lead to a huge headache down the road. Installing Homebrew however is a piece of cake, provided your cool with executing whatever a webserver happens to reply with. Fortunately, unlike Macports, Homebrew doesn't require you to be root to install, (or install most things via it), so use of Homebrew is always recommended over Macports. Installing/Uninstalling is waaay easier in Homebrew, as is updating.

With those out of the way, I would next get xquartz, which is X11 for OSX. This is good if you want to use IGV/R from a remote machine with x-forwarding over ssh.

For programming languages/intepreters, it's always best NOT to use the system version and instead reinstall them in a virtual environment. There's many ways to do this but i'll go through doing it for Python:

1. sudo apt-get install python-dev # Just found out that this is an unmentioned dep. for pysam and htspython
2. sudo easy_install pip
3. sudo pip install virtualenv
4. mkdir /path/to/personal/python
5. virtualenv /path/to/personal/python
6. now would be a good time to also get pypy - python thats 3-4x faster than CPython. Do the same as the above but with a different dir and run virtualenv -p /path/to/pypy/download /path/to/personal/pypy.
7. To use your personal python run source /path/to/personal/python/bin/activate. For that terminal session (and other sessions after running source again), anything you install via /path/to/personal/python/bin/pip will not interfere with the OSX system python. Add the source command to your .bash_profile to do this automatically for every terminal. I think 'pip' and 'python' also get re-aliased to whatever is in /path/to/personal/python/bin/..., so it's like you never even notice the difference. I recommend doing this sort of process for any programming thing you use that might interfere with the system version.

I highly recommend Sublime Text 3 as an IDE/text editor. Its syntax highlighting is great, and its very fast/low memory. Currently free but maybe not once it's out of beta.

Keka is one of the best compress/decompressors, and its free.

iTerm is a great replacement for the default OSX terminal emulator. It has a cool quake3 style "visor" mode which is handy.

If you need to interact with Linux filesystems (ext) at any point, you'll need osxfuse. There are two packages, oszfuse and SSHFS. Make sure to install them in that order else there will be troubles :/

Quicksilver is another good helper program. It basically works like the locate command in linux (keeps a database of files and their locations on disk), and is significantly better than the OSX finder bar.

Github Desktop is nice, but a little buggy. Certainly looks nice though.

Thats pretty much all I can think of that OSX specific. Plenty of Bioinformatics things, but not really relevant for OSX.

ADD COMMENT
2
Entering edit mode

+1 for XQuartz. I despise them for renaming X11 and not hanging banners all over the world. I prefer TextWrangler for text editing. Is Sublime Text better?

Also, why MacPorts? Would homebrew not suffice?

ADD REPLY
2
Entering edit mode

I used TextWrangler a lot before Sublime. Honestly, i think TextWrangler is faster, and there are some things it does that Sublime doesn't do out of the box, but since Sublime is so very very pretty, a lot of people are writing add-ons to copy things all the other text editors have. You can, for example, ssh and edit a file on another machine all from inside Sublime. You can't print yet though :/

ADD REPLY
1
Entering edit mode

Hmmm. I think I'll stick to TextWrangler. I tried Sublime on Windows, but stuck with notepad++, so I don't see how it can be better than TextWrangler for me.

ADD REPLY
1
Entering edit mode

I used to use Sublime but then I forced myself to learn Emacs. I'm still not quite sure how to order ANSI standard pizza from Emacs but I'm pretty certain that I will not bother with any other editor again..

This really sold it to me:

emacs has possibly the greatest learning curve of any program you could bother to learn to use, and the greatest retention rate of those that fully learn it. It is almost guaranteed that if you become an emacs wizard, ten years from now you'll be using emacs for everything -- reading your mail and rss feeds, ordering pizzas, organizing your music collection, etc.

ADD REPLY
0
Entering edit mode

I never learned to use Emacs (because real programmers use butterflies), but im always weary when there's a high retention rate for something crazy difficult to pick up, like, for example, touch-typing on a DVORAK keyboard, tmux when you've been using screen, AngularJS, Twisted Python, etc. It could be less about inherent value and more about sunk cost fallacy. But i've never used emacs so I wouldn't know. I certainly didn't know you could check your e-mail with it. I will definitely look into it :)

ADD REPLY
1
Entering edit mode

The good part about emacs key bindings is that they're useful outside of emacs. I use them on both the Terminal app as well as on TextWrangler. YMMV, especially on Windows (ewww)

ADD REPLY
0
Entering edit mode

emacs is my go-to editor on the command prompt, but I want a GUI editor as well. That's where TextWrangler comes in.

ADD REPLY
0
Entering edit mode

Well, I use the GUI Emacs version, like this for OS X.

ADD REPLY
3
Entering edit mode
5.6 years ago

Other useful tools to install on a mac, off the top of my head:

• iTerm2, for a better terminal experience
• mosh, as a replacement for ssh that allows automatically resuming connections (best if used with screen or tmux)
• brew install hombrew/science/igv (for IGV genome browser)
ADD COMMENT
1
Entering edit mode

Doesn't mosh require a server-side component (which the users would not be able to install)? So on its own it may not be useful.

ADD REPLY
0
Entering edit mode

You're right, it does, but if you have admin privileges on your cluster (or lab's *nix workstation), you can install it there too. If not, harass your sysadmin. My only annoyance with mosh is that I didn't find it sooner - the amount of time it's saved me is ludicrous.

ADD REPLY
0
Entering edit mode

+1 for iTerm2 , its been much better experience for me past few months. Have been using it lately.

ADD REPLY
2
Entering edit mode
5.6 years ago
GenoMax 108k

Add "command line tools for Xcode" to the list.
Once you have gcc installed and working you should have a Mac ready for most bioinformatics software :-)

Originally had added that as a comment since it was a minor addition to your list.

"Command line tools for Xocde" include OS X SDK, headers, and build tools such as the Apple LLVM compiler and Make".

Steps to install the tools are here.

ADD COMMENT
2
Entering edit mode
5.6 years ago
Ram 34k
1. First up, install XCode.
2. Use this guide to install homebrew on Mac and prioritize GNU binaries over BSD binaries. Use prefixes if you must. Everything is better with GNU binaries.
3. Install git.
4. Use homebrew to install additional tools you need, such as bwa.
5. Create a ~/.bash_profile and use it to customize your bash command line defaults. I usually increase HISTORY size, add colors and create sections for user defined PATH variables that will appropriately append to the default PATH variables
6. Create an alias to run brew update && brew upgrade --all && brew doctor everytime you log-in.
7. Optionally, use apps such as iTerm2 instead of the Terminal app. Enable option key as Meta so Emacs shortcuts work fine on the command line.

Once you do this, you have the a Linux machine better than most personal Linux machines out there.

ADD COMMENT
2
Entering edit mode

Using the GNU binaries is a really really good point! :)

ADD REPLY
1
Entering edit mode

Makes us compatible with the rest of the world, and we can stop worrying about BSD's quirks.

ADD REPLY
0
Entering edit mode
5.6 years ago
morovatunc ▴ 470

Forgive my ignorance, did you try to install all these programs and couldnt make it ? Based on my experience, listing names should not be easy. Most of the time you will progress as you face with the problem.

For installing homebrew,

http://digitizor.com/install-homebrew-osx-el-capitan/ this link came up as the first result of the uncle google. This link also explains how to download Xcode. Once you download the home-brew, i believe most of your problems should be solved.

I am a mac user who did not upgrade to el capitan yet.

ADD COMMENT
0
Entering edit mode

I think this is more of a discussion than a question. I should probably move this to Forum.

ADD REPLY

Login before adding your answer.

Traffic: 2021 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6