[Bioperl-l] translating Sequence in 6 open reading frames

Remo Sanges sanges at biogem.it
Tue Dec 13 12:24:11 EST 2005

joecker at freenet.de wrote:

>I try to use BioPerl for the translation of a sequence in 6 reading frames. 
>The Sequence is stored in a variable. 
>First I create a new Seq object with: 
>my $seqobj = Bio::Seq->new ( -seq => $seq,
>					   -alphabet  => 'DNA',
>					 );
>afterwards I use the package Bio::SeqUtils for translating:
> my $util = new Bio::SeqUtils
>my $polypeptide_3char = Bio::SeqUtils->seq3($seqobj);
>Bio::SeqUtils->seq3($seqobj, $polypeptide_3char);
>my @seqs = Bio::SeqUtils->translate_6frames($seqobj);
>Unfortunately I was not able to create the object. The program stops, but 
>there is no error.
>I hope someone can help me.
>Thanks a lot for your help,
>Bioperl-l mailing list
>Bioperl-l at portal.open-bio.org

it is strange that you don't get error:
the seq3 method need to work on a protein
sequence in order to return the the amino
acid sequence as a string of three letter
code from single letter code amino acids.

If I try to run your script I get the exception:

------------- EXCEPTION: Bio::Root::Exception -------------
MSG: Not a protein sequence
STACK: Error::throw
STACK: Bio::Root::Root::throw 
STACK: Bio::SeqUtils::seq3 /Users/remo/src/bioperl-1.4/Bio/SeqUtils.pm:159
STACK: pep.pl:16

By the way if you only use translate_6frames
you will get the translations.

Please try to read and well understand the documentation
before cut and paste code from it!

use strict;
use warnings;
use Data::Dumper;
use Bio::Seq;
use Bio::SeqUtils;


my $seqobj = Bio::Seq->new (-seq => $seq,
                            -alphabet  => 'DNA');

my $utils = new Bio::SeqUtils;

my @seqs = $utils->translate_6frames($seqobj);

print Dumper \@seqs;



More information about the Bioperl-l mailing list