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

Feature Multiple Distance Restraints #178

Merged
merged 25 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6bae2d5
Update _restraint.py to handle multiple distance restraints
fjclark Aug 8, 2023
0c78c6b
Update names of all Boresch restraint tests
fjclark Aug 8, 2023
64dd2aa
Check correct keys in multiple distance restraints dict
fjclark Aug 8, 2023
fd400b8
Add tests for multiple distance restraints and fix bugs this revealed
fjclark Aug 8, 2023
6d9b629
Write input files for multiple distance restraints
fjclark Aug 8, 2023
5dc9585
Change access of pandas series to avoid deprecation warning
fjclark Aug 9, 2023
67b4382
Add first version of multiple distance restraints derivation algorithm
fjclark Aug 10, 2023
8cd3986
Ensure that atom record is always written
Aug 15, 2023
eb41a90
Correct SOMD pert files
Sep 1, 2023
8d89a05
Merge branch 'devel' into feature_mdr
Sep 1, 2023
0fe2fe4
Fix sandpit CI
Sep 1, 2023
8e722eb
Fix issue with checking alchemlyb version number
Sep 1, 2023
514370e
Make restraint search more robust for multiple distance restraints
Sep 21, 2023
f5d1743
Add more tests of mdr restraint search algorithm
Oct 2, 2023
16d00d0
Merge branch 'devel' into feature_mdr
Oct 2, 2023
a61bbc0
Merge branch 'devel' into feature_mdr
fjclark Nov 8, 2023
9971a7b
Add tests for MDR restraints dict
fjclark Nov 14, 2023
edf8294
Implement multiple distance restraints for GROMACS
fjclark Nov 14, 2023
f8098bf
Merge branch 'feature_mdr' of https://github.com/fjclark/biosimspace-…
fjclark Nov 14, 2023
a8aeb71
Merge branch 'feature_mdr_gromacs' into feature_mdr
fjclark Nov 14, 2023
35b237f
Merge branch 'devel' into feature_mdr
fjclark Nov 14, 2023
e33539f
Require that gromacs process is passed free energy protocol if restra…
fjclark Nov 14, 2023
a8b56d0
Update changelog with MDR implementation
fjclark Nov 14, 2023
6655bfd
Add warning about SOMD instabilities with decoupled ligands [ci skip]
fjclark Nov 18, 2023
8025d4a
Remove duplicate mention of scikit-learn in dependencies [ci skip]
fjclark Nov 21, 2023
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
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 scikit-learn
fjclark marked this conversation as resolved.
Show resolved Hide resolved
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