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