Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ProMod3
Manage
Activity
Members
Plan
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
ProMod3
Commits
94eded67
Commit
94eded67
authored
3 years ago
by
Studer Gabriel
Browse files
Options
Downloads
Patches
Plain Diff
Add kwargs to modelling.MinimizeModelEnergy
Add tolerance values that are passed to the according SD/LBFGS minimizers
parent
4535fd18
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modelling/pymod/_pipeline.py
+12
-3
12 additions, 3 deletions
modelling/pymod/_pipeline.py
with
12 additions
and
3 deletions
modelling/pymod/_pipeline.py
+
12
−
3
View file @
94eded67
...
@@ -256,7 +256,8 @@ def BuildSidechains(mhandle, merge_distance=4, fragment_db=None,
...
@@ -256,7 +256,8 @@ def BuildSidechains(mhandle, merge_distance=4, fragment_db=None,
def
MinimizeModelEnergy
(
mhandle
,
max_iterations
=
12
,
max_iter_sd
=
20
,
def
MinimizeModelEnergy
(
mhandle
,
max_iterations
=
12
,
max_iter_sd
=
20
,
max_iter_lbfgs
=
10
,
use_amber_ff
=
False
,
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.
'''
Minimize energy of final model using molecular mechanics.
Uses :mod:`ost.mol.mm` to perform energy minimization.
Uses :mod:`ost.mol.mm` to perform energy minimization.
...
@@ -291,6 +292,14 @@ def MinimizeModelEnergy(mhandle, max_iterations=12, max_iter_sd=20,
...
@@ -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
:param max_iter_lbfgs: Max. number of iterations within LBFGS method
:type max_iter_lbfgs: :class:`int`
: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.
:param use_amber_ff: if True, use the AMBER force field instead of the def.
CHARMM one (see :meth:`BuildFromRawModel`).
CHARMM one (see :meth:`BuildFromRawModel`).
:type use_amber_ff: :class:`bool`
:type use_amber_ff: :class:`bool`
...
@@ -335,8 +344,8 @@ def MinimizeModelEnergy(mhandle, max_iterations=12, max_iter_sd=20,
...
@@ -335,8 +344,8 @@ def MinimizeModelEnergy(mhandle, max_iterations=12, max_iter_sd=20,
ost
.
LogInfo
(
"
Perform energy minimization
"
ost
.
LogInfo
(
"
Perform energy minimization
"
"
(iteration %d, energy: %g)
"
%
(
i
+
1
,
cur_energy
))
"
(iteration %d, energy: %g)
"
%
(
i
+
1
,
cur_energy
))
try
:
try
:
sim
.
ApplySD
(
tolerance
=
1.0
,
max_iterations
=
max_iter_sd
)
sim
.
ApplySD
(
tolerance
=
tolerance_sd
,
max_iterations
=
max_iter_sd
)
sim
.
ApplyLBFGS
(
tolerance
=
1.0
,
max_iterations
=
max_iter_lbfgs
)
sim
.
ApplyLBFGS
(
tolerance
=
tolerance_lbfgs
,
max_iterations
=
max_iter_lbfgs
)
sim
.
UpdatePositions
()
sim
.
UpdatePositions
()
except
Exception
as
ex
:
except
Exception
as
ex
:
# ABORT ON FAIL
# ABORT ON FAIL
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment