IMP  2.0.1
The Integrative Modeling Platform
cover_particles.py
1 ## \example core/cover_particles.py
2 ## 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.
3 
4 import IMP
5 import IMP.core
6 import IMP.atom
7 import IMP.atom
8 
9 m= IMP.Model()
10 prot= IMP.atom.read_pdb(IMP.core.get_example_path('example_protein.pdb'), m)
11 res= IMP.atom.get_by_type(prot, IMP.atom.RESIDUE_TYPE)
13 for r in res:
14  # add coordinates and a radius to the residue particle
16  # make sure that the coordinates and the radius define a sphere
17  # which contains all of the leaves (atoms) of the residue
18  IMP.core.Cover.setup_particle(r.get_particle(), pr)
19 # update the coordinates of the residue particles so that they cover the atoms
20 m.update()