IMP  2.0.1
The Integrative Modeling Platform
restrainer/simple_diameter.py

This example shows how to create simple IMP::core::DiameterRestraint.

1 ## \example restrainer/simple_diameter.py
2 ## This example shows how to create simple IMP::core::DiameterRestraint.
3 ##
4 
5 #-- File: simple_diameter.py --#
6 
7 import IMP
8 import IMP.core
9 import IMP.restrainer
10 
11 imp_model = IMP.Model()
12 ps = IMP.core.create_xyzr_particles(imp_model, 50, 1.0)
13 diameter = 10
14 
15 sd = IMP.restrainer.create_simple_diameter(ps, diameter)
16 
17 r = sd.get_restraint()
18 h = sd.get_harmonic_upper_bound()
19 
20 sd.set_mean(10.0)
21 sd.set_standard_deviation(3.5)
22 sd.set_k(0.1)
23 
24 imp_model.add_restraint(r)
25 r.show()
26 
27 imp_model.evaluate(False)