IMP  2.1.1
The Integrative Modeling Platform
restrainer/nup84_complex_in_bead_representation.py

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.

<!-- File: nup84_representation.xml -->
<Representation>
<Protein><Chain>
<Fragment id="Nup85">
<GeometricShapeRep total_residue="570">
<Sphere><InitialPosition x="300" y="300" z="300" optimize="1"/></Sphere>
</GeometricShapeRep>
</Fragment></Chain>
</Protein>
<Protein><Chain>
<Fragment id="Nup84">
<GeometricShapeRep total_residue="460">
<Sphere><InitialPosition x="200" y="0" z="200" optimize="1"/></Sphere>
</GeometricShapeRep>
</Fragment></Chain>
</Protein>
<Protein><Chain>
<Fragment id="Nup145C">
<GeometricShapeRep total_residue="442">
<Sphere><InitialPosition x="0" y="0" z="100" optimize="1"/></Sphere>
</GeometricShapeRep>
</Fragment></Chain>
</Protein>
<Protein><Chain>
<Fragment id="Nup120N">
<GeometricShapeRep total_residue="500">
<Sphere><InitialPosition x="0" y="100" z="200" optimize="1"/></Sphere>
</GeometricShapeRep>
</Fragment>
<Fragment id="Nup120C">
<GeometricShapeRep total_residue="260">
<Sphere><InitialPosition x="100" y="300" z="100" optimize="1"/></Sphere>
</GeometricShapeRep>
</Fragment></Chain>
</Protein>
<Protein><Chain>
<Fragment id="Nup133N">
<GeometricShapeRep total_residue="450">
<Sphere><InitialPosition x="100" y="0" z="300" optimize="1"/></Sphere>
</GeometricShapeRep>
</Fragment>
<Fragment id="Nup133C">
<GeometricShapeRep total_residue="288">
<Sphere><InitialPosition x="300" y="100" z="100" optimize="1"/></Sphere>
</GeometricShapeRep>
</Fragment></Chain>
</Protein>
<Protein><Chain>
<Fragment id="Seh1">
<GeometricShapeRep total_residue="351">
<Sphere><InitialPosition x="100" y="100" z="0" optimize="1"/></Sphere>
</GeometricShapeRep>
</Fragment></Chain>
</Protein>
<Protein><Chain>
<Fragment id="Sec13">
<GeometricShapeRep total_residue="379">
<Sphere><InitialPosition x="200" y="150" z="0" optimize="1"/></Sphere>
</GeometricShapeRep>
</Fragment></Chain>
</Protein>
</Representation>

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.

<!-- File: nup84_restraint.xml -->
<RestraintSet name="restraint_set">
<ExcludedVolume>
<Restraint name="ev_restraint">
<Particle id="Nup84"/>
<Particle id="Nup85"/>
<Particle id="Nup145C"/>
<Particle id="Nup120N"/>
<Particle id="Nup120C"/>
<Particle id="Nup133N"/>
<Particle id="Nup133C"/>
<Particle id="Seh1"/>
<Particle id="Sec13"/>
</ExcludedVolume>
<Y2H>
<Restraint name="y2h_restraint_1">
<Particle id="Nup145C"/>
<Particle id="Nup84"/>
<Particle id="Sec13"/>
<Restraint name="y2h_restraint_2">
<Particle id="Nup145C"/>
<Particle id="Nup85"/>
<Restraint name="y2h_restraint_3">
<Particle id="Nup145C"/>
<Particle id="Nup120C"/>
<Restraint name="y2h_restraint_4">
<Particle id="Nup84"/>
<Particle id="Nup133C"/>
<Restraint name="y2h_restraint_5">
<Particle id="Nup85"/>
<Particle id="Seh1"/>
<Restraint name="y2h_restraint_6">
<Particle id="Nup145C"/>
<Particle id="Sec13"/>
<Restraint name="y2h_restraint_7">
<Particle id="Nup120C"/>
<Particle id="Nup120N"/>
<Restraint name="y2h_restraint_8">
<Particle id="Nup133C"/>
<Particle id="Nup133N"/>
</Y2H>

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.

<!-- File: nup84_optimization.xml -->
<Optimization>
<ConjugateGradients id="opt1" steps="10">
<Restraint name="restraint_set"/>
</ConjugateGradients>
</Optimization>

The XML optimization input file sets up a simple conjugate gradients optimization.

<!-- File: nup84_display.xml -->
<Display>
<Protein>
<Chain><Fragment id="Nup85"><Color r="0.15" g="0.58" b="0.66"/></Fragment></Chain>
</Protein>
<Protein>
<Chain><Fragment id="Seh1"><Color r="0.38" g="0.04" b="0.37"/></Fragment></Chain>
</Protein>
<Protein>
<Chain><Fragment id="Nup84"><Color r="0.84" g="0.78" b="0.24"/></Fragment></Chain>
</Protein>
<Protein>
<Chain><Fragment id="Nup145C"><Color r="0.62" g="0.47" b="0.45"/></Fragment></Chain>
</Protein>
<Protein>
<Chain><Fragment id="Sec13"><Color r="0.00" g="0.71" b="0.01"/></Fragment></Chain>
</Protein>
<Protein>
<Chain><Fragment id="Nup120N"><Color r="0.11" g="0.31" b="0.86"/></Fragment></Chain>
<Chain><Fragment id="Nup120C"><Color r="0.11" g="0.31" b="0.86"/></Fragment></Chain>
</Protein>
<Protein>
<Chain><Fragment id="Nup133N"><Color r="0.89" g="0.27" b="0.40"/></Fragment></Chain>
<Chain><Fragment id="Nup133C"><Color r="0.89" g="0.27" b="0.40"/></Fragment></Chain>
</Protein>
</Display>

The XML display input file is for visualization only, and assigns each sphere a different color.

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.

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')