IMP  2.4.0
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 from __future__ import print_function
6 import IMP.atom
7 
8 # Create an IMP model and add a heavy atom-only protein from a PDB file
10 
11 root = IMP.atom.Hierarchy.setup_particle(m, m.add_particle("root"))
13  m, m.add_particle("rigid body"),
15 
16 prot = IMP.atom.read_pdb(IMP.atom.get_example_path("example_protein.pdb"), m,
18 root.add_child(prot)
19 print("adding rigid body for atoms")
20 rigid_body.add_member(IMP.atom.create_rigid_body(prot))
21 
23 
24 print("creating residue level rep")
26 print("adding rigid body for residues")
27 rigid_body.add_member(IMP.atom.create_rigid_body(residues))
28 resolutions.add_representation(residues)
29 
30 print("creating triplet residue level rep")
32 resolutions.add_representation(triplets)
33 print("adding rigid body for triplets")
34 rigid_body.add_member(IMP.atom.create_rigid_body(triplets))
35 
37 resolutions.add_representation(whole)
38 
39 print("resolutions are", resolutions)
40 
41 # note these resolutions need to be fixed
42 print("atoms")
43 print(IMP.atom.Selection(root, residue_index=15, resolution=1).get_selected_particles())
44 print("residues")
45 print(IMP.atom.Selection(root, residue_index=15, resolution=.3).get_selected_particles())
46 print("several residues")
47 print(IMP.atom.Selection(root, residue_index=15, resolution=.2).get_selected_particles())
48 print("very coarse")
49 print(IMP.atom.Selection(root, residue_index=15, resolution=.01).get_selected_particles())
50 print("all")
51 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