Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ channels:
- openeye
dependencies:
# Base depends
- gufe ~=1.8.0
- gufe >=1.9.0,<2
- numpy
- openfe ~=1.8.0 # TODO: Remove once we don't depend on openfe
- openfe ~=1.10.0 # TODO: Remove once we don't depend on openfe
- openff-units
- openmm
- openmmforcefields >=0.14.1 # TODO: remove when upstream deps fix this
Expand Down
14 changes: 2 additions & 12 deletions feflow/protocols/nonequilibrium_cycling.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ def _execute(self, ctx, *, protocol, state_a, state_b, mapping, **inputs):
get_alchemical_components,
)
from feflow.utils.hybrid_topology import HybridTopologyFactory
from feflow.utils.charge import get_alchemical_charge_difference
from feflow.utils.misc import register_ff_parameters_template

# Get receptor components from systems if found (None otherwise)
Expand Down Expand Up @@ -239,17 +238,8 @@ def _execute(self, ctx, *, protocol, state_a, state_b, mapping, **inputs):
)

# Handle charge corrections/transformations
# Get the change difference between the end states
# and check if the charge correction used is appropriate
try: # Catch unsupported charges differences and raise protocol error
charge_difference = get_alchemical_charge_difference(
mapping,
forcefield_settings.nonbonded_method,
alchemical_settings.explicit_charge_correction,
solvent_comp_a, # Solvent comp in a is expected to be the same as in b
)
except ValueError as e:
raise ProtocolSupportError(str(e))
# Get the formal change difference between the end states
charge_difference = mapping.get_alchemical_charge_difference()

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.

[nit] you're losing validation re: not doing net charge transformations without PME - probably will want to add that back at some point.

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.

Ah good catch! This is probably why the CI was taking so long, since the error wasn't being raised and we have a test running a whole DAG with it!

Will re-add the validation and refactor the test such that it doesn't run a whole DAG, even in case the error isn't raised


if alchemical_settings.explicit_charge_correction:
alchem_water_resids = _rfe_utils.topologyhelpers.get_alchemical_waters(
Expand Down
11 changes: 10 additions & 1 deletion feflow/settings/integrators.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
for the specific integrator settings.
"""

from typing import Annotated, TypeAlias
from typing import Annotated, TypeAlias, Literal

from pydantic import ConfigDict, field_validator

Expand Down Expand Up @@ -35,6 +35,15 @@ class PeriodicNonequilibriumIntegratorSettings(SettingsBaseModel):
"""Number of steps for the equilibrium parts of the cycle. Default 12500"""
nonequilibrium_steps: int = 12500
"""Number of steps for the non-equilibrium parts of the cycle. Default 12500"""
barostat: Literal["MonteCarloBarostat", "MonteCarloMembraneBarostat"] = (

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.

Will membrane support work out of the box?

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.

Hmm you are right, surely not since we are not handling membrane components at all. Maybe we just want to make this one just Literal["MonteCarloBarostat"]? Or what do you suggest?

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.

Yeah maybe that's a good short term solution.

"MonteCarloBarostat"
)
"""
The barostat to be used in the simulations. Default MonteCarloBarostat.
Notes
-----
If the system contains a membrane, use the `MonteCarloMembraneBarostat`.
"""
barostat_frequency: TimestepQuantity = 25 * unit.timestep
"""
Frequency at which volume scaling changes should be attempted.
Expand Down
2 changes: 2 additions & 0 deletions feflow/tests/test_protein_mutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,8 @@ def test_double_charge_fails(
from feflow.utils.exceptions import ProtocolSupportError

settings = NonEquilibriumCyclingProtocol.default_settings()
# Change engine platform for tests
settings.engine_settings.compute_platform = "CPU"

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.

Mostly for @dotsdl - please be aware that the default for all this is now CUDA, so if you're running any kind of minimization, etc.. on F@H servers, they'll need to have a CUDA GPU.

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 see. I'll make a PR into alchemiscale-fah that sets settings.engine_settings.compute_platform to None so that this doesn't trip users up. It's not a setting that has any bearing on the openmm-core used on F@H volunteer hosts downstream.

# We need to make sure we enable the alchemical charge correction
settings.alchemical_settings.explicit_charge_correction = True

Expand Down
4 changes: 0 additions & 4 deletions feflow/utils/charge.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
from openfe.protocols.openmm_utils.charge_generation import (
assign_offmol_partial_charges,
)
from openfe.protocols.openmm_rfe.equil_rfe_methods import (
_get_alchemical_charge_difference,
)

# TODO: Importing from OpenFE for now, should we migrate them here?
assign_offmol_partial_charges = assign_offmol_partial_charges
get_alchemical_charge_difference = _get_alchemical_charge_difference
Loading