IMP logo
IMP Reference Guide  2.6.0
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 import sys
11 
12 IMP.setup_from_argv(sys.argv, "rigid bodies")
13 
14 m = IMP.Model()
15 # create a new IMP.atom.Hierarchy for the pdb file
16 mp1 = IMP.atom.read_pdb(IMP.core.get_example_path('example_protein.pdb'), m)
17 chains = IMP.atom.get_by_type(mp1, IMP.atom.CHAIN_TYPE)
18 rd = IMP.atom.Hierarchy(chains[0])
19 # Create a rigid body from the first chain
20 # note that rbs != chains[0] as the bounding volume for rbs needs to include all of the
21 # chain, but chains[0] might have a smaller sphere associated with it.
22 rbs = IMP.atom.create_rigid_body(chains[0])
23 print("all done")