Bio-Roary
view release on metacpan or search on metacpan
contrib/roary2svg/roary2svg.pl view on Meta::CPAN
# print STDERR "$j $i $matrix[$j][$i]\n";
if ($matrix[$j][$i]) {
# box for each present gene
$svg->rectangle(
'x' => $llen+$i*$dx, 'y' => $j*$dy, 'width' => $dx, 'height' => $dy-1,
'style' => { fill=>$colour, opacity=>($is_core[$i] ? 1 : 0.75) },
);
}
}
# taxon label for each row
$svg->text( x=>$fontsize, y=>($j+0.75)*$dy, -cdata=>$id[$j], style=>$font_style );
# number of genes for each row
$svg->text( x=>$llen+$width2+$fontsize, y=>($j+0.75)*$dy, -cdata=>$tally[$j], style=>$font_style );
# separator line
my $ypos = ($j+1)*$dy;
$svg->line( x1=>0, y1=>$ypos, x2=>$width, y2=>$ypos, style=>{stroke=>$sepcolour});
}
# bottom label
my $bottom_text = "$N taxa, $C clusters";
$bottom_text .= $acconly ? " (accessory only)" : " (core + accessory)";
$svg->text( x=>$llen, y=>($N+0.75)*$dy, -cdata=>$bottom_text, style=>$font_style );
# border
if ($border) {
$svg->rectangle(
'x' => 0, 'y' => 0, 'width' => $width, 'height' => $real_height,
'style' => { stroke=>$sepcolour, fill=>'none' },
);
}
print STDERR "Writing SVG file\n";
( run in 0.685 second using v1.01-cache-2.11-cpan-454fe037f31 )