IMP  2.3.1
The Integrative Modeling Platform
atom/multiresolution.py
1 ## \example multiresolution.py
2 # This example shows how to use the multiresolution support available in
3 # IMP.atom via the IMP.atom.Resolution decorator and IMP.atom.Selection
4 
5 import IMP.atom
6 
7 # Create an IMP model and add a heavy atom-only protein from a PDB file
9 
10 root = IMP.atom.Hierarchy.setup_particle(m, m.add_particle("root"))
12  m, m.add_particle("rigid body"),
14 
15 prot = IMP.atom.read_pdb(IMP.atom.get_example_path("example_protein.pdb"), m,
17 root.add_child(prot)
18 print "adding rigid body for atoms"
19 rigid_body.add_member(IMP.atom.create_rigid_body(prot))
20 
22 
23 print "creating residue level rep"
25 print "adding rigid body for residues"
26 rigid_body.add_member(IMP.atom.create_rigid_body(residues))
27 resolutions.add_representation(residues)
28 
29 print "creating triplet residue level rep"
31 resolutions.add_representation(triplets)
32 print "adding rigid body for triplets"
33 rigid_body.add_member(IMP.atom.create_rigid_body(triplets))
34 
36 resolutions.add_representation(whole)
37 
38 print "resolutions are", resolutions
39 
40 # note these resolutions need to be fixed
41 print "atoms"
42 print IMP.atom.Selection(root, residue_index=15, resolution=1).get_selected_particles()
43 print "residues"
44 print IMP.atom.Selection(root, residue_index=15, resolution=.3).get_selected_particles()
45 print "several residues"
46 print IMP.atom.Selection(root, residue_index=15, resolution=.2).get_selected_particles()
47 print "very coarse"
48 print IMP.atom.Selection(root, residue_index=15, resolution=.01).get_selected_particles()
49 print "all"
50 print IMP.atom.Selection(root, residue_index=15, resolution=IMP.atom.ALL_RESOLUTIONS).get_selected_particles()
Select non water and non hydrogen atoms.
Definition: pdb.h:197
static RigidBody setup_particle(kernel::Model *m, ParticleIndex pi, kernel::ParticleIndexesAdaptor ps)
Definition: rigid_bodies.h:168
std::string get_example_path(std::string file_name)
Return the path to installed example data for this module.
A reference frame in 3D.
static Hierarchy setup_particle(kernel::Model *m, kernel::ParticleIndex pi, kernel::ParticleIndexesAdaptor children=kernel::ParticleIndexesAdaptor())
static Representation setup_particle(kernel::Model *m, ParticleIndex pi)
Hierarchy create_simplified_along_backbone(Chain input, const IntRanges &residue_segments, bool keep_detailed=false)
IMP::core::RigidBody create_rigid_body(Hierarchy h)
Functionality for loading, creating, manipulating and scoring atomic structures.
void read_pdb(base::TextInput input, int model, Hierarchy h)
Select hierarchy particles identified by the biological name.
Definition: Selection.h:62
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:73