{"action":"created","issue":{"url":"https://api.github.com/repos/biopython/biopython/issues/1608","repository_url":"https://api.github.com/repos/biopython/biopython","labels_url":"https://api.github.com/repos/biopython/biopython/issues/1608/labels{/name}","comments_url":"https://api.github.com/repos/biopython/biopython/issues/1608/comments","events_url":"https://api.github.com/repos/biopython/biopython/issues/1608/events","html_url":"https://github.com/biopython/biopython/issues/1608","id":313712834,"node_id":"MDU6SXNzdWUzMTM3MTI4MzQ=","number":1608,"title":"Parsing Genbanks with cross-origin features fails since PR #1497","user":{"login":"Zulko","id":1646122,"node_id":"MDQ6VXNlcjE2NDYxMjI=","avatar_url":"https://avatars0.githubusercontent.com/u/1646122?v=4","gravatar_id":"","url":"https://api.github.com/users/Zulko","html_url":"https://github.com/Zulko","followers_url":"https://api.github.com/users/Zulko/followers","following_url":"https://api.github.com/users/Zulko/following{/other_user}","gists_url":"https://api.github.com/users/Zulko/gists{/gist_id}","starred_url":"https://api.github.com/users/Zulko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zulko/subscriptions","organizations_url":"https://api.github.com/users/Zulko/orgs","repos_url":"https://api.github.com/users/Zulko/repos","events_url":"https://api.github.com/users/Zulko/events{/privacy}","received_events_url":"https://api.github.com/users/Zulko/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":31,"created_at":"2018-04-12T12:50:02Z","updated_at":"2018-08-21T13:29:33Z","closed_at":"2018-07-04T15:07:44Z","author_association":"NONE","body":"Hi there and thanks for maintaining the library.\r\n\r\nSince version 1.71 and pull request #1497,  FeatureLocation will throw an error if its ``end`` parameter is lower than it's ``start``. The problem is that other programs are OK with reading or generating such features in genbank files. As a consequence, our programs crash everytime they meet this case, and there is no easy workaround I could think of.\r\n\r\nA typical case where this occurs is when the record represents a 7000bp circular plasmid, and a feature goes from coordinate 6800, over the end, to coordinate 100. (therefore, a 300bp feature). I believe this is very common, not against the Genbank standard (as far as I know), and therefore should still be supported without throwing errors.\r\n\r\nI understand that the motivation for PR #1497 was that such features may break some of the API, like ``len(feature)``, but I would argue the Biopython user could do that check themselves, or maybe there shold be some sort of option to raise an error or not.\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/biopython/biopython/issues/comments/414673921","html_url":"https://github.com/biopython/biopython/issues/1608#issuecomment-414673921","issue_url":"https://api.github.com/repos/biopython/biopython/issues/1608","id":414673921,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDY3MzkyMQ==","user":{"login":"jamesabbott","id":5315529,"node_id":"MDQ6VXNlcjUzMTU1Mjk=","avatar_url":"https://avatars0.githubusercontent.com/u/5315529?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesabbott","html_url":"https://github.com/jamesabbott","followers_url":"https://api.github.com/users/jamesabbott/followers","following_url":"https://api.github.com/users/jamesabbott/following{/other_user}","gists_url":"https://api.github.com/users/jamesabbott/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesabbott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesabbott/subscriptions","organizations_url":"https://api.github.com/users/jamesabbott/orgs","repos_url":"https://api.github.com/users/jamesabbott/repos","events_url":"https://api.github.com/users/jamesabbott/events{/privacy}","received_events_url":"https://api.github.com/users/jamesabbott/received_events","type":"User","site_admin":false},"created_at":"2018-08-21T13:29:33Z","updated_at":"2018-08-21T13:29:33Z","author_association":"NONE","body":"I've also just come across this problem with features spanning the origin in some Ensembl bacteria  embl format records. Although a parser warning is generated for the invalid location, in this case subsequent exceptions are thrown resulting in the records being unparesable.\r\n\r\nFor example, parsing the [Helicobacter_sp_mit_91_6242](ftp://ftp.ensemblgenomes.org/pub/bacteria/current/embl/bacteria_178_collection/helicobacter_sp_mit_01_6242/Helicobacter_sp_mit_01_6242.ASM169333v1.37.chromosome.Chromosome.dat.gz) record, which contains:\r\n```\r\nFT   mRNA            1594494..84\r\nFT                   /gene=\"BBW65_00005\"\r\nFT                   /note=\"transcript_id=ANV98697\"\r\n```\r\nresults in:\r\n> BiopythonParserWarning: Ignoring invalid location: '1594494..84'\r\n\r\n> Traceback (most recent call last):\r\n>   File \"/Users/jabbott/miniconda3/envs/PASynth/lib/python3.7/site-packages/Bio/SeqIO/InsdcIO.py\", line 269, in _insdc_location_string\r\n>     parts = location.parts\r\n> AttributeError: 'NoneType' object has no attribute 'parts'\r\n> During handling of the above exception, another exception occurred:\r\n> [snip]\r\n> AttributeError: 'NoneType' object has no attribute 'ref'\r\n\r\nThis is using biopython 1.72. If the problem occurs with Ensembl data then I suspect that location strings spanning the origin without using a join() shoud be considered valid. I'll raise an issue wiht the Ensembl helpdesk and point them at this issue and see what they say.Interestingly the 'ID' line in these records leaves the field for 'circular|linear' blank so it is not actually possible to determine if the location is valid with regards to the molecule type."}}
{"actor":{"display_login":"jamesabbott"}}