[Bioperl-l] How to use Bio::Graphics::Glyph::dna?

Paul Boutros Paul.Boutros at utoronto.ca
Sat Dec 30 07:43:32 UTC 2006


Hi Lincoln,

Thanks, that worked like a charm!  Can I suggest adding the
example/explanation you gave me to the pod for Bio::Graphics::Glyph::dna?
Here's a patch against the 1.5.2 version of dna.pm to do that.

Paul

 

266c266,274

< in response to the dna() method.

---

> in response to the dna() method.  For example, you can use a

> Bio::SeqFeature::Generic object with an attached Bio::PrimarySeq

> like this:

>    my $dna = Bio::PrimarySeq->new( -seq => 'A' x 1000 );

>    my $feature = Bio::SeqFeature::Generic->new( -start => 1, -end => 800
);

>    $feature->attach_seq($dna);

>    $panel->add_track( $feature, -glyph => 'dna' );

> 

> A Bio::Graphics::Feature object may also be used.

 

 

 

  _____  

From: lincoln.stein at gmail.com [mailto:lincoln.stein at gmail.com] On Behalf Of
Lincoln Stein
Sent: Sunday, December 24, 2006 12:23 PM
To: Paul.Boutros at utoronto.ca
Cc: BioPerl Mailing List
Subject: Re: [Bioperl-l] How to use Bio::Graphics::Glyph::dna?

 

Hi,

You need to use either a Bio::SeqFeature::Generic object (with an attached
Bio::PrimarySeq) or a Bio::Graphics::Feature object. You are not intended to
create Bio::DB::GFF::Segment objects directly.

e.g. 
my $dna = Bio::PrimarySeq->new(-seq=>'a'x1000);
my $feature = Bio::SeqFeature::Generic->new(-start=>1,-end=>800);
$feature->attach_seq($dna);

Best,

Lincoln

On 12/23/06, Paul Boutros <paul.boutros at utoronto.ca> wrote:

Hello,

I'm trying to get the dna glyph of Bio::Graphics to work and am having
some problems.  I'm starting with a fasta file, and I am running perl
5.8.8 (ActiveState build 819) on WinXP and BioPerl 1.5.2 

If I try simply using a Bio::Seq object like this:
$panel->add_track(
        $segment,
        -glyph     =>   'dna',
        -do_gc     =>   'true',
        -gc_window =>   'auto' 
        );

I get the error:
Can't locate object method "start" via package "Bio::Seq" at
C:/Perl/site/lib/Bio/Graphics/FeatureBase.pm line 164.


And if I try creating a Bio::DB::GFFSegment object like this: 
my $db = Bio::DB::GFF->new(
        -adaptor  => 'berkeleydb',
        -create   => 1,
        -dsn      => '/usr/local/share/gff/dmel'
        );

$db->initialize(1);

$db->load_sequence_string(
        $seq->primary_id(),
        $seq->seq()
        );

my $segment = Bio::DB::GFF::Segment->new(
        $db,
        $seq->primary_id(),
        $seq->primary_id(), 
        1,
        $seq->length()
        );

$panel->add_track(
        $segment,
        -glyph     =>   'dna',
        -do_gc     =>   'true',
        -gc_window =>   'auto' 
        );

I get the error:
------------- EXCEPTION: Bio::Root::NotImplemented -------------
MSG: Abstract method "Bio::FeatureHolderI::get_SeqFeatures" is not
implemented b
y package Bio::DB::GFF::Segment. 
This is not your fault - author of Bio::DB::GFF::Segment should be blamed!

STACK: Error::throw
STACK: Bio::Root::Root::throw C:/Perl/site/lib/Bio/Root/Root.pm:359
STACK: Bio::Root::RootI::throw_not_implemented 
C:/Perl/site/lib/Bio/Root/RootI.pm:522
STACK: Bio::FeatureHolderI::get_SeqFeatures
C:/Perl/site/lib/Bio/FeatureHolderI.pm:101
STACK: Bio::Graphics::Glyph::_subfeat
C:/Perl/site/lib/Bio/Graphics/Glyph.pm:1186 
STACK: Bio::Graphics::Glyph::subfeat
C:/Perl/site/lib/Bio/Graphics/Glyph.pm:1167
STACK: Bio::Graphics::Glyph::new C:/Perl/site/lib/Bio/Graphics/Glyph.pm:56
STACK: Bio::Graphics::Glyph::Factory::make_glyph
C:/Perl/site/lib/Bio/Graphics/Glyph/Factory.pm:316
STACK: Bio::Graphics::Glyph::new C:/Perl/site/lib/Bio/Graphics/Glyph.pm:81
STACK: Bio::Graphics::Glyph::Factory::make_glyph
C:/Perl/site/lib/Bio/Graphics/Glyph/Factory.pm:316 
STACK: Bio::Graphics::Panel::_add_track
C:/Perl/site/lib/Bio/Graphics/Panel.pm:388
STACK: Bio::Graphics::Panel::_do_add_track
C:/Perl/site/lib/Bio/Graphics/Panel.pm:360
STACK: Bio::Graphics::Panel::add_track 
C:/Perl/site/lib/Bio/Graphics/Panel.pm:288
STACK: create_figure.pl:147
----------------------------------------------------------------

I'm really unsure what to try next, any suggestions much appreciated! 
Paul


_______________________________________________
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