[Bioperl-l] Bio::Graphics xyplot

Lincoln Stein lincoln.stein at gmail.com
Thu Dec 14 15:24:56 EST 2006


Hi,

The way it works is that you create a single feature that spans the entire
range of the xyplot. It contains subfeatures, each of which has a score. The
graph points correspond to each of the subfeatures.

Lincoln

On 12/7/06, Keith Anthony Boroevich <kaboroev at sfu.ca> wrote:
>
> 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
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>



-- 
Lincoln D. Stein
Cold Spring Harbor Laboratory
1 Bungtown Road
Cold Spring Harbor, NY 11724
(516) 367-8380 (voice)
(516) 367-8389 (fax)
FOR URGENT MESSAGES & SCHEDULING,
PLEASE CONTACT MY ASSISTANT,
SANDRA MICHELSEN, AT michelse at cshl.edu



More information about the Bioperl-l mailing list