IMP logo
IMP Reference Guide  2.21.0
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 from __future__ import print_function
7 import modeller
8 import IMP
9 import IMP.modeller
10 import sys
11 
12 IMP.setup_from_argv(sys.argv, "Load Modeller model")
13 
14 # Set up Modeller and build a model from the GGCC primary sequence
15 e = modeller.Environ()
16 e.edat.dynamic_sphere = True
17 e.libs.topology.read('${LIB}/top_heav.lib')
18 e.libs.parameters.read('${LIB}/par.lib')
19 modmodel = modeller.Model(e)
20 modmodel.build_sequence('GGCC')
21 # Generate Modeller stereochemistry
22 sel = modeller.Selection(modmodel)
23 modmodel.restraints.make(sel, restraint_type='STEREO', spline_on_site=False)
24 
25 # Set up IMP and use the ModelLoader class to load the atom coordinates
26 # from Modeller into IMP as a new Hierarchy
27 m = IMP.Model()
28 loader = IMP.modeller.ModelLoader(modmodel)
29 protein = loader.load_atoms(m)
30 
31 # Load each Modeller static restraint, and each Modeller dynamic restraint
32 # (soft-sphere in this case) in as an IMP.Restraint
34  list(loader.load_static_restraints())
35  + list(loader.load_dynamic_restraints()))
36 
37 print(sf.evaluate(False))
Strings setup_from_argv(const Strings &argv, std::string description, std::string positional_description, int num_positional)
Create a scoring function on a list of restraints.
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
Interface to the Modeller comparative modeling package.
Read a Modeller model into IMP.