diff --git a/modelling/pymod/_pipeline.py b/modelling/pymod/_pipeline.py index 8b79f214120d3c6bf4d345cdd223f2e7f5f33bac..db7fc2ad4b7d8cafcf530a17695ee3fae2113f68 100644 --- a/modelling/pymod/_pipeline.py +++ b/modelling/pymod/_pipeline.py @@ -256,7 +256,8 @@ def BuildSidechains(mhandle, merge_distance=4, fragment_db=None, def MinimizeModelEnergy(mhandle, max_iterations=12, max_iter_sd=20, max_iter_lbfgs=10, use_amber_ff=False, - extra_force_fields=list()): + extra_force_fields=list(), + tolerance_sd=1.0, tolerance_lbfgs=1.0): '''Minimize energy of final model using molecular mechanics. Uses :mod:`ost.mol.mm` to perform energy minimization. @@ -291,6 +292,14 @@ def MinimizeModelEnergy(mhandle, max_iterations=12, max_iter_sd=20, :param max_iter_lbfgs: Max. number of iterations within LBFGS method :type max_iter_lbfgs: :class:`int` + :param tolerance_sd: Tolerance parameter passed to ApplySD of + :class:`ost.mol.mm.Simulation` object. + :type tolerance_sd: :class:`float` + + :param tolerance_lbfgs: Tolerance parameter passed to ApplyLBFGS of + :class:`ost.mol.mm.Simulation` object. + :type tolerance_lbfgs: :class:`float` + :param use_amber_ff: if True, use the AMBER force field instead of the def. CHARMM one (see :meth:`BuildFromRawModel`). :type use_amber_ff: :class:`bool` @@ -335,8 +344,8 @@ def MinimizeModelEnergy(mhandle, max_iterations=12, max_iter_sd=20, ost.LogInfo("Perform energy minimization " "(iteration %d, energy: %g)" % (i+1, cur_energy)) try: - sim.ApplySD(tolerance = 1.0, max_iterations = max_iter_sd) - sim.ApplyLBFGS(tolerance = 1.0, max_iterations = max_iter_lbfgs) + sim.ApplySD(tolerance = tolerance_sd, max_iterations = max_iter_sd) + sim.ApplyLBFGS(tolerance = tolerance_lbfgs, max_iterations = max_iter_lbfgs) sim.UpdatePositions() except Exception as ex: # ABORT ON FAIL