[Biopython-dev] [Bug 1999] new frame translation method

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Wed Feb 3 21:44:14 UTC 2010


http://bugzilla.open-bio.org/show_bug.cgi?id=1999





------- Comment #3 from eric.talevich at gmail.com  2010-02-03 16:44 EST -------
Can we split this into two functions? I tried this function today, hoping it
would help me get a list of ORFs from a big contig -- but both
frameTranslations and six_frame_translation do two things without stopping in
between:

1. Translate the DNA or RNA sequence to amino acids in all six frames
2. Pretty-print the six-frame translation


So, how about factoring out just this piece (or similar):

def translate_six_frames(seq, genetic_code=1):
    """Dictionary of 6-frame translations."""
    anti = seq.reverse_complement()
    frames = {}
    for i in range(0,3):
        frames[i+1]  = seq[i:].translate(genetic_code)
        frames[-i-1] = SeqUtils.reverse(anti[i:].translate(genetic_code))
    return frames


Then either pretty-printer can call this internally, and the user also has
access to the individual translated sequences.


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list