IMP logo
IMP Reference Guide  2.22.0
The Integrative Modeling Platform
npc.py
1 """@namespace IMP.pmi.restraints.npc
2 Specialized restraints for modeling the Nuclear Pore Complex.
3 
4 These restraints have been used to model the Nuclear Pore Complex (NPC)
5 but may be useful for other applications too. They model the NPC as lying
6 in the xy plane, centered at the origin. (Transport through the pore
7 corresponds to movement along the z axis.) The surface of the nuclear
8 membrane is represented as the surface of a half torus, also lying in
9 the xy plane and centered at the origin. Individual proteins
10 (or parts of proteins, such as the N- or C- termini) are then localized to
11 different regions of the complex (e.g. near the membrane or pore, or on
12 the nuclear or cytoplasmic side) by simple restraints on their Cartesian
13 coordinates.
14 """
15 
16 import IMP.npc
17 
18 
19 class XYRadialPositionRestraint(IMP.pmi.restraints.RestraintBase):
20  """Restrain a protein's distance from the z axis to within a given range.
21  """
22  _include_in_rmf = True
23 
24  def __init__(self, hier, protein, lower_bound=0.0, upper_bound=0.0,
25  consider_radius=False, sigma=1.0, term='C', label=None,
26  weight=1.0):
27  """Constructor
28  """
29 
30  super().__init__(hier.get_model(), label=label, weight=weight)
31 
33  self.model, lower_bound, upper_bound, consider_radius, sigma)
35  hier, protein, resolution=1)
36  if term == 'C':
37  terminal = residues[-1]
38  # print (terminal, type(terminal))
39  xyr.add_particle(terminal)
40  elif term == 'N':
41  terminal = residues[0]
42  # print (terminal, type(terminal))
43  xyr.add_particle(terminal)
44  else:
45  for residue in residues:
46  # print (residue, type(residue))
47  xyr.add_particle(residue)
48 
49  self.dataset = None
50  for p, state in IMP.pmi.tools._all_protocol_outputs(hier):
51  p.add_xyradial_restraint(state, residues, lower_bound,
52  upper_bound, sigma, self)
53 
54  self.rs.add_restraint(xyr)
55 
56 
57 class XYRadialPositionLowerRestraint(IMP.pmi.restraints.RestraintBase):
58  """Restrain a protein's distance from the z axis to above a lower bound.
59  """
60  _include_in_rmf = True
61 
62  def __init__(self, hier, protein, lower_bound=0.0,
63  consider_radius=False, sigma=1.0, label=None, weight=1.0):
64  """Constructor
65  """
66 
67  super().__init__(hier.get_model(), label=label, weight=weight)
68 
70  self.model, lower_bound, consider_radius, sigma)
72  hier, protein, resolution=1)
73  cterminal = residues[-1]
74 
75  xyr.add_particle(cterminal)
76  self.rs.add_restraint(xyr)
77 
78 
79 class XYRadialPositionUpperRestraint(IMP.pmi.restraints.RestraintBase):
80  """Restrain a protein's distance from the z axis to below an upper bound.
81  """
82  _include_in_rmf = True
83 
84  def __init__(self, hier, protein, upper_bound=0.0,
85  consider_radius=False, sigma=1.0, label=None, weight=1.0):
86  """Constructor
87  """
88 
89  super().__init__(hier.get_model(), label=label, weight=weight)
90 
92  self.model, upper_bound, consider_radius, sigma)
94  hier, protein, resolution=1)
95  cterminal = residues[-1]
96 
97  xyr.add_particle(cterminal)
98  self.rs.add_restraint(xyr)
99 
100 
101 class ZAxialPositionRestraint(IMP.pmi.restraints.RestraintBase):
102  """Restrain a protein's z coordinate to within a given range.
103  """
104  _include_in_rmf = True
105 
106  def __init__(self, hier, protein, lower_bound=0.0,
107  upper_bound=0.0, consider_radius=False, sigma=1.0, term='C',
108  label=None, weight=1.0):
109  """Constructor
110  """
111 
112  super().__init__(hier.get_model(), label=label, weight=weight)
113 
115  self.model, lower_bound, upper_bound, consider_radius, sigma)
117  hier, protein, resolution=1)
118  if term == 'C':
119  terminal = residues[-1]
120  # print (terminal, type(terminal))
121  zax.add_particle(terminal)
122  elif term == 'N':
123  terminal = residues[0]
124  # print (terminal, type(terminal))
125  zax.add_particle(terminal)
126  else:
127  for residue in residues:
128  # print (residue, type(residue))
129  zax.add_particle(residue)
130 
131  self.dataset = None
132  for p, state in IMP.pmi.tools._all_protocol_outputs(hier):
133  p.add_zaxial_restraint(state, residues, lower_bound,
134  upper_bound, sigma, self)
135 
136  self.rs.add_restraint(zax)
137 
138 
139 class ZAxialPositionLowerRestraint(IMP.pmi.restraints.RestraintBase):
140  """Restrain a protein's z coordinate to above a lower bound.
141  """
142  _include_in_rmf = True
143 
144  def __init__(self, hier, protein, lower_bound=0.0,
145  consider_radius=False, sigma=1.0, label=None, weight=1.0):
146  """Constructor
147  """
148 
149  super().__init__(hier.get_model(), label=label, weight=weight)
150 
152  self.model, lower_bound, consider_radius, sigma)
154  hier, protein, resolution=1)
155  cterminal = residues[-1]
156 
157  zax.add_particle(cterminal)
158  self.rs.add_restraint(zax)
159 
160 
161 class ZAxialPositionUpperRestraint(IMP.pmi.restraints.RestraintBase):
162  """Restrain a protein's z coordinate to below an upper bound.
163  """
164  _include_in_rmf = True
165 
166  def __init__(self, hier, protein, upper_bound=0.0,
167  consider_radius=False, sigma=1.0, label=None, weight=1.0):
168  """Constructor
169  """
170 
171  super().__init__(hier.get_model(), label=label, weight=weight)
172 
174  self.model, upper_bound, consider_radius, sigma)
176  hier, protein, resolution=1)
177  cterminal = residues[-1]
178 
179  zax.add_particle(cterminal)
180  self.rs.add_restraint(zax)
181 
182 
183 class YAxialPositionRestraint(IMP.pmi.restraints.RestraintBase):
184  """Restrain a protein's y coordinate to within a given range.
185  """
186  _include_in_rmf = True
187 
188  def __init__(self, hier, protein, lower_bound=0.0,
189  upper_bound=0.0, consider_radius=False, sigma=1.0, term='C',
190  label=None, weight=1.0):
191  """Constructor
192  """
193 
194  super().__init__(hier.get_model(), label=label, weight=weight)
195 
197  self.model, lower_bound, upper_bound, consider_radius, sigma)
199  hier, protein, resolution=1)
200  if term == 'C':
201  terminal = residues[-1]
202  # print (terminal, type(terminal))
203  yax.add_particle(terminal)
204  elif term == 'N':
205  terminal = residues[0]
206  # print (terminal, type(terminal))
207  yax.add_particle(terminal)
208  else:
209  for residue in residues:
210  # print (residue, type(residue))
211  yax.add_particle(residue)
212 
213  self.dataset = None
214  for p, state in IMP.pmi.tools._all_protocol_outputs(hier):
215  p.add_yaxial_restraint(state, residues, lower_bound,
216  upper_bound, sigma, self)
217 
218  self.rs.add_restraint(yax)
219 
220 
221 class YAxialPositionLowerRestraint(IMP.pmi.restraints.RestraintBase):
222  """Restrain a protein's y coordinate to above a lower bound.
223  """
224  _include_in_rmf = True
225 
226  def __init__(self, hier, protein, lower_bound=0.0,
227  consider_radius=False, sigma=1.0, label=None, weight=1.0):
228  """Constructor
229  """
230 
231  super().__init__(hier.get_model(), label=label, weight=weight)
232 
234  self.model, lower_bound, consider_radius, sigma)
236  hier, protein, resolution=1)
237  cterminal = residues[-1]
238 
239  yax.add_particle(cterminal)
240  self.rs.add_restraint(yax)
241 
242 
243 class YAxialPositionUpperRestraint(IMP.pmi.restraints.RestraintBase):
244  """Restrain a protein's y coordinate to below an upper bound.
245  """
246  _include_in_rmf = True
247 
248  def __init__(self, hier, protein, upper_bound=0.0,
249  consider_radius=False, sigma=1.0, label=None, weight=1.0):
250  """Constructor
251  """
252 
253  super().__init__(hier.get_model(), label=label, weight=weight)
254 
256  self.model, upper_bound, consider_radius, sigma)
258  hier, protein, resolution=1)
259  cterminal = residues[-1]
260 
261  yax.add_particle(cterminal)
262  self.rs.add_restraint(yax)
263 
264 
265 class MembraneSurfaceLocationRestraint(IMP.pmi.restraints.RestraintBase):
266  """Localize protein on the surface of a half torus in the xy plane.
267  """
268  _include_in_rmf = True
269 
270  def __init__(self, hier, protein,
271  tor_R=540.0, tor_r=127.5, tor_th=45.0, sigma=0.2,
272  resolution=1, label=None, weight=1.0):
273  """Constructor
274  """
275 
276  super().__init__(hier.get_model(), label=label, weight=weight)
277 
279  self.model, tor_R, tor_r, tor_th, sigma)
281  hier, protein, resolution=resolution)
282  for residue in residues:
283  # print (residue, type(residue))
284  msl.add_particle(residue)
285 
286  self.dataset = None
287  for p, state in IMP.pmi.tools._all_protocol_outputs(hier):
288  p.add_membrane_surface_location_restraint(
289  state, residues, tor_R, tor_r, tor_th, sigma, self)
290 
291  self.rs.add_restraint(msl)
292 
293 
295  IMP.pmi.restraints.RestraintBase):
296  """Localize one protein on the surface of a half torus in the xy plane.
297 
298  Create Membrane Surface Location CONDITIONAL Restraint
299  for Nup120 ALPS Motifs - Mutually Exclusive from (135,152,'Nup120')
300  and (197,216,'Nup120').
301  It returns a minimum penalty score from two potential ALPS motifs.
302  """
303  _include_in_rmf = True
304 
305  def __init__(self, hier, protein1, protein2,
306  tor_R=540.0, tor_r=127.5, tor_th=45.0, sigma=0.2,
307  resolution=1, label=None, weight=1.0):
308  """Constructor
309  """
310 
311  super().__init__(hier.get_model(), label=label, weight=weight)
312 
314  self.model, tor_R, tor_r, tor_th, sigma)
316  hier, protein1, resolution=resolution)
317  for residue in residues1:
318  # print (residue, type(residue))
319  msl.add_particle1(residue)
321  hier, protein2, resolution=resolution)
322  for residue in residues2:
323  # print (residue, type(residue))
324  msl.add_particle2(residue)
325 
326  # Approximate as two membrane restraints
327  self.dataset = None
328  for p, state in IMP.pmi.tools._all_protocol_outputs(hier):
329  for residues in residues1, residues2:
330  p.add_membrane_surface_location_restraint(
331  state, residues, tor_R, tor_r, tor_th, sigma, self)
332 
333  self.rs.add_restraint(msl)
334 
335 
336 class MembraneExclusionRestraint(IMP.pmi.restraints.RestraintBase):
337  """Keep protein away from a half torus in the xy plane.
338  """
339  _include_in_rmf = True
340 
341  def __init__(self, hier, protein=None,
342  tor_R=540.0, tor_r=127.5, tor_th=45.0, sigma=0.2,
343  resolution=1, label=None, weight=1.0):
344  """Constructor
345  """
346 
347  super().__init__(hier.get_model(), label=label, weight=weight)
348 
350  self.model, tor_R, tor_r, tor_th, sigma)
352  hier, protein, resolution=resolution)
353  for residue in residues:
354  mex.add_particle(residue)
355 
356  self.dataset = None
357  for p, state in IMP.pmi.tools._all_protocol_outputs(hier):
358  p.add_membrane_exclusion_restraint(
359  state, residues, tor_R, tor_r, tor_th, sigma, self)
360 
361  self.rs.add_restraint(mex)
Restrain a protein's y coordinate to above a lower bound.
Definition: npc.py:221
Restrain a protein's z coordinate to within a given range.
Definition: npc.py:101
Keep protein away from a half torus in the xy plane.
Definition: npc.py:336
Restrain a protein's distance from the z axis to within a given range.
Definition: npc.py:19
Restrain particles by their z coordinate.
Restrain particles by their y coordinate.
Restrain particles by their distance from the z axis in the xy plane.
Try to keep one set of particles localized on a membrane surface.
Restrain particles by their z coordinate.
Restrain a protein's distance from the z axis to above a lower bound.
Definition: npc.py:57
def select_by_tuple_2
New tuple format: molname OR (start,stop,molname,copynum,statenum) Copy and state are optional...
Definition: tools.py:430
Try to keep particles away from a membrane.
Restrain a protein's y coordinate to within a given range.
Definition: npc.py:183
Restrain particles by their distance from the z axis in the xy plane.
Localize one protein on the surface of a half torus in the xy plane.
Definition: npc.py:294
Try to keep particles localized on a membrane surface.
Restrain a protein's distance from the z axis to below an upper bound.
Definition: npc.py:79
Restrain a protein's z coordinate to below an upper bound.
Definition: npc.py:161
Localize protein on the surface of a half torus in the xy plane.
Definition: npc.py:265
Restrain a protein's y coordinate to below an upper bound.
Definition: npc.py:243
Restraints designed for modeling the Nuclear Pore Complex (NPC)
Restrain particles by their z coordinate.
Restrain particles by their distance from the z axis in the xy plane.
Restrain a protein's z coordinate to above a lower bound.
Definition: npc.py:139
Restrain particles by their y coordinate.
Restrain particles by their y coordinate.