[Bioperl-l] Please help with Bio::Graphics

Lincoln Stein lstein at cshl.org
Tue Feb 11 16:28:11 EST 2003


Hi,

Did I send out a response to this?  I sent it out during the O'Reilly 
conference when the wireless was going up and down.  The issue here is a bug 
in the dna glyph which is due to my misreading of the seq() method, which 
returns a Bio::PrimarySeq when called with a featureI, and a plain DNA string 
when called on a Bio::PrimarySeq().  I have checked in a new version of the 
dna.pm module that should fix this so that the GC content glyph will work 
correctly.

Lincoln


On Monday 03 February 2003 09:26 pm, Jason Stajich wrote:
> This is probably because the dna glyph is really intended to work with
> Bio::DB::GFF directly which has features which have a dna() method.
>
> The best way I could think to do this would be :
>
> #!/usr/bin/perl -w
> use strict;
>
> package DNAFeature;
> use Bio::SeqFeature::Generic;
>
> use vars qw(@ISA);
> @ISA = qw(Bio::SeqFeature::Generic);
>
> sub dna{
>     my $self = shift;
>
>     return $self->{'dna'} = shift if @_;
>     return $self->{'dna'};
> }
>
> package main;
>
> my $gcfeature = DNAFeature->new(-start => 1, -end =>
> $seq->length,-primary_tag => 'gcfeature');
>
> $gcfeature->dna($seq->seq());
>
> ..
>
> But I didn't have much luck in getting it to render either but perhaps
> Lincoln has better ideas.
>
> -jason
>
> On Mon, 3 Feb 2003, Lucas Quincy Ton wrote:
> > Dear all,
> >      I have recently started using the Bio::Graphics module to render a
> > png picture from an embl-formatted file.  Everything so far looks fine
> > but when I coded the 'dna' glyph to render GC-content plot, I get the
> > plot but with just a straight line in the middle (50%) from lelf to
> > right.  Would someone please gear me to the right direction?  My code is
> > as follow:
> >
> > #I create a SeqFeature::Generic object
> > my $gcfeature = Bio::SeqFeature::Generic->new(-start=>1,
> > 					      -end=>$seq->length,);
> > #here I attach the whole DNA sequence referenced by $seq to the feature
> > #I do this because I read perldoc on dna.pm which specified that "the
> > feature #must return a DNA sequence string in response to the dna()
> > method -- so I made
> > #my best guess as to its meaning
> > $gcfeature->attach_seq($seq);
> > #now I create a track for GC content
> > $panel->add_track($gcfeature,
> >      -glyph	=> 'dna',
> >      -fgcolor => 'black',
> >      -height => 100,
> >      -bgcolor => 'red',
> >      -do_gc	=> 'true',
> >      -gc_bins => 10,
> >      -axis_color=> 'blue',
> >      -strand => 'forward',);
> >
> > Any response will be greatly appreciated.
> > Lucas Ton.
> >
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l at bioperl.org
> > http://bioperl.org/mailman/listinfo/bioperl-l

-- 
========================================================================
Lincoln D. Stein                           Cold Spring Harbor Laboratory
lstein at cshl.org			                  Cold Spring Harbor, NY
========================================================================




More information about the Bioperl-l mailing list