IMP  2.1.1
The Integrative Modeling Platform
nup84_complex_in_bead_representation.py
1 ## \example restrainer/nup84_complex_in_bead_representation.py
2 # This example shows basic modeling of Nup84 complex using bead representation. On the following figures, we see XML input files for the representation, restraint, optimization and display. See kernel/nup84.py "Nup84 coarse grained" example in the kernel for a non-restrainer version of this example.
3 #
4 # \include nup84_representation.xml
5 #
6 # The XML representation input file determines how the system is represented using a 'bead model'. Each protein is represented as a sphere, or a pair of spheres (in the case of the rodlike Nup133 and Nup120 proteins), with larger proteins using larger spheres.
7 #
8 # \include nup84_restraint.xml
9 #
10 # The XML restraint input file encodes the input structural data as spatial restraints on the system. Here, we use two simple sources of information. First, excluded volume for each protein. Second, yeast two-hybrid results for some pairs of proteins.
11 #
12 # \include nup84_optimization.xml
13 #
14 # The XML optimization input file sets up a simple conjugate gradients optimization.
15 #
16 # \include nup84_display.xml
17 #
18 # The XML display input file is for visualization only, and assigns each sphere a different color.
19 #
20 #
21 # The following Python script loads in all four of the XML files and performs the optimization. Restrainer first generates a set of sphere-like particles to represent the system. It then converts the information in the restraints file into a set of IMP restraints. It generates an excluded volume restraint that prevents each protein sphere from penetrating any other sphere and a set of 'connectivity' restraints that force the protein particles to reproduce the interactions implied by the yeast two-hybrid experiments. The optimization generates a file optimized.py that is an input file for the molecular visualization program Chimera; when loaded into Chimera, it displays the final optimized configuration of the complex.
22 #
23 
24 # -- File: nup84_complex_in_bead_representation.py --#
25 
26 import IMP
27 import IMP.restrainer
28 
29 IMP.base.set_log_level(IMP.base.VERBOSE)
30 
31 # Create restrainer object
32 restrainer = IMP.restrainer.Main()
33 
34 # Add representation, restraint, optimization and display to restrainer
35 rep = restrainer.add_representation(
36  IMP.restrainer.get_example_path('input/nup84_representation.xml'))
37 rsr = restrainer.add_restraint(
38  IMP.restrainer.get_example_path('input/nup84_restraint.xml'))
39 opt = restrainer.add_optimization(
40  IMP.restrainer.get_example_path('input/nup84_optimization.xml'))
41 disp = restrainer.add_display(
42  IMP.restrainer.get_example_path('input/nup84_display.xml'))
43 
44 # =======================================================================###
45 # At this point all data from XML files have been placed into the model.
46 # Now it is possible to perform various operations on the IMP model.
47 # =======================================================================###
48 
49 # Save the initial state in Chimera format
50 restrainer.log.write('initial.py')
51 
52 # Perform optimization
53 restrainer.optimize()
54 
55 # Save the optimized state in Chimera format
56 restrainer.log.write('optimized.py')
void set_log_level(LogLevel l)
Set the current global log level.
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.