显示序列
本节将通过RULE的使用来绘制序列文本,并对基底着色。我们将使用等宽字体(mono)
label_font = mono
案例文本格式
单位点碱基信息,data/6/sequence.txt (20,000 entries)
# sequence.txt
...
hs1 2 2 C
hs1 3 3 A
hs1 4 4 A
...
和data/6/sequence.long.txt (100,000 entries).
# sequence.long.txt
...
hs1 1 1 A
hs1 1 1 C
hs1 1 1 A
hs1 1 1 G
hs1 2 2 T
hs1 2 2 A
hs1 2 2 C
hs1 2 2 T
...
实现文本操控条件
最好还是使用外部文件来控制:然后用include。
<plots>
# default values for all <plot> blocks
type = text
color = black
label_font = mono
label_size = 32
# radial padding
rpadding = 0.2r
<plot>
file = data/6/sequence.txt
r1 = 0.9r
r0 = 0.3r
label_size = 16
# angular padding
padding = -0.25r #padding是负数的时候堆叠更加紧密
<rules>
<<include rule.textcolor.conf>>
</rules>
</plot>
</plots>
控制字体颜色:
<rule>
condition = var(value) eq "A"
color = red
</rule>
<rule>
condition = var(value) eq "T"
color = blue
</rule>
<rule>
condition = var(value) eq "C"
color = green
</rule>
调整字体大小:
<rule>
# If the text is not A, then hide it. When this rule triggers,
# other rules are not evaluated.
condition = var(value) ne "A"
show = no
</rule>
# This rule is applied to any text that didn't pass the previous
# rule (i.e. only A). The label is set to a random value between
# 12 and 48. The rand() function returns a uniformly sampled
# random value in the interval [0,1).
<rule>
condition = 1
label_size = eval(12+32*rand())
</rule>
官方conf [here]