home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
develop.63b38c487d,2024/12/22
The Integrative Modeling Platform
IMP Manual
Reference Guide
Tutorial Index
Modules
Classes
Examples
doc
examples
container
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
import
sys
8
9
IMP.setup_from_argv
(sys.argv,
"restrain in sphere"
)
10
11
radius = 10
12
stiffness = 2
13
center =
IMP.algebra.Vector3D
(1, 2, 3)
14
(m, c) = IMP.example.create_model_and_particles()
15
ub =
IMP.core.HarmonicUpperBound
(radius, stiffness)
16
17
# Restrain based on the distance to a single point (hence a ball)
18
ss =
IMP.core.DistanceToSingletonScore
(ub, center)
19
20
r =
IMP.container.SingletonsRestraint
(ss, c)
21
r.evaluate(
False
)
IMP::container::SingletonsRestraint
Applies a SingletonScore to each Singleton in a list.
Definition:
SingletonsRestraint.h:36
IMP::setup_from_argv
Strings setup_from_argv(const Strings &argv, std::string description, std::string positional_description, int num_positional)
IMP::core::HarmonicUpperBound
Upper bound harmonic function (non-zero when feature > mean)
Definition:
core/HarmonicUpperBound.h:22
IMP::core::GenericDistanceToSingletonScore
Apply a function to the distance to a fixed point.
Definition:
DistanceToSingletonScore.h:36
IMP::example
Example module.
IMP::algebra::Vector3D
VectorD< 3 > Vector3D
Definition:
VectorD.h:408