目录

  • 安装
  • 准备文件
    • karyotype
    • conf文件
  • 作图
    • 获取tutorial压缩包
    • 制作自己的第一个图

安装

利用conda安装circos是最简单的(perl安装各个依赖包的过程比较繁琐)

#创建虚拟环境
conda create -n circos python=3.7
#激活虚拟环境
conda activate circos
#安装circos
conda install -c bioconda circos
#测试circos
circos --modules

看到下面这些提示左侧全部为ok即可(按照以上步骤操作必然全部为ok)。

准备文件

karyotype

作图的必须文件之一,这个文件可以看作是一个坐标文件,圈图一般利用基因组为坐标进行作图,自然也可以用其他数据进行作图。
假如是利用conda安装的circos,那么你的karyotype需要位于我们的perl所在目录,比如利用which perl来确定perl所在目录,比如

(perl) [fanxuezhe@192 karyotype]$ which perl
~/anaconda3/envs/perl/bin/perl

那么就在~/anaconda3/envs/perl/bin中找到data目录,该目录就是将来karyotype文件存放的目录,到该目录下的karyotype文件夹下可以看到已经预定义好的karyotype文件

(perl) [fanxuezhe@192 karyotype]$ pwd
/home/fanxuezhe/anaconda3/envs/perl/data/karyotype
(perl) [fanxuezhe@192 karyotype]$ ls
assembly                          karyotype.chimp.pt4.txt              karyotype.human.hg16.txt  karyotype.mouse.mm9.txt    karyotype.sorghum.txt
chromosome.band.hg19.txt          karyotype.chimp.txt                  karyotype.human.hg17.txt  karyotype.mouse.txt        karyotype.yeast.txt
chromosome.band.hg38.txt          karyotype.drosophila.dm6.hires.txt   karyotype.human.hg18.txt  karyotype.oryzasativa.txt  karyotype.zeamays.txt
dm6.hires.txt                     karyotype.drosophila.dm6.lowres.txt  karyotype.human.hg19.txt  karyotype.rat.rn4.txt      parse.karyotype
dm6.lowres.txt                    karyotype.drosophila.hires.dm3.txt   karyotype.human.hg38.txt  karyotype.rat.txt          README
karyotype.arabidopsis.tair10.txt  karyotype.drosophila.lowres.dm3.txt  karyotype.human.txt       karyotype.rm.3.txt
karyotype.arabidopsis.txt         karyotype.drosophila.txt             karyotype.mouse.mm10.txt  karyotype.rm.txt

格式类似于

(perl) [fanxuezhe@192 karyotype]$ vim karyotype.human.txt
chr - hs1 1 0 249250621 chr1
chr - hs2 2 0 243199373 chr2
chr - hs3 3 0 198022430 chr3
chr - hs4 4 0 191154276 chr4
chr - hs5 5 0 180915260 chr5
chr - hs6 6 0 171115067 chr6
chr - hs7 7 0 159138663 chr7
chr - hs8 8 0 146364022 chr8
chr - hs9 9 0 141213431 chr9
chr - hs10 10 0 135534747 chr10
chr - hs11 11 0 135006516 chr11
chr - hs12 12 0 133851895 chr12
chr - hs13 13 0 115169878 chr13
chr - hs14 14 0 107349540 chr14
chr - hs15 15 0 102531392 chr15
chr - hs16 16 0 90354753 chr16
chr - hs17 17 0 81195210 chr17
chr - hs18 18 0 78077248 chr18
chr - hs19 19 0 59128983 chr19
chr - hs20 20 0 63025520 chr20
chr - hs21 21 0 48129895 chr21
chr - hs22 22 0 51304566 chr22
chr - hsX x 0 155270560 chrx
chr - hsY y 0 59373566 chry
band hs1 p36.33 p36.33 0 2300000 gneg
band hs1 p36.32 p36.32 2300000 5400000 gpos25
band hs1 p36.31 p36.31 5400000 7200000 gneg
band hs1 p36.23 p36.23 7200000 9200000 gpos25
band hs1 p36.22 p36.22 9200000 12700000 gneg
band hs1 p36.21 p36.21 12700000 16200000 gpos50
band hs1 p36.13 p36.13 16200000 20400000 gneg
band hs1 p36.12 p36.12 20400000 23900000 gpos25
band hs1 p36.11 p36.11 23900000 28000000 gneg
band hs1 p35.3 p35.3 28000000 30200000 gpos25
band hs1 p35.2 p35.2 30200000 32400000 gneg
band hs1 p35.1 p35.1 32400000 34600000 gpos25
band hs1 p34.3 p34.3 34600000 40100000 gneg
band hs1 p34.2 p34.2 40100000 44100000 gpos25

