[Bioperl-l] Frame translation gets an extra aa?

Chris Fields cjfields at illinois.edu
Wed Jan 19 15:14:53 UTC 2011


On Jan 17, 2011, at 12:02 PM, Karger, Amir wrote:

> "strict" seems a bit vague to me. -add_third_bp defaulting to false? -assume_third_bp?
> 
> You might also want to check whether anything else in the vast code base calls CT::translate and see whether the assumptions make sense there.

I go strictly by the test suite for API conformance, but from that last run it seems that nothing in the code base relies on automatically filling out incomplete codons.

> In any case, as long as it's clearly documented, I don't think it matters too much what you do. Well, I take it back: there should be some way to do either assuming or not assuming without too much extra work. Writing the code to say "if we're in frame 1, which is the only frame where this can happen, and the length of the translated thing ends up being one too long, then truncate the object by one" was kind of annoying, and the extra object copying might be a problem if you were trying to write fast code, which luckily I'm not in this case.
> 
> -Amir

Fast code and BioPerl?  We're trying to make things faster, but this may be more difficult in practice with the default OO system (and a complete switch to Moose will be problematic in the short term).

I have committed a fix to github for the above.  Basically, setting either '-complete' or '-complete_codons' will fill out partial codons and attempt to translate them, but this behavior is off by default.  I think this makes sense, just from the perspective we don't want unintended side-effects.

chris

> ________________________________________
> From: Chris Fields [cjfields at illinois.edu]
> Sent: Monday, January 17, 2011 11:07
> To: Karger, Amir
> Cc: Aaron Mackey; bioperl-l at lists.open-bio.org
> Subject: Re: [Bioperl-l] Frame translation gets an extra aa?
> 
> Amir,
> 
> Completely missed the frame argument you passed.  Yes, the behavior between PrimarySeqI::translate and CodonTable::translate seems inconsistent here, particularly with the '-complete' parameter (implying a complete CDS) defaulting to false.  If the default assumption by PrimarySeqI::translate() is any sequence to be translated isn't complete, why should CodonTable::translate() automatically 'complete' the translation for incomplete codons by default?  I would consider this a bug.
> 
> However, as '-complete' also assumes a complete CDS, using it doesn't quite fit either, so we probably need some argument that allows for more finitely defining this.  '-strict' ?
> 
> Anyway, that is easily fixed; just currying the flag to the call to CodonTable::translate, then bypassing translation of partial codons is present, corrects the problem.  Would just need to decide on the above.
> 
> chris
> 
> 
> 
> _______________________________________________
> 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