IMP  2.1.0
The Integrative Modeling Platform
restrainer/basic_setup.py

This example shows how to construct a molecular hierarchy consisting of two proteins, and then apply connectivity restraint obtained from pulldown experimental data to these two proteins. On the following figure, we see an XML representation of the molecular hierarchy.

<!-- File: eg1_representation.xml -->
<Representation>
<Protein id="Protein1">
<Chain filename="data/protein1.pdb" selector="CAlpha"/>
<Chain>
<Fragment>
<GeometricShapeRep total_residue="10">
<Sphere/>
</GeometricShapeRep>
</Fragment>
</Chain>
</Protein>
<Protein id="Protein2">
<Chain filename="data/protein2.pdb"/>
</Protein>
</Representation>

Each level of molecular hierarchy corresponds to an XML tag. Each tag can have optional attributes. In this example, each protein has a unique id. Protein1 has 2 chains. The first chain is constructed from the PDB file using IMP::atom::CAlphaSelector. The second chain is represented by a sphere fragment that is big enough to contain 10 residues. Protein2 is constructed using the default selector, IMP::atom::NonWaterNonHydrogenSelector.

The following figure shows the definition of the restraint.

<!-- File: eg1_restraint.xml -->
<Pulldown>
<Particle id="Protein1"/>
<Particle id="Protein2"/>
</Pulldown>

The pulldown restraint is applied to Protein1 and Protein2.

The following Python script demonstrates the process of loading our data into IMP model.

1 ## \example restrainer/basic_setup.py
2 # This example shows how to construct a molecular hierarchy consisting of two proteins, and then apply connectivity restraint obtained from pulldown experimental data to these two proteins.
3 #
4 # On the following figure, we see an XML representation of the molecular hierarchy.
5 #
6 # \include eg1_representation.xml
7 #
8 # Each level of molecular hierarchy corresponds to an XML tag. Each tag can have
9 # optional attributes. In this example, each protein has a unique id. Protein1 has
10 # 2 chains. The first chain is constructed from the PDB file using
11 # IMP::atom::CAlphaSelector. The second chain is represented by a sphere fragment
12 # that is big enough to contain 10 residues. Protein2 is constructed using the
13 # default selector, IMP::atom::NonWaterNonHydrogenSelector.
14 #
15 # The following figure shows the definition of the restraint.
16 #
17 # \include eg1_restraint.xml
18 #
19 # The pulldown restraint is applied to Protein1 and Protein2.
20 #
21 # The following Python script demonstrates the process of loading our data into \imp model.
22 #
23 
24 # -- File: basic_setup.py --#
25 
26 import IMP
27 import IMP.restrainer
28 
29 # Create restrainer object
30 restrainer = IMP.restrainer.Main()
31 
32 # Add representation and restraint to restrainer
33 rep = restrainer.add_representation(
34  IMP.restrainer.get_example_path('input/eg1_representation.xml'))
35 rsr = restrainer.add_restraint(
36  IMP.restrainer.get_example_path('input/eg1_restraint.xml'))
37 
38 # =======================================================================###
39 # At this point all data from XML files have been placed into the model.
40 # Now it is possible to perform various operations on the IMP model.
41 # =======================================================================###
42 
43 # Get the IMP model object used by restrainer
44 model = restrainer.get_model()
45 
46 model.show()
47 model.evaluate(False)