数据内容可以粗略分为两类,第一类为chr为起始的数据,这些数据表示染色体的数据。第二类为band表示染色体上的特定区域。对两类数据进行解释(文件是以空格为分隔符进行分隔的):
chr - hs1 1 0 249250621 chr1
chr表示染色体
hs1表示物种缩写加上染色体的编号(尽量用物种缩写,有多个物种便于区分,即使有一个用缩写也合理)
1表示染色体的编号
0表示染色体的起始位置
249250621表示染色体的结束位置
chr1表示染色体的染色(chr1对应的颜色在etc/colors.ucsc.conf中有定义,格式为rgb的染色)
例如:

chr1  = 153,102,0
chr2  = 102,102,0
chr3  = 153,153,30
chr4  = 204,0,0
chr5  = 255,0,0
chr6  = 255,0,204
chr7  = 255,204,204
chr8  = 255,153,0
chr9  = 255,204,0
chr10 = 255,255,0
chr11 = 204,255,0
chr12 = 0,255,0
chr13 = 53,128,0
chr14 = 0,0,204
chr15 = 102,153,255
chr16 = 153,204,255
chr17 = 0,255,255
chr18 = 204,255,255
chr19 = 153,0,204
chr20 = 204,51,255
chr21 = 204,153,255
chr22 = 102,102,102
chr23 = 153,153,153
chrX  = 153,153,153
chr24 = 204,204,204
chrY  = 204,204,204
chrM  = 204,204,153
chr0  = 204,204,153
chrUn = 121,204,61
chrNA = 255,255,255

我们也可以照葫芦画瓢定义自己的颜色

对band数据的解释
band hs1 p36.33 p36.33 0 2300000 gneg
band表示当前的数据是一个band,也就是染色体中的一部分
hs1表示当前band位于chr中定义的hs1染色体上
p36.33表示当前的染色体位置,将来可以选择是否显示在圈图上
p36.33表示当前的染色体位置,将来可以选择是否显示在圈图上
0表示当前band的起始位置
23000000表示当前band的结束位置
gneg表示颜色,同样在color.ucsc.conf中定义
注意
1.band之间不能发生重叠
2.band加和必须能够覆盖完整的染色体
比如
chr为0-10
band为0-5、5-10即可

conf文件

conf文件是用来对图形的各个元素以及形式进行控制的文件,conf文件可以实现对圈图更细粒度的控制。示例

# 1.1 MINIMUM CIRCOS CONFIGURATION
#
# This is a 'hello world' Circos tutorial.
#
# Only required configuration elements are included.
#
# Subsequent tutorials in this section build on this example to
# generate a representative image with common elements found in Circos
# figures in the literature.# Chromosome name, size and color definition
karyotype = data/karyotype/karyotype.human.txt# The <ideogram> block defines the position, size, labels and other
# properties of the segments on which data are drawn. These segments
# are usually chromosomes, but can be any integer axis.<ideogram><spacing>
# Spacing between ideograms. Suffix "r" denotes a relative value. It
# is relative to circle circumference (e.g. space is 0.5% of
# circumference).
default = 0.005r# You can increase the spacing between specific ideograms.
#<pairwise hsY;hs1>
#spacing = 20r
#</pairwise></spacing># Ideogram position, thickness and fill.
#
# Radial position within the image of the ideograms. This value is
# usually relative ("r" suffix).
radius           = 0.90r# Thickness of ideograms, which can be absolute (e.g. pixels, "p"
# suffix) or relative ("r" suffix). When relative, it is a fraction of
# image radius.
thickness        = 20p# Ideograms can be drawn as filled, outlined, or both. When filled,
# the color will be taken from the last field in the karyotype file,
# or set by chromosomes_colors. Color names are discussed in
#
# http://www.circos.ca/documentation/tutorials/configuration/configuration_files
#
# When stroke_thickness=0p or if the parameter is missing, the ideogram is
# has no outline and the value of stroke_color is not used.fill             = yes
stroke_color     = dgrey
stroke_thickness = 2p</ideogram>
################################################################
# The remaining content is standard and required. It is imported from
# default files in the Circos distribution.
#
# These should be present in every Circos configuration file and
# overridden as required. To see the content of these files,
# look in etc/ in the Circos distribution.
#
# It's best to include these files using relative paths. This way, the
# files if not found under your current directory will be drawn from
# the Circos distribution.
#
# As always, centralize all your inputs as much as possible.<image>
# Included from Circos distribution.
<<include etc/image.conf>>
</image># RGB/HSV/LCH color definitions, color lists, location of fonts, fill
# patterns. Included from Circos distribution.
#
# In older versions of Circos, colors, fonts and patterns were
# included individually. Now, this is done from a central file. Make
# sure that you're not importing these values twice.
#
# *** DO NOT DO THIS ***
# <colors>
# <<include etc/colors.conf>>
# <colors>
# **********************
<<include etc/colors_fonts_patterns.conf>># Debugging, I/O an dother system parameters
# Included from Circos distribution.
<<include etc/housekeeping.conf>>

