IMP  2.0.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 of XYZRDecorator-style particles.
3 
4 import IMP
5 import IMP.core
6 import IMP.atom
7 import IMP.container
8 
9 # This example addes a restraint on nonbonded interactions
10 # after excluding a set of bonded interactions.
11 
12 m= IMP.Model()
13 # The set of particles
15 
16 # create a bond between two particles
17 bd0= IMP.atom.Bonded.setup_particle(ps.get_particle(0))
18 bd1= IMP.atom.Bonded.setup_particle(ps.get_particle(1))
19 IMP.atom.create_custom_bond(bd0, bd1, 2.0)
20 
21 # Set up the nonbonded list for all pairs at are touching
22 # and let things move 3 before updating the list
23 nbl= IMP.container.ClosePairContainer(ps, 0.0, 3.0)
24 nbl.add_pair_filter(IMP.atom.BondedPairFilter())
25 
26 # Set up excluded volume
28 evr= IMP.container.PairsRestraint(sdps, nbl)
29 m.add_restraint(evr)
30 
31 # Set up optimizer
33 o.set_model(m)
34 
35 o.optimize(1000)