-
Notifications
You must be signed in to change notification settings - Fork 159
Add a library of all CCD residues separate from modified amino/nucleic acids #1315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
Thanks a lot, @swails . I'm confident that all issues I found are addressed here.
@@ -1119,16 +1121,14 @@ def __getitem__(self, selection): | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.