[Bioperl-l] Frame translation gets an extra aa?
Karger, Amir
akarger at CGR.Harvard.edu
Mon Jan 17 18:02:05 UTC 2011
"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.
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
________________________________________
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
More information about the Bioperl-l
mailing list