[Bioperl-l] Can I get different Graphics::Panel colours fordifferent HSP frames within the same blast hit?

Aaron J. Mackey amackey at pcbi.upenn.edu
Thu Dec 9 13:19:14 EST 2004


Ahh, right, my apologies.  I had run into the all_callbacks solution to 
a slightly different problem: wanting to provide different 
labels/hyperlinks for each segment.  I was thinking that bgcolor 
attributes would be similar with segment.pm, but you're right, 
graded_segment.pm already hijacks the bgcolor calculation.

-Aaron

On Dec 9, 2004, at 11:51 AM, Crabtree, Jonathan wrote:

>
> Hi Aaron-
>
>> There's another solution that shouldn't involve code patches: see the
>> documentation in Panel (short answer: all_callbacks: 1)
>
> Perhaps I'm being obtuse, but I don't see how turning all_callbacks on
> helps you with the -bgcolor issue.  It seems like
> Bio::Graphics::Glyph::graded_segments::draw need to be called on the
> parent feature in order to get the correct min/max score range.  To 
> wit:
>
>   my ($min_score,$max_score) = $self->minmax(\@parts);
>
> And since the call that sets $fill = $self->bgcolor is outside the loop
> that sets the colors of the individual @parts (the HSPs in this case),
> there's no way you can then get a different (base) color for each part
> unless you do what I did, and move the assignment to $fill inside the
> loop.
>
> Now I'm not saying there isn't some other way to assign the HSPs their
> own colors, just that if you want to use the graded_segments glyph to 
> do
> so then you need a slightly different implementation of its draw 
> method.
> Besides, all solutions involve code patches; it's just a question of
> which code you feel like patching ;)
>
> Jonathan
>
>
--
Aaron J. Mackey, Ph.D.
Dept. of Biology, Goddard 212
University of Pennsylvania       email:  amackey at pcbi.upenn.edu
415 S. University Avenue         office: 215-898-1205
Philadelphia, PA  19104-6017     fax:    215-746-6697



More information about the Bioperl-l mailing list