[Bioperl-l] Bio::Graphics::Glyph::translation.pm

Jason Stajich jason at cgt.duhs.duke.edu
Mon Mar 8 13:12:30 EST 2004


err - I don't think you should be calling attach_seq really, but rather
add_feature on the seq object

 $seq_object->add_SeqFeature($feature);

This is really the right way to do this - it will properly update the
seqfeature and call attach_feature for you.

-jason

On Mon, 8 Mar 2004, Lincoln Stein wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> You need to attach a Bio::PrimarySeqI to the Bio::SeqFeature::Generic,
> not a Bio::SeqI.  I know this is confusing, but I think that you can
> get the effect you want by changing this line to read:
>
> 	$feature->attach_seq($seq_object->seq);
>
> Lincoln
>
> On Wednesday 03 March 2004 04:03 pm, Dr. Todd Naumann wrote:
> > Hi,
> >
> > I am trying to use the translation glyph and I am running into
> > problems. When I run the program below with glyph=>'dna' I get a
> > picture of double stranded DNA sequence as I expected. When I try
> > to use
> > glyph=>'translation' I get the following error message:
> >
> > Can't locate object method "translate" via package
> > "Bio::SeqFeature::Generic" at
> > /usr/lib/perl5/site_perl/5.8.2/Bio/Graphics/Glyph/translation.pm
> > line 134, <GEN0> line 118.
> >
> > I tried to find another SeqFeature object that has a translate
> > method but did not have any luck. If someone could point me in the
> > right direction I would really appreciate it.
> >
> > -Todd
> >
> > #!/usr/bin/perl
> >
> > use strict;
> > use warnings;
> >
> > use Bio::Graphics;
> > use Bio::SeqFeature::Generic;
> > use Bio::SeqIO;
> >
> > # initialize the graphics panel
> > my $panel = Bio::Graphics::Panel->new(-length => 80,
> > -width => 800,
> > -pad_left => 10,
> > -pad_right => 10,
> > );
> >
> > # make the feature object
> > my $feature = Bio::SeqFeature::Generic->new(-start=>1,
> > -end=>60,
> > );
> >
> > # create a sequence object
> > my $seqIO_object = Bio::SeqIO->new(-file => 'test_sequence.gb',
> > -format => 'genbank',
> > );
> >
> > my $seq_object = $seqIO_object->next_seq();
> >
> > # attach sequence object to feature
> > $feature->attach_seq($seq_object);
> >
> > # add track to panel
> > $panel->add_track($feature,
> > -glyph => 'translation',
> > -fgcolor => 'black',
> > );
> >
> > print $panel->png;
> >
> > exit;
> > ============================
> > Todd Naumann
> > Dept. of Chemistry
> > Penn State University
> > University Park, PA  16802
> >
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l at portal.open-bio.org
> > http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
> - --
> Lincoln D. Stein
> Cold Spring Harbor Laboratory
> 1 Bungtown Road
> Cold Spring Harbor, NY 11724
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.1 (GNU/Linux)
>
> iD8DBQFATLTt0CIvUP7P+AkRAgrqAJ9YLCuetr50r704+MyFo1+H7Py+4wCeOXeM
> YiFetRZeCf+misFV4omy+f0=
> =sLUm
> -----END PGP SIGNATURE-----
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>

--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu


More information about the Bioperl-l mailing list