A short post about installing Circos on Ubuntu, other Linux distributions and on Windows.
Note: if you are using Ubuntu, the location of the env program is in /usr/bin/env. The gddiag and circos programs, use /bin/env, so when you run gddiag it gives a bad interpreter error. Change the first line to #!/usr/bin/perl for both the gddiag and circos programs.
Installing Circos on Ubuntu
cat /etc/lsb-release #DISTRIB_ID=Ubuntu #DISTRIB_RELEASE=12.04 #DISTRIB_CODENAME=precise #DISTRIB_DESCRIPTION="Ubuntu 12.04 LTS" wget http://circos.ca/distribution/circos-0.64.tgz sudo cpan App::cpanminus #change directory into where you unzipped circos and then the bin directory cd circos-0.60/bin test.modules > toget cat toget | grep -v "^ok" #fail Config::General is not usable (it or a sub-module is missing) #fail Font::TTF::Font is not usable (it or a sub-module is missing) #fail GD is not usable (it or a sub-module is missing) #fail GD::Image is not usable (it or a sub-module is missing) #fail GD::Polyline is not usable (it or a sub-module is missing) #fail Math::Bezier is not usable (it or a sub-module is missing) #fail Math::VecStat is not usable (it or a sub-module is missing) #fail Readonly is not usable (it or a sub-module is missing) #fail Regexp::Common is not usable (it or a sub-module is missing) #fail Set::IntSpan is not usable (it or a sub-module is missing) #fail Text::Format is not usable (it or a sub-module is missing) sudo cpanm Config::General sudo cpanm Font::TTF::Font sudo cpanm GD sudo cpanm GD::Image sudo cpanm GD::Polyline sudo cpanm Math::VecStat sudo cpanm Readonly sudo cpanm Regexp::Common sudo cpanm Text::Format sudo cpanm Math::Bezier sudo cpanm Set::IntSpan test.modules | grep ^fail fail GD is not usable (it or a sub-module is missing) fail GD::Image is not usable (it or a sub-module is missing) fail GD::Polyline is not usable (it or a sub-module is missing) sudo apt-get -y install libgd2-xpm-dev build-essential sudo cpanm GD sudo cpanm GD::Image sudo cpanm GD::Polyline #all modules should be installed now test.modules | grep "^fail" #test GD gddiag #see if gddiag.png looks the same as the image at http://www.circos.ca/tutorials/lessons/configuration/png_output/images #But I was still getting an error about error/configuration.missing.txt circos #debuggroup conf 0.09s welcome to circos v0.60 4 May 2012 #debuggroup conf 0.09s guessing configuration file # # *** CIRCOS ERROR *** # # CONFIGURATION FILE ERROR # ...error text from [error/configuration.missing.txt] could not be read... # If you are having trouble debugging this error, use this tutorial to learn how # to use the debugging facility # http://www.circos.ca/tutorials/lessons/configuration/debugging # If you're still stumped, get support in the Circos Google Group # http://groups.google.com/group/circos-data-visualization # Stack trace: # at /home/tan118/src/circos-0.60/bin/../lib/Circos/Error.pm line 325 # Circos::Error::fatal_error('configuration', 'missing') called at /home/tan118/src/circos-0.60/bin/../lib/#Circos.pm line 152 # Circos::run('Circos') called at bin/circos line 232 #I wrote to the author of Circos and turns out that #the configuration.missing.txt file is missing in the tarball #download the file and put it inside the error directory wget http://davetang.org/file/configuration.missing.txt mv configuration.missing.txt error #In retrospect, the missing file above wouldn't have been a problem #i.e. you could still run Circos if you gave it the right parameters #However I wasn't sure what the error message: #...error text from [error/configuration.missing.txt] could not be read... #meant
Installing Circos on other Linux distributions
The easiest way to install Perl modules without administrator rights is to use ActivePerl; download it at http://www.activestate.com/activeperl/downloads. Once downloaded just run the shell script, install.sh, and follow the instructions.
To install Perl modules using ActiveState, use ppm. Here were the missing modules that I needed to install:
ppm install Config::General ppm install Font::TTF::Font ppm install Math::Bezier ppm install Math::Round ppm install Math::VecStat ppm install Params::Validate ppm install Regexp::Common ppm install Set::IntSpan ppm install Text::Format
Now if I run test.modules, all the modules are available.
To test if everything is working correctly, use the "run" script in the example folder, which should output a png and svg file that looks like this:
And on Windows
- Install ActivePerl
- Install cygwin
Now open up a cygwin terminal and extract the tarball:
tar -xzf circos-0.64.tgz cd bin test.modules ok Carp ok Clone fail Config::General is not usable (it or a sub-module is missing) ok Cwd ok Data::Dumper ok Digest::MD5 ok File::Basename ok File::Spec::Functions ok File::Temp ok FindBin fail Font::TTF::Font is not usable (it or a sub-module is missing) ok GD ok GD::Image ok Getopt::Long ok IO::File ok List::MoreUtils ok List::Util fail Math::Round is not usable (it or a sub-module is missing) fail Math::VecStat is not usable (it or a sub-module is missing) ok Memoize fail Params::Validate is not usable (it or a sub-module is missing) ok Pod::Usage ok POSIX ok Readonly fail Regexp::Common is not usable (it or a sub-module is missing) ok Storable ok Sys::Hostname ok Text::Balanced fail Text::Format is not usable (it or a sub-module is missing) ok Time::HiRes
The easiest way to install those missing packages is to open up the Perl Package Manager; it's not the fastest way but it's the least complicated (because cygwin has its own ppm and it conflicts with the ActivePerl ppm). After searching and installing the missing packages:
test.modules ok Carp ok Clone ok Config::General ok Cwd ok Data::Dumper ok Digest::MD5 ok File::Basename ok File::Spec::Functions ok File::Temp ok FindBin ok Font::TTF::Font ok GD ok GD::Image ok Getopt::Long ok IO::File ok List::MoreUtils ok List::Util ok Math::Round ok Math::VecStat ok Memoize ok Params::Validate ok Pod::Usage ok POSIX ok Readonly ok Regexp::Common ok Storable ok Sys::Hostname ok Text::Balanced ok Text::Format ok Time::HiRes #now cd into the example folder and run the script called "run" #the run.out file will tell you that you're missing several other packages #install those as well as per above using the Package Manager #for example this is the last missing package cat run.out *** REQUIRED MODULE IS MISSING *** You are missing the Perl module Set::IntSpan. Use CPAN to install it as described in this tutorial http://www.circos.ca/documentation/tutorials/configuration/perl_and_modules #now if you run "run" you should be able to generate the png file as above run
More information

This work is licensed under a Creative Commons
Attribution 4.0 International License.
Hi,
After install every things, but it did not run at all even test
gddiag or ./gddiag
run or ./run
bash: ./circos: /bin/env: bad interpreter: No such file or directory
how to solve this problem?
Thanks,
WW
Hi William,
What operating system are you running this on?
How did you install Circos?
Cheers,
Dave
I’ll go ahead and guess that this is a mac user. Reading your note, in red at the top, fixes this problem. It could use a separation of ” #!/usr/bin/perl ” from the word “for”.
beautiful, thanks! i worked through this once but it is easier reading from a script.
in the ubuntu section you could add:
for c in `cat toget | grep -v “^ok” | cut -d” ” -f2` ; do sudo cpanm `echo $c` ; done
to automate running through the “sudo cpanm ___” lines
Hi Ryan,
Thanks for the tip. I think you don’t need the backticks and the echo command, just
do sudo cpanm $c;
should do.
Cheers,
Dave
Thank you very much! =)
I needed install others lines (SO: Red Hat Enterprise Linux)
sudo cpanm GD::Text::Wrap;
sudo cpanm GD::Graph::boxplot;
sudo cpanm Statistics::KernelEstimation;
sudo cpanm GD::Graph::lines;
sudo cpanm Text::NSP::Measures::2D::Fisher::left;
sudo cpanm Statistics::Multtest;
Glad you got it working π
I tried installing perl Modules using CYGWIN. Example is not running. There is neither error message getting displayed nor output. Also, while testing GD and Params modules , it says failed. Though it has been installed successfully.
Kindly help me out.
If you write down the exact steps of what you did, the exact error message and email the official mailing list (circos-data-visualization at googlegroups.com), I am sure someone more qualified than me can help you.
You are my hero! π Seriously, I have learnt a lot from you π Keep up the good work!
Thanks! Comments like these keep me motivated π Glad you have found the site useful π
I have installed circos ubuntu 14 latest version using ubuntu software center > circos > install
I want to make plot of fusion between two genes
my desired genes are: chr2 184472606 Gene-AC074182.1 chr2 174973789 CACYBP
I hope to see a normal circos plot conecting a line from chr2 to chr1.
can you help me.. I got trouble making this simple plot.
Thank you in advance
Hi,
if you go through this tutorial, which is quite short, you should be able to produce what you want.
Cheers,
Dave
Hi,
I am struggling with the installation on windows. I extracted the tarball using WinRar and then just set the working directory to bin. I know the test.modules file is in there, because I can open up the directory manually and see it. But when I type “test.modules” into the cygwin terminal, I get this:
Nick@NB****** /cygdrive/c/Users/Nick/Downloads/circos-0.67-7/bin
$ test.modules
-bash: test.modules: command not found
I have no experience with cygwin, just trying to follow your blog. I’ve made plots with circos via their online site, but I want to download it to create more unique ones. Thanks for the help –Nick
Try this using cygwin:
Davo–thank you so much for the fast reply! I attempted what you said and this is what it gave me:
Nick@NB****** ~
$ cd /cygdrive/c/Users/Nick/Downloads/circos-0.67-7/bin
Nick@NB****** /cygdrive/c/Users/Nick/Downloads/circos-0.67-7/bin
$ chmod 755 test.modules
Nick@NB****** /cygdrive/c/Users/Nick/Downloads/circos-0.67-7/bin
$ ./test.modules
Circos can now list its own modules.
> circos -modules
I guess I was anticipating to be given a list of with either “OK” or “FAIL” by them, like in your example. I installed a long list of modules using the command prompt: perl -MCPAN -e shell, and was hoping they would pop up. I also attempted typing in modules or circos -modules to call the output but it just gave more bash: ….
Also I am operating with windows 8.1. Thank you for the help, I wish this could be installed through R instead of having to use cygwin and perl. –Nick
Don’t despair π There’s a R Circos package, which you can try: http://cran.r-project.org/web/packages/RCircos/RCircos.pdf
Wow….you are the man!! Your blog has been a must follow in my attempts to understand bioinformatics–thank you so much for the help! What a simple solution, glad I added that extra line at the end! –Nick
I find that RCircos is much lacking when you get into really complex plots, although it works fine for the most basic curved barplots. I found touching them up in Illustrator to be more difficult too.
It’s annoying that ./test.modules no longer works in the most recent versions of Circos. In fact it’s not even clear to me why they keep that file there — if you look at it, literally all it does is print out what you showed here, but doing ./circos -modules in the same directory does nothing.
What I found was a solution — for me — is to download an older version here ( http://circos.ca/software/download/circos/) like 0.64, then run the .test_modules on that old version. Once they’re installed (and I know which ones to install) then the newer 0.67 works fine. I’m on a Mac and have now installed this on several computers but hoo boy it’s not straightforward. Good luck getting GD to install properly!