forked from biopython/biopython
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Record class in Bio.SCOP.Cla to use a dictionary instead of a…
… list of pairs, because the file format definition specified by the maintainers of SCOP states that the order of the key-value pairs in the hierarchy field of the Record does not matter. Also updated the string representation of the Record so that it does not end with a newline character. Updated tests accordingly.
- Loading branch information
Showing
5 changed files
with
59 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6d2257d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything in the spec about the possibility of duplicate keys? This can't be handled with a dict.
6d2257d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is true, but the file format specification is more of an informal description: http://scop.mrc-lmb.cam.ac.uk/scop/release-notes.html#scop-parseable-files
"the sixth column is the list of sunid for the domain: class (cl), fold (cf), superfamily (sf), family (fa), protein domain (dm), species (sp), and domain entry (px). They appear as pairs (key=sunid) so that order does not need to be taken into account in parsing the file and therefore intermediate levels can be added in the future without breaking code written now."
I don't know much about this, but I assumed that the hierarchical classification would remain for some time, and that a hierarchical classification implies a single value for each key.
6d2257d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any decision on this? Currently, to examine a member of the Record.hierarchy list, I must manually iterate over the list and check if the first member of each tuple is the key which I'm looking for. This is a pain and is easily remedied by this patch.
6d2257d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to discuss this on the main list (and CC the original authors)
as it could break existing scripts. Would you like to write it up as a proposal
ith a before/after example? Assuming there are no objections it seems sensible
to me, but I don't use SCOP.
The newline thing seems harmless, and I was meaning to merge that anyway.
If you want that to go in quickly, could you make a clean branch with just that
change (or a patch for just that change)?
Peter