本文學習參考:
生信媛:https://mp.weixin.qq.com/s/qXDlKf7ut8QF2c5_0hiKpA
http://circos.ca/
circos 用于基因組圈圖。
circos是用perl寫的程序,依賴一些perl模塊实辑。安裝主要是GD等模塊的安裝堤撵。
circos常用參數(shù):
circos -conf circos.conf #運行軟件
常用參數(shù):
-version
-modules 檢測是否將所需的perl模塊都安裝上
-outputdir 設(shè)置輸出文件的路徑
-outputfile 設(shè)置輸出文件名的前綴
使用circos畫出基因組圈圖,(實例數(shù)據(jù)為水稻)齐板;需要準備的文件:
1.是karyotype.txt
第一列:通常為chr,是對染色體的描述;
第二列:通常為-霞势;
第三列:是染色體的ID;
第四列:染色體的標簽斑鸦,該值可以直接展示到圈圖上愕贡;
第五列:起始位置;
第六列:結(jié)束位置巷屿;
第七列:染色體或者band的顏色固以。
chr - Chr1 1 0 43270922 chr1
chr - Chr2 2 0 35937249 chr2
chr - Chr3 3 0 36413818 chr3
chr - Chr4 4 0 35502693 chr4
chr - Chr5 5 0 29958433 chr5
chr - Chr6 6 0 31248786 chr6
chr - Chr7 7 0 29697620 chr7
chr - Chr8 8 0 28443021 chr8
chr - Chr9 9 0 23012719 chr9
chr - Chr10 10 0 23207286 chr10
chr - Chr11 11 0 29021105 chr11
chr - Chr12 12 0 27531855 chr12
2.主配置文件(circos.conf)
<<include etc/colors_fonts_patterns.conf>>
<image>
<<include etc/image.conf>>
</image> #以上部分不需要修改的標準參數(shù)
karyotype = karyotype.txt
chromosomes_units = 1000000 #設(shè)置長度單位,一下設(shè)置表示為1M長度的序列代表為1u。
chromosomes_display_default = yes #默認是將所有的染色體都展示出來憨琳。
<ideogram>
<spacing> #設(shè)置圈圖中染色體之間的空隙大小诫钓,以下設(shè)置為每個空隙大小為周長的0.5%
default = 0.005r
</spacing>
radius = 0.80r #設(shè)定ideograms的位置,即在離圓心80%處
thickness = 6p #設(shè)定ideograms的厚度
fill = yes #設(shè)定dideograms是否填充顏色篙螟,顏色由karyotype最后一列決定
fill_color = deepskyblue
stroke_color = black #設(shè)定ideograms輪廓的顏色及其厚度
stroke_thickness = 1p
show_label = yes #設(shè)定是否顯示label,對應的是karyotype文件的第四列
label_font = light
label_radius = 1r + 110p #當顯示標簽的時候必須要有的參數(shù)尖坤,用來設(shè)定label的位置
label_size = 30
label_parallel = yes #設(shè)定label的字體方向,yes是易于瀏覽的方向
</ideogram>
show_ticks = yes #是否顯示標記闲擦,染色體刻度
show_tick_labels = yes
<ticks>
skip_first_label = no
skip_last_label = no
radius = dims(ideogram,radius_outer)
color = black #設(shè)定標簽顏色
thickness = 2p
size = 30p
multiplier = 1e-6
format = %.2f #label值的格式化方法慢味;%f結(jié)果為浮點數(shù),這個是表示結(jié)果為小數(shù)點后保留2位
#以下設(shè)定了2個ticks,前者為小刻度墅冷,后者是大刻度纯路。
<tick>
spacing = 2u #設(shè)定每個刻度代表的長度,其單位有u寞忿,即1u = chromosomes_units = 1000000.
size = 10p #設(shè)置tick的長度
show_label = no
thickness = 3p
</tick>
<tick> #此處設(shè)置的是大刻度
spacing = 10u
size = 20p
show_label = yes
label_size = 25p
label_offset = 10p #設(shè)置ticks' label離ticks的距離
format = %.2f
</tick>
</ticks>
###########以上即可顯示基因組的基本信息#########################
#####highlights還可以加上一些基因組的注釋信息等#######
<highlights>
z = 0
<highlight>
file = gene.gff3 #文件信息包括染色體位置驰唬,起始位置,終止位置
r0 = 0.90r #r0和r1代表這個圖形的起始和終止分別距離圓心的距離
r1 = 0.99r
fill_color = blue #即外圈注釋為藍色
</highlight>
<highlight>
file = transposon.gff3
r0 = 0.81r
r1 = 0.90r
fill_color = red
</highlight>
</highlights>
###################以下用于繪制圖形#############
<plots> ###此行一定要添加否則不能顯示直方圖等
<plot>
type = histogram
thickness = 1p
file = gc.histogram.txt ##該文件有四列腔彰,例子:Chr1 0 199999 0.4585
r1 = 0.57r #設(shè)置直方圖的位置叫编,r1要比r0大,默認方向向外
r0 = 0.48r
fill_color = red
orientation=out
<backgrounds> #設(shè)定直方圖的背景顏色
<background>
color=vvlgrey
</background>
</backgrounds>
</plot>
</plots>
<<include etc/housekeeping.conf>>
結(jié)果如下
circos.png