Applies a SingletonScore to each Singleton in a list.
This restraint stores the used particles in a ParticlesTemp. The container used can be set so that the list can be shared with other containers (or a nonbonded list can be used). By default a ListSingletonContainer is used and the {add_, set_, clear_}particle{s} methodas can be used.
Examples using various multiplicity containers:
import IMP.example radius=10 stiffness=2 center= IMP.algebra.Vector3D(1,2,3) (m,c)=IMP.example.create_model_and_particles() ub= IMP.core.HarmonicUpperBound(radius, stiffness) # Restrain based on the distance to a single point (hence a ball ss= IMP.core.DistanceToSingletonScore(ub, center) r= IMP.container.SingletonsRestraint(ss, c) m.add_restraint(r) m.evaluate(False)
import IMP import IMP.core import IMP.atom import IMP.container # This example addes a restraint on nonbonded interactions # after excluding a set of bonded interactions. m= IMP.Model() # The set of particles ps = IMP.container.ListSingletonContainer(IMP.core.create_xyzr_particles(m, 20, 1.0)) # create a bond between two particles bd0= IMP.atom.Bonded.setup_particle(ps.get_particle(0)) bd1= IMP.atom.Bonded.setup_particle(ps.get_particle(1)) IMP.atom.create_custom_bond(bd0, bd1, 2.0) # Set up the nonbonded list for all pairs at are touching # and let things move 3 before updating the list nbl= IMP.container.ClosePairContainer(ps, 0.0, 3.0) nbl.add_pair_filter(IMP.atom.BondedPairFilter()) # Set up excluded volume sdps= IMP.core.SoftSpherePairScore(1) evr= IMP.container.PairsRestraint(sdps, nbl) m.add_restraint(evr) # Set up optimizer o= IMP.core.ConjugateGradients() o.set_model(m) o.optimize(1000)
Examples: charmm forcefield verbose, initialize chains, optimize balls, restrain in sphere, load protein restrain bonds
Inheritance diagram for IMP::container::SingletonsRestraint:Public Member Functions | |
| SingletonsRestraint (SingletonScore *ss, SingletonContainer *pc, std::string name="SingletonsRestraint %1%") | |
| Create the restraint with a shared container. | |
| ParticlesTemp | get_arguments () const |
| Get the container used to store Particles. | |
| SingletonContainer * | get_container () const |
| SingletonScore * | get_score () const |
Static Public Member Functions | |
| static SingletonsRestraint * | get_from (IMP::base::Object *o) |
| IMP::container::SingletonsRestraint::SingletonsRestraint | ( | SingletonScore * | ss, |
| SingletonContainer * | pc, | ||
| std::string | name = "SingletonsRestraint %1%" |
||
| ) |
Create the restraint with a shared container.
| [in] | ss | The function to apply to each particle. |
| [in] | pc | The container containing the stored particles. This container is not copied. |
| [in] | name | The object name |
| ParticlesTemp IMP::container::SingletonsRestraint::get_arguments | ( | ) | const |
Get the container used to store Particles.