Inquiry of Heatmap legend (add color legend bar)

920 views
Skip to first unread message

颖孙

unread,
Jan 9, 2013, 12:47:59 PM1/9/13
to circos-data-...@googlegroups.com
(1) Is it possible to add this kind of legend bar to the Circos heatmaps? 
(I wish to get a bar which could show from white->grey->black)
(2) How can I get the color index which is automatically calculated by Circos for each data point?
I used <rules> shown as follows:
#heatmap
<plot>
type=heatmap
file=/Users/moranlab/circos-0.62-1/Jun_Circos/chr_data/insertionIndex_chr.txt
r0=0.89r
r1=0.99r
#minsize = 1000
<rules>
<rule>
condition=var(value) <= 0
show=no
</rule>
# this rule will remap the value onto a color, using the Brewer
# 9-color blue palette (blues-9-seq-N, N=1..9).
# the remap_round function syntax is
# remap_round(VAR,min,max,remap_min,remap_max)
<rule>
condition=var(value) > 0
color = eval(sprintf("greys-9-seq-%d",remap_round(var(value),0,0.7212911,1,9)))
</rule>
</rules>
</plot>


Thanks a lot!!!!!!
Ying Sun

颖孙

unread,
Jan 9, 2013, 12:49:52 PM1/9/13
to circos-data-...@googlegroups.com
As to the second question, I mean:
how can I know what color has been assigned to each data point?

Thank you!!

Martin Krzywinski

unread,
Feb 12, 2013, 8:28:11 PM2/12/13
to circos-data-...@googlegroups.com
Circos doesn't create legends right now.

It also doesn't report the association between heat map value and color. I have to add this.

To make a grey heat map, I suggest you use the greys Brewer palette. It's enough to do this in the <plot> block

type = heatmap
color = greys-9-seq
min = 0
max = 100

to map the range [0,100] onto the 9-color Brewer palette. Unless you want to do your own remapping, you don't need to use <rules>. The example you posted was created to illustrate how rules work.

The Brewer palettes don't start/end with white/black. If you want to include them you can add a color to the list

color = white,greys-9-seq,black

though be aware of the fact that this will break the perceptual uniformity of the palette. If you want to assign a specific color to the min/max values, then you can use a rule.

<rules>
<rule>
condition = var(value) == 0
color = white
</rule>
<rule>
condition = var(value) == 100
color = black
</rule>
</rules>


Martin Krzywinski
science + art




--
You received this message because you are subscribed to the Google Groups "Circos" group.
To view this discussion on the web visit https://groups.google.com/d/msg/circos-data-visualization/-/ybrsylAWUxQJ.

To post to this group, send email to circos-data-...@googlegroups.com.
To unsubscribe from this group, send email to circos-data-visual...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/circos-data-visualization?hl=en.

Reply all
Reply to author
Forward
0 new messages