[Bioperl-l] Bio::Graphics - Here is the program in a better format

Crabtree, Jonathan crabtree at tigr.org
Fri Jun 18 10:32:30 EDT 2004


To get the connecting lines to extend all the way to the edges of the
image, simply expand your top-level $feature.  Change the following
statement so that it uses "-start => 1, -end => $length" instead:

>         $feature = 
> Bio::SeqFeature::Generic->new(-display_name=>$domain,
> -score=>$score, -start=>$start, -end=>$end);

I think you can safely ignore Remo's first comment, since you are in
fact creating the Panel only once (thanks to your $flag variable.)  With
regards to the domain labels, however, I think that Remo is on the right
track (no pun intended.)  The problem here is that whenever you have a
feature with subfeatures (as is the case with your $feature and
$subfeature objects), Bio::Graphics will only try to display labels and
descriptions for the top-level feature, not the subfeatures.  This is a
feature, not a bug, and it's documented in Panel.pm.

Anyway, this is why the only label and description you're seeing is the
one you've assigned to $feature (which happens to be the name and score
of the first domain to appear in your input file).  As Remo says, one
option is to assign this top-level feature a name that consists of
concatenating all the individual domain names together.  However, then
you have the problem that the names and scores will no longer appear
next to the subfeatures to which they refer.

You may be able to get Bio::Graphics to label the subfeatures by clever
use of the -all_callbacks option in Bio::Graphics::Panel, but I'm not
sure about this.  Your other option is to choose a slightly different
graphical layout, for example using one top-level glyph to represent the
protein and then overlaying a set of top-level "rndrect" glyphs for the
domains.  You can pass a coderef to the -glyph option to mix and match
different glyph types within a single track.


More information about the Bioperl-l mailing list