{"action":"opened","issue":{"url":"https://api.github.com/repos/biopython/biopython/issues/1002","repository_url":"https://api.github.com/repos/biopython/biopython","labels_url":"https://api.github.com/repos/biopython/biopython/issues/1002/labels{/name}","comments_url":"https://api.github.com/repos/biopython/biopython/issues/1002/comments","events_url":"https://api.github.com/repos/biopython/biopython/issues/1002/events","html_url":"https://github.com/biopython/biopython/issues/1002","id":190181714,"number":1002,"title":"New frame translation method (from Redmine, bug 1999)","user":{"login":"MarkusPiotrowski","id":4503120,"avatar_url":"https://avatars.githubusercontent.com/u/4503120?v=3","gravatar_id":"","url":"https://api.github.com/users/MarkusPiotrowski","html_url":"https://github.com/MarkusPiotrowski","followers_url":"https://api.github.com/users/MarkusPiotrowski/followers","following_url":"https://api.github.com/users/MarkusPiotrowski/following{/other_user}","gists_url":"https://api.github.com/users/MarkusPiotrowski/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkusPiotrowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkusPiotrowski/subscriptions","organizations_url":"https://api.github.com/users/MarkusPiotrowski/orgs","repos_url":"https://api.github.com/users/MarkusPiotrowski/repos","events_url":"https://api.github.com/users/MarkusPiotrowski/events{/privacy}","received_events_url":"https://api.github.com/users/MarkusPiotrowski/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-17T22:23:20Z","updated_at":"2016-11-17T22:23:20Z","closed_at":null,"body":"Redmine bug No 1999, 18.05.2006\r\n\r\n> From  Marc Colosimo:\r\n> I'll repeat my previous posting to bugzilla so that it will stick out more. I've created a new frame translation method similar to `six_frame_translation` in `SeqUtils,` but this is more generic and produces output, as far as I can tell, exactly like DNA Striders (which I really like).\r\n> \r\n> I think this would be a good addition to `SeqUtils `or `Seq` itself.\r\n> \r\n> Marc\r\n \r\n> Comment No 1 from Peter Cock\r\n>Created an attachment (id=583)\r\n>Marc's frameTranslations.py rescued from the mailing list 15 May 2006\r\n\r\n\r\n> Comment No 2 from Michiel de Hoon\r\n> Since `SeqUtils.frameTranslations` and `SeqUtils.six_frame_translations` are so similar, I think we should\r\n> keep only one of these functions. Preferably named \"six_frame_translations\", for backward compatibility.\r\n> Also, I think we should not require the seqO argument to be a `Seq` object.\r\n> If this function is to replace the existing `SeqUtils.six_frame_translations`, we should make to sure to keep all the existing functionality of that function. I believe current the GC content calculation is missing in` SeqUtils.frameTranslations`.\r\n\r\n \r\n> Comment No 3 from Eric Talevich \r\n> 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:\r\n> \r\n> 1. Translate the DNA or RNA sequence to amino acids in all six frames\r\n> 2. Pretty-print the six-frame translation\r\n> \r\n> So, how about factoring out just this piece (or similar):\r\n>\r\n>      def translate_six_frames(seq, genetic_code=1):\r\n>             \"\"\"Dictionary of 6-frame translations.\"\"\"\r\n>             anti = seq.reverse_complement()\r\n>             frames = {}\r\n>             for i in range(0,3):\r\n>                 frames[i+1] = seq[i:].translate(genetic_code)\r\n>                 frames[-i-1] = SeqUtils.reverse(anti[i:].translate(genetic_code))\r\n>             return frames\r\n>\r\n> Then either pretty-printer can call this internally, and the user also has access to the individual translated sequences.\r\n\r\n>Comment No 4 from Peter Cock \r\n> (In reply to comment #3)\r\n> \r\n> >    Can we split this into two functions? I tried this function today, hoping it\r\n> >    would help me get a list of ORFs from a big contig -- but both\r\n> >    frameTranslations and six_frame_translation do two things without stopping in\r\n> >    between:\r\n> > \r\n> >    1. Translate the DNA or RNA sequence to amino acids in all six frames\r\n> \r\n> I'd wondered about this - possibly as a generator/iterator which always gives\r\n> back exactly six sequences - but don't really see much point. There is also\r\n> going to be some debate about how frames are labelled (especially the minus\r\n> frames).\r\n> \r\n> >    2. Pretty-print the six-frame translation\r\n> \r\n> Personally I don't see this as being very useful, but someone must like it.\r\n> I lean to just deprecating and removing this code.\r\n> \r\n>>    So, how about factoring out just this piece (or similar):\r\n>> \r\n>>     def translate_six_frames(seq, genetic_code=1):\r\n>>         \"\"\"Dictionary of 6-frame translations.\"\"\"\r\n>>         anti = seq.reverse_complement()\r\n>>         frames = {}\r\n>>         for i in range(0,3):\r\n>>             frames[i+1] = seq[i:].translate(genetic_code)\r\n>>             frames[-i-1] = SeqUtils.reverse(anti[i:].translate(genetic_code))\r\n>>         return frames\r\n> \r\n> You should be taking the reverse complement, not just the reverse. This\r\n> would just be seq[i:].reverse_complement() or seq.reverse_complenent()[i:]\r\n> depending on how you label the reverse frames."}}
{"actor":{"display_login":"MarkusPiotrowski"}}