from modeller import * from modeller.automodel import * log.verbose() env = environ() env.io.atom_files_directory = ['.', '../atom_files'] # Build 3 models, and assess with both DOPE and GA341 a = automodel(env, alnfile = 'alignment.ali', knowns = '5fd1', sequence = '1fdx', assess_methods=(assess.DOPE, assess.GA341)) a.starting_model= 1 a.ending_model = 3 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])