解释:
1.利用karyotype=data/karyotype/*****.txt的方式来指定,data目录就是我们在karyotype中提到的data目录
2.<ideogram></ideogram>是一个xml格式的数据,利用这个区块来划分出图形的设定参数,比如这里设定了<spacing></spacing>也就是染色体之间的距离,0.005r表示利用周长的0.005倍作为间距。radius表示圈型的内径,thickness表示圈的厚度,厚度可以用p作为单位,也可用r半径作为相对单位。fill表示是否有填充颜色,stroke_color表示边框的颜色,stroke_thickness表示边框的厚度。
3.<image></image>表示图形的设置,比如图形的输出名称,图形的格式等等,这里引出一个重要的引用方法–include,这相当于将另一个文件中的信息放在此处。,另外几个include表达的也是这种含义。

作图

一开始跟着tutorial作图,能够很快的看到效果,提升成就感,并且在tutorial中的conf文件基础之上去修改能够简化很多设置。

获取tutorial压缩包

#获取最新的tutorial文件
wget  http://circos.ca/distribution/circos-tutorials-current.tgz
#解压
tar -zxvf circos-tutorials-current.tgz
#转移工作目录到tutorial之下
cd circos-tutorials-0.67/tutorials/
#查看所有文件
(perl) [fanxuezhe@192 tutorials]$ ls
0  1  10  2  3  4  5  6  7  8  9  circos.png  connectogram.tgz  makeimages
#这里的0,1,2,3....与官网的教程相对应

制作自己的第一个图

#转移工作目录到tutorial之下的1/1中
cd circos-tutorials-0.67/tutorials/1/1
#作图
circos -conf circos.conf

在执行命令的文件夹下会看到这样的图形,这个图形是人类的23个染色体的按顺序排列的形状,至此已经完成了第一张圈图

更加详细的排布后续在其他博客中继续更新

circos个人使用教程相关推荐

  1. 【工具】55种开源数据可视化工具简介

    工欲善其事必先利其器.本文对55个流行的数据可视化工具进行了简单的介绍,包括著名的D3.js.R.Gephi.Raphaël.Processing.js.Tableau Public.Google C ...

  2. 云课堂缺勤补签软件_GO柱状图绘图指南 | 云课堂(22)

    一直关注联川公众号的小伙伴们都知道,联川云平台已于2018年12月6日正式上线(http://www.lc-bio.cn/index.html): 还没使用过的小伙伴,赶紧点开大显身手一番~使用指南详 ...

  3. 【55种开源数据可视化工具简介】

    http://blog.csdn.net/tianxuzhang/article/details/44925777 大数据时代数据可视化成为理解和表达数据的有效甚至是唯一的手段. 工欲善其事必先利其器 ...

  4. Circos入门教程

    1 Circos简介 Circos是一个非常酷炫的基因组数据可视化软件,能够将基因组数据映射到环形的基因组坐标上,用相互嵌套的环道来展示基因组数据,还可以通过连接线来呈现基因组区块之间的关系.Circ ...

  5. python绘制分形图形教程_#python绘制分形图形教程#如何用Python绘制Circos图

    用Python实现Circos图的在线绘制的Circos有局限性,如对数据的要求.个性局限理速度等的问题,但如果你是一个Pythoneer或者喜欢用更加Pythonic的方式来个性化地绘制Circos ...

  6. 【茗创科技】最酷的脑功能连接图--Circos安装教程

    大家好,这里是 "茗创科技" .茗创科技专注于脑科学数据处理,涵盖(EEG/ERP, fMRI,结构像,DTI,ASL, ,FNIRS)等,欢迎留言讨论及转发推荐,也欢迎了解茗创科 ...

  7. 宏基因组实战10. 绘制圈图-Circos安装与使用

    前情提要 如果您在学习本教程中存在困难,可能因为缺少背景知识,建议先阅读本系列前期文章 宏基因组分析理论教程 微生物组入门圣经+宏基因组分析实操课程 1背景知识-Shell入门与本地blast实战 2 ...

  8. CIRCOS增加热图、点图、线图和区块属性

    生物信息学习的正确姿势 NGS系列文章包括NGS基础.转录组分析 (Nature重磅综述|关于RNA-seq你想知道的全在这).ChIP-seq分析 (ChIP-seq基本分析流程).单细胞测序分析  ...

  9. Record of circos usage

    欢迎关注天下博客:http://blog.genesino.com/2012/04/circos-usage/ Circos是绘制圈图的神器,在http://circos.ca/images/页面有很 ...

最新文章

  1. 打包phar文件过大的问题。
  2. 2016年3月12日广州开源社区巡讲活动
  3. 动态规划 dp05 插入乘号问题 c代码
  4. Matlab神经网络十讲(7): Adaptive Filter and Adaptive Training
  5. [单刷 APUE 系列] 第十四章——高级 I/O
  6. 上海师范大学计算机技术考研分数线,上海师范大学2019年考研复试分数线已公布...
  7. 一篇文章带你了解Python运算符重载
  8. Sql UNION 合并多个结果集并排序
  9. 同软件多个线程设置不同ip_IP数量不够该如何解决,快试试掘金网ip代理
  10. 【AAAI会议】三位教父上演神仙打架,Hinton吐槽CNN就是个“垃圾”
  11. 94. autoload
  12. Chrome谷歌浏览器登入指引
  13. python如何看字符串长度_Python如何查找字符串的长度?(代码示例)
  14. pytorch的vgg19的预训练模型提取图片特征
  15. 用123 组成的6位数 的java代码,输入一个三位的整数,计算其每位数字的累加之和。例如:输入整数123后,其每位数字累加之和为6(1+2+3),感激不尽...
  16. fan4801开关电源原理图_开关电源各模块原理实图讲解
  17. 网页代码优化html标签,通过优化网页HTML代码提高网页访问速度
  18. 拉普拉斯方程和泊松方程的MATLAB可视化
  19. Android 网速实时监听
  20. 图像修复 python_50.图像修复

热门文章

  1. 华为数通笔记-PPP
  2. CentOS 7 minimal安装完成之后安装图形界面
  3. 低延时直播系统开发技术方案
  4. js 详解es6 let TDZ(暂时性死区)
  5. 多功能日期查询小工具
  6. ASCII码值与字符的转换
  7. See Conf 悠鹤《蚂蚁庄园背后的技术与思考》笔记
  8. iphone相册储存空间已满_苹果iPhone手机存储空间满了怎么办以及解决方法
  9. 精益软件度量之读书笔记(一)度量和组织目标
  10. 官方教程之短视频app源码接入openinstall实现免填邀请码功能