Accessing output data after modeling is complete
Keywords: manual

Next: Fully automated alignment and Up: More advanced usage Previous: Building multi-chain models with Contents Index

##
Accessing output data after modeling is complete

After automodel.make() finishes building your model(s), the output data is accessible to your script as automodel.outputs. This variable is an ordinary Python list, one element for each model (so `a.outputs[0]` refers to the first model, and so on). Each list element is a Python dictionary of key:value pairs, the most important of which are:

- `'failure'`: the Python value `None` if no failure occurred (i.e., the model was built successfully). Otherwise, it is the exception that was raised.

- `'name'`: the name of the output PDB file, if no error occurred.

- `'molpdf'`: the value of the MODELLER objective function, if no error occurred.

- `'pdfterms'`: the contributions to the objective function from all physical restraint types (see Section 6.10.1), if no error occurred.

- `'xxx score'`: the value of the assessment score `'xxx'` (e.g., `'GA341 score'`, `'DOPE score'`).

If you are also building loop models, information for these is made available in loopmodel.loop.outputs.

Example: examples/automodel/model-outputs.py

      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])

Next: Fully automated alignment and Up: More advanced usage Previous: Building multi-chain models with Contents Index