[Bioperl-l] using graphics xyplot

Shawn Hoon shawnh at stanford.edu
Mon Dec 15 22:35:00 EST 2003


hi,
	I'm trying to use the SVG/PNG component for drawing xyplots along a 
segment. Its not clear to me how to do it
without going through a Bio::DB::GFF::Aggregator. If I just have a 
bunch of scores (i.e. features) that I want plot along a segment of 
dna.
Something like this doesn't seem to be possible since there is a call 
to $feat->parts in xyplot.pm :

my $panel = Bio::Graphics::Panel->new(-length => 1000,
                                       -key_style => 'between',
                                       -width     => 800,
                                       -pad_left  => 10,
                                       -pad_right => 10,
                                       -image_class=>'GD::SVG'
                                       );

$panel->add_track(arrow => 
Bio::SeqFeature::Generic->new(-start=>1,-end=>1000),
my $feat = Bio::SeqFeature::Generic->new();
while($i < 1000){
     my $f= Bio::SeqFeature::Generic->new(-start=>$i,
								-end=>$i+50,
								-strand=>1,
								-score=>int(rand(100)));
   $feat->add_sub_SeqFeature($f,'EXPAND');
     $i+=50;
}
$panel->add_track($feat,
                   -graph_type=>'line',
                   -bump=>0,
                   -glyph =>'xyplot');
my $gd = $panel->gd;

print $gd->svg;

am I trying to use it wrongly?

thanks,

shawn



More information about the Bioperl-l mailing list