{"action":"created","issue":{"url":"https://api.github.com/repos/biopython/biopython/issues/558","repository_url":"https://api.github.com/repos/biopython/biopython","labels_url":"https://api.github.com/repos/biopython/biopython/issues/558/labels{/name}","comments_url":"https://api.github.com/repos/biopython/biopython/issues/558/comments","events_url":"https://api.github.com/repos/biopython/biopython/issues/558/events","html_url":"https://github.com/biopython/biopython/issues/558","id":85579417,"node_id":"MDU6SXNzdWU4NTU3OTQxNw==","number":558,"title":"add gap \"codon\" to translate table","user":{"login":"ColinAnthony","id":8817395,"node_id":"MDQ6VXNlcjg4MTczOTU=","avatar_url":"https://avatars1.githubusercontent.com/u/8817395?v=4","gravatar_id":"","url":"https://api.github.com/users/ColinAnthony","html_url":"https://github.com/ColinAnthony","followers_url":"https://api.github.com/users/ColinAnthony/followers","following_url":"https://api.github.com/users/ColinAnthony/following{/other_user}","gists_url":"https://api.github.com/users/ColinAnthony/gists{/gist_id}","starred_url":"https://api.github.com/users/ColinAnthony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ColinAnthony/subscriptions","organizations_url":"https://api.github.com/users/ColinAnthony/orgs","repos_url":"https://api.github.com/users/ColinAnthony/repos","events_url":"https://api.github.com/users/ColinAnthony/events{/privacy}","received_events_url":"https://api.github.com/users/ColinAnthony/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2015-06-05T16:50:00Z","updated_at":"2018-10-04T09:39:36Z","closed_at":"2015-12-18T17:42:02Z","author_association":"NONE","body":"I understand that the seq.translate does not allow for translating sequences with gaps (ie: if you have a DNA alignment with gaps and want to create a protein alignment).\nThis should be quite a simple and very useful addition.\nWould it be possible to add {\"---\":\"-\",} to the translation table/dictionary?\n\nAdditionally, allowing incomplete codons to be translated to \"X\" would increase the usefulness of the function ie: {\"--N\":\"X\",\"-N-\":\"X\",\"N--\":\"X\"} where N = [A/G/C/T]\n"},"comment":{"url":"https://api.github.com/repos/biopython/biopython/issues/comments/426952638","html_url":"https://github.com/biopython/biopython/issues/558#issuecomment-426952638","issue_url":"https://api.github.com/repos/biopython/biopython/issues/558","id":426952638,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNjk1MjYzOA==","user":{"login":"peterjc","id":63959,"node_id":"MDQ6VXNlcjYzOTU5","avatar_url":"https://avatars2.githubusercontent.com/u/63959?v=4","gravatar_id":"","url":"https://api.github.com/users/peterjc","html_url":"https://github.com/peterjc","followers_url":"https://api.github.com/users/peterjc/followers","following_url":"https://api.github.com/users/peterjc/following{/other_user}","gists_url":"https://api.github.com/users/peterjc/gists{/gist_id}","starred_url":"https://api.github.com/users/peterjc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterjc/subscriptions","organizations_url":"https://api.github.com/users/peterjc/orgs","repos_url":"https://api.github.com/users/peterjc/repos","events_url":"https://api.github.com/users/peterjc/events{/privacy}","received_events_url":"https://api.github.com/users/peterjc/received_events","type":"User","site_admin":false},"created_at":"2018-10-04T09:39:36Z","updated_at":"2018-10-04T09:39:36Z","author_association":"MEMBER","body":"@Pezhvuk What do you mean? Quoting the release notes from Biopython 1.67 (8 June 2016),\r\n\r\n> When a gap character is defined, Bio.Seq will now translate gap codons\r\n> (e.g. \"---\") into a single gap (\"-\") in the protein sequence. The gap character\r\n> is inferred from the Seq object's alphabet, but it can also be passed as an\r\n> argument to the translate method.\r\n\r\n As far as I know, it is working perfectly, e.g.\r\n\r\nIt works perfectly and there is no deprecation warning:\r\n\r\n```python\r\n>>> from Bio.Seq import Seq\r\n>>> Seq(\"ACT---GAA\").translate(gap=\"-\")\r\nSeq('T-E', Gapped(ExtendedIUPACProtein(), '-'))\r\n```\r\n\r\nOr, doing this via an explicitly declared gapped alphabet:\r\n\r\n```python\r\n>>> from Bio.Seq import Seq\r\n>>> from Bio.Alphabet import generic_dna, Gapped\r\n>>> Seq(\"ACT---GAA\", Gapped(generic_dna, \"-\")).translate()\r\nSeq('T-E', Gapped(ExtendedIUPACProtein(), '-'))\r\n```"}}
{"actor":{"display_login":"peterjc"}}