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

Support version 1.0 for openfe and gufe #38

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

ijpulidos
Copy link
Contributor

@ijpulidos ijpulidos commented Mar 13, 2024

This PR supersedes #33.

Solves #31

It aims to add the following changes in order to support the 1.0 version/rc of gufe and openfe.

TODO:

  • Fix IntegratorSettings
    • Make a new integrator settings class for NEQ integrator
  • Fix solvation settings
    • should be just an import replacement
  • Deal with mapping changes
    • SIngle mapping validation
    • Make sure everything is now a list rather than a dictionary
    • Remove dependency on "ligand" dictionary entry in mapping
  • LJ Alchemical settings

@ijpulidos ijpulidos requested a review from IAlibay March 13, 2024 22:52
@codecov-commenter
Copy link

codecov-commenter commented Mar 13, 2024

Codecov Report

Attention: Patch coverage is 79.54545% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 85.84%. Comparing base (05ab4bc) to head (7b107c1).
Report is 4 commits behind head on main.

Files Patch % Lines
feflow/settings/integrators.py 74.28% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #38      +/-   ##
==========================================
- Coverage   92.06%   85.84%   -6.23%     
==========================================
  Files           7       10       +3     
  Lines         416     1399     +983     
==========================================
+ Hits          383     1201     +818     
- Misses         33      198     +165     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

class Config:
arbitrary_types_allowed = True

timestep: FloatQuantity["femtosecond"] = 4 * unit.femtoseconds
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry very much a flyby 2 second review for now - the IntegratorSettings need to include information about the barostat frequency & possibly com removal, see: https://github.com/OpenFreeEnergy/openfe/blob/c4678745900e6425354407de5885c7c3eefd429b/openfe/protocols/openmm_utils/omm_settings.py#L195-L201

I'm not particularly sure it's the right design pattern, see: OpenFreeEnergy/openfe#712, however because get_system_generator (https://github.com/OpenFreeEnergy/openfe/blob/main/openfe/protocols/openmm_utils/system_creation.py#L26) currently asks for an integrator settings object (and you're using it in the neq protocol), you end up needing that additional field.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah maybe there's going to be a typing issue - I can see that maybe we have to have a discussion about this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The barostat_frequency doesn't seem to be needed or used, as far as I can tell, at least not in the NeqCycling protocol, which makes me wonder if this is something we would like to change. What are the scenarios where changing this frequency is desired?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the end it was indeed needed for "real-life" simulations, this probably means we need to add more testing that resembles this situation.

Comment on lines 29 to 31
equilibrium_steps: int = 250000
"""Number of steps for the equilibrium parts of the cycle. Default 250000"""
nonequilibrium_steps: int = 250000
Copy link
Collaborator

Choose a reason for hiding this comment

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

Usually we put this under "SimulationSettings"

Copy link
Contributor Author

@ijpulidos ijpulidos Mar 14, 2024

Choose a reason for hiding this comment

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

In this case these are specific to the integrator as a single cycle/run of the integrator does a "equilibration on endstate A" -> "nonequilibrium sim on A to B (changing lambda)" -> "equilibration on endstate B" -> "nonequilibrium sim on B to A". So these parameters are to change how many steps on each of the eq/neq parts. I hope that makes sense. More info in the docs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is, this is not about prior equilibration of the system to perform the NEQ parts. Which is something that this protocol doesn't do, so far.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see what you mean. This is a bit of an odd once since, as a user, I would expect these to be more "how I define my simulation protocol" than "something related to my integrator". It probably doesn't matter, but it's something to consider longer term.

@ijpulidos
Copy link
Contributor Author

ijpulidos commented Mar 24, 2024

This one should be now pretty much ready to go.

The failing tests are the ones with "bad" mappings. Now the LigandAtomMapping implementation checks for boundaries, so the way we were forcing a "failed dag execution" is no longer working. We would have to think about better ways to test a failed dag execution (I think it's desired to have a "negative" test). Is the openfe package doing a similar test?

On the other hand, we should probably wait for a 1.0 release of both gufe and openfe before merging this into main.

@IAlibay
Copy link
Collaborator

IAlibay commented Mar 24, 2024

Awesome work here @ijpulidos ! I'll try to have a look tomorrow morning ahead of our call.

@dotsdl dotsdl marked this pull request as ready for review April 2, 2024 16:32
@ijpulidos ijpulidos mentioned this pull request Apr 16, 2024
12 tasks
@ijpulidos ijpulidos requested a review from IAlibay April 16, 2024 16:46
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.

None yet

3 participants