IMP
2.4.0
The Integrative Modeling Platform
IMP Mainpage
Modules
Classes
Examples
container/bipartite_nonbonded_interactions.py
This example shows how set up excluded volume interactions between two sets of particles.
1
## \example container/bipartite_nonbonded_interactions.py
2
# This example shows how set up excluded volume interactions between two
3
# sets of particles.
4
5
import
IMP
6
import
IMP.core
7
import
IMP.container
8
9
# This example addes a restraint on bipartite nonbonded interactions
10
# after excluding a set of bonded interactions.
11
12
m =
IMP.kernel.Model
()
13
# The set of particles
14
ps0 =
IMP.container.ListSingletonContainer
(
15
IMP.core.create_xyzr_particles
(m, 20, 1.0))
16
ps1 =
IMP.container.ListSingletonContainer
(
17
IMP.core.create_xyzr_particles
(m, 20, 2.0))
18
19
# Set up the nonbonded list
20
nbl =
IMP.container.CloseBipartitePairContainer
(ps0, ps1, 0, 1)
21
22
# Set up excluded volume
23
ps =
IMP.core.SphereDistancePairScore
(
IMP.core.HarmonicLowerBound
(0, 1))
24
evr =
IMP.container.PairsRestraint
(ps, nbl)
25
m.add_restraint(evr)
26
27
# Set up optimizer
28
o =
IMP.core.ConjugateGradients
(m)
29
30
o.optimize(1000)