[Bioperl-l] Can Bio::Graphics render a muti_segments picture?

Lincoln Stein lstein at cshl.org
Mon May 12 10:53:47 EDT 2003


Here's an example of drawing a multi-segment object:

use strict;
use Bio::Graphics;
use Bio::SeqFeature::Generic;

my $Generic = 'Bio::SeqFeature::Generic';  # to reduce typing

# create a feature to use for the scale arrow
my $whole_region = $Generic->new(-start=>1,   -end=>10000,-seq_id=>'whole');

# create a multi-segment feature
my $blue1        = $Generic->new(-start=>5000,-end=>9000,-seq_id=>'blue1');
$blue1->add_SeqFeature($Generic->new(-start=>5000,-end=>6000));
$blue1->add_SeqFeature($Generic->new(-start=>7000,-end=>7500));
$blue1->add_SeqFeature($Generic->new(-start=>8000,-end=>9000));

my $panel = Bio::Graphics::Panel->new(-segment=>$whole_region,-width=>800);
$panel->add_track($whole_region,
                  -glyph  => 'arrow',
                  -double => 1,
                  -tick   => 2);

$panel->add_track($blue1,
                  -glyph   => 'segments',
                  -label   => 1,
                  -bgcolor => 'blue');

print $panel->png;

Best,

Lincoln



On Monday 12 May 2003 06:18 am, tongw wrote:
> Greeting all, especially the developers of Bioperl:
>     It`s my first time to locate the mail list of Bioperl, and I have
> applied the Bioperl modules to sovle the problems in my research, which
> is more comfotable than write the perl scripts, specially in the format
> changing and drawing the picture by GD module.
>   But I meet a question: I think the Bio::Graphics only draw the whole
> sequence in one segment. I want to know whether there is some methods to
> render a muti_segments picture, and it is more necessary when the
> sequence is very long.
> Kind Regards.
> Specially thank Lincoln, your howto docment about Graphics helps me to
> grasp the main usages in graphics module.
>
>                                                        Wei Tong
>
>
> ============================================
>
> Wei Tong
>
> Bioinformatics Department
> Beijing Genomics Institute/
> Genomics & Bioinformatics Center Chinese Academy of Science Beijing
> Airport Industrial Zone B6 Beijing 101300, P.R. China
>
> Tel: 0086-10-80481833 (Office)
> Email : tongw at genomics.org.cn
> http://www.genomics.org.cn
> ============================================
>
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at bioperl.org
> http://pw600a.bioperl.org/mailman/listinfo/bioperl-l

-- 
Lincoln Stein
lstein at cshl.org
Cold Spring Harbor Laboratory
1 Bungtown Road
Cold Spring Harbor, NY 11724
(516) 367-8380 (voice)
(516) 367-8389 (fax)



More information about the Bioperl-l mailing list