Skip to content

Conversation

@swails
Copy link
Contributor

@swails swails commented Aug 21, 2023

This will allow doing bond/atom mapping for all standard 3-residue codes in the PDB.

Copy link

@thomas-dresselhaus thomas-dresselhaus left a 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.

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}

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.

Copy link
Contributor Author

@swails swails Sep 12, 2023

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.

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)

Copy link
Contributor Author

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.

@swails swails merged commit 7ba559f into ParmEd:master Sep 12, 2023
@swails swails deleted the feature/full-ccd-template branch September 12, 2023 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants