IMP logo
IMP Reference Guide  2.6.0
The Integrative Modeling Platform
core/cover_particles.py

Show how to maintain a sphere per residue which includes all atoms of the residue. The derivatives are propagated from the sphere cover to the atoms so that restraints can be used at multiple levels.

1 ## \example core/cover_particles.py
2 # Show how to maintain a sphere per residue which includes all atoms
3 # of the residue. The derivatives are propagated from the sphere
4 # cover to the atoms so that restraints can be used at multiple
5 # levels.
6 
7 import IMP
8 import IMP.core
9 import IMP.atom
10 import IMP.atom
11 import sys
12 
13 IMP.setup_from_argv(sys.argv, "cover particles")
14 
15 m = IMP.Model()
16 prot = IMP.atom.read_pdb(IMP.core.get_example_path('example_protein.pdb'), m)
17 res = IMP.atom.get_by_type(prot, IMP.atom.RESIDUE_TYPE)
19 for r in res:
20  # add coordinates and a radius to the residue particle
22  # make sure that the coordinates and the radius define a sphere
23  # which contains all of the leaves (atoms) of the residue
24  IMP.core.Cover.setup_particle(r.get_particle(), pr)
25 # update the coordinates of the residue particles so that they cover the atoms
26 m.update()