1 """@namespace IMP.pmi.restraints
2 Classes to handle different kinds of restraints.
4 PMI restraints generally wrap IMP restraints. Typical features in PMI restraints are:
5 - Easy setup: for example, you can usually create one with a PMI [Molecule](@ref IMP::pmi::topology::Molecule) or a slice from one.
6 - Fast setup from data files. For example you can set up the [CrossLinkingMassSpectrometryRestraint](@ref IMP::pmi::restraints::crosslinking::CrossLinkingMassSpectrometryRestraint) by reading in a crosslink file into a [database](@ref IMP::pmi::io::crosslink::CrossLinkDataBase).
7 - Useful output: reporting functions which are put into log files when running [ReplicaExchange](@ref IMP::pmi::macros::ReplicaExchange0).
14 class _NuisancesBase(object):
15 ''' This base class is used to provide nuisance setup and interface
16 for the ISD cross-link restraints '''
20 def create_length(self):
21 ''' a nuisance on the length of the cross-link '''
23 self.lengthissampled =
True
24 lengthminnuis = 0.0000001
25 lengthmaxnuis = 1000.0
29 length = IMP.pmi.tools.SetupNuisance(self.m, lengthinit,
32 lengthissampled).get_particle()
33 self.rslen.add_restraint(
41 def create_sigma(self, resolution):
42 ''' a nuisance on the structural uncertainty '''
43 if isinstance(resolution,str):
46 sigmainit = resolution + 2.0
47 self.sigmaissampled =
True
48 sigmaminnuis = 0.0000001
53 sigma = IMP.pmi.tools.SetupNuisance(self.m, sigmainit,
54 sigmaminnuis, sigmamaxnuis, self.sigmaissampled).get_particle()
55 self.sigma_dictionary[resolution] = (
59 self.rssig.add_restraint(
68 def get_sigma(self, resolution):
69 if not resolution
in self.sigma_dictionary:
70 self.create_sigma(resolution)
71 return self.sigma_dictionary[resolution]
73 def create_psi(self, value):
74 ''' a nuisance on the inconsistency '''
75 if isinstance(value,str):
79 self.psiissampled =
True
80 psiminnuis = 0.0000001
81 psimaxnuis = 0.4999999
85 psi = IMP.pmi.tools.SetupNuisance(self.m, psiinit,
86 psiminnuis, psimaxnuis,
87 self.psiissampled).get_particle()
88 self.psi_dictionary[value] = (
92 self.rspsi.add_restraint(
101 def get_psi(self, value):
102 if not value
in self.psi_dictionary:
103 self.create_psi(value)
104 return self.psi_dictionary[value]
Python classes to represent, score, sample and analyze models.