Skip to content
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

Update topology/system particle bookkeeping in OpenMM #1051

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

mattwthompson
Copy link
Member

@mattwthompson mattwthompson commented Sep 17, 2024

Description

Resolves #1049

Checklist

Copy link

codecov bot commented Sep 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.51%. Comparing base (292faec) to head (694449f).

Additional details and impacted files

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@mattwthompson mattwthompson marked this pull request as ready for review September 18, 2024 13:56
Copy link

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

Couple of very brief (i.e. had 10 mins to read the code) and probably way too specifically opiniated to OpenFE workfllows views.

@@ -173,6 +186,21 @@ def to_openmm_topology(
order=bond_order,
)

if has_virtual_sites and not collate:
virtual_site_chain = openmm_topology.addChain(atom_chain_id)
virtual_site_residue = openmm_topology.addResidue("VS", virtual_site_chain)
Copy link

Choose a reason for hiding this comment

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

From a practical standpoint, a reference to the original residue would possibly be useful - i.e. when I'm doing "solvent within N of Y" I'm looking for a residue name that matches SOL | WAT | HOH not VS.

virtual_site_residue = openmm_topology.addResidue("VS", virtual_site_chain)

for molecule_index, molecule in enumerate(topology.molecules):
virtual_sites_in_this_molecule: list[VirtualSiteKey] = molecule_virtual_site_map[molecule_index]
Copy link

Choose a reason for hiding this comment

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

Only briefly looking at things, but it looks to me like that we're really needing is this map. If we could map things to/from the collated form then yes we have to plan for this map being optionally around, but at the same time it's not crazy extra amounts of work to work around it.

interchange
The Interchange object to convert to an OpenMM Topology.
collate
If False, the default, all virtual sites will be added to a single residue at the end of the topology.
Copy link

Choose a reason for hiding this comment

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

single residue

I'm sure I'm missing something important here - is there a practical advantage to doing a single residue rather than a residue per molecule's worth of virtual sites?

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