Skip to content

Conformational options - #491

Open
skfegan wants to merge 24 commits into
mainfrom
conformational-options
Open

skfegan wants to merge 24 commits into
mainfrom
conformational-options

Conversation

@skfegan

@skfegan skfegan commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Summary

This pull request adds different options for ways to define residue level dihedrals for the conformational entropy calculation. Residue level dihedrals are lacking a standard definition unlike atomistic dihedrals.

Changes

  • added input option conf_type (str, default="ua_backbone")
  • added dihedral_finder.py to levels/dihedrals with 4 functions for identifying the dihedrals
  • updated documentation to describe the four options

Testing

  • Added some unit tests for the dihedral_finder

Impact

  • Gives some user flexibility in choice of method

Checklist

  • Tests added or updated
  • Documentation updated
  • If dependencies in pyproject.toml changed, the lower bounds were reviewed deliberately

@harryswift01 harryswift01 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this in, I think this will be a great addition to see all conf_type options in, and the dihedral methods are much easier to follow now that they're in their own module. I've left a few comments. The main one is on line 265: I'm not sure get_chain is doing what we intended there, so it'd be good to get your thoughts on that one. The other two are just small tidy-ups and not blockers.

if len(edges) == 1:
backbone += edges
elif len(edges) == 2:
chain = self._axes.get_chain(residue, edges[0], edges[1])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just had a check of get_chain and I'm not sure this is doing what we intended. It returns only the intermediate atoms and leaves out the edges (chain[1:-1] at axes.py:1173), so the edge atoms never get added to the backbone here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot. The get_chain function is acting as it should. I have fixed dihedral_finder so that the dihedrals are what was intended for ua_backbone method.

"""
atom_groups: list[Any] = []

if level == "united_atom":

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This united-atom block looks identical in all four methods (also 121, 184 and 240). Since conf_type only changes the residue level, could it just live once in topology._get_dihedrals?

List of AtomGroups, each representing a dihedral definition.
"""
atom_groups: list[Any] = []
self._dihedral_definitions = DihedralDefinitions()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This creates a new DihedralDefinitions (and an AxesCalculator) on every call. Could it be set up once in __init__ instead?

@skfegan
skfegan requested a review from harryswift01 December 1, 2026 09:20

This branch has not been deployed

No deployments
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.

2 participants