IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
atom/multiresolution.py
1## \example atom/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
5import IMP.atom
6import sys
7
8IMP.setup_from_argv(sys.argv, "multiresolution")
9
10# Create an IMP model and add a heavy atom-only protein from a PDB file
11m = IMP.Model()
12
13root = IMP.atom.Hierarchy.setup_particle(m, m.add_particle("root"))
15 m, m.add_particle("rigid body"),
17
18prot = IMP.atom.read_pdb(IMP.atom.get_example_path("example_protein.pdb"), m,
20root.add_child(prot)
21print("adding rigid body for atoms")
22rigid_body.add_member(IMP.atom.create_rigid_body(prot))
23
25
26print("creating residue level rep")
28print("adding rigid body for residues")
29rigid_body.add_member(IMP.atom.create_rigid_body(residues))
30resolutions.add_representation(residues)
31
32print("creating triplet residue level rep")
34resolutions.add_representation(triplets)
35print("adding rigid body for triplets")
36rigid_body.add_member(IMP.atom.create_rigid_body(triplets))
37
39resolutions.add_representation(whole)
40
41print("resolutions are", resolutions)
42
43# note these resolutions need to be fixed
44print("atoms")
46 root, residue_index=15, resolution=1).get_selected_particles())
47print("residues")
49 root, residue_index=15, resolution=.3).get_selected_particles())
50print("several residues")
52 root, residue_index=15, resolution=.2).get_selected_particles())
53print("very coarse")
55 root, residue_index=15, resolution=.01).get_selected_particles())
56print("all")
58 root, residue_index=15,
59 resolution=IMP.atom.ALL_RESOLUTIONS).get_selected_particles())
Class for storing model, its restraints, constraints, and particles.
Definition Model.h:111
A reference frame in 3D.
static Hierarchy setup_particle(Model *m, ParticleIndex pi, ParticleIndexesAdaptor children=ParticleIndexesAdaptor())
Create a Hierarchy of level t by adding the needed attributes.
Select non water and non hydrogen atoms.
Definition pdb.h:320
static Representation setup_particle(Model *m, ParticleIndex pi)
Select hierarchy particles identified by the biological name.
Definition Selection.h:76
static RigidBody setup_particle(Model *m, ParticleIndex pi, ParticleIndexesAdaptor ps)
Functionality for loading, creating, manipulating and scoring atomic structures.
IMP::core::RigidBody create_rigid_body(const Hierarchies &h, std::string name=std::string("created rigid body"))
Rigidify a molecule or collection of molecules.
std::string get_example_path(std::string file_name)
Return the full path to one of this module's example files.
Hierarchy read_pdb(TextInput input, Model *model, PDBSelector *selector=get_default_pdb_selector(), bool select_first_model=true)
Read all the molecules in the first model of the PDB file.
Hierarchy create_simplified_along_backbone(Hierarchy input, int num_res, bool keep_detailed=false, Model *m=nullptr)
void setup_from_argv(int argc, char **argv, std::string description)
Parse the command line flags and return the positional arguments.