I found that installing the Circos package was a bit of a pain (especially in the newest version of OS X, El Capitan). So below I provide detailed, step-by-step setup instructions.
0. Enter bash shell
1. Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2. Be sure that Perl and make (Xcode) are installed
perl -v which make
If you need Perl
curl -L http://xrl.us/installperlosx | bash
If need you need make - install Xcode from app store with command line tools enabled 🙂
3. Download and install Circos
mkdir ~/Applications/circos/ cd ~/Applications/circos/ curl -L http://circos.ca/distribution/circos-0.67-7.tgz -o circos-0.67-7.tgz tar xvfz circos-0.67-pre4.tgz rm circos-0.67-7.tgz ln -s circos-0.67-7 current export PATH=~/Applications/circos/current/bin/:$PATH . ~/.bashrc
4. Try to run circos -modules (check for modules & instalation)
So, here is the problem with OS X you will probably get this error:
bash: /Users/Aidan/Applications/circos/current/bin/circos: /bin/env: bad interpreter: No such file or directory
If you have an earlier version of OS X, you can fix this error by runing the following commands [administrator password is required].
sudo su cd /bin ln -s /usr/bin/env env exit
If, however, you have El Capitan, you will find those commands don't work. This is because Apple decided they didn't want the end user messing around with the /bin directory. Fortunately, there are two work arounds if you are comfortable with Perl (and unix) then it might be easiest to just change the first line of the scripts
Alternatively, you can hack this new OS X "rootless" feature as follows. The proper way to disable the "rootless" mode, a.k.a. System Integrity Protection (SIP), is to boot temporarily into recovery mode by restarting and holding Command+R during boot. Once you're there, fire up a terminal window via the menu of the installer that launches in recovery mode. Type the following command
You can then shutdown and re-boot normally. This process can be reversed using
csrutil enable from the recovery terminal, should you want to reinstate SIP.
5. Install missing Perl modules
cd ~/Applications/circos/current/bin/circos ./circos -modules
Take note of the modules that are listed as missing. You can copy-paste them into a text edit file for reference during the next few steps.
Use CPAN to install and update modules
perl -MCPAN -e shell
Be sure to answer yes to everything if this is your first time using CPAN
at cpan consol, first update cpan:
install CPAN install Math::Bezier
Do this (substituting
Math::Bezier) for every perl package you're missing. After installing all missing packages leave the cpan terminal by typing
IMPORTANT - if
GD::Polyline is missing, you must install
libgd before installing GD
You can install libgd using the following bash command (outside of cpan).
brew install libgd
After you've got that squared away, go back to CPAN and install GD
perl -MCPAN -e shell install GD install GD::Polyline exit
Finally, test your installation! If you added circos to your path, it should just work. Otherwise don't forget to pass the full path
~/Applications/circos/current/bin/circos in order to run circos.
I hope this helps and good luck writing your circos scripts!