Skip to content

Add a library of all CCD residues separate from modified amino/nucleic acids#1315

Merged
swails merged 8 commits into
ParmEd:masterfrom
swails:feature/full-ccd-template
Sep 12, 2023
Merged

Add a library of all CCD residues separate from modified amino/nucleic acids#1315
swails merged 8 commits into
ParmEd:masterfrom
swails:feature/full-ccd-template

Conversation

@swails

@swails swails commented Aug 21, 2023

Copy link
Copy Markdown
Contributor

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

@thomas-dresselhaus thomas-dresselhaus left a comment

Copy link
Copy Markdown

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.

Comment thread parmed/structure.py
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}

Copy link
Copy Markdown

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.

@swails swails Sep 12, 2023

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown

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
Copy Markdown
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