{"action":"opened","issue":{"url":"https://api.github.com/repos/osuosl/pgd/issues/51","repository_url":"https://api.github.com/repos/osuosl/pgd","labels_url":"https://api.github.com/repos/osuosl/pgd/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/osuosl/pgd/issues/51/comments","events_url":"https://api.github.com/repos/osuosl/pgd/issues/51/events","html_url":"https://github.com/osuosl/pgd/issues/51","id":153129816,"number":51,"title":"Refactor code that associates filenames with protein codes","user":{"login":"mathuin","id":221823,"avatar_url":"https://avatars.githubusercontent.com/u/221823?v=3","gravatar_id":"","url":"https://api.github.com/users/mathuin","html_url":"https://github.com/mathuin","followers_url":"https://api.github.com/users/mathuin/followers","following_url":"https://api.github.com/users/mathuin/following{/other_user}","gists_url":"https://api.github.com/users/mathuin/gists{/gist_id}","starred_url":"https://api.github.com/users/mathuin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathuin/subscriptions","organizations_url":"https://api.github.com/users/mathuin/orgs","repos_url":"https://api.github.com/users/mathuin/repos","events_url":"https://api.github.com/users/mathuin/events{/privacy}","received_events_url":"https://api.github.com/users/mathuin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-04T22:30:47Z","updated_at":"2016-05-04T22:30:47Z","closed_at":null,"body":"Right now we have at least three different pieces of code in the splicer app that associate protein codes like `1XYZ` with files like `./pdb/pdb1xyz.ent.gz`.  We do it in the FTP update script, in the protein import script, and the tests.\r\n\r\nEach of these are implemented differently.  They all need to change once we start using the rsync archive which has files in locations like `/data/pdb/xy/pdb1xyz.ent.gz`.  I think we should write one routine, put it somewhere in the splicer app where everything can see it, and then make all the others use that one.\r\n\r\nWhere to put it?  This \"app\" started life as a collection of not-really-Django code.  Right now I'm leaning towards creating another file (say tools.py) for this routine and any others like it that we come across.  Then it's a simple matter of `from pgd_splicer.tools import pdbfile` or the like.\r\n\r\nThoughts?  I can mock something up as a demo if that will help."}}