Link radius

३६ वेळा पाहिले
पहिल्या न वाचलेल्या मेसेजवर जा

Madhuri V

न वाचलेले,
६ जुलै, २०२३, ३:४४:१४ PM६/७/२३
प्रति Circos
I'm trying to define the link radius proportional to the height of the histogram bars for  each specific  data point. I have found this in one of the tutorials of circos, but couldn't completely understand how it is done. The image id attached below. Can someone help me to understand how to do it as  couldn't figure it out?image-07.pngimage-05.png

Martin

न वाचलेले,
१० जुलै, २०२३, ८:११:३६ PM१०/७/२३
प्रति Circos
I think the example you posted is very old. This is the current way of doing it


If you want to make the radius proportional to the height of a histogram (i.e. data from another data track), you have to include these data values in the input file to the link track. Currently, there's no way to cross-reference a value from one data track to another.

The way to do this would be something like this,

chr1 10 20 chr2 50 60 y=6
chr1 30 40 chr2 80 100 y=5
...

Here, "y" would be some value that you want to use as input to the radius of the link.

Then, in the link track (see the tutorial link above), you'd have a rule like

<rules>
<rule>
condition = 1
radius1    = eval("%sr",0.5 + var(y)/20) 
</rule>
</rules>

What would happen here is that for each link, Circos would evaluate the radius1 expression using the "y" value from the data line in place of var(y). So, for the first link, you'd have

eval("%sr",0.5 + 6/20) = eval("%sr",0.5 + 0.3) = 0.8r

The "r" suffix means the value is evaluated relative to the ideogram position.

You'd adjust the offset 0.5 and scale 20 to map the range of histogram values onto the range of radius positions. Otherwise, you can write as complicated an expression as you like to make the remapping.

Another option is, when preparing the data files, to compute the radius and enter it directly in the link file

chr1 10 20 chr2 50 60 r1=0.5r,r2=0.5r
chr1 30 40 chr2 80 100 r1=0.6r,r2=0.7r

and then in the <rule> you'd have

radius1 = var(r1)
radius2 = var(r2)

Here the parameter names "y", "r1" and "r2" are arbitrary. 

m
सर्वांना उत्तर द्या
लेखकाला उत्तर द्या
फॉरवर्ड करा
0 नवीन मेसेज