Generate Raf dict from PDB (closes 3169) #35

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

lennax commented Apr 23, 2012

I've adapted Hongbo Zhu's code to extract the three to one letter codes directly from the PDB Chemical Component dictionary.

Existing calls of from Raf import to_one_letter_code should work as expected.

  • Scripts/PDB/generate_three_to_one_dict.py: Downloads and extracts PDB Chemical Component Dictionary
  • Bio/SCOP/three_to_one_dict.py: Product of this script; Python-accessible version of the dict
  • Bio/SCOP/Raf.py: Modification of Raf to import three_to_one_dict
Generate Raf dict from PDB.
Script downloads and extracts PDB Chemical Component Dictionary.
Modified Raf to read from generated dict.

How likely is file size to change in the future? Maybe a warnings.warn(message) would be better than SystemExit(message) here.

etal commented on 85cfbcd Apr 23, 2012

Aside from a nitpick on the script, this patch looks good to me.

Contributor

lennax commented Apr 23, 2012

My logic was that the dictionary will likely only get bigger with time. But you make a good point and I've changed it to a warning. If the file download is corrupted, the gzip step will probably fail anyway.

Contributor

etal commented Apr 24, 2012

OK, all clear by me. Anyone else see a problem with adding a new script? (I'll merge it tomorrow if nobody else speaks up.)

Owner

peterjc commented Apr 25, 2012

Eric - are you familiar with git rebase? I prefer that for small changes like this to avoid a needless branch and merge in the main history (which is what GitHub does even if it could have been a 'fast forward' merge, i.e. no merge needed for the special case where the pull request is directly from the current master tip).

Contributor

etal commented Apr 25, 2012

Yes, I've spent a few tense evenings with git rebase.

I'm sensing approval for this change set, so I'll rebase, merge and push it tonight.

Owner

peterjc commented Apr 25, 2012

Please do - I've not tested it, but the basic idea of this patch seems good.

Contributor

etal commented Apr 26, 2012

Rebasing seems to have worked, so I'll close this pull request and the bug. Thanks again, Lenna!

@etal etal closed this Apr 26, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment