Windows7 Circos 安装全记录

Windows7 Circos 安装全记录 

[原创 by nodexy@201408@SZ] 

 

目录

准备

安装

运行

最佳实践

 

正文

 

 

准备

=================================================

 

1. 下载安装perl 

访问 http://www.perl.org ,选择下载菜单,有两种版本的perl可供下载,strawberry perl和activestate perl,比如我们选择前者(推荐安装前者),则打开 http://strawberryperl.com/,根据自己的操作系统选择对应的32bit或64bit 。

 

这里我下的是32bit,下载地址是  http://strawberryperl.com/download/5.18.2.2/strawberry-perl-5.18.2.2-32bit.msi 

下载完成后双击打开安装,选择安装目录,下一步,完成;

建议安装在非C盘的目录,比如我们安装在 D:\bioviz\目录下 。

 

验证:

打开 windows 命令行窗口(cmd),输入 perl -v ,如果看到正确的perl版本信息,则说明安装成功。 

 

 

PS:

如果你下载的不是 .msi 安装文件,而是.zip,那么你可能需要自行添加或设置perl相关的环境变量,具体方法请自行google 。

 

 

 

2. 下载安装circos  

访问 http://circos.ca/ ,选择 software菜单,按照指示地址下载 circos,比如跳转到 http://circos.ca/software/download/ 并选择下载 http://circos.ca/distribution/circos-0.66.tgz 

 

这里有4个文件可供下载,分别介绍如下:

circos-course-0.67.tgzcircos课件,用于了解和学习circos,可选

circos-tools-0.18.tgzcircos辅助工具,比如用于chr排序,数据格式转换等,可选

circos-tutorials-0.66.tgzcircos教程,包含示例数据,配置文件等,可选

circos-0.66.tgzcircos程序,必须下载 

 

除了下载circos本身circos-0.66.tgz外,我们推荐下载 circos-tutorials-0.66.tgz,方便通过运行示例来了解学习circos 。

 

 

下载完成后,直接解压circos的压缩包即完成circos的安装,比如我们解压在 D:\bioviz\ 目录下 

 

 

 

安装

=================================================

1. 了解circos所需的perl模块

官网教程 http://circos.ca/tutorials/lessons/configuration/perl_and_modules/ 

 

至少需要下载安装的模块: 

Config::General (v2.50 or later)

Font::TTF

GD

List::MoreUtils

Math::Bezier

Math::Round

Math::VecStat

Params::Validate

Readonly

Regexp::Common

Set::IntSpan (v1.16 or later)

Text::Format

 

如果你在运行circos时遇到缺少模块的提示,那么还需要安装错误提示中的模块。

 

 

 

 

 

 

2.  下载安装perl模块

 

安装perl模块有很多办法,我们在此推荐直接下载和复制的方式,比如对于Config::General模块,

- 在 http://www.cpan.org/ 搜索并下载(一般是 xxx.tar.gz格式)

- 放置在 circos-0.66\lib 目录里即可 (放置在这里的好处是这些模块只供circos使用,不会与你的其他perl程序出现版本兼容问题)

- 比如Config::General模块,需要在lib里先创建 Config目录,然后复制General.pm进去 (建议直接将xxx.tar.gz压缩文件解压提取到lib目录,然后根据情况更改文件夹名称即可)

 

这种办法的好处是,不需要用户熟悉某个perl的模块管理器,并且可以方便地任意替换模块的版本,而无需使用工具回退或更新。

当然缺点就是需要一个个地搜索下载。

 

 

除了libgd和GD,其他perl模块都比较好安装,可以直接下载。为什么GD模块很特殊?因为GD模块的绘图需要调用OS的libgd C库,所以需要编译安装,无法直接下载预编译的版本;并且编译时需要支持circos需要的字体库和位图格式如PNG,JPEG等。

不管是在windows7还是linux或mac os,安装GD模块都稍微会麻烦一些,而这一步也是安装circos中最容易遇到各种错误的步骤。

 

庆幸的是,windows上安装GD相对是比较容易的;更加庆幸的是,最新的strawberry perl一般都已包含GD模块,可以直接使用。

如果你的系统还是需要安装GD,那么像其他模块一样,搜索下载GD模块的压缩包,解压,将GD文件夹和GD.pm分别拷贝到cicos的lib目录里。

然后你需要在运行circos过程中测试GD是否OK,如果报出GD相关错误,那么你可能需要重新安装GD模块。

你可以在GD文件夹的demos目录里,运行对应的perl脚本来测试GD库是否可以正常工作。

PS:

由于我们把perl模块安装在circos的lib,所以如果你使用perldoc 命令,是无法查看到circos lib里的perl模块的,只会查看到perl的原有模块。

所以在命令行下试试 perldoc GD ,你就可以知道自己的perl是否有GD模块了。

PS:

好奇的同学还是希望知道,除了这种全手动的安装方法外,还有什么方便的安装perl模块的方法,答案就是CPAN!

如果你已经安装好了perl,直接在windows命令行下输入 cpan,会进入 cpan> 模式,

输入 h 查看帮助信息和可用命令,输入 install Config::General 则可以安装 Config::General模块 。

如果你使用此方法,请确保你知道CPAN工具的工作过程,并且会卸载,会升级,会解决版本兼容性等问题。

 

3. 测试验证circos 

 

在 circos根目录  D:\bioviz\circos-0.66\ 执行 perl bin\circos 

如果给出的错误是缺少 circos.conf 配置文件等信息,则说明安装初步成功;

如果给出的错误是缺少默默模块,则需要继续安装缺少的模块,直到出现缺少配置文件的错误。

 

比如在不安装任何模块的时候运行circos,会给出下列错误:

 

D:\bioviz\circos-0.66>perl bin\circos

 

*** REQUIRED MODULE IS MISSING ***

 

You are missing the Perl module Config::General. Use CPAN to install it as described in th

is tutorial

 

http://www.circos.ca/documentation/tutorials/configuration/perl_and_modules

 

 

如果所需模块安装完成,则可能出现下列错误:

 

D:\bioviz\circos-0.66>perl bin\circos

debuggroup summary 0.21s welcome to circos v0.66 7 Apr 2014

debuggroup summary 0.21s guessing configuration file

 

  *** CIRCOS ERROR ***

 

  CONFIGURATION FILE ERROR

 

  Circos could not find the configuration file. To run Circos, you need to

  specify this file using the -conf flag. The configuration file contains all

  the parameters that define the image, including input files, image size,

  formatting, etc.

 

  If you do not use the -conf flag, Circos will attempt to look for a file

  circos.conf in several reasonable places such as . etc/ ../etc

 

  To see how configuration files work, create the example image, whose

  configuration and data are found in example/. From the Circos distribution

  directory,

 

      cd example

 

      ../bin/circos -conf ./circos.conf

 

  or use the 'run' script (UNIX only).

 

  Configuration files are described here

 

      http://circos.ca/tutorials/lessons/configuration/configuration_files/

 

  and the use of command-line flags, such as -conf, is described here

 

      http://circos.ca/tutorials/lessons/configuration/runtime_parameters/

 

  Windows users unfamiliar with Perl should read

 

      http://circos.ca/tutorials/lessons/configuration/unix_vs_windows/

 

  If you are having trouble debugging this error, first read the best practices

  tutorial for helpful tips that address many common problems

 

      http://www.circos.ca/documentation/tutorials/reference/best_practices

 

  The debugging facility is helpful to figure out what's happening under the

  hood

 

      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 D:/bioviz/circos-0.66/bin/../lib/Circos/Error.pm line 362.

        Circos::Error::fatal_error("configuration", "missing") called at D:/bioviz/

0.66/bin/../lib/Circos.pm line 195

        Circos::run("Circos") called at bin\circos line 300

 

D:\bioviz\circos-0.66>

 

 

 

运行

=================================================

1. 运行circos 教程中的例子 

 

cd D:\bioviz\circos-0.66\example\

perl ..\bin\circos -conf etc\circos.conf 

 

控制台会输出:

D:\bioviz\circos-0.66\example>perl ..\bin\circos -conf etc\circos.conf

debuggroup summary 0.21s welcome to circos v0.66 7 Apr 2014

debuggroup summary 0.21s loading configuration from file etc\circos.conf

debuggroup summary 0.21s found conf file etc\circos.conf

debuggroup summary 0.77s debug will appear for these features: summary

debuggroup summary 0.77s parsing karyotype and organizing ideograms

debuggroup summary 1.12s applying global and local scaling

debuggroup summary 1.26s allocating image, colors and brushes

debuggroup summary 8.21s drawing highlights and ideograms

debuggroup summary 12.15s found conf file D:\bioviz\circos-0.66\etc\tracks\link.conf

debuggroup summary 12.15s found conf file D:\bioviz\circos-0.66\etc\tracks\link.conf

debuggroup summary 12.16s found conf file D:\bioviz\circos-0.66\etc\tracks\highlight.co

debuggroup summary 12.16s found conf file D:\bioviz\circos-0.66\etc\tracks\highlight.co

debuggroup summary 12.16s found conf file D:\bioviz\circos-0.66\etc\tracks\text.conf

debuggroup summary 12.16s found conf file D:\bioviz\circos-0.66\etc\tracks\heatmap.conf

...... (这里省去大段的中间日志)

debuggroup summary 12.33s found conf file D:\bioviz\circos-0.66\etc\tracks\scatter.conf

debuggroup summary,output 12.98s generating output

debuggroup summary,output 13.74s created PNG image etc/circos.png (658 kb)

debuggroup summary,output 13.74s created SVG image etc/circos.svg (492 kb)

 

 

查看 etc/目录下是否有 circos.png 和 circos.svg,并且是刚刚创建的。 

 

 

2. 使用自己准备的数据运行 circos 

在 circos-0.66\ 目录下建立work子目录,在work目录建立 prj_human_001 子目录,在 prj_human_001目录分别建立 etc和data子目录。

 

etc目录存放配置文件,data 目录存放数据文件,分别构造好以后,在 prj_human_001目录里执行:

 

perl ..\..\bin\circos -conf etc\circos.conf   

 

 

最佳实践 

=================================================

1. 在windows7上尽量将perl,circos安装在非C盘的目录,安装路径中尽量不要包含空格等特殊字符;

 

2. 运行circos绘图之前,线规划好工作目录,建议在circos的根目录里创建work目录,并在work目录里按项目或任务创建子目录;在项目子目录分别创建 data , conf 和 output 目录,所以最终的目录结构大体如下:

 

D:\bioviz\circos-0.66\

|__bin 

|__data

|__error

|__etc

|__example 

|__fonts 

|__lib

|__tiles 

|__work\

      |__ prj_human_001

   |__etc

|__ circos.conf 

   |__data

      |__ prj_human_002

   |__etc

   |__data

      |__ prj_human_003

      |__ prj_......

 

 

 

3. 遇到各种诡异错误的时候,可以选择使用 --debug 参数打开调试模式,通过查看日志来排除错误。

 

 

4. 如果你希望跟其他circos用户交流,可以选择:

- 加入Q群  171307056  

- 关注微博  http://weibo.com/circos 

- 加入circos google group:   http://groups.google.com/group/circos-data-visualization  

 

5. 如果你也有不错的circos使用经验,欢迎分享:[email protected]   

 

# END 

猜你喜欢

转载自nodex.iteye.com/blog/2106479