[Bioperl-l] RE: Passing extra arguments to method references in Bio::Graphics::Panel::add_track

michael watson (IAH-C) michael.watson at bbsrc.ac.uk
Mon May 9 11:30:44 EDT 2005


Hi

Sorry, a bit hasty on the trigger....

I am on bioperl-1.5.

I'm using the following code to create some rather tasty images:

$panel->add_track(transcript2  => \@includeCDS,
		  -bgcolor    =>  'blue',
		  -fgcolor    =>  'black',
		  -key        => 'CDS',
		  -bump       =>  0,
		  -height     =>  10,
		  -label      => \&gene_description,
		  -description=> \&gene_label,
		 );

This is fairly standard, and @includeCDS is a bunch of feature objects.

What I want to do is pass extra arguments to &gene_description, and then
within &gene_description check to see if the feature start is greater
than a certain value (the extra argument).  If it is, then I want to
return an empty string, if it isn't I want to return the gene
description.  Something like:

-label      => \&gene_description($start)

But when I tried that it didn't work ;-(.

So is it possible to pass extra arguments to those functions I am
referencing above?

Many thanks

Mick



More information about the Bioperl-l mailing list