IMP  2.0.1
The Integrative Modeling Platform
simple_connectivity_on_molecules.py
1 ## \example restrainer/simple_connectivity_on_molecules.py
2 ## This example shows how to create simple IMP::core::ConnectivityRestraint on molecules.
3 ##
4 
5 #-- File: simple_connectivity_on_molecules.py --#
6 
7 import IMP
8 import IMP.core
9 import IMP.restrainer
10 
11 m = IMP.Model()
12 
14 ps = m.get_particles()
15 mhs = IMP.atom.Hierarchies()
16 
17 for p in ps:
19  mhs.append(mh)
20 
21 sc = IMP.restrainer.create_simple_connectivity_on_molecules(mhs)
22 
23 r = sc.get_restraint()
24 h = sc.get_harmonic_upper_bound()
25 sdps = sc.get_sphere_distance_pair_score()
26 
27 sc.set_mean(10.0)
28 sc.set_standard_deviation(3.5)
29 sc.set_k(0.1)
30 
31 m.add_restraint(r)
32 r.show()
33 
34 m.evaluate(False)