IMP  2.2.0
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
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 
12 m = IMP.kernel.Model()
13 prot = IMP.atom.read_pdb(IMP.core.get_example_path('example_protein.pdb'), m)
14 res = IMP.atom.get_by_type(prot, IMP.atom.RESIDUE_TYPE)
16 for r in res:
17  # add coordinates and a radius to the residue particle
19  # make sure that the coordinates and the radius define a sphere
20  # which contains all of the leaves (atoms) of the residue
21  IMP.core.Cover.setup_particle(r.get_particle(), pr)
22 # update the coordinates of the residue particles so that they cover the atoms
23 m.update()
Return the hierarchy children of a particle.
std::string get_example_path(std::string file_name)
Return the path to installed example data for this module.
static XYZR setup_particle(kernel::Model *m, ParticleIndex pi)
Definition: XYZR.h:48
static Cover setup_particle(kernel::Model *m, ParticleIndex pi, ParticleIndexesAdaptor members)
Definition: CoverRefined.h:72
Hierarchies get_by_type(Hierarchy mhd, GetByType t)
static const IMP::core::HierarchyTraits & get_traits()
Get the molecular hierarchy HierararchyTraits.
See IMP.core for more information.
See IMP.atom for more information.
void read_pdb(base::TextInput input, int model, Hierarchy h)
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:72