IMP
2.1.1
The Integrative Modeling Platform
IMP Mainpage
All IMP Modules
Related Pages
Modules
Namespaces
Classes
Files
Examples
Indexes
File List
File Members
custom_hierarchy.py
1
## \example core/custom_hierarchy.py
2
# This example shows how to create and use a custom hierarchy of particles.
3
4
import
IMP
5
import
IMP.core
6
7
8
def
custom_hierarchy(parent_particle, children_particles):
9
tr =
IMP.core.HierarchyTraits
(
"my hierarchy"
)
10
pd =
IMP.core.Hierarchy.setup_particle
(parent_particle, tr)
11
for
p
in
children_particles:
12
cd =
IMP.core.Hierarchy.setup_particle
(p, tr)
13
pd.add_child(cd)
14
pd.show()
15
16
m =
IMP.kernel.Model
()
17
p1 =
IMP.kernel.Particle
(m)
18
p2 =
IMP.kernel.Particle
(m)
19
p3 =
IMP.kernel.Particle
(m)
20
custom_hierarchy(p1, (p2, p3))
IMP::core::Hierarchy::setup_particle
static Hierarchy setup_particle(kernel::Model *m, ParticleIndex pi, DecoratorTraits tr=get_default_decorator_traits())
Definition:
core/Hierarchy.h:99
IMP::core::HierarchyTraits
Define the type for a type of hierarchy.
Definition:
core/Hierarchy.h:48
IMP::kernel::Particle
Class to handle individual model particles.
Definition:
kernel/declare_Particle.h:34
IMP::core
See IMP.core for more information.
Definition:
AngleRestraint.h:19
custom_hierarchy
Definition:
custom_hierarchy.py:1
IMP::kernel::Model
Class for storing model, its restraints, constraints, and particles.
Definition:
kernel/declare_Model.h:72