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

Lincoln Stein lstein at cshl.edu
Sun Dec 24 17:23:18 UTC 2006


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