IMP  2.1.0
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(
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)
See IMP.restrainer for more information.
std::string get_example_path(std::string file_name)
Return the path to installed example data for this module.