1 """@namespace IMP.pmi.restraints.basic
2 Some miscellaneous simple restraints.
5 from __future__
import print_function
14 class ExternalBarrier(object):
22 self.m = representation.prot.get_model()
35 resolution=resolution,
36 hierarchies=hierarchies)
37 lsc.add_particles(particles)
39 self.rs.add_restraint(r3)
41 def set_label(self, label):
44 def add_to_model(self):
45 self.m.add_restraint(self.rs)
47 def get_restraint(self):
53 score = self.rs.unprotected_evaluate(
None)
54 output[
"_TotalScore"] = str(score)
55 output[
"ExternalBarrier_" + self.label] = str(score)
59 class DistanceRestraint(object):
70 self.m = representation.prot.get_model()
83 resolution=resolution,
84 name=tuple_selection1[2],
85 residue=tuple_selection1[0])
88 resolution=resolution,
89 name=tuple_selection2[2],
90 residue=tuple_selection2[0])
98 if len(particles1) > 1
or len(particles2) > 1:
99 raise ValueError(
"more than one particle selected")
101 self.rs.add_restraint(
105 self.rs.add_restraint(
110 def set_weight(self,weight):
112 self.rs.set_weight(weight)
114 def set_label(self, label):
117 def add_to_model(self):
118 self.m.add_restraint(self.rs)
120 def get_restraint(self):
123 def get_output(self):
126 score = self.weight * self.rs.unprotected_evaluate(
None)
127 output[
"_TotalScore"] = str(score)
128 output[
"DistanceRestraint_" + self.label] = str(score)
132 return self.weight * self.rs.unprotected_evaluate(
None)
Applies a SingletonScore to each Singleton in a list.
Lower bound harmonic function (non-zero when feature < mean)
Various classes to hold sets of particles.
Upper bound harmonic function (non-zero when feature > mean)
Object used to hold a set of restraints.
Low level functionality (logging, error handling, profiling, command line flags etc) that is used by ...
Distance restraint between two particles.
Store a kernel::ParticleIndexes.
Apply a function to the distance to a fixed point.
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.