IMP
2.0.0
The Integrative Modeling Platform
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
simple_connectivity_on_rigid_bodies.py
1
## \example restrainer/simple_connectivity_on_rigid_bodies.py
2
## This example shows how to create simple IMP::core::ConnectivityRestraint on rigid bodies.
3
##
4
5
#-- File: simple_connectivity_on_rigid_bodies --#
6
7
import
IMP
8
import
IMP.atom
9
import
IMP.restrainer
10
11
m =
IMP.Model
()
12
sel =
IMP.atom.CAlphaPDBSelector
()
13
14
mh1 =
IMP.atom.read_pdb
(
IMP.restrainer.get_example_path
(
"input.pdb"
), m, sel)
15
mh2 =
IMP.atom.read_pdb
(
IMP.restrainer.get_example_path
(
"input.pdb"
), m, sel)
16
IMP.atom.add_radii
(mh1)
17
IMP.atom.add_radii
(mh2)
18
19
mhs = IMP.atom.Hierarchies()
20
mhs.append(mh1)
21
mhs.append(mh2)
22
23
rbs =
IMP.restrainer.set_rigid_bodies
(mhs)
24
25
sc =
IMP.restrainer.create_simple_connectivity_on_rigid_bodies
(rbs)
26
27
r = sc.get_restraint()
28
h = sc.get_harmonic_upper_bound()
29
ps = sc.get_sphere_distance_pair_score()
30
31
sc.set_mean(10.0)
32
sc.set_standard_deviation(3.5)
33
sc.set_k(0.1)
34
35
m.add_restraint(r)
36
r.show()
37
38
m.evaluate(
False
)