IMP logo
IMP Reference Guide  2.11.1
The Integrative Modeling Platform
npc_restraints.py
1 import IMP.npc
3 
4 class XYRadialPositionRestraint(object):
5  """Create XYRadial Position Restraint
6  """
7  def __init__(self,
8  representation = None,
9  protein = None,
10  lower_bound = 0.0,
11  upper_bound = 0.0,
12  consider_radius = False,
13  sigma = 1.0,
14  term = 'C',
15  hier = None):
16  """Constructor
17  @param representation representation
18  """
19 
20  # PMI1/2 selection
21  if representation is None and hier is not None:
22  self.m = hier.get_model()
23  elif hier is None and representation is not None:
24  self.m = representation.prot.get_model()
25  else:
26  raise Exception("XYRadialPositionRestraint: must pass hier or representation")
27 
28  self.rs = IMP.RestraintSet(self.m, 'XYRadialPositionRestraint')
29  self.weight=1.0
30  self.label = "None"
31 
32  xyr = IMP.npc.XYRadialPositionRestraint(self.m, lower_bound, upper_bound, consider_radius, sigma)
33  #terminal_residue = IMP.pmi.tools.get_terminal_residue(representation, representation.hier_dict[protein], terminus="C")
34  residues = IMP.pmi.tools.select_by_tuple(representation, protein, resolution=1)
35  if (term == 'C'):
36  terminal = residues[-1]
37  #print (terminal, type(terminal))
38  xyr.add_particle(terminal)
39  elif (term == 'N'):
40  terminal = residues[0]
41  #print (terminal, type(terminal))
42  xyr.add_particle(terminal)
43  else:
44  for residue in residues:
45  #print (residue, type(residue))
46  xyr.add_particle(residue)
47 
48  self.dataset = None
49  if representation:
50  for p, state in representation._protocol_output:
51  p.add_xyradial_restraint(state, residues, lower_bound,
52  upper_bound, sigma, self)
53 
54  self.rs.add_restraint(xyr)
55 
56  def set_label(self, label):
57  self.label = label
58 
59  def add_to_model(self):
61 
62  def get_restraint(self):
63  return self.rs
64 
65  def set_weight(self, weight):
66  self.weight = weight
67  self.rs.set_weight(self.weight)
68 
69  def get_output(self):
70  self.m.update()
71  output = {}
72  score = self.weight * self.rs.unprotected_evaluate(None)
73  output["_TotalScore"] = str(score)
74  output["XYRadialPositionRestraint_" + self.label] = str(score)
75  return output
76 
77  def evaluate(self):
78  return self.weight * self.rs.unprotected_evaluate(None)
79 
81  """Create XYRadial Position Lower restraints
82  """
83  def __init__(self,
84  representation = None,
85  protein = None,
86  lower_bound = 0.0,
87  consider_radius = False,
88  sigma = 1.0,
89  hier = None):
90  """Constructor
91  @param representation representation
92  """
93 
94  # PMI1/2 selection
95  if representation is None and hier is not None:
96  self.m = hier.get_model()
97  elif hier is None and representation is not None:
98  self.m = representation.prot.get_model()
99  else:
100  raise Exception("XYRadialPositionLowerRestraint: must pass hier or representation")
101 
102  self.rs = IMP.RestraintSet(self.m, 'XYRadialPositionLowerRestraint')
103  self.weight=1.0
104  self.label = "None"
105 
106  xyr = IMP.npc.XYRadialPositionLowerRestraint(self.m, lower_bound, consider_radius, sigma)
107  #terminal_residue = IMP.pmi.tools.get_terminal_residue(representation, representation.hier_dict[protein], terminus="C")
108  residues = IMP.pmi.tools.select_by_tuple(representation, protein, resolution=1)
109  cterminal = residues[-1] #nterminal = residues[0]
110  #print (cterminal, type(cterminal))
111 
112  xyr.add_particle(cterminal)
113  self.rs.add_restraint(xyr)
114 
115  def set_label(self, label):
116  self.label = label
117 
118  def add_to_model(self):
119  IMP.pmi.tools.add_restraint_to_model(self.m, self.rs)
120 
121  def get_restraint(self):
122  return self.rs
123 
124  def set_weight(self, weight):
125  self.weight = weight
126  self.rs.set_weight(self.weight)
127 
128  def get_output(self):
129  self.m.update()
130  output = {}
131  score = self.weight * self.rs.unprotected_evaluate(None)
132  output["_TotalScore"] = str(score)
133  output["XYRadialPositionLowerRestraint_" + self.label] = str(score)
134  return output
135 
136  def evaluate(self):
137  return self.weight * self.rs.unprotected_evaluate(None)
138 
140  """Create XYRadial Position Upper restraints
141  """
142  def __init__(self,
143  representation = None,
144  protein = None,
145  upper_bound = 0.0,
146  consider_radius = False,
147  sigma = 1.0,
148  hier = None):
149  """Constructor
150  @param representation representation
151  """
152 
153  # PMI1/2 selection
154  if representation is None and hier is not None:
155  self.m = hier.get_model()
156  elif hier is None and representation is not None:
157  self.m = representation.prot.get_model()
158  else:
159  raise Exception("XYRadialPositionUpperRestraint: must pass hier or representation")
160 
161  self.rs = IMP.RestraintSet(self.m, 'XYRadialPositionUpperRestraint')
162  self.weight=1.0
163  self.label = "None"
164 
165  xyr = IMP.npc.XYRadialPositionUpperRestraint(self.m, upper_bound, consider_radius, sigma)
166  #terminal_residue = IMP.pmi.tools.get_terminal_residue(representation, representation.hier_dict[protein], terminus="C")
167  residues = IMP.pmi.tools.select_by_tuple(representation, protein, resolution=1)
168  cterminal = residues[-1] #nterminal = residues[0]
169  #print (cterminal, type(cterminal))
170 
171  xyr.add_particle(cterminal)
172  self.rs.add_restraint(xyr)
173 
174  def set_label(self, label):
175  self.label = label
176 
177  def add_to_model(self):
178  IMP.pmi.tools.add_restraint_to_model(self.m, self.rs)
179 
180  def get_restraint(self):
181  return self.rs
182 
183  def set_weight(self, weight):
184  self.weight = weight
185  self.rs.set_weight(self.weight)
186 
187  def get_output(self):
188  self.m.update()
189  output = {}
190  score = self.weight * self.rs.unprotected_evaluate(None)
191  output["_TotalScore"] = str(score)
192  output["XYRadialPositionUpperRestraint_" + self.label] = str(score)
193  return output
194 
195  def evaluate(self):
196  return self.weight * self.rs.unprotected_evaluate(None)
197 
198 
200  """Create Z-Axial Position restraints
201  """
202  def __init__(self,
203  representation = None,
204  protein = None,
205  lower_bound = 0.0,
206  upper_bound = 0.0,
207  consider_radius = False,
208  sigma = 1.0,
209  term = 'C',
210  hier = None):
211  """Constructor
212  @param representation representation
213  """
214 
215  # PMI1/2 selection
216  if representation is None and hier is not None:
217  self.m = hier.get_model()
218  elif hier is None and representation is not None:
219  self.m = representation.prot.get_model()
220  else:
221  raise Exception("ZAxialPositionRestraint: must pass hier or representation")
222 
223  self.rs = IMP.RestraintSet(self.m, 'ZAxialPositionRestraint')
224  self.weight=1.0
225  self.label = "None"
226 
227  zax = IMP.npc.ZAxialPositionRestraint(self.m, lower_bound, upper_bound, consider_radius, sigma)
228  #terminal_residue = IMP.pmi.tools.get_terminal_residue(representation, representation.hier_dict[protein], terminus="C")
229  residues = IMP.pmi.tools.select_by_tuple(representation, protein, resolution=1)
230  if term == 'C':
231  residues = residues[-1:]
232  elif term == 'N':
233  residues = residues[:1]
234  for residue in residues:
235  zax.add_particle(residue)
236 
237  self.dataset = None
238  if representation:
239  for p, state in representation._protocol_output:
240  p.add_zaxial_restraint(state, residues, lower_bound,
241  upper_bound, sigma, self)
242 
243  self.rs.add_restraint(zax)
244 
245  def set_label(self, label):
246  self.label = label
247 
248  def add_to_model(self):
249  IMP.pmi.tools.add_restraint_to_model(self.m, self.rs)
250 
251  def get_restraint(self):
252  return self.rs
253 
254  def set_weight(self, weight):
255  self.weight = weight
256  self.rs.set_weight(self.weight)
257 
258  def get_output(self):
259  self.m.update()
260  output = {}
261  score = self.weight * self.rs.unprotected_evaluate(None)
262  output["_TotalScore"] = str(score)
263  output["ZAxialPositionRestraint_" + self.label] = str(score)
264  return output
265 
266  def evaluate(self):
267  return self.weight * self.rs.unprotected_evaluate(None)
268 
270  """Create Z-Axial Position Lower restraints
271  """
272  def __init__(self,
273  representation = None,
274  protein = None,
275  lower_bound = 0.0,
276  consider_radius = False,
277  sigma = 1.0,
278  hier = None):
279  """Constructor
280  @param representation representation
281  """
282 
283  # PMI1/2 selection
284  if representation is None and hier is not None:
285  self.m = hier.get_model()
286  elif hier is None and representation is not None:
287  self.m = representation.prot.get_model()
288  else:
289  raise Exception("ZAxialPositionLowerRestraint: must pass hier or representation")
290 
291  self.rs = IMP.RestraintSet(self.m, 'ZAxialPositionLowerRestraint')
292  self.weight=1.0
293  self.label = "None"
294 
295  zax = IMP.npc.ZAxialPositionLowerRestraint(self.m, lower_bound, consider_radius, sigma)
296  #terminal_residue = IMP.pmi.tools.get_terminal_residue(representation, representation.hier_dict[protein], terminus="C")
297  residues = IMP.pmi.tools.select_by_tuple(representation, protein, resolution=1)
298  cterminal = residues[-1] #nterminal = residues[0]
299  #print (cterminal, type(cterminal))
300 
301  zax.add_particle(cterminal)
302  self.rs.add_restraint(zax)
303 
304  def set_label(self, label):
305  self.label = label
306 
307  def add_to_model(self):
308  IMP.pmi.tools.add_restraint_to_model(self.m, self.rs)
309 
310  def get_restraint(self):
311  return self.rs
312 
313  def set_weight(self, weight):
314  self.weight = weight
315  self.rs.set_weight(self.weight)
316 
317  def get_output(self):
318  self.m.update()
319  output = {}
320  score = self.weight * self.rs.unprotected_evaluate(None)
321  output["_TotalScore"] = str(score)
322  output["ZAxialPositionLowerRestraint_" + self.label] = str(score)
323  return output
324 
325  def evaluate(self):
326  return self.weight * self.rs.unprotected_evaluate(None)
327 
329  """Create Z-Axial Position Upper restraints
330  """
331  def __init__(self,
332  representation = None,
333  protein = None,
334  upper_bound = 0.0,
335  consider_radius = False,
336  sigma = 1.0,
337  hier = None):
338  """Constructor
339  @param representation representation
340  """
341 
342  # PMI1/2 selection
343  if representation is None and hier is not None:
344  self.m = hier.get_model()
345  elif hier is None and representation is not None:
346  self.m = representation.prot.get_model()
347  else:
348  raise Exception("ZAxialPositionUpperRestraint: must pass hier or representation")
349 
350  self.rs = IMP.RestraintSet(self.m, 'ZAxialPositionUpperRestraint')
351  self.weight=1.0
352  self.label = "None"
353 
354  zax = IMP.npc.ZAxialPositionUpperRestraint(self.m, upper_bound, consider_radius, sigma)
355  #terminal_residue = IMP.pmi.tools.get_terminal_residue(representation, representation.hier_dict[protein], terminus="C")
356  residues = IMP.pmi.tools.select_by_tuple(representation, protein, resolution=1)
357  cterminal = residues[-1] #nterminal = residues[0]
358  #print (cterminal, type(cterminal))
359 
360  zax.add_particle(cterminal)
361  self.rs.add_restraint(zax)
362 
363  def set_label(self, label):
364  self.label = label
365 
366  def add_to_model(self):
367  IMP.pmi.tools.add_restraint_to_model(self.m, self.rs)
368 
369  def get_restraint(self):
370  return self.rs
371 
372  def set_weight(self, weight):
373  self.weight = weight
374  self.rs.set_weight(self.weight)
375 
376  def get_output(self):
377  self.m.update()
378  output = {}
379  score = self.weight * self.rs.unprotected_evaluate(None)
380  output["_TotalScore"] = str(score)
381  output["ZAxialPositionUpperRestraint_" + self.label] = str(score)
382  return output
383 
384  def evaluate(self):
385  return self.weight * self.rs.unprotected_evaluate(None)
386 
387 
389  """Create Y-Axial Position restraints
390  """
391  def __init__(self,
392  representation = None,
393  protein = None,
394  lower_bound = 0.0,
395  upper_bound = 0.0,
396  consider_radius = False,
397  sigma = 1.0,
398  term = 'C',
399  hier = None):
400  """Constructor
401  @param representation representation
402  """
403 
404  # PMI1/2 selection
405  if representation is None and hier is not None:
406  self.m = hier.get_model()
407  elif hier is None and representation is not None:
408  self.m = representation.prot.get_model()
409  else:
410  raise Exception("YAxialPositionRestraint: must pass hier or representation")
411 
412  self.rs = IMP.RestraintSet(self.m, 'YAxialPositionRestraint')
413  self.weight=1.0
414  self.label = "None"
415 
416  yax = IMP.npc.YAxialPositionRestraint(self.m, lower_bound, upper_bound, consider_radius, sigma)
417  #terminal_residue = IMP.pmi.tools.get_terminal_residue(representation, representation.hier_dict[protein], terminus="C")
418  residues = IMP.pmi.tools.select_by_tuple(representation, protein, resolution=1)
419  if (term == 'C'):
420  terminal = residues[-1]
421  #print (terminal, type(terminal))
422  yax.add_particle(terminal)
423  elif (term == 'N'):
424  terminal = residues[0]
425  #print (terminal, type(terminal))
426  yax.add_particle(terminal)
427  else:
428  for residue in residues:
429  #print (residue, type(residue))
430  yax.add_particle(residue)
431 
432  self.dataset = None
433  if representation:
434  for p, state in representation._protocol_output:
435  p.add_yaxial_restraint(state, residues, lower_bound,
436  upper_bound, sigma, self)
437 
438  self.rs.add_restraint(yax)
439 
440  def set_label(self, label):
441  self.label = label
442 
443  def add_to_model(self):
444  IMP.pmi.tools.add_restraint_to_model(self.m, self.rs)
445 
446  def get_restraint(self):
447  return self.rs
448 
449  def set_weight(self, weight):
450  self.weight = weight
451  self.rs.set_weight(self.weight)
452 
453  def get_output(self):
454  self.m.update()
455  output = {}
456  score = self.weight * self.rs.unprotected_evaluate(None)
457  output["_TotalScore"] = str(score)
458  output["YAxialPositionRestraint_" + self.label] = str(score)
459  return output
460 
461  def evaluate(self):
462  return self.weight * self.rs.unprotected_evaluate(None)
463 
465  """Create Y-Axial Position Lower restraints
466  """
467  def __init__(self,
468  representation = None,
469  protein = None,
470  lower_bound = 0.0,
471  consider_radius = False,
472  sigma = 1.0,
473  hier = None):
474  """Constructor
475  @param representation representation
476  """
477 
478  # PMI1/2 selection
479  if representation is None and hier is not None:
480  self.m = hier.get_model()
481  elif hier is None and representation is not None:
482  self.m = representation.prot.get_model()
483  else:
484  raise Exception("YAxialPositionLowerRestraint: must pass hier or representation")
485 
486  self.rs = IMP.RestraintSet(self.m, 'YAxialPositionLowerRestraint')
487  self.weight=1.0
488  self.label = "None"
489 
490  yax = IMP.npc.YAxialPositionLowerRestraint(self.m, lower_bound, consider_radius, sigma)
491  #terminal_residue = IMP.pmi.tools.get_terminal_residue(representation, representation.hier_dict[protein], terminus="C")
492  residues = IMP.pmi.tools.select_by_tuple(representation, protein, resolution=1)
493  cterminal = residues[-1] #nterminal = residues[0]
494  #print (cterminal, type(cterminal))
495 
496  yax.add_particle(cterminal)
497  self.rs.add_restraint(yax)
498 
499  def set_label(self, label):
500  self.label = label
501 
502  def add_to_model(self):
503  IMP.pmi.tools.add_restraint_to_model(self.m, self.rs)
504 
505  def get_restraint(self):
506  return self.rs
507 
508  def set_weight(self, weight):
509  self.weight = weight
510  self.rs.set_weight(self.weight)
511 
512  def get_output(self):
513  self.m.update()
514  output = {}
515  score = self.weight * self.rs.unprotected_evaluate(None)
516  output["_TotalScore"] = str(score)
517  output["YAxialPositionLowerRestraint_" + self.label] = str(score)
518  return output
519 
520  def evaluate(self):
521  return self.weight * self.rs.unprotected_evaluate(None)
522 
524  """Create Y-Axial Position Upper restraints
525  """
526  def __init__(self,
527  representation = None,
528  protein = None,
529  upper_bound = 0.0,
530  consider_radius = False,
531  sigma = 1.0,
532  hier = None):
533  """Constructor
534  @param representation representation
535  """
536 
537  # PMI1/2 selection
538  if representation is None and hier is not None:
539  self.m = hier.get_model()
540  elif hier is None and representation is not None:
541  self.m = representation.prot.get_model()
542  else:
543  raise Exception("YAxialPositionUpperRestraint: must pass hier or representation")
544 
545  self.rs = IMP.RestraintSet(self.m, 'YAxialPositionUpperRestraint')
546  self.weight=1.0
547  self.label = "None"
548 
549  yax = IMP.npc.YAxialPositionUpperRestraint(self.m, upper_bound, consider_radius, sigma)
550  #terminal_residue = IMP.pmi.tools.get_terminal_residue(representation, representation.hier_dict[protein], terminus="C")
551  residues = IMP.pmi.tools.select_by_tuple(representation, protein, resolution=1)
552  cterminal = residues[-1] #nterminal = residues[0]
553  #print (cterminal, type(cterminal))
554 
555  yax.add_particle(cterminal)
556  self.rs.add_restraint(yax)
557 
558  def set_label(self, label):
559  self.label = label
560 
561  def add_to_model(self):
562  IMP.pmi.tools.add_restraint_to_model(self.m, self.rs)
563 
564  def get_restraint(self):
565  return self.rs
566 
567  def set_weight(self, weight):
568  self.weight = weight
569  self.rs.set_weight(self.weight)
570 
571  def get_output(self):
572  self.m.update()
573  output = {}
574  score = self.weight * self.rs.unprotected_evaluate(None)
575  output["_TotalScore"] = str(score)
576  output["YAxialPositionUpperRestraint_" + self.label] = str(score)
577  return output
578 
579  def evaluate(self):
580  return self.weight * self.rs.unprotected_evaluate(None)
581 
582 
584  """Create Membrane Surface Location Restraint
585  """
586  def __init__(self,
587  representation = None,
588  protein = None,
589  tor_R = 540.0,
590  tor_r = 127.5,
591  tor_th = 45.0,
592  sigma = 0.2,
593  resolution = 1,
594  hier = None):
595  """Constructor
596  @param representation representation
597  """
598 
599  # PMI1/2 selection
600  if representation is None and hier is not None:
601  self.m = hier.get_model()
602  elif hier is None and representation is not None:
603  self.m = representation.prot.get_model()
604  else:
605  raise Exception("MembraneSurfaceLocationRestraint: must pass hier or representation")
606 
607  self.rs = IMP.RestraintSet(self.m, 'MembraneSurfaceLocationRestraint')
608  self.weight=1.0
609  self.label = "None"
610 
611  msl = IMP.npc.MembraneSurfaceLocationRestraint(self.m, tor_R, tor_r, tor_th, sigma)
612  residues = IMP.pmi.tools.select_by_tuple(representation, protein, resolution=resolution)
613  for residue in residues:
614  #print (residue, type(residue))
615  msl.add_particle(residue)
616 
617  self.dataset = None
618  if representation:
619  for p, state in representation._protocol_output:
620  p.add_membrane_surface_location_restraint(
621  state, residues, tor_R, tor_r, tor_th, sigma, self)
622 
623  self.rs.add_restraint(msl)
624 
625  def set_label(self, label):
626  self.label = label
627 
628  def add_to_model(self):
629  IMP.pmi.tools.add_restraint_to_model(self.m, self.rs)
630 
631  def get_restraint(self):
632  return self.rs
633 
634  def set_weight(self, weight):
635  self.weight = weight
636  self.rs.set_weight(self.weight)
637 
638  def get_output(self):
639  self.m.update()
640  output = {}
641  score = self.weight * self.rs.unprotected_evaluate(None)
642  output["_TotalScore"] = str(score)
643  output["MembraneSurfaceLocationRestraint_" + self.label] = str(score)
644  return output
645 
646  def evaluate(self):
647  return self.weight * self.rs.unprotected_evaluate(None)
648 
649 
651  """Create Membrane Surface Location CONDITIONAL Restraint
652  for Nup120 ALPS Motifs - Mutually Exclusive from (135,152,'Nup120') and (197,216,'Nup120').
653  It returns a minimum penalty score from two potential ALPS motifs.
654  """
655  def __init__(self,
656  representation = None,
657  protein1 = None,
658  protein2 = None,
659  tor_R = 540.0,
660  tor_r = 127.5,
661  tor_th = 45.0,
662  sigma = 0.2,
663  resolution = 1,
664  hier = None):
665  """Constructor
666  @param representation representation
667  """
668 
669  # PMI1/2 selection
670  if representation is None and hier is not None:
671  self.m = hier.get_model()
672  elif hier is None and representation is not None:
673  self.m = representation.prot.get_model()
674  else:
675  raise Exception("MembraneSurfaceLocationConditionalRestraint: must pass hier or representation")
676 
677  self.rs = IMP.RestraintSet(self.m, 'MembraneSurfaceLocationConditionalRestraint')
678  self.weight=1.0
679  self.label = "None"
680 
681  msl = IMP.npc.MembraneSurfaceLocationConditionalRestraint(self.m, tor_R, tor_r, tor_th, sigma)
682  residues1 = IMP.pmi.tools.select_by_tuple(representation, protein1, resolution=resolution)
683  for residue in residues1:
684  #print (residue, type(residue))
685  msl.add_particle1(residue)
686  residues2 = IMP.pmi.tools.select_by_tuple(representation, protein2, resolution=resolution)
687  for residue in residues2:
688  #print (residue, type(residue))
689  msl.add_particle2(residue)
690 
691  # Approximate as two membrane restraints
692  self.dataset = None
693  if representation:
694  for p, state in representation._protocol_output:
695  for residues in residues1, residues2:
696  p.add_membrane_surface_location_restraint(
697  state, residues, tor_R, tor_r, tor_th, sigma, self)
698 
699  self.rs.add_restraint(msl)
700 
701  def set_label(self, label):
702  self.label = label
703 
704  def add_to_model(self):
705  IMP.pmi.tools.add_restraint_to_model(self.m, self.rs)
706 
707  def get_restraint(self):
708  return self.rs
709 
710  def set_weight(self, weight):
711  self.weight = weight
712  self.rs.set_weight(self.weight)
713 
714  def get_output(self):
715  self.m.update()
716  output = {}
717  score = self.weight * self.rs.unprotected_evaluate(None)
718  output["_TotalScore"] = str(score)
719  output["MembraneSurfaceLocationConditionalRestraint_" + self.label] = str(score)
720  return output
721 
722  def evaluate(self):
723  return self.weight * self.rs.unprotected_evaluate(None)
724 
725 
727  """Create Membrane Exclusion Restraint
728  """
729  def __init__(self,
730  representation = None,
731  protein = None,
732  tor_R = 540.0,
733  tor_r = 127.5,
734  tor_th = 45.0,
735  sigma = 0.2,
736  resolution = 1,
737  hier = None):
738  """Constructor
739  @param representation representation
740  """
741 
742  # PMI1/2 selection
743  if representation is None and hier is not None:
744  self.m = hier.get_model()
745  elif hier is None and representation is not None:
746  self.m = representation.prot.get_model()
747  else:
748  raise Exception("MembraneExclusionRestraint: must pass hier or representation")
749 
750  self.rs = IMP.RestraintSet(self.m, 'MembraneExclusionRestraint')
751  self.weight=1.0
752  self.label = "None"
753 
754  mex = IMP.npc.MembraneExclusionRestraint(self.m, tor_R, tor_r, tor_th, sigma)
755  residues = IMP.pmi.tools.select_by_tuple(representation, protein, resolution=resolution)
756  for residue in residues:
757  #print (residue, type(residue))
758  mex.add_particle(residue)
759 
760  self.dataset = None
761  if representation:
762  for p, state in representation._protocol_output:
763  p.add_membrane_exclusion_restraint(
764  state, residues, tor_R, tor_r, tor_th, sigma, self)
765 
766  self.rs.add_restraint(mex)
767 
768  def set_label(self, label):
769  self.label = label
770 
771  def add_to_model(self):
772  IMP.pmi.tools.add_restraint_to_model(self.m, self.rs)
773 
774  def get_restraint(self):
775  return self.rs
776 
777  def set_weight(self, weight):
778  self.weight = weight
779  self.rs.set_weight(self.weight)
780 
781  def get_output(self):
782  self.m.update()
783  output = {}
784  score = self.weight * self.rs.unprotected_evaluate(None)
785  output["_TotalScore"] = str(score)
786  output["MembraneExclusionRestraint_" + self.label] = str(score)
787  return output
788 
789  def evaluate(self):
790  return self.weight * self.rs.unprotected_evaluate(None)
Create Z-Axial Position Upper restraints.
Restrain particles by their z coordinate.
Create Z-Axial Position restraints.
Restrain particles by their y coordinate.
Create Membrane Surface Location CONDITIONAL Restraint for Nup120 ALPS Motifs - Mutually Exclusive fr...
Restrain particles by their distance from the z axis in the xy plane.
Create Y-Axial Position restraints.
Try to keep one set of particles localized on a membrane surface.
Restrain particles by their z coordinate.
Create Membrane Surface Location Restraint.
Representation of the system.
Object used to hold a set of restraints.
Definition: RestraintSet.h:36
Create Y-Axial Position Lower restraints.
def add_restraint_to_model
Add a PMI restraint to the model.
Definition: tools.py:86
Try to keep particles away from a membrane.
Restrain particles by their distance from the z axis in the xy plane.
Try to keep particles localized on a membrane surface.
Create Y-Axial Position Upper restraints.
The general base class for IMP exceptions.
Definition: exception.h:49
Create Z-Axial Position Lower restraints.
Restraints designed for modeling the Nuclear Pore Complex (NPC)
Create XYRadial Position Lower restraints.
Create Membrane Exclusion Restraint.
Restrain particles by their z coordinate.
Restrain particles by their distance from the z axis in the xy plane.
Restrain particles by their y coordinate.
Create XYRadial Position Upper restraints.
Restrain particles by their y coordinate.