Skip to content

Commit

Permalink
bit more settings update
Browse files Browse the repository at this point in the history
  • Loading branch information
IAlibay committed Jan 29, 2024
1 parent 281b329 commit aa96a26
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions openfe/protocols/openmm_utils/omm_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,17 @@ class OpenMMSolvationSettings(BaseSolvationSettings):
The periodic cell size is defined by one, and only one, of the following:
* ``solvent_padding`` in combination with ``box_shape``,
* ``number_of_solvent_molecules`` in combination with ``box_shape``,
* ``box_vectors``,
* ``box_size``
When using ``number_of_solvent_molecules``, the size of the cell is
defined by :meth:`openmm.app.Modeller.addSolvent` internal heuristics,
automatically selecting a padding value that is large enough to contain
the number of waters based on a geometric estimate of the volume required
by each water molecule.
Defining the pertiodic cell shape
---------------------------------
Expand Down Expand Up @@ -141,12 +149,7 @@ class OpenMMSolvationSettings(BaseSolvationSettings):
"""
solvent_padding: Optional[FloatQuantity['nanometer'] = 1.2 * unit.nanometer]
"""
Minimum distance from any solute atoms to the edge of the solvent box.

When used, the number of waters to add is defined by OpenMM.Modeller's
internal heuristics. These heuristics are based on a geometric estimate
of the volume required by each water molecule.

Minimum distance from any solute bounding sphere to the edge of the box.

Note
----
Expand All @@ -166,12 +169,6 @@ class OpenMMSolvationSettings(BaseSolvationSettings):
"""
The number of solvent molecules (water + ions) to add.
When defined, the size of the cell will be defined by OpenMM.Modeller's
internal heuristics, automatically selecting a padding value that
is large enough to contain the number of waters based on a geometric
estimate of the volume required by each water molecule.
Note
----
* Cannot be defined alongside ``solvent_padding``, ``box_size``,
Expand Down Expand Up @@ -201,6 +198,17 @@ class OpenMMSolvationSettings(BaseSolvationSettings):
``number_of_solvent_molecules``, or ``box_vectors``.
"""

@validator('box_vectors')
def supported_vectors(cls, v):
if v is not None:
from openff.interchange.components._packmol import _box_vectors_are_in_reduced_form
if v.lower() not in supported:
errmsg = ("Only the following sampler_method values are "
f"supported: {supported}")
raise ValueError(errmsg)
return v




class AlchemicalSamplerSettings(SettingsBaseModel):
Expand Down

0 comments on commit aa96a26

Please sign in to comment.