IMP  2.0.1
The Integrative Modeling Platform
basic_setup.py
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(IMP.restrainer.get_example_path('input/eg1_representation.xml'))
34 rsr = restrainer.add_restraint(IMP.restrainer.get_example_path('input/eg1_restraint.xml'))
35 
36 ###=======================================================================###
37 # At this point all data from XML files have been placed into the model.
38 # Now it is possible to perform various operations on the IMP model.
39 ###=======================================================================###
40 
41 # Get the IMP model object used by restrainer
42 model = restrainer.get_model()
43 
44 model.show()
45 model.evaluate(False)