IMP
2.2.1
The Integrative Modeling Platform
IMP Mainpage
All IMP Modules
Related Pages
Modules
Namespaces
Classes
Files
Examples
Indexes
multistate.py
1
## \example multistate.py
2
#
3
4
import
IMP.atom
5
import
IMP.kernel
6
7
m =
IMP.kernel.Model
()
8
9
rt =
IMP.atom.Hierarchy.setup_particle
(m, m.add_particle(
"root"
))
10
11
12
def
create_one():
13
h =
IMP.atom.read_pdb
(
IMP.atom.get_example_path
(
"1d3d-protein.pdb"
), m)
14
return
h
15
16
h0 = create_one()
17
rt.add_child(h0)
18
IMP.atom.State.setup_particle
(h0, 0)
19
h1 = create_one()
20
rt.add_child(h1)
21
IMP.atom.State.setup_particle
(h1, 1)
22
23
24
r8 =
IMP.atom.Selection
(
25
rt,
26
state_index=1,
27
residue_index=8,
28
atom_type=IMP.atom.AT_CA)
29
30
# we get the 8th CA from state 1
31
for
p
in
r8.get_selected_particles():
32
print
IMP.atom.get_state_index
(p), p