[Bioperl-l] Sorting Bio:Graphics::Glyphs
Oliver Burren
oliver.burren at cimr.cam.ac.uk
Wed Dec 3 09:14:46 EST 2003
Hi,
I have a lot of transcripts that I'm rendering using the excellent
Bio::Graphics module. I want to sort these by the last two characters in
the display_name attribute. I used the following callback
sub sort_trans($$){substr($_[0]->display_name,-2)<=>
substr($_[1]->display_name,-2)}
# the last two chars are numbers therefore using <=>
I then added
the following track glyph
my $ttrack=$panel->add_track(\@transcripts,
-glyph=>'transcript',
#......more options here
-sort_order=>&sort_trans # should this be
# \&sort_trans ?
);
If i then run this I get the following error
Can't call method "display_name" on unblessed reference at gene_page.cgi
line 93, <DATA> line 191.
In the pod documentation for Glyphs it says to use $a and $b vars if I
use these though i get an exception that tells me to use a ($$)
prototype (which I think I'm doing by using a call back with
prototype).
I'm using Version 1.3 of bioperl.
Can anyone point out what I should be doing or am doing wrong ?
Thanks,
Olly Burren
--
-------------------------------------------------------------------------------
JDRF/WT Diabetes and Inflammation Laboratory
Cambridge Institute for Medical Research
Addenbrooke's Hospital Site
Hills Road,
Cambridge
CB2 2XY
Tel. +44 (0)1223 762598 Fax. +44 (0)1223 762102
-------------------------------------------------------------------------------
More information about the Bioperl-l
mailing list