Changing the default optimization and refinement protocol

See Section A.4 for a detailed description of the optimization and refinement protocol used by AutoModel. To summarize, each model is first optimized with the variable target function method (VTFM) with conjugate gradients (CG), and is then refined using molecular dynamics (MD) with simulated annealing (SA) [Šali & Blundell, 1993]. Most of the time (70%) is spent on the MD&SA part. Our experience is that when MD&SA are used, if there are violations in the best of the 10 models, they probably come from an alignment error, not an optimizer failure (if there are no insertions longer than approximately 15 residues).

The VTFM step can be tuned by adjusting AutoModel.library_schedule, AutoModel.max_var_iterations, and AutoModel.max_molpdf.

The MD&SA step can be tuned by adjusting AutoModel.md_level.

The whole optimization can be repeated multiple times if desired (by default it is run only once) by adjusting AutoModel.repeat_optimization.

The energy function used in both VTFM and MD&SA can be scaled by setting Environ.schedule_scale. (Note that for VTFM, the function is additionally scaled by the factors set in AutoModel.library_schedule.)

Example: examples/automodel/model-changeopt.py

# Example of changing the default optimization schedule
from modeller import *
from modeller.automodel import *

log.verbose()
env = Environ()

# Give less weight to all soft-sphere restraints:
env.schedule_scale = physical.Values(default=1.0, soft_sphere=0.7)
env.io.atom_files_directory = ['.', '../atom_files']

a = AutoModel(env, alnfile='alignment.ali', knowns='5fd1', sequence='1fdx')
a.starting_model = a.ending_model = 1

# Very thorough VTFM optimization:
a.library_schedule = autosched.slow
a.max_var_iterations = 300

# Thorough MD optimization:
a.md_level = refine.slow

# Repeat the whole cycle 2 times and do not stop unless obj.func. > 1E6
a.repeat_optimization = 2
a.max_molpdf = 1e6

a.make()