引子
闲来无事,翻看CELL杂志,发现很多基因组的图都使用circos来作图,于是就去circos.ca网上看了一眼,发现果然是个基因组研究绘图强大工具,应该为生物信息员掌握。于是花了点时间,来试验它的每一个设置。上网搜索发现,它的中文资料少得可怜,于是将心得体会做一总结,形成这一系列教程。希望能对急于掌握circos又不擅长阅读英语的人有所帮助。--糗世界之糗糗
下载与安装
下载地址:http://circos.ca/software/download/circos/
circos是基于perl的脚本程序。它的安装难度在于安装好perl以及它所需要的模块。对于windows用户,可以试着安装Strawberry Perl或者ActiveState Perl。这两者都是不错的选择。对于Unix/linux/MacOS用户,很可能你已经安装了perl,否则,你可以到http://www.perl.org/get.html去下载安装。
我们需要测试一下perl的环境, UNIX/Linux/MacOS用户
> which perl /usr/bin/perl > perl -v This is perl, v5.10.0 built for ... |
Windows用户
> perl -v This is perl, v5.10.0 built for ... |
接着,我们将下载下来的circos程序解压,假设它的目录是circos-x.xx
> cd circos-x.xx > bin/circos -man |
你可能得到一个帮助页面,那么你安装circos已经成功。也可能得到是出错信息。
常见错误1:
-bash: /bin/env: No such file or directory |
对于MacOS用户或者遇到这一提示的用户的问题是,env的安装目录并非典型的/bin/env,而是/usr/bin/env。我们需要将env文件的位置设置正确。
> which env /usr/bin/env |
现在有两个解决办法,第一个是将所有bin/*或者tools/*/bin文件中第一行写有
#!/bin/env perl |
改成
#!/usr/bin/env perl |
第二个办法(可能更方便)是在bin下建立一个env文件的链接。
> cd /bin > sudo ln -s /usr/bin/env env |
常见错误2:
Can't locate Config/General.pm in @INC ... |
无论是什么pm文件,如果出现这类错误,那就说明相应的模块没有安装。Circos需要以下模块
Config::General (v2.50 or later) GD GD::Polyline List::MoreUtils Math::Bezier Math::Round Math::VecStat Params::Validate Readonly Regexp::Common Set::IntSpan (v1.16 or later)
如果是Window用户,Strawberry Perl和ActiveState Perl都有安装包管理程序,你可以很轻松的从CPAN安装上面的这些模块。如果是UNIX/Linux/MacOS用户,需要使用CPAN shell安装。
对于UNIX/Linux/MacOS用户,可以使用circos包中bin/test.modules来测试需要安装那些包
> cd bin > ./test.modules |
对提示有failed模块,我们进入shell安装。
> sudo perl -MCPAN -e shell #这里需要root权限,否则你有可能得到permission denied error > install Config::General #缺少什么模块就install什么模块,这里的Config::General只是个示例 |
或者你可以直接去CPAN上下载安装包,在本地解压并安装。比如Set::IntSpan
# download module > wget http://search.cpan.org/CPAN/authors/id/S/SW/SWMCD/Set-IntSpan-1.16.tar.gz # unpack archive > tar xvfz Set-IntSpan-1.16.tar.gz > cd Set-IntSpan-1.16 # configure and compile > perl Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for Set::IntSpan > make cp IntSpan.pm blib/lib/Set/IntSpan.pm Manifying blib/man3/Set::IntSpan.3 > make test » make test PERL_DL_NONLAZY=1 /home/martink/perl/5.10.0/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/binary.t .... ok t/bsearch.t ... ok ... t/spans.t ..... ok t/subclass.t .. ok t/unary.t ..... ok All tests successful. Files=18, Tests=1931, 0 wallclock secs ( 0.28 usr 0.03 sys + 0.36 cusr 0.06 csys = 0.73 CPU) Result: PASS # install (keep in mind file permission requirements, as described below) > make install |
对于Params::Validate,是使用Build system,
# download module > wget http://search.cpan.org/CPAN/authors/id/D/DR/DROLSKY/Params-Validate-0.95.tar.gz # unpack archive > tar xvfz Params-Validate-0.95.tar.gz > cd Params-Validate-0.95 # configure and compile > perl Build.PL Creating new 'MYMETA.yml' with configuration results Creating new 'Build' script for 'Params-Validate' version '0.95' > ./Build Building Params-Validate cc -Ic -I/home/martink/perl/5.10.0/lib/5.10.0/x86_64-linux/CORE -DXS_VERSION="0.95" -DVERSION="0.95" -fPIC -c -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -o lib/Params/Validate.o lib/Params/Validate.c ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/Params/Validate/Validate.bs') cc -shared -O2 -o blib/arch/auto/Params/Validate/Validate.so lib/Params/Validate.o > ./Build test t/01-validate.t ............ ok t/02-noop.t ................ ok t/03-attribute.t ........... ok ... t/30-hashref-alteration.t .. ok t/kwalitee.t ............... skipped: This test is only run for the module author t/pod-coverage.t ........... skipped: This test is only run for the module author t/pod.t .................... skipped: This test is only run for the module author All tests successful. Files=32, Tests=497, 1 wallclock secs ( 0.10 usr 0.04 sys + 0.78 cusr 0.13 csys = 1.05 CPU) Result: PASS # install (keep in mind file permission requirements, as described below) > ./Build install |
对于MacOS用户,如果提示
bash: make command not found |
那么你需要下载并安装Xcode
> which make /usr/bin/make |
对于MacOS用户,如果安装包的过程中出现困难,有些包怎么都无法安装,比如gd库,可以转换思想,使用port安装。
在下载安装好port之后,可以使用
> sudo port selfupdate > sudo port install perl5 > sudo port install p5.12-gd #注意现在的perl5是5.12版本,将来可能会变化,需要使用perl5 -v来确认 ... |
因为port安装是全新的版本,并没有替换掉之前的perl。所以需要对circos文件做出修改,所有bin/*或者tools/*/bin文件中第一行写有
#!/usr/bin/env perl |
改成
#!/usr/bin/env perl5 |
MacOS也可以使用brew来安装。
brew install perl brew link --overwrite perl brew install libgd sudo perl -MCPAN -e shell install GD Math::Bezier Params::Validate Math::VecStat Font::TTF::Font Clone Config::General GD::Polyline List::MoreUtils Math::Round Readonly Statistics::Basic Set::IntSpan Text::Format SVG Regexp::Common |
至此,你将成功地运行circus
qiuworld$ /path/to/circos/bin/circos -man CIRCOS(1) User Contributed Perl Documentation CIRCOS(1) NAME ____ _ / ___(_)_ __ ___ ___ ___ | | | | '__/ __/ _ \/ __| | |___| | | | (_| (_) \__ \ \____|_|_| \___\___/|___/ round is good circos - generate publication-quality, circularly-composited plots of data and annotations layered on chromosome ideograms SYNOPSIS circos -conf circos.conf [-silent] [-debug] [-help] [-man] DESCRIPTION This is a command line interface to Circos. Most settings are meant to be passed using a configuration file. All command line options listed below can be defined in the configuration file. Defining them on the command line is useful when using a configuration template for many images. OPTIONS Configuration -configfile FILE Name of configuration file. This is required. Ideograms -chromosomes STRING -chromosomes_order STRING -chromosomes_scale STRING -chromosomes_radius STRING Defines list, order, scale and radius of ideograms. Output Format -png -24bit -svg Toggles output of PNG and SVG files. When using transparency, make sure that PNG output is 24-bit. Output Paths -outputdir DIR -outputfile FILE Change the output directory and filename. Input Format -file_delim DELIMITER Specify the file delimiter for all input data files. By default this is a space. Use a tab if you want to have multi-word records in the data files (e.g. multi word labels). Custom Fields : |
您好,看了您的Circos的教程,所以想转载一下,不知是否可以,谢谢!
转载请注明出处,谢谢。
你好,请问,你文中说的Windows下Perl的Mod安装会有一个管理程序,但是我安装了草莓Perl,没有发现有管理程序,不知道要怎么安装Mod~望解答~
非常感谢!
你好,我刚安装了circos,草莓Perl下可以用 -MCPAN -e shell 指令下载Mod的。
你好,我在ubuntu上用新立得直接安装的circos,但运行circos -conf ./circos.conf时提示如下错误:
Config::General The file “etc/colors.ucsc.conf” does not exist within ConfigPath: /etc/circos…./etc./usr/bin/etc./usr/bin/../etc./usr/bin/…/usr/bin! at /usr/share/perl5/Circos/Configuration.pm line 382
请问如何解决?谢谢!
路径问题。请检查你的circos的运行路径是否在PATH变量中。
您好,我是perl初学者,恩问的可能是个有点傻的问题,刚刚完成了安装,但回过神来发现不知道安装的这些模块的目录,也不知道circos的执行文件所在目录,是在circos文件夹下的bin目录吗?需不需要另添加到环境变量?
circos会自己检测它们是否安装正确。你可通过http://perldoc.perl.org/perlfaq3.html#How-do-I-find-which-modules-are-installed-on-my-system%3f网页学到更多。
作者您好!我按您的方法检测circos是否正确安装,显示的是bin不是内部或外部命令,也不是可运行的程序或批处理文件
这是为什么呢?
另外我在按别的网站说用strawberry perl的client来安装各个module的时候,按着教程试着做,提示缺少statistics::basic 和 SVG模块,SVG模块我安装上了,但是statistics::basic怎么都装不上,在make的过程中不停重复,install那里说有一个解压失败,这是为什么?换了ActiveState Perl,把模块都装上了,就是出现我上面说的,没有正确安装。
谢谢!
安装问题我没有办法帮助您,因为这个原因非常多,我的perl的水平也有限。你最好求助身边的朋友。
在建立符号链接的这一段:
“对于MacOS用户或者遇到这一提示的用户的问题是,env的安装目录并非典型的/bin/env,而是/usr/bin/env。我们需要将env文件的位置设置正确。”
您用的命令是:
sudo ln -s /usr/bin/env env
我照着做了以后,还是会报错:-bash: /bin/env: No such file or directory
当我尝试这样建立符号链接时,错误就没有了,
sudo ln -s /usr/bin/env /bin/env
这句话是把符号链接建立在了路径:/bin中,
我的环境是Ubuntu12.04 32 的机器,博主知道这是为什么吗?谢谢
你不是在bin目录下操作的吧?
是在bin目录下进行的操作,符号链接已经建立好了,就是没效果,您可以看看这里,这是我的操作:http://media-cache-ec0.pinimg.com/originals/7b/ab/d7/7babd7914f10ccc06918331ca4dc3c2b.jpg
当我这样建立符号链接时:
sudo ln -s /usr/bin/env /bin/env
,就可以了,好奇怪啊
的确很奇怪啊。
操作如下:
root@x:/home/x/program/circos-0.67/bin# sudo ln -s /usr/bin/env env
root@x:/home/x/program/circos-0.67/bin# l
circos* env@ gddiag* list.modules* test.modules*
root@x:/home/x/program/circos-0.67/bin# cd ..
root@x:/home/x/program/circos-0.67# bin/circos -man
bash: bin/circos: /bin/env: 坏的解释器: 没有那个文件或目录
root@x:/home/x/program/circos-0.67# cd bin/
root@x:/home/x/program/circos-0.67/bin# sudo ln -s /usr/bin/env /bin/env
root@x:/home/x/program/circos-0.67/bin# circos -man
未找到 ‘circos’ 命令,您要输入的是否是:
命令 ‘circo’ 来自于包 ‘graphviz’ (main)
circos:未找到命令
root@x:/home/x/program/circos-0.67/bin# cd ..
root@x:/home/x/program/circos-0.67# bin/circos -modules
ok 1.20 Carp
ok 0.37 Clone
ok 2.56 Config::General
ok 3.36 Cwd
ok 2.130_02 Data::Dumper
ok 2.51 Digest::MD5
ok 2.82 File::Basename
你是在circos的bin里做的link,难怪。你需要做的是cd /bin。不过反正你做了sudo ln -s /usr/bin/env /bin/env.这样就可以了。
你试试where circos,看看能不能找到circos. 找不到的话,你可以export PATH=$PATH:~/program/circos-0.67/bin.
如果你要在~/program/circos-0.67/bin目录下操作的话,你需要使用./circos。
这些都是最基本的linux操作,可能你需要对linux再熟悉一点。
恩,好的,多谢:-D
你好,我安装好所需的模块以后执行
./circos -man
出现如下信息以及circos 的帮助文档,应该是不影响circos的使用:
You have an old groff. Update to version 1.20.1 for good Unicode support.
If you don’t upgrade, wide characters may come out oddly.
at /psc/program/install/perl-5.18.1/lib/5.18.1/Pod/Perldoc.pm line 1346.
You have an old groff. Update to version 1.20.1 for good Unicode support.
If you don’t upgrade, wide characters may come out oddly.
at /psc/program/install/perl-5.18.1/lib/5.18.1/Pod/Perldoc.pm line 1346.
后来按照README执行
../bin/circos -conf etc/circos.conf
报错:
Sort subroutine didn’t return single value at /psc/home/huanghuan/software/perl_module/circos-0.67/bin/../lib/Circos/Debug.pm line 143.
不知道是什么问题?是没有装好,还是配置的问题?谢谢
您好, 问题解决了,换了最新版的,就OK了
If no options are passed on the command line. The program will
attempt to autoconfigure itself with the gdlib-config program (present
in GD versions 2.0.27 or later). Otherwise it will prompt for these
values interactively.
Warning: No success on command[/usr/bin/perl Build.PL –installdirs site]
LDS/GD-2.56.tar.gz
/usr/bin/perl Build.PL –installdirs site — NOT OK
Running Build test
Make had some problems, won’t test
Running Build install
Make had some problems, won’t install
Failed during this command:
LDS/GD-2.56.tar.gz : writemakefile NO ‘/usr/bin/perl Build.PL –installdirs site’ returned status 512
安装GD模块时遇到这个问题,请问如何解决??
这个问题在我能力之外。请使用google的查找如何安装GD。
您好,感谢你的分享。根据您的文章所推荐的顺序,我执行了circos -modules这一步时,所有模块都是正常的。但在执行circos -man时总是显示“系统找不到指定的路径”,这是为什么呢。
这个错误有没有上下文?最好的全部的错误都发出来。