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