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