IMP logo
IMP Reference Guide  2.14.0
The Integrative Modeling Platform
pmi/restraints/proteomics.py
1 """@namespace IMP.pmi.restraints.proteomics
2 Restraints for handling various kinds of proteomics data.
3 """
4 
5 from __future__ import print_function
6 import IMP
7 import IMP.core
8 import IMP.algebra
9 import IMP.atom
10 import IMP.container
11 import IMP.pmi
12 import IMP.pmi.tools
13 import IMP.pmi.output
14 import numpy
15 import math
16 import math
17 import sys
18 import warnings
19 
20 
21 class ConnectivityRestraint(object):
22 
23  '''
24  generate a connectivity restraint between domains
25  setting up the restraint
26  example:
27  sel1 = IMP.atom.Selection(root_hier, molecule="Rpb3",
28  residue_indexes=range(1,100))
29  sel2 = IMP.atom.Selection(root_hier, molecule="Rpb4",
30  residue_indexes=range(1,100))
31  cr=restraints.ConnectivityRestraint((sel1, sel2), label='CR1')
32  cr.add_to_model()
33  Multistate support =No
34  Resolution=Yes
35  '''
36 
37  def __init__(self, domains, kappa=10.0, resolution=None, label="None"):
38  self.weight = 1.0
39  self.kappa = kappa
40  self.label = label
41 
43  domains, self.kappa, self.label)
44  self.m = cr.get_model()
45  self.rs = IMP.RestraintSet(self.m, label)
46  self.rs.add_restraint(cr)
47 
48  def set_label(self, label):
49  self.label = label
50  self.rs.set_name(label)
51  for r in self.rs.get_restraints():
52  r.set_name(label)
53 
54  def add_to_model(self):
56 
57  def get_restraint(self):
58  return self.rs
59 
60  def get_restraints(self):
61  rlist = []
62  for r in self.rs.get_restraints():
63  rlist.append(IMP.core.PairRestraint.get_from(r))
64  return rlist
65 
66  def set_weight(self, weight):
67  self.weight = weight
68  self.rs.set_weight(weight)
69 
70  def get_output(self):
71  output = {}
72  score = self.weight * self.rs.unprotected_evaluate(None)
73  output["_TotalScore"] = str(score)
74  output["ConnectivityRestraint_" + self.label] = str(score)
75  return output
76 
77 #
78 
79 
80 class CompositeRestraint(object):
81 
82  '''
83  handleparticles a list of particles
84  compositeparticles is a list of list of particles
85  '''
86 
87  def __init__(self, handle_particles, composite_particles, cut_off=5.0,
88  lam=1.0, plateau=0.0, resolution=None, label="None"):
89  # composite particles: all particles beside the handle
90  self.label = label
91 
92  hs = IMP.pmi.tools.input_adaptor(handle_particles, resolution,
93  flatten=True)
94  self.handleparticles = [h.get_particle() for h in hs]
95  self.m = self.handleparticles[0].get_model()
96  self.rs = IMP.RestraintSet(self.m, 'cr')
97 
98  self.compositeparticles = []
99  compositeparticle_list = []
100  for cp in composite_particles:
101  hs = IMP.pmi.tools.input_adaptor(cp, resolution, flatten=True)
102  tmplist = [h.get_particle() for h in hs]
103  compositeparticle_list.append(tmplist)
104  self.compositeparticles += tmplist
105 
106  ln = IMP.pmi.CompositeRestraint(self.m, self.handleparticles, cut_off,
107  lam, True, plateau)
108 
109  for ps in compositeparticle_list:
110  # composite particles is a list of list of particles
111  ln.add_composite_particle(ps)
112 
113  self.rs.add_restraint(ln)
114 
115  def set_label(self, label):
116  self.label = label
117 
118  def get_handle_particles(self):
119  return self.handleparticles
120 
121  def get_composite_particles(self):
122  return self.compositeparticles
123 
124  def get_restraint(self):
125  return self.rs
126 
127  def add_to_model(self):
128  IMP.pmi.tools.add_restraint_to_model(self.m, self.rs)
129 
130  def get_output(self):
131  output = {}
132  score = self.rs.unprotected_evaluate(None)
133  output["_TotalScore"] = str(score)
134  output["CompositeRestraint_" + self.label] = str(score)
135  return output
136 
137 
138 #
140 
141  '''
142  this restraint allows ambiguous cross-linking between multiple copies
143  excluding between symmetric copies
144  It allows name ambiguity
145  '''
146 
147  def __init__(self, root_hier, restraints_file, cut_off=5.0, lam=1.0,
148  plateau=0.01, resolution=None, label="None"):
149  self.weight = 1.0
150  self.m = root_hier.get_model()
151  self.rs = IMP.RestraintSet(self.m, 'data')
152  self.label = "None"
153  self.pairs = []
154 
155  self.outputlevel = "low"
156  self.cut_off = cut_off
157  self.lam = lam
158  self.plateau = plateau
159 
160  fl = IMP.pmi.tools.open_file_or_inline_text(restraints_file)
161 
162  for line in fl:
163 
164  tokens = line.split()
165  # skip character
166  if (tokens[0] == "#"):
167  continue
168  r1 = int(tokens[2])
169  c1 = tokens[0]
170  r2 = int(tokens[3])
171  c2 = tokens[1]
172 
173  ps1 = IMP.atom.Selection(root_hier, resolution=resolution,
174  molecule=c1, residue_index=r1)
175  ps1 = ps1.get_selected_particles()
176  hrc1 = [p.get_name() for p in ps1]
177  def nosym_subset(ps):
178  return [p for p in ps if not IMP.pmi.Symmetric.get_is_setup(p)
179  or IMP.pmi.Symmetric(p).get_symmetric() == 0]
180  ps1nosym = nosym_subset(ps1)
181  hrc1nosym = [p.get_name() for p in ps1nosym]
182 
183  if len(ps1) == 0:
184  warnings.warn(
185  "AmbiguousCompositeRestraint: residue %d of chain %s "
186  "is not there" % (r1, c1), IMP.pmi.StructureWarning)
187  continue
188 
189  ps2 = IMP.atom.Selection(root_hier, resolution=resolution,
190  molecule=c2, residue_index=r2)
191  ps2 = ps2.get_selected_particles()
192  hrc2 = [p.get_name() for p in ps2]
193  ps2nosym = nosym_subset(ps2)
194  hrc2nosym = [p.get_name() for p in ps2nosym]
195 
196  if len(ps2) == 0:
197  warnings.warn(
198  "AmbiguousCompositeRestraint: residue %d of chain %s "
199  "is not there" % (r2, c2), IMP.pmi.StructureWarning)
200  continue
201 
203  self.m, ps1nosym, self.cut_off, self.lam, True, self.plateau)
204  cr.add_composite_particle(ps2)
205 
206  self.rs.add_restraint(cr)
207  self.pairs.append(
208  (ps1nosym,
209  hrc1nosym,
210  c1,
211  r1,
212  ps2,
213  hrc2,
214  c2,
215  r2,
216  cr))
217 
219  self.m, ps1, self.cut_off, self.lam, True, self.plateau)
220  cr.add_composite_particle(ps2nosym)
221 
222  self.rs.add_restraint(cr)
223  self.pairs.append(
224  (ps1,
225  hrc1,
226  c1,
227  r1,
228  ps2nosym,
229  hrc2nosym,
230  c2,
231  r2,
232  cr))
233 
234  def plot_restraint(
235  self,
236  maxdist=100,
237  npoints=100):
238 
239  p1 = IMP.Particle(self.m)
240  p2 = IMP.Particle(self.m)
244  self.m,
245  [p1],
246  self.cut_off,
247  self.lam,
248  True,
249  self.plateau)
250  cr.add_composite_particle([p2])
251  dists = []
252  scores = []
253  for i in range(npoints):
254  d2.set_coordinates(
255  IMP.algebra.Vector3D(maxdist / npoints * float(i), 0, 0))
256  dists.append(IMP.core.get_distance(d1, d2))
257  scores.append(cr.unprotected_evaluate(None))
258  IMP.pmi.output.plot_xy_data(dists, scores)
259 
260  def set_label(self, label):
261  self.label = label
262  self.rs.set_name(label)
263  for r in self.rs.get_restraints():
264  r.set_name(label)
265 
266  def add_to_model(self):
267  IMP.pmi.tools.add_restraint_to_model(self.m, self.rs)
268 
269  def get_hierarchies(self):
270  return self.prot
271 
272  def get_restraint_sets(self):
273  return self.rs
274 
275  def get_restraint(self):
276  return self.rs
277 
278  def set_output_level(self, level="low"):
279  # this might be "low" or "high"
280  self.outputlevel = level
281 
282  def set_weight(self, weight):
283  self.weight = weight
284  self.rs.set_weight(weight)
285 
286  def get_output(self):
287  # content of the cross-link database pairs
288  # self.pairs.append((p1,p2,dr,r1,c1,r2,c2))
289  output = {}
290  score = self.weight * self.rs.unprotected_evaluate(None)
291  output["_TotalScore"] = str(score)
292  output["AmbiguousCompositeRestraint_Score_" + self.label] = str(score)
293  for n, p in enumerate(self.pairs):
294 
295  ps1 = p[0]
296  hrc1 = p[1]
297  c1 = p[2]
298  r1 = p[3]
299  ps2 = p[4]
300  hrc2 = p[5]
301  c2 = p[6]
302  r2 = p[7]
303  cr = p[8]
304  for n1, p1 in enumerate(ps1):
305  name1 = hrc1[n1]
306 
307  for n2, p2 in enumerate(ps2):
308  name2 = hrc2[n2]
309  d1 = IMP.core.XYZR(p1)
310  d2 = IMP.core.XYZR(p2)
311  label = str(r1) + ":" + name1 + "_" + str(r2) + ":" + name2
312  output["AmbiguousCompositeRestraint_Distance_" +
313  label] = str(IMP.core.get_distance(d1, d2))
314 
315  label = str(r1) + ":" + c1 + "_" + str(r2) + ":" + c2
316  output["AmbiguousCompositeRestraint_Score_" +
317  label] = str(self.weight * cr.unprotected_evaluate(None))
318 
319  return output
320 
321 
322 #
323 class SimplifiedPEMAP(object):
324 
325  def __init__(self, root_hier, restraints_file, expdistance, strength,
326  resolution=None):
327  self.m = root_hier.get_model()
328  self.rs = IMP.RestraintSet(self.m, 'data')
329  self.label = "None"
330  self.pairs = []
331 
332  self.outputlevel = "low"
333  self.expdistance = expdistance
334  self.strength = strength
335 
336  fl = IMP.pmi.tools.open_file_or_inline_text(restraints_file)
337 
338  for line in fl:
339 
340  tokens = line.split()
341  # skip character
342  if (tokens[0] == "#"):
343  continue
344  r1 = int(tokens[2])
345  c1 = tokens[0]
346  r2 = int(tokens[3])
347  c2 = tokens[1]
348  pcc = float(tokens[4])
349 
350  ps1 = IMP.atom.Selection(root_hier, resolution=resolution,
351  molecule=c1, residue_index=r1,
352  copy_index=0)
353  ps1 = ps1.get_selected_particles()
354  if len(ps1) == 0:
355  warnings.warn(
356  "SimplifiedPEMAP: residue %d of chain %s is not there "
357  "(w/ %d %s)" % (r1, c1, r2, c2), IMP.pmi.StructureWarning)
358  continue
359  if len(ps1) > 1:
360  warnings.warn(
361  "SimplifiedPEMAP: residue %d of chain %s selected "
362  "multiple particles" % (r1, c1), IMP.pmi.StructureWarning)
363  continue
364 
365  ps2 = IMP.atom.Selection(root_hier, resolution=resolution,
366  molecule=c2, residue_index=r2,
367  copy_index=0)
368  ps2 = ps2.get_selected_particles()
369  if len(ps2) == 0:
370  warnings.warn(
371  "SimplifiedPEMAP: residue %d of chain %s is not there "
372  "(w/ %d %s)" % (r1, c1, r2, c2), IMP.pmi.StructureWarning)
373  continue
374  if len(ps2) > 1:
375  warnings.warn(
376  "SimplifiedPEMAP: residue %d of chain %s selected "
377  "multiple particles" % (r2, c2), IMP.pmi.StructureWarning)
378  continue
379 
380  p1 = ps1[0]
381  p2 = ps2[0]
382 
383  # This is harmonic potential for the pE-MAP data
384  upperdist = self.get_upper_bond(pcc)
385  limit = 0.5 * self.strength * 15.0 ** 2 + 10.0
387  upperdist, self.strength, 15, limit)
388 
389  # This is harmonic for the X-link
390  #hub= IMP.core.TruncatedHarmonicBound(17.0,self.strength,upperdist+15,limit)
391 
393  dr = IMP.core.PairRestraint(self.m, df, (p1, p2))
394  self.rs.add_restraint(dr)
395  self.pairs.append((p1, p2, dr, r1, c1, r2, c2))
396 
397  # Lower-bound restraint
398  lowerdist = self.get_lower_bond(pcc)
399  limit = 0.5 * self.strength * 15.0 ** 2 + 10.0
401  lowerdist, self.strength, 15, limit)
402 
403  # This is harmonic for the X-link
404  #hub2= IMP.core.TruncatedHarmonicBound(17.0,self.strength,upperdist+15,limit)
405 
407  dr2 = IMP.core.PairRestraint(self.m, df2, (p1, p2))
408  self.rs.add_restraint(dr2)
409  self.pairs.append((p1, p2, dr2, r1, c1, r2, c2))
410 
411  def get_upper_bond(self, pearsoncc):
412  # return (pearsoncc-1.)/-0.0075
413  return (pearsoncc - .5) / (-0.005415)
414 
415  def get_lower_bond(self, pearsoncc):
416  return (pearsoncc - 1.) / -0.0551
417 
418  def set_label(self, label):
419  self.label = label
420 
421  def add_to_model(self):
422  IMP.pmi.tools.add_restraint_to_model(self.m, self.rs)
423 
424  def get_hierarchies(self):
425  return self.prot
426 
427  def get_restraint_sets(self):
428  return self.rs
429 
430  def set_output_level(self, level="low"):
431  # this might be "low" or "high"
432  self.outputlevel = level
433 
434  def get_output(self):
435  # content of the cross-link database pairs
436  # self.pairs.append((p1,p2,dr,r1,c1,r2,c2))
437  output = {}
438  score = self.rs.unprotected_evaluate(None)
439  output["_TotalScore"] = str(score)
440  output["SimplifiedPEMAP_Score_" + self.label] = str(score)
441  for i in range(len(self.pairs)):
442 
443  p0 = self.pairs[i][0]
444  p1 = self.pairs[i][1]
445  crosslinker = 'standard'
446  ln = self.pairs[i][2]
447  resid1 = self.pairs[i][3]
448  chain1 = self.pairs[i][4]
449  resid2 = self.pairs[i][5]
450  chain2 = self.pairs[i][6]
451 
452  label = str(resid1) + ":" + chain1 + "_" + \
453  str(resid2) + ":" + chain2
454  output["SimplifiedPEMAP_Score_" + crosslinker + "_" +
455  label] = str(ln.unprotected_evaluate(None))
456 
457  d0 = IMP.core.XYZ(p0)
458  d1 = IMP.core.XYZ(p1)
459  output["SimplifiedPEMAP_Distance_" +
460  label] = str(IMP.core.get_distance(d0, d1))
461 
462  return output
463 
464 
466 
467  '''
468  generates and wraps a IMP.pmi.ConnectivityRestraint between domains
469  example:
470  cr=restraints.ConnectivityNetworkRestraint(simo,["CCC",(1,100,"TTT"),(100,150,"AAA")])
471  cr.add_to_model()
472  cr.set_label("CR1")
473 
474  Multistate support =No
475  Selection type=selection tuple
476  Resolution=Yes
477  '''
478 
479  def __init__(self, objects, kappa=10.0, resolution=1.0, label="None"):
480 
481  self.weight = 1.0
482  self.kappa = kappa
483  self.label = label
484  if self.label == "None":
485  self.label = str(selection_tuples)
486 
487  hiers=[]
488 
489  for obj in objects:
490  hiers.append(IMP.pmi.tools.input_adaptor(obj,
491  resolution,
492  flatten=True))
493  self.m=hiers[0][0].get_model()
494 
495  #particles=[h.get_particle() for h in hiers]
496  cr = ConnectivityNetworkRestraint(self.m)
497  for hs in hiers:
498  cr.add_particles([h.get_particle() for h in hs])
499  self.rs = IMP.RestraintSet(self.m, label)
500  self.rs.add_restraint(cr)
501 
502  def set_label(self, label):
503  self.label = label
504  self.rs.set_name(label)
505  for r in self.rs.get_restraints():
506  r.set_name(label)
507 
508  def add_to_model(self):
509  IMP.pmi.tools.add_restraint_to_model(self.m, self.rs)
510 
511  def get_restraint(self):
512  return self.rs
513 
514  def get_restraints(self):
515  rlist = []
516  for r in self.rs.get_restraints():
517  rlist.append(IMP.core.PairRestraint.get_from(r))
518  return rlist
519 
520  def set_weight(self, weight):
521  self.weight = weight
522  self.rs.set_weight(weight)
523 
524  def get_output(self):
525  output = {}
526  score = self.weight * self.rs.unprotected_evaluate(None)
527  output["_TotalScore"] = str(score)
528  output["ConnectivityNetworkRestraint_" + self.label] = str(score)
529  return output
530 
531 
533 
534  '''
535  a python restraint that computes the score for a composite of proteins
536  Authors: G. Bouvier, R. Pellarin. Pasteur Institute.
537  '''
538 
539  def __init__(self, m, slope=1.0, theta=0.0, plateau=0.0000000001, linear_slope=0.015):
540  '''
541  input a list of particles, the slope and theta of the sigmoid potential
542  theta is the cutoff distance for a protein-protein contact
543  '''
544  # Import networkx here so that we don't introduce it as a dependency
545  # for *every* proteomics restraint, only this one
546  import networkx
547  self.networkx = networkx
548  IMP.Restraint.__init__(self, m, "ConnectivityNetworkRestraint %1%")
549  self.slope = slope
550  self.theta = theta
551  self.linear_slope = linear_slope
552  self.plateau = plateau
553  self.particles_blocks = []
554  self.particle_list = []
555 
556  def get_number_of_particle_blocks(self):
557  return len(self.particles_blocks)
558 
559  def get_number_of_particles_for_block(self, block_index):
560  return len(self.particles_blocks[block_index])
561 
562  def add_particles(self, particles):
563  self.particles_blocks.append(particles)
564  self.particle_list += particles
565 
566  def get_full_graph(self):
567  '''
568  get the full graph of distances between every particle pair
569  '''
570  import scipy.spatial
571  pdist_array = numpy.array(
573  pdist_mat = scipy.spatial.distance.squareform(pdist_array)
574  pdist_mat[pdist_mat < 0] = 0
575  graph = self.networkx.Graph(pdist_mat)
576  return graph
577 
579  """
580  return the minimum spanning tree
581  """
582  graph = self.get_full_graph()
583  graph = self.networkx.minimum_spanning_tree(graph)
584  return graph
585 
586  def sigmoid(self, x):
587  '''
588  a sigmoid function that scores the probability of a contact
589  between two proteins
590  '''
591  # return 1 - (x)**self.slope/ float(((x)**self.slope +
592  # self.theta**self.slope))
593  argvalue = (x - self.theta) / self.slope
594  return 1.0 - (1.0 - self.plateau) / (1.0 + math.exp(-argvalue))
595 
596  def unprotected_evaluate(self, da):
597  graph = self.get_minimum_spanning_tree()
598  score = 0.0
599  for e in graph.edges():
600  dist = graph.get_edge_data(*e)['weight']
601  prob = self.sigmoid(dist)
602  score += -numpy.log(prob)
603  score += self.linear_slope * dist
604  return score
605 
606  def do_get_inputs(self):
607  return self.particle_list
608 
609 
610 class FuzzyBoolean(object):
611 
612  '''
613  Fully Ambiguous Restraint that can be built using boolean logic
614  R. Pellarin. Pasteur Institute.
615  '''
616 
617  def __init__(self, p1, operator=None, p2=None):
618  '''
619  input a list of particles, the slope and theta of the sigmoid potential
620  theta is the cutoff distance for a protein-protein contact
621  '''
622  if isinstance(p1, FuzzyBoolean) and isinstance(p2, FuzzyBoolean):
623  self.operations = [p1, operator, p2]
624  self.value = None
625  else:
626  self.operations = []
627  self.value = p1
628 
629  def __or__(self, FuzzyBoolean2):
630  return FuzzyBoolean(self, self.or_, FuzzyBoolean2)
631 
632  def __and__(self, FuzzyBoolean2):
633  return FuzzyBoolean(self, self.and_, FuzzyBoolean2)
634 
635  def and_(self, a, b):
636  return a * b
637 
638  def or_(self, a, b):
639  return 1.0 - (1.0 - a) * (1.0 - b)
640 
641  def evaluate(self):
642 
643  if len(self.operations) == 0:
644  return self.value
645  FuzzyBoolean1, op, FuzzyBoolean2 = self.operations
646 
647  return op(FuzzyBoolean1.evaluate(), FuzzyBoolean2.evaluate())
648 
649 
651 
652  '''
653  Fully Ambiguous Restraint that can be built using boolean logic
654  R. Pellarin. Pasteur Institute.
655  '''
656  plateau = 0.00000000000001
657  theta = 5.0
658  slope = 2.0
659  innerslope = 0.01
660 
661  def __init__(self, m, p1, p2, operator=None):
662  '''
663  input a list of particles, the slope and theta of the sigmoid potential
664  theta is the cutoff distance for a protein-protein contact
665  '''
666  IMP.Restraint.__init__(self, m, "FuzzyRestraint %1%")
667  self.m = m
668  self.min = sys.float_info.min
669  if isinstance(p1, FuzzyRestraint) and isinstance(p2, FuzzyRestraint):
670  self.operations = [p1, operator, p2]
671  self.particle_pair = None
672  elif isinstance(p1, FuzzyRestraint) and p2 is None:
673  self.operations = [p1, operator, None]
674  self.particle_pair = None
675  else:
676  self.operations = []
677  self.particle_pair = (p1, p2)
678 
679  def __or__(self, FuzzyRestraint2):
680  return FuzzyRestraint(self.m, self, FuzzyRestraint2, self.or_)
681 
682  def __and__(self, FuzzyRestraint2):
683  return FuzzyRestraint(self.m, self, FuzzyRestraint2, self.and_)
684 
685  def __invert__(self):
686  return FuzzyRestraint(self.m, self, None, self.invert_)
687 
688  def and_(self, a, b):
689  c = a + b
690  return c
691 
692  def or_(self, a, b):
693  c = math.exp(-a) + math.exp(-b) - math.exp(-a - b)
694  return -math.log(c)
695 
696  def invert_(self, a):
697  c = 1.0 - math.exp(-a)
698  return -math.log(c)
699 
700  def evaluate(self):
701  if len(self.operations) == 0:
702  return self.distance()
703  FuzzyRestraint1, op, FuzzyRestraint2 = self.operations
704 
705  if FuzzyRestraint2 is not None:
706  return op(FuzzyRestraint1.evaluate(), FuzzyRestraint2.evaluate())
707  else:
708  return op(FuzzyRestraint1.evaluate())
709 
710  def distance(self):
711  d1 = IMP.core.XYZ(self.particle_pair[0])
712  d2 = IMP.core.XYZ(self.particle_pair[1])
713  d = IMP.core.get_distance(d1, d2)
714  argvalue = (d-self.theta)/self.slope
715  return -math.log(1.0 -(1.0-self.plateau)/(1.0+math.exp(-argvalue)))+self.innerslope*d
716 
717  def add_to_model(self):
719 
720  def unprotected_evaluate(self, da):
721  return self.evaluate()
722 
723  def __str__(self):
724  if len(self.operations) == 0:
725  return str(self.particle_pair)
726  FuzzyRestraint1, op, FuzzyRestraint2 = self.operations
727  if FuzzyRestraint2 is not None:
728  return str(FuzzyRestraint1) +str(op)+str(FuzzyRestraint2)
729  else:
730  return str(FuzzyRestraint1) +str(op)
731 
732  def do_get_inputs(self):
733  if len(self.operations) == 0:
734  return list(self.particle_pair)
735  FuzzyRestraint1, op, FuzzyRestraint2 = self.operations
736  if FuzzyRestraint2 is not None:
737  return list(set(FuzzyRestraint1.do_get_inputs() +FuzzyRestraint2.do_get_inputs()))
738  else:
739  return list(set(FuzzyRestraint1.do_get_inputs()))
A function that is harmonic over an interval.
this restraint allows ambiguous cross-linking between multiple copies excluding between symmetric cop...
void add_particles(RMF::FileHandle fh, const ParticlesTemp &hs)
Various classes to hold sets of particles.
static XYZR setup_particle(Model *m, ParticleIndex pi)
Definition: XYZR.h:48
generate a connectivity restraint between domains setting up the restraint example: sel1 = IMP...
def get_full_graph
get the full graph of distances between every particle pair
Miscellaneous utilities.
Definition: tools.py:1
Add symmetric attribute to a particle.
Definition: Symmetric.h:23
A score on the distance between the surfaces of two spheres.
double get_distance(XYZR a, XYZR b)
Compute the sphere distance between a and b.
Definition: XYZR.h:89
generates and wraps a IMP.pmi.ConnectivityRestraint between domains example: cr=restraints.ConnectivityNetworkRestraint(simo,["CCC",(1,100,"TTT"),(100,150,"AAA")]) cr.add_to_model() cr.set_label("CR1")
Object used to hold a set of restraints.
Definition: RestraintSet.h:36
def input_adaptor
Adapt things for PMI (degrees of freedom, restraints, ...) Returns list of list of hierarchies...
Definition: tools.py:917
Warning related to handling of structures.
a python restraint that computes the score for a composite of proteins Authors: G.
def __init__
input a list of particles, the slope and theta of the sigmoid potential theta is the cutoff distance ...
def add_restraint_to_model
Add a PMI restraint to the model.
Definition: tools.py:84
static bool get_is_setup(Model *m, ParticleIndex pi)
Definition: Symmetric.h:29
A restraint for ambiguous cross-linking MS data and multiple state approach.
A decorator for a particle with x,y,z coordinates.
Definition: XYZ.h:30
handleparticles a list of particles compositeparticles is a list of list of particles ...
Classes for writing output files and processing them.
Definition: output.py:1
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...
Fully Ambiguous Restraint that can be built using boolean logic R.
def __init__
input a list of particles, the slope and theta of the sigmoid potential theta is the cutoff distance ...
VectorD< 3 > Vector3D
Definition: VectorD.h:421
Class to handle individual particles of a Model object.
Definition: Particle.h:41
Floats get_list_of_bipartite_minimum_sphere_distance(const ParticlesTemps &pss)
Definition: pmi/utilities.h:71
def sigmoid
a sigmoid function that scores the probability of a contact between two proteins
Restraint * create_connectivity_restraint(const Selections &s, double x0, double k, std::string name="Connectivity%1%")
Create a restraint connecting the selections.
Applies a PairScore to a Pair.
Definition: PairRestraint.h:29
Python classes to represent, score, sample and analyze models.
Functionality for loading, creating, manipulating and scoring atomic structures.
Select hierarchy particles identified by the biological name.
Definition: Selection.h:66
Fully Ambiguous Restraint that can be built using boolean logic R.
def __init__
input a list of particles, the slope and theta of the sigmoid potential theta is the cutoff distance ...
virtual ModelObjectsTemp do_get_inputs() const =0
A restraint is a term in an IMP ScoringFunction.
Definition: Restraint.h:54
A decorator for a particle with x,y,z coordinates and a radius.
Definition: XYZR.h:27