[Bioperl-l] translate() oddities

Roy Chaudhuri roy.chaudhuri at gmail.com
Tue Apr 29 14:27:10 UTC 2008


Spent two minutes looking at this, so may as well chip in with what I 
discovered even though you solved your problem.

This "bug" comes about because in version 1.5.1 and earlier, the 
arguments to translate were a simple list, with the first argument the 
terminator (defaults to "*"). Your old version therefore assumed that 
you wanted to translate the stop codon to "-frame". Amusingly given your 
typo, if you miss the hyphen off the frame argument in version 1.5.2 it 
reverts to the old interface and you end up with the output 
"MMMMMframe". The moral of the story is of course to read the docs 
relevant to the version you are using.

Roy.
--
Dr. Roy Chaudhuri
Department of Veterinary Medicine
University of Cambridge, U.K.

Derek Gatherer wrote:
> Thanks Stefan
> 
> Actually, there was a typo in my message, I did use -frame => 
> 1.  However, the problem disappears on upgrading from 1.5.0 to 1.5.2.
> 
> So not a bug anymore.
> 
> Cheers
> Derek
> 
> At 14:46 29/04/2008, Stefan Kirov wrote:
>> my $frame1_obj = $seqobj->translate(-frame => 1);
>> not
>> my $frame1_obj = $seqobj->translate(frame => 1);
>> Stefan
>>
>> Derek Gatherer wrote:
>>> Hi
>>>
>>> I thought I'd better run this by the community before I embarrass
>>> myself on Bugzilla.  It seems like a clear bug to me.  I'm running
>>> Bioperl 1.5.0 on RedHat.
>>>
>>> For a test input:
>>>
>>>> test
>>> ATGATGATGATGATGTGA
>>>
>>> the following code is fine.
>>>
>>> while((my $seqobj = $seq_in->next_seq()))
>>> {
>>>     print "\n".$seqobj->display_id;
>>>     my $len  = $seqobj->length();
>>>     print " length: $len";
>>>     my $frame1_obj = $seqobj->translate();
>>>     my $f1_prot = $frame1_obj->seq();
>>>     print "\n$f1_prot";
>>> }
>>>
>>> Output:
>>>
>>> test length: 18
>>> MMMMM*
>>>
>>> But if I want to change the frame as specified in the BioPerl
>>> tutorial, by using:
>>>
>>> my $frame1_obj = $seqobj->translate(frame => 1); # which should now
>>> give frame 2, I get:
>>>
>>> test length: 18
>>> MMMMM-frame
>>>
>>> The frame is unchanged and the text "-frame" is tacked on the end of
>>> the output.  The same occurs with translate(frame => 2).
>>>
>>> Any ideas?  Can something as fundamental as translate() really be
>>> bugged?  or am I guilty of some particularly heinous syntax error?
>>>
>>> Cheers
>>> Derek
>>>
>>> _______________________________________________
>>> Bioperl-l mailing list
>>> Bioperl-l at lists.open-bio.org
>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>>
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l




More information about the Bioperl-l mailing list