IMP logo
IMP Reference Guide  develop.45c11de31d,2024/03/27
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.
3 # A score state is then used to ensure that the bodies remain rigid during
4 # the optimization process.
5 #
6 
7 import IMP
8 import IMP.core
9 import IMP.atom
10 import IMP.container
11 import sys
12 
13 IMP.setup_from_argv(sys.argv, "rigid bodies")
14 
15 m = IMP.Model()
16 # create a new IMP.atom.Hierarchy for the pdb file
17 mp1 = IMP.atom.read_pdb(IMP.core.get_example_path('example_protein.pdb'), m)
18 chains = IMP.atom.get_by_type(mp1, IMP.atom.CHAIN_TYPE)
19 rd = IMP.atom.Hierarchy(chains[0])
20 # Create a rigid body from the first chain
21 # note that rbs != chains[0] as the bounding volume for rbs needs to include
22 # all of the chain, but chains[0] might have a smaller sphere associated
23 # with it.
24 rbs = IMP.atom.create_rigid_body(chains[0])
25 print("all done")