色带 Ribbon

之前的绘图过程中,我们的link都是一条粗细均匀的线,并不能体现连接区的跨度。使用色带将更有视觉冲击力:

conf

<links>

radius = 0.99r
crest  = 1
ribbon           = yes                        #打开色带设置
flat             = yes
stroke_color     = vdgrey                     #设置色带默认颜色
stroke_thickness = 2                   
color            = grey_a3

bezier_radius        = 0r
bezier_radius_purity = 0.5

<link>

file       = data/5/segdup.txt

<rules>

flow       = continue

<rule>
condition  = var(intrachr) && abs(var(pos1)-var(pos2)) < 10Mb
show       = no
</rule>

<rule>
condition  = max(var(size1),var(size2)) < 10kb
show       = no
</rule>

<rule>
condition  = 1《
z          = eval(int(max(var(size1),var(size2))/5000))
</rule>

<rule>
condition    = var(intrachr) 
condition    = (from(hs1) && var(start1) < 1Mb) || (to(hs1) && var(start2) < 1Mb)
color        = orange
stroke_color = dorange                                      #设置条带填充和线条颜色
</rule>

<rule>
condition    = var(intrachr)
condition    = (from(hs1) && var(start1) > 16Mb && var(start1) < 17Mb) || (to(hs1) && var(start2) > 16Mb && var(start2) < 17Mb)
color        = lblue
stroke_color = dblue
</rule>

</rules>

</link>

</links>

扭曲色带

1、如何扭曲

我们的文本文件都包含这样的形式:

linkID chr1 start1 end1 linkID chr2 start2 end2

那么色带的绘制顺序是

start1 >> end1 >> end2 >> start2 >>start1

2、通过调整ideogram的方向产生色带

chromosomes_reverse = hs2

3、不要扭曲,只要“FLAT”

打开开关:

<link>
ribbon = yes
flat   = yes
...
</link>

4、开启扭曲

4.1、首先我们要打开扭曲的开关:

<link>
ribbon = yes
twist  = yes
...
</link>

4.2、你可以将twist属性写进link文本文档中:

linkID chr1 start1 end1 twist=yes linkID chr2 start2 end2 twist=yes

5、加上相反坐标

结合扭曲的另一种方法是定义要反转的链接坐标。因此我们原来定义为

linkID chr1 start1 end1 linkID chr2 start2 end2

现在更改为:

linkID chr1 end1 start1 linkID chr2 start2 end2

results matching ""

    No results matching ""