[Bioperl-l] Getting Co-ordinates in Bio::Graphics::Panel

Lincoln Stein lstein at cshl.edu
Wed May 5 14:21:04 EDT 2004


HI Adam,

Use $panel->boxes().  It returns the glyphs in all tracks. Since 
boxes() returns the feature object, you can simply ignore the ones 
you don't want.

$track->boxes() should work too.  I don't know why it isn't.

Lincoln

On Wednesday 05 May 2004 02:07 pm, Adam Woolfe wrote:
> Im trying to get the co-ordinates of glyphs on each track drawn
> using Bio::Graphics:Panel.
>
> i know from CPAN documentation that you can use the boxes()
> function as in:
>
> @coords = $panel->boxes();
>
> but I have a whole set of glyphs on several tracks which I would
> like to get the coordinates for. Here is an example of one of the
> tracks I would like to get coordinates for.
>
> #create a new Panel object
> 	my $panel = Bio::Graphics::Panel->new(-length => $seqlength,
>                                      	      -key_style=>'between',
> 				     	      -offset=>1,
> 					      -width  =>1000,
>                                               -pad_left => 10,
>                                               -pad_right => 10,
> 				              -pad_top => 10,
> 				              -pad_bottom => 10);
>
> my $org1track = $panel->add_track(-glyph => 'graded_segments',
>                               -label  => 1,
>                               -bgcolor => 'blue',
>                               -min_score => 0,
>                               -max_score => 100,
> 			      -key =>'Org1');
>
> #each glyph is drawn on the track
> foreach $glyph.... {
>
> 		$org1object =
> Bio::SeqFeature::Generic->new(-score=>$glyph[2],-start=>$glyph[0],
> -end=>$glyph[1]);
>
> 	$org1track->add_feature($org1object);
>
> 		    }
>
> I want the coordinates for each of those features I added to the
> $org1track track. I tried using:
>
> @coords = $org1track->boxes();
>
> but that didnt work. How can I achieve this?
>
> cheers,
>
> Adam
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l

-- 
Lincoln D. Stein
Cold Spring Harbor Laboratory
1 Bungtown Road
Cold Spring Harbor, NY 11724


More information about the Bioperl-l mailing list