home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
2.22.0
The Integrative Modeling Platform
IMP Manual
Reference Guide
Tutorial Index
Modules
Classes
Examples
version 2.22.0
pmi/ideal_helix.py
1
## \example pmi/ideal_helix.py
2
"""Short example demonstrating ideal helices in PMI
3
"""
4
5
import
IMP
6
import
IMP.atom
7
import
IMP.rmf
8
import
IMP.pmi
9
import
IMP.pmi.topology
10
import
IMP.pmi.dof
11
import
IMP.pmi.macros
12
import
IMP.pmi.restraints
13
import
sys
14
15
IMP.setup_from_argv
(sys.argv,
"Demonstration of ideal helices"
)
16
17
# Create System and State
18
mdl =
IMP.Model
()
19
s =
IMP.pmi.topology.System
(mdl)
20
st = s.create_state()
21
22
# Create a molecule and add helix representation
23
# this makes a c-alpha chain in approximately the shape of a helix
24
mol = st.create_molecule(
"example_helix"
, sequence=
'A'
*20, chain_id=
'A'
)
25
mol.add_representation(mol,
26
resolutions=[1, 10],
27
ideal_helix=
True
)
28
hier = s.build()
29
30
# write a single-frame RMF to view the helix
31
out =
IMP.pmi.output.Output
()
32
out.init_rmf(
"example_helix.rmf3"
, hierarchies=[hier])
33
out.write_rmf(
"example_helix.rmf3"
)