Skip to content

Commit

Permalink
Merge pull request #178 from fjclark/feature_mdr
Browse files Browse the repository at this point in the history
Add support for multiple distance restraints for ABFE simulations.
[ci skip]
  • Loading branch information
lohedges authored Dec 4, 2023
2 parents 92999ad + 8025d4a commit 755103e
Show file tree
Hide file tree
Showing 18 changed files with 2,013 additions and 236 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Sandpit_exs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

- name: Install dependency
run: |
mamba install -c conda-forge -c openbiosim/label/main biosimspace python=3.10 ambertools gromacs "sire=2023.3" "alchemlyb>=2.1" pytest openff-interchange pint=0.21 rdkit "jaxlib>0.3.7" tqdm
mamba install -c conda-forge -c openbiosim/label/main biosimspace python=3.10 ambertools gromacs "sire=2023.3.0" "alchemlyb>=2.1" pytest openff-interchange pint=0.21 rdkit "jaxlib>0.3.7" tqdm scikit-learn
python -m pip install git+https://github.com/Exscientia/MDRestraintsGenerator.git
# For the testing of BSS.FreeEnergy.AlchemicalFreeEnergy.analysis
python -m pip install https://github.com/alchemistry/alchemtest/archive/master.zip
Expand Down
1 change: 1 addition & 0 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Devel
* Remove redundant ``BioSimSpace.Types.Type.__ne__`` operator (`#201 <https://github.com/OpenBioSim/biosimspace/pull/201>`__).
* Minor internal updates due to Sire API fixes (`#203 <https://github.com/OpenBioSim/biosimspace/pull/203>`__).
* Fix bug in the BSS Boresch restraint search code (`@fjclark <https://github.com/fjclark>`_) (`#204 <https://github.com/OpenBioSim/biosimspace/pull/204>`__).
* Added SOMD and GROMACS support for multiple distance restraints for ABFE calculations (`#178 <https://github.com/OpenBioSim/biosimspace/pull/178>`__).

`2023.4.0 <https://github.com/openbiosim/biosimspace/compare/2023.3.1...2023.4.0>`_ - Oct 13 2023
-------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,23 @@ def __init__(
"Use the 'BioSimSpace.Align' package to map and merge molecules."
)

if self._protocol.getPerturbationType() != "full":
pert_type = self._protocol.getPerturbationType()
if pert_type not in ["full", "release_restraint"]:
raise NotImplementedError(
"GROMACS currently only supports the 'full' perturbation "
"type. Please use engine='SOMD' when running multistep "
"perturbation types."
)
if pert_type == "release_restraint":
restraint_err = ValueError(
"The 'release_restraint' perturbation type requires a multiple "
"distance restraint restraint type."
)
if not restraint:
raise restraint_err
if restraint._restraint_type != "multiple_distance":
raise restraint_err

self._exe = _gmx_exe
elif engine == "AMBER":
# Find a molecular dynamics engine and executable.
Expand Down Expand Up @@ -354,6 +365,15 @@ def __init__(
# Ensure that the system is compatible with the restraint
restraint.system = self._system

# Warn the user about instabilities with multiple distance restraints in SOMD.
if restraint._restraint_type == "multiple_distance" and engine == "SOMD":
_warnings.warn(
"SOMD simulations with some non-interacting ligands can be unstable. This "
"affects some systems with multiple distance restraints during the release "
"restraint state. If you experience problems, consider using multiple distance "
"restraints with GROMACS instead."
)

self._restraint = restraint

# Create fake instance methods for 'analyse' and 'difference'. These
Expand Down
508 changes: 450 additions & 58 deletions python/BioSimSpace/Sandpit/Exscientia/FreeEnergy/_restraint.py

Large diffs are not rendered by default.

Loading

0 comments on commit 755103e

Please sign in to comment.