Add a library of all CCD residues separate from modified amino/nucleic acids#1315
Conversation
thomas-dresselhaus
left a comment
There was a problem hiding this comment.
Thanks a lot, @swails . I'm confident that all issues I found are addressed here.
| scan = [x * y for x, y in zip(scan, selection)] | ||
| # Copy all parameters | ||
| struct = type(self)() | ||
| res_numbers_are_fake = {res.number for res in self.residues} == {0} |
There was a problem hiding this comment.
I actually think they are -1 if they are fake. And if you do that here, then you might want to use it in __repr__, too.
There was a problem hiding this comment.
-1 is the (bad) not-set default. The existing logic was only checking if they were 0, which leads me to think that they were set to 0 in one of the parsers.
There was a problem hiding this comment.
necrocommenting here, but -1 is sometimes a valid resid (if residues have been inserted before the canonical 0). Depending on the source of this (if this is internal book-keeping and you're sure it's never -1) then you might be better off using a safer sentinel value (-MAX_INT or something)
There was a problem hiding this comment.
Yes, that's why I called it a bad default 😃
In practice, multi-residue structures will only report res numbers being fake if all residue "number" attributes are the same value (0 in this case). If that's true, then the original residue numbers, whatever their source, are pretty meaningless.
This will allow doing bond/atom mapping for all standard 3-residue codes in the PDB.