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

Dr. Todd Naumann tan10 at psu.edu
Wed Mar 3 16:03:45 EST 2004


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



More information about the Bioperl-l mailing list