Skip to content

Commit

Permalink
Apply same fix to Process.Amber.
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Sep 25, 2024
1 parent 24f4958 commit 8a823b6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/BioSimSpace/Process/_amber.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ def _setup(self, **kwargs):

# Set the simulation box.
system.setBox(*_cubic(box_length))
reference_system.setBox(*_cubic(box_length))

# Apply SOMD1 compatibility to the perturbation.
if (
Expand All @@ -322,6 +323,7 @@ def _setup(self, **kwargs):
else:
# Check for perturbable molecules and convert to the chosen end state.
system = self._checkPerturbable(system)
reference_system = self._checkPerturbable(self._reference_system)

# RST file (coordinates).
try:
Expand Down
11 changes: 11 additions & 0 deletions tests/Process/test_amber.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,17 @@ def test_backbone_restraint_mask_rna(rna_system):
assert " restraintmask=\"@P,C5',C3',O3',O5'\"," in config


@pytest.mark.skipif(has_amber is False, reason="Requires AMBER to be installed.")
def test_perturbable_restraint(perturbable_system):
"""Test a free energy perturbation protocol."""

# Create a short minimisation prototocol with a restraint.
protocol = BSS.Protocol.Minimisation(steps=100, restraint="heavy")

# Run the process, check that it finished without error, and returns a system.
run_process(perturbable_system, protocol)


def run_process(system, protocol, check_data=False):
"""Helper function to run various simulation protocols."""

Expand Down

0 comments on commit 8a823b6

Please sign in to comment.