IMP logo
IMP Reference Guide  2.13.0
The Integrative Modeling Platform
restraints/parameters.py
1 """@namespace IMP.pmi.restraints.parameters
2 Restraints for parameters.
3 """
4 
5 import IMP
6 import IMP.isd
7 import IMP.pmi.tools
9 
10 
11 class WeightRestraint(IMP.pmi.restraints.RestraintBase):
12 
13  """Wrapper for an ``IMP.isd.WeightRestraint``"""
14 
15  def __init__(self, w, lower, upper, kappa, label=None, weight=1.):
16  """Create restraint on weight parameter.
17  @param w ``IMP.isd.Weight`` particle
18  @param lower Lower bound on weight restraint
19  @param upper Upper bound on weight restraint
20  @param kappa Strength of restraint
21  @param label A unique label to be used in outputs
22  @param weight The weight to apply to all internal restraints
23  """
24  self.w = w
25  model = self.w.get_model()
26  super(WeightRestraint, self).__init__(model, label=label,
27  weight=weight)
28  self.lower = lower
29  self.upper = upper
30  self.kappa = kappa
31  self.rs.add_restraint(
33  self.w,
34  self.lower,
35  self.upper,
36  self.kappa))
37 
38 
39 class JeffreysPrior(IMP.pmi.restraints.RestraintBase):
40 
41  """Wrapper for ``IMP.isd.JeffreysRestraint``"""
42 
43  def __init__(self, nuisance, label=None, weight=1.):
44  """Create Jeffreys prior.
45  @param nuisance Nuisance parameter
46  @param label A unique label to be used in outputs
47  @param weight The weight to apply to all internal restraints
48  """
49  model = nuisance.get_model()
50  super(JeffreysPrior, self).__init__(model, label=label, weight=weight)
51  jp = IMP.isd.JeffreysRestraint(self.model, nuisance)
52  self.rs.add_restraint(jp)
Wrapper for an IMP.isd.WeightRestraint
Miscellaneous utilities.
Definition: tools.py:1
Classes to handle different kinds of restraints.
def __init__
Create restraint on weight parameter.
Wrapper for IMP.isd.JeffreysRestraint
Inferential scoring building on methods developed as part of the Inferential Structure Determination ...