[Bioperl-l] accessing params for custom glyphs?

Smithies, Russell Russell.Smithies at agresearch.co.nz
Thu Apr 17 21:39:23 EDT 2008


This is probably more of a Perl OO problem I'm having, but can anyone
tell me how to access a parameter when I create a custom glyph?

I've created a panel in the usual way then I add a feature with
'my_glyph' and want to pass the value of -new_parameter to the glyph
drawing code.

    $panel->add_track( $feature,
    			-font => gdSmallFont,
			-glyph => 'my_glyph' ,
			-height => 10,
                		-label  => 1,
                		-strand => "forward",
                		-new_parameter => "test",


In my_glyph.pm, I have the usual draw_component sub:

sub draw_component {
  my $self = shift;
  my $gd = shift;
  my ($x1,$y1,$x2,$y2) = $self->bounds(@_);
  my $fg = $self->fgcolor;
  my $params = $self->??????????   <<--- how do I access the value of
"new_parameter" set in the panel drawing code?

  $gd->line($x1,$y1,$x2,$y2,$fg);
  $gd->line($x1,$y2,$x2,$y1,$fg);

}

Any ideas?

Thanx,

Russell	Smithies			
=======================================================================
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