[Bioperl-l] Bioperl Graphics panel->boxes()

Heleen de Weerd hhdeweerd at gmail.com
Tue Feb 25 18:53:20 UTC 2014


Hi all,

I am currently updating code from about 5 years ago (bioperl hasn't been 
updated for a long time) and I have run into an issue with Bioperl Graphics.
The code is used to visualize blast results online. Multiple query are 
drawn underneath each other and the image is clickable to get more 
information about a hit.

In previous code panel->boxes() was used to obtain the coordinates of hits 
with a query. However now this code doesn't seem to work as before.
The code only gives the coordinates for the first query, however nothing 
for the queries and hits after the first hit.
I have been trying to find if this is a known issues, however I cannot find 
anything.
Does anyone have any idea?

Basic representation of the code:
So first off a panel is created.
And following a loop to create complete panel. 
For each query several blast hits are added.
 
  my $panel = Bio::Graphics::Panel->new(-length      => 
$session->param('panel_stop')-$session->param('panel_start'), 
                                       -offset      => 
$session->param('panel_start'));  

  foreach (@query_seqs) {
    $panel->add_track(arrow =>Bio::SeqFeature::Generic->new(-start 
=>$session->param('panel_start'),
                                                            -end   
=>$session->param('panel_stop')),
                                                            -glyph   => 
'arrow',
                                                            -fgcolor => 
'black');
    foreach my $row (@{$set}) {
      $parent_feat = Bio::SeqFeature::Generic->new(-display_name => 
$row->{sbj_name}." ".$row->{sbj_desc},
                                                   -seq_id       => 
"query_name=$query_name",
                                                   -start        => 
$row->{query_begin},
                                                   -end          => 
$row->{query_end});
      push(@$feats, $parent_feat);
    }

    my $track = $panel->add_track($feats 
                                  -glyph        => $glyph_type,
                                  -label        => 1,
                                  -strand_arrow => 1,
                                  -connector    => 'dashed',
                                  -font2color   => 'red',;
                                  -sort_order   => 'left',
                                  -min_score    => 0,
                                  -max_score    => $max_score);
  }

I am sure features are created, because they show up on in the 
visualization.
However now I want to get the coordinates using $panel->boxes to create an 
imagemap, but I don´t get all coordinates, only for the first query

  $html = "<img src='$thispage&display=panel' usemap='#blast_details' 
border=0>\n";
  $html .= "<map name='blast_details'>\n";
  foreach ($panel->boxes) {
    my $feature = $_->[0];
    my $coords  = join( ',',@{$_}[1..4]);
    my $seq_id = $feature->seq_id;
    $html .= "<area coords='$coords' href='$thispage&$seq_id' %'>";
  }
  $html .= "</map>\n";

If you have any idea or have any questions please let me know.
 Thank you!
Heleen de Weerd





More information about the Bioperl-l mailing list