IMP logo
IMP Reference Guide  2.22.0
The Integrative Modeling Platform
bipartite_nonbonded_interactions.py
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 import sys
9 
10 IMP.setup_from_argv(sys.argv, "bipartite nonbonded interactions")
11 
12 # This example adds a restraint on bipartite nonbonded interactions
13 # after excluding a set of bonded interactions.
14 
15 m = IMP.Model()
16 # The set of particles
18  m, IMP.core.create_xyzr_particles(m, 20, 1.0))
20  m, IMP.core.create_xyzr_particles(m, 20, 2.0))
21 
22 # Set up the nonbonded list
24 
25 # Set up excluded volume
27 evr = IMP.container.PairsRestraint(ps, nbl)
28 
29 # Set up optimizer
31 o.set_scoring_function([evr])
32 
33 o.optimize(1000)
Lower bound harmonic function (non-zero when feature < mean)
Strings setup_from_argv(const Strings &argv, std::string description, std::string positional_description, int num_positional)
Various classes to hold sets of particles.
XYZRs create_xyzr_particles(Model *m, unsigned int num, Float radius, Float box_side=10)
Create a set of particles with random coordinates.
Simple conjugate gradients optimizer.
A score on the distance between the surfaces of two spheres.
Return all spatially-proximal pairs of particles (a,b) from the two SingletonContainers A and B...
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
Store a list of ParticleIndexes.
Basic functionality that is expected to be used by a wide variety of IMP users.
Applies a PairScore to each Pair in a list.