IMP  2.1.1
The Integrative Modeling Platform
load_modeller_model.py
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.kernel.Model()
24 loader = IMP.modeller.ModelLoader(modmodel)
25 protein = loader.load_atoms(m)
26 
27 # Load each Modeller static restraint in as an IMP.kernel.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.kernel.Restraint
33 for r in loader.load_dynamic_restraints():
34  m.add_restraint(r)
35 
36 print m.evaluate(False)
See IMP.modeller for more information.
Read a Modeller model into IMP.
Class for storing model, its restraints, constraints, and particles.