IMP  2.0.1
The Integrative Modeling Platform
modeller/load_modeller_model.py

This demonstrates reading in an existing Modeller model, and converting the Modeller restraints (both static and dynamic) into equivalent IMP restraints.

1 ## \example modeller/load_modeller_model.py
2 ## This demonstrates reading in an existing Modeller model, and converting the
3 ## Modeller restraints (both static and dynamic) into equivalent IMP restraints.
4 ##
5 
6 import modeller
7 import IMP
8 import IMP.modeller
9 
10 # Set up Modeller and build a model from the GGCC primary sequence
11 e = modeller.environ()
12 e.edat.dynamic_sphere = True
13 e.libs.topology.read('${LIB}/top_heav.lib')
14 e.libs.parameters.read('${LIB}/par.lib')
15 modmodel = modeller.model(e)
16 modmodel.build_sequence('GGCC')
17 # Generate Modeller stereochemistry
18 sel = modeller.selection(modmodel)
19 modmodel.restraints.make(sel, restraint_type='STEREO', spline_on_site=False)
20 
21 # Set up IMP and use the ModelLoader class to load the atom coordinates
22 # from Modeller into IMP as a new Hierarchy
23 m = IMP.Model()
24 loader = IMP.modeller.ModelLoader(modmodel)
25 protein = loader.load_atoms(m)
26 
27 # Load each Modeller static restraint in as an IMP Restraint
28 for r in loader.load_static_restraints():
29  m.add_restraint(r)
30 
31 # Load each Modeller dynamic restraint (soft-sphere in this case) in as an
32 # equivalent IMP Restraint
33 for r in loader.load_dynamic_restraints():
34  m.add_restraint(r)
35 
36 print m.evaluate(False)