[Bioperl-l] Bio::Graphics xyplot

Keith Anthony Boroevich kaboroev at sfu.ca
Thu Dec 7 22:26:35 UTC 2006


Hi everyone,

I'm attempting to add an xyplot of the phred quality scores to an
Bio::Graphics image, and cannot get it to work.
I have the panel with a track for both the scale and the DNA displaying
properly.  When I attempt to add the xyplot i just get a garbled track
of, what looks like, timy xyplots for each datapoint.  I have the cvs
(updated today) of bioperl-live running.  I think what I am missing is
the creation of a "Sequence Feature Group" to hold the individual points
of the plot.  However, I cannot seem to find such an object. This is
what I attempted:

-------BEGIN---CODE-----------
# start panel
my $panel = Bio::Graphics::Panel->new(-length    => $f_seqlen,
                      -width     => $f_seqlen*10,
                      -pad_left  => 10,
                      -pad_right => 10,
                      -grid      => 1
                      );
# add scale
$panel->add_track(arrow =>
Bio::SeqFeature::Generic->new(-start=>1,-end=>$f_seqlen),
              -double  => 1,
              -tick    => 2,
              -fgcolor => 'black');
# add DNA ($feature is of type Bio::SeqFeature::Annotated)
$panel->add_track(dna => $feature);
# get list of quality scores from database
my ($pqs_value) = $dbh->selectrow_array($sql);
my @pqs_value = split(/\s/,$pqs_value);
# create track
my $track =  $panel->add_track(-glyph        => 'xyplot',
                   -graph_type   => 'points',
                   -point_symbol => 'point',
                   -max_score    => 100,
                   -min_score    => 0,
                   -scale        => 'none');
# add "subfeatures" to
for (my $i=0;$i<$f_seqlen;$i++) {
   
$track->add_feature(Bio::SeqFeature::Generic->new(-start=>$i,-end=>$i,-score=>$pqs_value[$i]));

}
print $panel->png();
$panel->finished;
------END---CODE----------

I also attempted to create an array of the point features and passed
that by reference to the panel "add_track" as it describes in the xyplot
documentation, but that resulted in the exact same image.

keith

-- 
 ><)))°> -cGRASP- <°(((><
 Keith Anthony Boroevich
 Davidson Lab
 Dept of Molecular Biology
 Simon Fraser University
 Tel: 604-268-7276




More information about the Bioperl-l mailing list