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