plots
這個(gè)block 中府蛇,支持許多的圖表類型判帮,scatter plot
是最常用的一種轨奄。用法如下:
關(guān)于file
文件的內(nèi)容净宵,在之前的文章中已經(jīng)詳細(xì)介紹過(guò)敲才。r0
和r1
定義圓環(huán)的位置,max
和min
定義y軸的最小值和最大值择葡,剩余的幾個(gè)參數(shù)控制散點(diǎn)的外觀紧武。
glyph
表示點(diǎn)的形狀,circle
代表圓形敏储,triangle
代表三角形阻星,rectangle
代表矩形;glyph_size
控制點(diǎn)的大幸烟怼妥箕;fill_color
控制點(diǎn)的填充色,stroke_color
控制邊框的顏色更舞。
關(guān)于scatter plot
, 在軟件的安裝目錄下畦幢,有對(duì)應(yīng)的默認(rèn)配置
etc/tracks/scatter.conf
oritenation
表示方向,in
表示從r0到r1, out
表示從r1到r0
在plot
中疏哗,可以插入backgrounds
, axes
, rules
3種block
1. backgrounds
用法如下:
backgrounds
定義背景色呛讲,每個(gè)定義一個(gè)區(qū)域的背景色禾怠,這個(gè)區(qū)域由y0
和y1
定義返奉。
在plot
中贝搁, max
和min
分別定義了y軸的最大值和最小值,這里的y0
和y1
對(duì)應(yīng)的就是y軸的值芽偏;y0
代表起始位置雷逆,y1
代表終止位置;如果只指定了y0
和y1
中的一個(gè)污尉,需要參考鄰近區(qū)域和max,min的值作出判斷
在上圖的第一個(gè)background
中膀哲,只指定了y0 = 0.006
,從其他結(jié)果background
的設(shè)置可以推測(cè)出,此時(shí)的y1 = max
;
上面的例子中被碗,根據(jù)y軸的值劃分了3個(gè)區(qū)域某宪,定義了3種不同 的背景色
min到0.002,背景色為
vvlred
0.002到0.006锐朴,背景色為
vlgrey
0.006到max, 背景色為
vvlgreen
2. axes
用法如下:
axes
定義y軸的刻度線兴喂,由多個(gè)axis
構(gòu)成。和backgrounds
一樣焚志,根據(jù)y0
和y1
定義區(qū)域衣迷,spacing
定義刻度線的間隔。
刻度線的外觀由thickness
和color
兩個(gè)參數(shù)控制酱酬,thickness
控制線條的粗細(xì)程度壶谒,color
控制線條的顏色。
3. rules
用法如下:
rules
代表規(guī)則膳沽,由多個(gè)rule
構(gòu)成汗菜;在每個(gè)rule
中,conditioon
設(shè)置規(guī)則挑社,var(value) > 0.006
表示 y軸的值大于0.006呵俏,當(dāng)滿足這個(gè)條件時(shí),執(zhí)行rule
中的其他語(yǔ)句滔灶,下面的示例中普碎,調(diào)整了value > 0.006
的點(diǎn)的外觀。
最后看一個(gè)實(shí)例
這張圖中录平,除了染色體的圓環(huán)外麻车,還有3圈圓環(huán),每一個(gè)圓環(huán)都是一張scatter plot
, 而且都設(shè)置了背景色和刻度線斗这。
結(jié)合整幅圖的結(jié)構(gòu)和散點(diǎn)圖的用法动猬,理解下面的配置文件就非常簡(jiǎn)單了
<<include colors_fonts_patterns.conf>>
<<include ideogram.conf>>
<<include ticks.conf>>
<image>
<<include etc/image.conf>>
</image>
karyotype ? = data/karyotype/karyotype.human.txt
chromosomes_units = 1000000
chromosomes ? ? ? = hs1;hs2;hs3
chromosomes_display_default = no
################################################################
#
# define 3 scatter plots, using the same data file
#
<plots>
# all are scatter plots
type ? ? ? ? ? ? = scatter
stroke_thickness = 1
# first plot shows all points and selectively formats points at small/large
# y-axis values to be red/green and triangles/rectangles
<plot>
file ? ? ? ? ? ? = data/6/snp.density.txt
fill_color ? ? ? = grey
stroke_color ? ? = black
glyph ? ? ? ? ? ?= circle
glyph_size ? ? ? = 10
max ? = 0.013
min ? = 0
r1 ? ?= 0.95r
r0 ? ?= 0.65r
# optional y0/y1 values (absolute or relative) in <background> blocks
# define the start/end limits of background color
#
# y0 = 0.006
# y0 = 0.75r
<backgrounds>
<background>
color ? ? = vvlgreen
y0 ? ? ? ?= 0.006
</background>
<background>
color ? ? = vlgrey
y1 ? ? ? ?= 0.006
y0 ? ? ? ?= 0.002
</background>
<background>
color ? ? = vvlred
y1 ? ? ? ?= 0.002
</background>
</backgrounds>
<axes>
<axis>
color ? ? = lgreen
thickness = 1
spacing ? = 0.05r
y0 ? ? ? ?= 0.006
</axis>
<axis>
color ? ? = dgreen
thickness = 2
spacing ? = 0.1r
y0 ? ? ? ?= 0.006
</axis>
<axis>
color ? ? = lgrey
thickness = 1
spacing ? = 0.05r
y1 ? ? ? ?= 0.006
y0 ? ? ? ?= 0.002
</axis>
<axis>
color ? ? = dgrey
thickness = 2
spacing ? = 0.1r
y1 ? ? ? ?= 0.006
y0 ? ? ? ?= 0.002
</axis>
<axis>
color ? ? = lred
thickness = 1
spacing ? = 0.05r
y1 ? ? ? ?= 0.002
</axis>
<axis>
color ? ? = dred
thickness = 2
spacing ? = 0.1r
y1 ? ? ? ?= 0.002
</axis>
</axes>
<rules>
<rule>
condition ? ?= var(value) > 0.006
stroke_color = dgreen
fill_color ? = green
glyph ? ? ? ?= rectangle
glyph_size ? = 8
</rule>
<rule>
condition ? ?= var(value) < 0.002
stroke_color = dred
fill_color ? = red
glyph ? ? ? ?= triangle
</rule>
</rules>
</plot>
# the second plot is a crop of the first plot, placed outside
# the ideogram circle, showing only points with large y-values
<plot>
file ? ? ? ? ? ? = data/6/snp.density.txt
fill_color ? ? ? = green
stroke_color ? ? = dgreen
glyph ? ? ? ? ? ?= rectangle
glyph_size ? ? ? = 8
max ? = 0.013
min ? = 0.007
r1 ? ?= 1.175r
r0 ? ?= 1.075r
<backgrounds>
# you can stack backgrounds by using transparent color
<background>
color ? ? = vlgreen_a4
y0 ? ? ? ?= 0.75r
</background>
<background>
color ? ? = vlgreen_a4
y0 ? ? ? ?= 0.5r
</background>
<background>
color ? ? = vlgreen_a4
y0 ? ? ? ?= 0.25r
</background>
<background>
color ? ? = vlgreen_a4
</background>
</backgrounds>
<axes>
<axis>
color ? ? = green_a3
thickness = 2
spacing ? = 0.1r
</axis>
</axes>
<rules>
<rule>
condition ? ?= var(value) < 0.007
show ? ? ? ? = no
</rule>
</rules>
</plot>
# the third plot is a crop of the first plot, placed closer to the
# center of the circle, showing only points with small y-values
<plot>
file ? ? ? ? ? ? = data/6/snp.density.txt
fill_color ? ? ? = red
stroke_color ? ? = dred
glyph ? ? ? ? ? ?= rectangle
glyph_size ? ? ? = 8
max ? = 0.0015
min ? = 0.000
r1 ? ?= 0.60r
r0 ? ?= 0.35r
<backgrounds>
<background>
color ? ? = vlred_a4
y1 ? ? ? ?= 0.25r
</background>
<background>
color ? ? = vlred_a4
y1 ? ? ? ?= 0.5r
</background>
<background>
color ? ? = vlred_a4
y1 ? ? ? ?= 0.75r
</background>
<background>
color ? ? = vlred_a4
</background>
</backgrounds>
<axes>
<axis>
color ? ? = red_a5
thickness = 1
spacing ? = 0.025r
</axis>
<axis>
color ? ? = red_a3
thickness = 2
spacing ? = 0.1r
</axis>
</axes>
<rules>
<rule>
condition ? ?= var(value) > 0.002
show ? ? ? ? = no
</rule>
</rules>
</plot>
</plots>
<<include etc/housekeeping.conf>>