IMP  2.4.0
The Integrative Modeling Platform
parameters.py
1 #!/usr/bin/env python
2 import IMP
3 import IMP.core
4 import IMP.base
5 import IMP.algebra
6 import IMP.atom
7 import IMP.container
8 import IMP.isd
9 
10 
11 class WeightRestraint(object):
12 
13  def __init__(self, weight, lower, upper, kappa):
14 
15  self.weight = weight
16  self.m = self.weight.get_model()
17  self.label = "None"
18  self.rs = IMP.RestraintSet(self.m, 'weight_restraint')
19  self.lower = lower
20  self.upper = upper
21  self.kappa = kappa
22  self.rs.add_restraint(
24  self.weight,
25  self.lower,
26  self.upper,
27  self.kappa))
28 
29  def get_restraint(self, label):
30  return self.rs
31 
32  def add_to_model(self):
33  self.m.add_restraint(self.rs)
34 
35  def set_label(self, label):
36  self.label = label
37 
38  def get_output(self):
39  self.m.update()
40  output = {}
41  score = self.rs.unprotected_evaluate(None)
42  output["_TotalScore"] = str(score)
43  output["WeightRestraint_" + self.label] = str(score)
44  return output
45 
46 
47 class JeffreysPrior(object):
48 
49  def __init__(self, nuisance):
50 
51  self.m = nuisance.get_model()
52  self.label = "None"
53  self.rs = IMP.RestraintSet(self.m, 'jeffrey_prior')
54  jp = IMP.isd.JeffreysRestraint(self.m, nuisance)
55  self.rs.add_restraint(jp)
56 
57  def add_to_model(self):
58  self.m.add_restraint(self.rs)
59 
60  def set_label(self, label):
61  self.label = label
62 
63  def get_output(self):
64  output = {}
65  score = self.rs.unprotected_evaluate(None)
66  output["_TotalScore"] = str(score)
67  output["JeffreyPrior_" + self.label] = str(score)
68  return output
69 
70 #
Various classes to hold sets of particles.
Object used to hold a set of restraints.
Low level functionality (logging, error handling, profiling, command line flags etc) that is used by ...
Basic functionality that is expected to be used by a wide variety of IMP users.
General purpose algebraic and geometric methods that are expected to be used by a wide variety of IMP...
Functionality for loading, creating, manipulating and scoring atomic structures.
Inferential scoring building on methods developed as part of the Inferential Structure Determination ...