[Bioperl-l] Bio::Graphics::Panel imagemap making with Bio::Graphics::Panel

Kevin Lam Koiyau ULNJUJERYDIX at spammotel.com
Wed May 3 08:20:38 UTC 2006


Help!
I can't figure out the docs instructions

I want to create an imagemap of short sequence matches with a longer one
with clickable imagemaps for the short sequences. I figure I can do this
easily enough using the example script for parsing blast output but I need
an example script to understand how to produce the html code for the
imagemap. I can find only rather cryptic references about how this can be
done (see below).

$boxes = $panel-E<gt>boxes
    @boxes = $panel-E<gt>boxes
    The boxes() method returns a list of arrayrefs containing the
coordinates of each glyph.  The method is useful for constructing an
image map.  In a scalar context, boxes() returns an arrayref.  In an
list context, the method returns the list directly.

    Each member of the list is an arrayref of the following format:

      [ $feature, $x1, $y1, $x2, $y2, $track ]

    The first element is the feature object; either an
Ace::Sequence::Feature, a Das::Segment::Feature, or another Bioperl
Bio::SeqFeatureI object.  The coordinates are the topleft and
bottomright corners of the glyph, including any space allocated for
labels. The track is the Bio::Graphics::Glyph object corresponding to
the track that the feature is rendered inside.

    $position = $panel-E<gt>track_position($track)
    After calling gd() or boxes(), you can learn the resulting Y
coordinate of a track by calling track_position() with the value
returned by add_track() or unshift_track().  This will return undef if
called before gd() or boxes() or with an invalid track.

    @pixel_coords = $panel-E<gt>location2pixel(@feature_coords)
    Public routine to map feature coordinates (in base pairs) into pixel
coordinates relative to the left-hand edge of the picture. If you
define a -background callback, the callback may wish to invoke this
routine in order to translate base coordinates into pixel coordinates.

    $left = $panel-E<gt>left
    $right = $panel-E<gt>right
    $top   = $panel-E<gt>top
    $bottom = $panel-E<gt>bottom
    Return the pixel coordinates of the *drawing area*     of the panel, that
is, exclusive of the padding.


got it from http://docs.bioperl.org/bioperl-live/Bio/Graphics/Panel.html




More information about the Bioperl-l mailing list