IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
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
6import IMP.example
7import sys
8
9IMP.setup_from_argv(sys.argv, "restrain in sphere")
10
11radius = 10
12stiffness = 2
13center = IMP.algebra.Vector3D(1, 2, 3)
14(m, c) = IMP.example.create_model_and_particles()
15ub = IMP.core.HarmonicUpperBound(radius, stiffness)
16
17# Restrain based on the distance to a single point (hence a ball)
19
21r.evaluate(False)
Applies a SingletonScore to each Singleton in a list.
Upper bound harmonic function (non-zero when feature > mean).
VectorD< 3 > Vector3D
Definition VectorD.h:407
Example module.
void setup_from_argv(int argc, char **argv, std::string description)
Parse the command line flags and return the positional arguments.