[Bioperl-l] addition of GD::graphic object to Bio::Graphics

Smithies, Russell Russell.Smithies at agresearch.co.nz
Sun Apr 27 21:27:23 UTC 2008

You can get the GD object back from the Bio::Graphics::Panel  then draw
on it using GD methods


#create a BioPerl panel
my $panel = Bio::Graphics::Panel->new(
                              			-length   => 600
                              			-width    => 800,
					-bgcolor  => 'white'
# add your features
my $feature = Bio::SeqFeature::Generic->new( -start => 1,-end   =>
$panel->add_track($feature, glyph   =>   'segments',
					-label   =>   0,
					-height  =>   30,
					-bgcolor  =>  'red',
					-fgcolor  => 'red'

# grab the GD thingy
my $gd = $panel->gd;

#create a color - not sure if there's a better way?
$black = $gd->colorAllocate(0,0,0);

#draw on your GD thingy
$gd->line(10,10,$panel->width -10,10,$black);
$gd->string(gdSmallFont,20,10,'test' ,'$black);

# print it as normal	
print $panel->png;

> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org
[mailto:bioperl-l-bounces at lists.open-
> bio.org] On Behalf Of sergei ryazansky
> Sent: Monday, 28 April 2008 2:05 a.m.
> To: bioperl-l at bioperl.org
> Subject: [Bioperl-l] addition of GD::graphic object to Bio::Graphics
> Hi all,
> is it possible to add a GD::graphic object (chart) to Bio::Graphics
> to obtain a file with image of both the chart and bioseq object?
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
Attention: The information contained in this message and/or attachments
from AgResearch Limited is intended only for the persons or entities
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipients is prohibited by AgResearch
Limited. If you have received this message in error, please notify the
sender immediately.

More information about the Bioperl-l mailing list