{"action":"created","issue":{"url":"https://api.github.com/repos/ParmEd/ParmEd/issues/441","labels_url":"https://api.github.com/repos/ParmEd/ParmEd/issues/441/labels{/name}","comments_url":"https://api.github.com/repos/ParmEd/ParmEd/issues/441/comments","events_url":"https://api.github.com/repos/ParmEd/ParmEd/issues/441/events","html_url":"https://github.com/ParmEd/ParmEd/issues/441","id":108921620,"number":441,"title":".mol2 file load fails for molecule with zero partial charges","user":{"login":"davidlmobley","id":7132257,"avatar_url":"https://avatars.githubusercontent.com/u/7132257?v=3","gravatar_id":"","url":"https://api.github.com/users/davidlmobley","html_url":"https://github.com/davidlmobley","followers_url":"https://api.github.com/users/davidlmobley/followers","following_url":"https://api.github.com/users/davidlmobley/following{/other_user}","gists_url":"https://api.github.com/users/davidlmobley/gists{/gist_id}","starred_url":"https://api.github.com/users/davidlmobley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidlmobley/subscriptions","organizations_url":"https://api.github.com/users/davidlmobley/orgs","repos_url":"https://api.github.com/users/davidlmobley/repos","events_url":"https://api.github.com/users/davidlmobley/events{/privacy}","received_events_url":"https://api.github.com/users/davidlmobley/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ParmEd/ParmEd/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-29T17:48:27Z","updated_at":"2015-09-30T12:56:29Z","closed_at":null,"body":"I'm trying to load a .mol2 file for a molecule which happens to have zero partial charges, and I get this issue:\r\n\r\n```\r\n/Users/dmobley/anaconda/lib/python2.7/site-packages/parmed/formats/registry.pyc in load_file(filename, *args, **kwargs)\r\n    121                             name, arg)\r\n    122     if hasattr(cls, 'parse'):\r\n--> 123         return cls.parse(filename, *args, **kwargs)\r\n    124     elif hasattr(cls, 'open_old'):\r\n    125         return cls.open_old(filename, *args, **kwargs)\r\n\r\n/Users/dmobley/anaconda/lib/python2.7/site-packages/parmed/formats/mol2.pyc in parse(filename, structure)\r\n    145                         last_residue = (resid, resname)\r\n    146                         restemp.name = resname\r\n--> 147                     atom = Atom(name=name, type=typ, number=id, charge=charge)\r\n    148                     atom.xx, atom.xy, atom.xz = x, y, z\r\n    149                     struct.add_atom(atom, resname, resid)\r\n\r\nUnboundLocalError: local variable 'charge' referenced before assignment\r\n```"},"comment":{"url":"https://api.github.com/repos/ParmEd/ParmEd/issues/comments/144387960","html_url":"https://github.com/ParmEd/ParmEd/issues/441#issuecomment-144387960","issue_url":"https://api.github.com/repos/ParmEd/ParmEd/issues/441","id":144387960,"user":{"login":"swails","id":779022,"avatar_url":"https://avatars.githubusercontent.com/u/779022?v=3","gravatar_id":"","url":"https://api.github.com/users/swails","html_url":"https://github.com/swails","followers_url":"https://api.github.com/users/swails/followers","following_url":"https://api.github.com/users/swails/following{/other_user}","gists_url":"https://api.github.com/users/swails/gists{/gist_id}","starred_url":"https://api.github.com/users/swails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swails/subscriptions","organizations_url":"https://api.github.com/users/swails/orgs","repos_url":"https://api.github.com/users/swails/repos","events_url":"https://api.github.com/users/swails/events{/privacy}","received_events_url":"https://api.github.com/users/swails/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T12:56:29Z","updated_at":"2015-09-30T12:56:29Z","body":"I just tried parsing the file you attached in your email and it worked fine.\r\n\r\nI also checked the code and saw that `charge` is initialized to 0 already if `NO_CHARGES` is set -- [see here](https://github.com/ParmEd/ParmEd/blob/master/parmed/formats/mol2.py#L164-L170).\r\n\r\nI suspect maybe you are using an out-of-date ParmEd?  Your traceback says that the parsing is failing on `atom = Atom(name=name, type=typ, number=id, charge=charge)`, which it says is line 147.  But that doesn't match up with line 147 from the file in master."}}