1 """@namespace IMP.pmi.restraints
2 Classes to handle different kinds of restraints.
9 class _NuisancesBase(object):
10 ''' This base class is used to provide nuisance setup and interface
11 for the ISD cross-link restraints '''
15 def create_length(self):
16 ''' a nuisance on the length of the cross-link '''
18 self.lengthissampled =
True
19 lengthminnuis = 0.0000001
20 lengthmaxnuis = 1000.0
24 length = IMP.pmi.tools.SetupNuisance(self.m, lengthinit,
27 lengthissampled).get_particle()
28 self.rslen.add_restraint(
36 def create_sigma(self, resolution):
37 ''' a nuisance on the structural uncertainty '''
38 if isinstance(resolution,str):
41 sigmainit = resolution + 2.0
42 self.sigmaissampled =
True
43 sigmaminnuis = 0.0000001
48 sigma = IMP.pmi.tools.SetupNuisance(self.m, sigmainit,
49 sigmaminnuis, sigmamaxnuis, self.sigmaissampled).get_particle()
50 self.sigma_dictionary[resolution] = (
54 self.rssig.add_restraint(
63 def get_sigma(self, resolution):
64 if not resolution
in self.sigma_dictionary:
65 self.create_sigma(resolution)
66 return self.sigma_dictionary[resolution]
68 def create_psi(self, value):
69 ''' a nuisance on the inconsistency '''
70 if isinstance(value,str):
74 self.psiissampled =
True
75 psiminnuis = 0.0000001
76 psimaxnuis = 0.4999999
80 psi = IMP.pmi.tools.SetupNuisance(self.m, psiinit,
81 psiminnuis, psimaxnuis,
82 self.psiissampled).get_particle()
83 self.psi_dictionary[value] = (
87 self.rspsi.add_restraint(
96 def get_psi(self, value):
97 if not value
in self.psi_dictionary:
98 self.create_psi(value)
99 return self.psi_dictionary[value]
Python classes to represent, score, sample and analyze models.