[Bioperl-l] Again, boxes in heterogenious segments

Lincoln Stein lstein at cshl.org
Sun Feb 23 18:28:00 EST 2003


Hi Marco,

To get the boxes around each of the subfeatures, use the -box_subparts option:
 $graphics->add_track( heterogeneous_segments  => $gene,
                                         -fgcolor         => \&snp_color,
                                         -exon_color      =>'blue',	
                                       -intron_color    =>'red',
                                        -height          => 15,
					-box_subparts => 1,
                                 );

Also there was a typo in your -height argument, just in case it bites you.

Lincoln

On Friday 21 February 2003 07:40 am, Marco Aurelio Valtas Cunha wrote:
> Hi all,
>
>   I'm replying myself because I'm really in trouble here. We have to decide
> if is possible to use Bio::Graphics or not to continue the project, or we
> have to develop another way to render the graphics we want. So if somebody
> has a thought it will help a lot.
>
> Marco.
>
> Marco Aurelio Valtas Cunha wrote:
> > Hi all,
> >
> > I'm trapped trying to call $graphics->boxes on a heterogeneous_segments
> > track, how this is supose to work?  How to get the coordenates of
> > sub_SeqFeaures?
> > Just to add, I'm trying to make a box with some snps in it, instead of
> > arrows bellow the box.
> > The code is similar to this:
> >
> > --snip
> >
> > $gene = Bio::SeqFeature::Generic->new(-primary_tag=> 'region', -start=>
> > 0, -end=> 200, -source=>'region');
> >
> > foreach(@my_snps){
> >
> > my($snp_name,$coord) = @{$_};
> >
> > $snp =
> > Bio::SeqFeature::Generic->new(-primary_tag=>"$snp_name",-start=>$coord,
> > -end=>$coord, -source=>'snp');
> >
> > $gene->add_sub_SeqFeature($snp);
> > }
> >
> > $graphics = Bio::Graphics::Panel->new(-segment=> $gene, -width=> '200');
> > $graphics->add_track( heterogeneous_segments  => $gene,
> >                                         -fgcolor         => \&snp_color,
> >                                         -exon_color      =>'blue',
> >                                         -intron_color    =>'red',
> >                                         -heigth          => 15,
> >                                     );
> > # Now calling boxes!!
> > my @boxes = $graphics->boxes;
> >
> > # This always print the gene coords...
> > print "$_->[0]->primary_tag.$_->[1].$_->[2].$_->[3].$_->[4]\n"
> > foreach(@boxes);
> >
> > exit(0);
> > --snip
> >
> > Marco.

-- 
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