IMP
2.3.1
The Integrative Modeling Platform
IMP Mainpage
Modules
Applications
Related Pages
Groups
Classes
Files
Examples
Indexes
File List
File Members
container/restrain_in_sphere.py
1
## \example container/restrain_in_sphere.py
2
# This fragment shows how to restrain a set of points stored in a
3
# SingletonContainer in a sphere of radius 'radius' centered around
4
# 'center'.
5
6
import
IMP.example
7
radius = 10
8
stiffness = 2
9
center =
IMP.algebra.Vector3D
(1, 2, 3)
10
(m, c) = IMP.example.create_model_and_particles()
11
ub =
IMP.core.HarmonicUpperBound
(radius, stiffness)
12
13
# Restrain based on the distance to a single point (hence a ball)
14
ss =
IMP.core.DistanceToSingletonScore
(ub, center)
15
16
r =
IMP.container.SingletonsRestraint
(ss, c)
17
m.add_restraint(r)
18
m.evaluate(
False
)
IMP::container::SingletonsRestraint
Applies a SingletonScore to each Singleton in a list.
Definition:
SingletonsRestraint.h:34
IMP::core::HarmonicUpperBound
Upper bound harmonic function (non-zero when feature > mean)
Definition:
core/HarmonicUpperBound.h:20
IMP::core::GenericDistanceToSingletonScore
Apply a function to the distance to a fixed point.
Definition:
DistanceToSingletonScore.h:34
IMP::example
Example module.
IMP::algebra::Vector3D
VectorD< 3 > Vector3D
Definition:
VectorD.h:395