IMP  2.3.1
The Integrative Modeling Platform
core/rigid_bodies.py

This example shows how to set up rigid bodies, one per residue in a protein. A score state is then used to ensure that the bodies remain rigid during the optimization process.

1 ## \example core/rigid_bodies.py
2 # This example shows how to set up rigid bodies, one per residue in a protein. A score
3 # state is then used to ensure that the bodies remain rigid during the optimization process.
4 #
5 
6 import IMP
7 import IMP.core
8 import IMP.atom
9 import IMP.container
10 
11 m = IMP.kernel.Model()
12 # create a new IMP.atom.Hierarchy for the pdb file
13 mp1 = IMP.atom.read_pdb(IMP.core.get_example_path('example_protein.pdb'), m)
14 chains = IMP.atom.get_by_type(mp1, IMP.atom.CHAIN_TYPE)
15 rd = IMP.atom.Hierarchy(chains[0])
16 # Create a rigid body from the first chain
17 # note that rbs != chains[0] as the bounding volume for rbs needs to include all of the
18 # chain, but chains[0] might have a smaller sphere associated with it.
19 rbs = IMP.atom.create_rigid_body(chains[0])
20 print "all done"