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

Crabtree, Jonathan crabtree at tigr.org
Thu Dec 9 11:51:25 EST 2004

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

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 ;)


More information about the Bioperl-l mailing list