地址 http://blog.sciencenet.cn/blog-442719-758821.html
引子
闲来无事,翻看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 ifyour 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 |
至此,你将成功地运行circos
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: |
http://pgfe.umassmed.edu/ou/archives/2513
http://blog.sciencenet.cn/blog-442719-758821.html 此文来自科学网黄顺谋博客