home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
2.22.0
The Integrative Modeling Platform
IMP Manual
Reference Guide
Tutorial Index
Modules
Classes
Examples
doc
examples
core
bounding_box_restraint.py
1
import
IMP,
IMP.core
,
IMP.algebra
,
IMP.container
2
3
K_BB = 10.0
# bounding box force coefficient in kcal/mol/A^2
4
RADIUS = 1.0
# particle radius in A
5
6
def
create_particle(m, bb, radius = RADIUS):
7
p =
IMP.Particle
(m)
8
s =
IMP.algebra.Sphere3D
(
9
IMP.algebra.get_random_vector_in
(bb), radius)
10
d =
IMP.core.XYZR.setup_particle
(p, s)
11
d.set_coordinates_are_optimized(
True
)
12
return
p
13
14
bb =
IMP.algebra.BoundingBox3D
(
IMP.algebra.Vector3D
(0, 0, 0),
15
IMP.algebra.Vector3D
(10, 10, 10))
16
m =
IMP.Model
()
17
particles = []
18
for
i
in
range(0,10):
19
particles.append(create_particle(m, bb))
20
hpb =
IMP.core.HarmonicUpperBound
(0, K_BB)
21
bbss =
IMP.core.BoundingBox3DSingletonScore
(hpb, bb)
22
bbr =
IMP.container.SingletonsRestraint
(bbss, particles)
IMP::container::SingletonsRestraint
Applies a SingletonScore to each Singleton in a list.
Definition:
SingletonsRestraint.h:36
IMP::container
Various classes to hold sets of particles.
IMP::core::HarmonicUpperBound
Upper bound harmonic function (non-zero when feature > mean)
Definition:
core/HarmonicUpperBound.h:22
IMP::core::XYZR::setup_particle
static XYZR setup_particle(Model *m, ParticleIndex pi)
Definition:
XYZR.h:48
IMP::core::GenericBoundingBox3DSingletonScore
Definition:
BoundingBox3DSingletonScore.h:64
IMP::algebra::get_random_vector_in
Vector3D get_random_vector_in(const Cylinder3D &c)
Generate a random vector in a cylinder with uniform density.
IMP::Model
Class for storing model, its restraints, constraints, and particles.
Definition:
Model.h:86
IMP::algebra::BoundingBoxD< 3 >
IMP::core
Basic functionality that is expected to be used by a wide variety of IMP users.
IMP::algebra
General purpose algebraic and geometric methods that are expected to be used by a wide variety of IMP...
IMP::algebra::Vector3D
VectorD< 3 > Vector3D
Definition:
VectorD.h:408
IMP::Particle
Class to handle individual particles of a Model object.
Definition:
Particle.h:43
IMP::algebra::SphereD< 3 >