diff --git a/python/BioSimSpace/Process/_amber.py b/python/BioSimSpace/Process/_amber.py index f9b5e21ca..aec4bc743 100644 --- a/python/BioSimSpace/Process/_amber.py +++ b/python/BioSimSpace/Process/_amber.py @@ -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 ( @@ -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: diff --git a/tests/Process/test_amber.py b/tests/Process/test_amber.py index 18a23df2a..eb66b0d88 100644 --- a/tests/Process/test_amber.py +++ b/tests/Process/test_amber.py @@ -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."""