[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[modeller_usage] How to optimize a model



Dear Ben Webb,

Thanks for everything you have been very helpful. I'm trying to include one model I generated in the optimization scrip fro FAQ:

from modeller import *
from modeller.automodel import *

log.verbose()
env = environ()

a = automodel(env, alnfile='align1.ali', knowns='templ1', sequence='targ1')
# Very thorough VTFM optimization:
a.library_schedule = autosched.slow
a.max_var_iterations = 300
# Very thorough MD optimization:
a.md_level = refine.very_slow
# Repeat the whole cycle 3-times and do not stop unless obj.func. > 1E6
a.repeat_optimization = 3
a.max_molpdf = 1e6

a.make()

How can I do it? And how can I automate it including on this script to optimize only the best model: from modeller import * from modeller.automodel import * log.verbose() env = environ() a = automodel(env,
            alnfile  = '1',
            knowns   = ('2', '3'),
sequence = 'bar', assess_methods=(assess.DOPE, assess.GA341)) a.starting_model= 1 a.ending_model = 10 a.make()

# Get a list of all successfully built models from a.outputs
ok_models = filter(lambda x: x['failure'] is None, a.outputs)

# Rank the models by DOPE score
key = 'DOPE score'
ok_models.sort(lambda a,b: cmp(a[key], b[key]))

# Get top model
m = ok_models[0]
print "Top model: %s (DOPE score %.3f)" % (m['name'], m[key])


a.make()

Thanks again,

--
Atila Iamarino
L.E.M.B. - Laboratory of Molecular Evolution and Bioinformatics
Av. Prof. Lineu Prestes, 1734 - USP (University of São Paulo) - ICB
Zip: 05508-000 Phone: +55 11 30917290 / +55 11 30918453