svg vs png: transparency and axis

353 views
Skip to first unread message

sigrid.rouam

unread,
Jan 3, 2012, 5:20:16 AM1/3/12
to Circos
Hello,

I have a question regarding some differences that I observed between
svg and png output.
1) The link transparency is not appearing in the svg file (I choose a
black_a5 color)
2) The histogram axis do not appear in the svg file (I have the
following parameters: axis = yes; axis_color = lgrey; axis_thickness =
2; axis_spacing = 0.5)

Is it possible to fix these two issues so as to obtain the same output
in the svg file as in the png file?

Thank you in advance for your help.
Happy new year!

Sigrid

Martin

unread,
Jan 18, 2012, 7:59:36 PM1/18/12
to Circos

Hi Sigrid,

I can't reproduce the link transparency error. For example, drawing
5px thick links with color black_a5

<link test>
...
thickness = 5
color = black_a5
...

generates the correct <path> tags in the SVG file. Here the link is a
line, so the stroke-opacity is set in the 'style' attribute:

<path d="M 2305.9,660.5 L 2287.5,679.6 2265.6,701.9 2240.2,726.7
2211.8,753.2 2180.5,781.0 2146.5,809.4 2110.1,837.7 2071.5,865.5
2030.9,892.4 1988.5,917.8 1944.6,941.5 1899.2,962.9 1852.7,981.9
1805.3,998.1 1757.0,1011.4 1708.3,1021.4 1659.1,1028.2 1609.7,1031.5
1560.4,1031.2 1511.2,1027.5 1462.3,1020.3 1414.1,1009.5 1366.5,995.4
1319.8,978.1 1274.1,957.8 1229.6,934.6 1186.5,908.8 1145.0,880.7
1105.1,850.7 1067.0,819.1 1030.9,786.5 997.0,753.1 965.3,719.6
936.0,686.4 909.2,654.3 885.1,623.7 863.8,595.3 845.5,570.0
830.2,548.3 " style="stroke-opacity: 0.166667; stroke-width: 5.0;
stroke: rgb(0,0,0); fill: none" />

Can you post a sample <path> tag from the SVG file you get?

Similarly, I can't reproduce the missing axis. Can you email me your
conf/data files? I will look into this more.

Martin

sigrid.rouam

unread,
Jan 18, 2012, 9:02:21 PM1/18/12
to Circos, Sigrid Rouam
Hello Martin,


Thank you for your reply.

Here are the files I am using:

circos.conf

karyotype = ../../data/karyotype/karyotype.human.hg19.transp.txt

chromosomes_units = 1000000
chromosomes_display_default = no
chromosomes =
hs1;hs2;hs3;hs4;hs5;hs6;hs7;hs8;hs9;hs10;hs11;hs12;hs13;hs14;hs15;hs16;hs17;hs18;hs19;hs20;hs21;hs22;hsx

<<include links4.0800098.conf>>

<plots>
<<include histogram.conf>>
</plots>

<<include ideogram.conf>>
<<include ticks.conf>>

<image>
dir = .
file = circos4.0800098.png
24bit = yes
png = yes
svg = yes
radius = 500p
background = white
angle_offset = -90
auto_alpha_colors = yes
auto_alpha_steps = 5
</image>

<<include ../../etc/housekeeping.conf>>

<highlights>
<highlight>
file = ../data/highlight.segments.txt
r0 = 0.68r
r1 = 0.71r
</highlight>
<highlight>
file = ../data/CNV.0800098.txt
stroke_thickness = 0.5
stroke_color = grey
r0 = 0.72r
r1 = 0.75r

</highlight>
</highlights>


histogram.conf

<plot>
show = yes
type = histogram
file = ../data/Freq.gain.circos.txt

fill_under = yes
min = 0
max = 1
r0 = 0.85r
r1 = 0.95r

fill_color = red
background = yes
background_color = white
background_stroke_color = grey
background_stroke_thickness = 1
axis = yes
axis_color = grey
axis_thickness = 1
axis_spacing = 0.5
</plot>

<plot>

show = yes
type = histogram
file = ../data/Freq.loss.circos.txt

fill_under = yes
min = -1
max = 0
r0 = 0.75r
r1 = 0.85r

fill_color = blue
background = yes
background_color = white
background_stroke_color = grey
background_stroke_thickness = 1
axis = yes
axis_color = grey
axis_thickness = 1
axis_spacing = 0.5
</plot>

links.conf

<links>
<link chain>
file = ../data/links4.txt
bezier_radius = 0r
radius = 0.68r
thickness = 1p
color = black_a5
</link>
</links>


And here is what I get:
svg output
https://docs.google.com/open?id=0BxG_oOO3AuERZTA2OTEwYjUtZTgyOS00M2E5LWI5NjctNTc2NGZlOTM2M2Mw

png output
https://docs.google.com/open?id=0BxG_oOO3AuERZDMwNjZlYzUtYWE2Yy00ZmE1LTgyNmUtZGY3Mjc5YWYwNTQ4

The png output looks pretty weird, with grey stains on the graph, but
seems to work for the transparency and axis.
The svg output is much nicer, but transparency and axis do not work.

Thank you for your help.

Sigrid

Martin Krzywinski

unread,
Jan 18, 2012, 9:37:47 PM1/18/12
to circos-data-...@googlegroups.com
The axis grids are in the SVG file, but have no thickness or color.
Strange. What version of Circos are you using?

The PNG *does* look funny.

I need all the data and conf files to help you debug this. I need to
be able to generate the image myself to find out what the problem is.

Put the data/conf files in a zip file (don't forget all the files,
including karyotype) and email it to me - martin.k...@gmail.com
- and I will investigate.

> --
> You received this message because you are subscribed to the Google Groups "Circos" group.
> 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.
>

Mark

unread,
Mar 27, 2012, 8:02:31 PM3/27/12
to circos-data-...@googlegroups.com
Hi,

It seems that besides the *funny* ness of the graph, the issue Sigrid is seeing whereby axes are printed on .png files but not on .svg files is widespread. For example, compare circos-tutorials-0.56/tutorials/6/3/circos3.svg with the corresponding png file. Grids appear on the png but not on the svg.
Thanks for some great software!

Martin Krzywinski

unread,
Mar 28, 2012, 9:33:18 PM3/28/12
to circos-data-...@googlegroups.com

Good one Mark! I see the problem in 6/circos.3.svg

The axis spacing lines don't have any color assigned to them in the svg file.

I'll post a fix.

Martin

--
You received this message because you are subscribed to the Google Groups "Circos" group.

Martin Krzywinski

unread,
Mar 29, 2012, 5:46:48 PM3/29/12
to circos-data-...@googlegroups.com

I've verified that upcoming v0.56-2 fixes these problems.

I've attached an SVG file with transparent links and track axes. Both look ok now.

Martin
circos.svg
Reply all
Reply to author
Forward
0 new messages