Reorganization of single and triple letter protein codes #174

wants to merge 4 commits into


None yet
3 participants

bow commented Apr 4, 2013

This pull request was triggered by the discussion here.

Summary of the changes:

  • I've moved the SCOP dictionary into Bio.Data.SCOPData.protein_letters_3to1. Other imports relying on the initial SCOP dictionary location have also been renamed. For the PDB imports, I use import Bio.Data, except for PDB/ where the dictionary protein_letters_3to1 is imported directly. I chose to rename the dict to make it in line with a corresponding dict in Bio.Data.IUPACData. And since we may break some scripts with this update (Bio.SCOP.three_to_one_dict is now gone), I thought we should just go all the way..
  • I've also moved the protein dictionaries in into Bio.Data.IUPACData. They're now split into two: extended (containing codes for 'extended' amino acids) and non-extended. By default, SeqUtils uses the extended one. These dictionaries do not contain stop codons, instead they remain the default custom_map argument, just like before.
  • There's also small change in seq3 to prevent unwanted update of these dictionaries, as they are now available Biopython-wide and may be used in modules other than SeqUtils.

bow added some commits Apr 4, 2013

@bow bow Move one-to-three protein letter maps into Bio.Data.IUPACData 4624999
@bow bow SeqUtils.seq3 now creates a copy of the imported IUPACData dict
This is to prevent a bug where the IUPACData dict is imported in some other
modules, and the key-value pairs have unexpected values due to seq3's update.
@bow bow Move Bio.SCOP.three_to_one_dict to Bio.Data.SCOPData ee60058

etal commented Apr 15, 2013

To avoid breaking scripts that use, could we add a file at Bio/SCOP/ that simply imports the Bio.Data.SCOPData dictionaries, assigns them to the old names, and issues a DeprecationWarning?


bow commented Apr 15, 2013

Good idea, Eric :). Added in the latest commit.


etal commented Aug 26, 2013

Looks good to me. All clear to merge?


cbrueffer commented Aug 26, 2013

Yes, please.


bow commented Mar 27, 2014

Closing this PR since it has been merged into master via cherry-pick (e.g. 8500794)

bow closed this Mar 27, 2014

bow deleted the bow:fix_pdbio_custom_map branch Jul 8, 2015

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