IMP  2.1.1
The Integrative Modeling Platform
nonbonded_interactions.py
1 ## \example container/nonbonded_interactions.py
2 # This example shows how to set up an excluded volume restraint for a set
3 # of XYZRDecorator-style particles.
4 
5 import IMP
6 import IMP.core
7 import IMP.atom
8 import IMP.container
9 
10 # This example addes a restraint on nonbonded interactions
11 # after excluding a set of bonded interactions.
12 
13 m = IMP.kernel.Model()
14 # The set of particles
17 
18 # create a bond between two particles
19 bd0 = IMP.atom.Bonded.setup_particle(ps.get_particle(0))
20 bd1 = IMP.atom.Bonded.setup_particle(ps.get_particle(1))
21 IMP.atom.create_custom_bond(bd0, bd1, 2.0)
22 
23 # Set up the nonbonded list for all pairs at are touching
24 # and let things move 3 before updating the list
25 nbl = IMP.container.ClosePairContainer(ps, 0.0, 3.0)
26 nbl.add_pair_filter(IMP.atom.BondedPairFilter())
27 
28 # Set up excluded volume
30 evr = IMP.container.PairsRestraint(sdps, nbl)
31 m.add_restraint(evr)
32 
33 # Set up optimizer
35 o.set_model(m)
36 
37 o.optimize(1000)
See IMP.container for more information.
Simple conjugate gradients optimizer.
Return all close unordered pairs of particles taken from the SingletonContainer.
Bond create_custom_bond(Bonded a, Bonded b, Float length, Float stiffness=-1)
Connect the two wrapped particles by a custom bond.
static Bonded setup_particle(kernel::Model *m, ParticleIndex pi)
XYZRs create_xyzr_particles(kernel::Model *m, unsigned int num, Float radius, Float box_side=10)
Create a set of particles with random coordinates.
See IMP.core for more information.
See IMP.atom for more information.
Applies a PairScore to each Pair in a list.
A filter for bonds.
Class for storing model, its restraints, constraints, and particles.