IMP logo
IMP Reference Guide  2.18.0
The Integrative Modeling Platform
restraints/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 ther 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  def __init__(self, hier, protein, lower_bound=0.0, upper_bound=0.0,
23  consider_radius=False, sigma=1.0, term='C', label=None,
24  weight=1.0):
25  """Constructor
26  """
27 
28  super(XYRadialPositionRestraint, self).__init__(
29  hier.get_model(), label=label, weight=weight)
30 
32  self.model, lower_bound, upper_bound, consider_radius, sigma)
34  hier, 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  for p, state in IMP.pmi.tools._all_protocol_outputs(hier):
50  p.add_xyradial_restraint(state, residues, lower_bound,
51  upper_bound, sigma, self)
52 
53  self.rs.add_restraint(xyr)
54 
55 
56 class XYRadialPositionLowerRestraint(IMP.pmi.restraints.RestraintBase):
57  """Restrain a protein's distance from the z axis to above a lower bound.
58  """
59  def __init__(self, hier, protein, lower_bound=0.0,
60  consider_radius=False, sigma=1.0, label=None, weight=1.0):
61  """Constructor
62  """
63 
64  super(XYRadialPositionLowerRestraint, self).__init__(
65  hier.get_model(), label=label, weight=weight)
66 
68  self.model, lower_bound, consider_radius, sigma)
70  hier, protein, resolution=1)
71  cterminal = residues[-1]
72 
73  xyr.add_particle(cterminal)
74  self.rs.add_restraint(xyr)
75 
76 
77 class XYRadialPositionUpperRestraint(IMP.pmi.restraints.RestraintBase):
78  """Restrain a protein's distance from the z axis to below an upper bound.
79  """
80  def __init__(self, hier, protein, upper_bound=0.0,
81  consider_radius=False, sigma=1.0, label=None, weight=1.0):
82  """Constructor
83  """
84 
85  super(XYRadialPositionUpperRestraint, self).__init__(
86  hier.get_model(), label=label, weight=weight)
87 
89  self.model, upper_bound, consider_radius, sigma)
91  hier, protein, resolution=1)
92  cterminal = residues[-1]
93 
94  xyr.add_particle(cterminal)
95  self.rs.add_restraint(xyr)
96 
97 
98 class ZAxialPositionRestraint(IMP.pmi.restraints.RestraintBase):
99  """Restrain a protein's z coordinate to within a given range.
100  """
101  def __init__(self, hier, protein, lower_bound=0.0,
102  upper_bound=0.0, consider_radius=False, sigma=1.0, term='C',
103  label=None, weight=1.0):
104  """Constructor
105  """
106 
107  super(ZAxialPositionRestraint, self).__init__(
108  hier.get_model(), label=label, weight=weight)
109 
111  self.model, lower_bound, upper_bound, consider_radius, sigma)
113  hier, protein, resolution=1)
114  if term == 'C':
115  terminal = residues[-1]
116  # print (terminal, type(terminal))
117  zax.add_particle(terminal)
118  elif term == 'N':
119  terminal = residues[0]
120  # print (terminal, type(terminal))
121  zax.add_particle(terminal)
122  else:
123  for residue in residues:
124  # print (residue, type(residue))
125  zax.add_particle(residue)
126 
127  self.dataset = None
128  for p, state in IMP.pmi.tools._all_protocol_outputs(hier):
129  p.add_zaxial_restraint(state, residues, lower_bound,
130  upper_bound, sigma, self)
131 
132  self.rs.add_restraint(zax)
133 
134 
135 class ZAxialPositionLowerRestraint(IMP.pmi.restraints.RestraintBase):
136  """Restrain a protein's z coordinate to above a lower bound.
137  """
138  def __init__(self, hier, protein, lower_bound=0.0,
139  consider_radius=False, sigma=1.0, label=None, weight=1.0):
140  """Constructor
141  """
142 
143  super(ZAxialPositionLowerRestraint, self).__init__(
144  hier.get_model(), label=label, weight=weight)
145 
147  self.model, lower_bound, consider_radius, sigma)
149  hier, protein, resolution=1)
150  cterminal = residues[-1]
151 
152  zax.add_particle(cterminal)
153  self.rs.add_restraint(zax)
154 
155 
156 class ZAxialPositionUpperRestraint(IMP.pmi.restraints.RestraintBase):
157  """Restrain a protein's z coordinate to below an upper bound.
158  """
159  def __init__(self, hier, protein, upper_bound=0.0,
160  consider_radius=False, sigma=1.0, label=None, weight=1.0):
161  """Constructor
162  """
163 
164  super(ZAxialPositionUpperRestraint, self).__init__(
165  hier.get_model(), label=label, weight=weight)
166 
168  self.model, upper_bound, consider_radius, sigma)
170  hier, protein, resolution=1)
171  cterminal = residues[-1]
172 
173  zax.add_particle(cterminal)
174  self.rs.add_restraint(zax)
175 
176 
177 class YAxialPositionRestraint(IMP.pmi.restraints.RestraintBase):
178  """Restrain a protein's y coordinate to within a given range.
179  """
180  def __init__(self, hier, protein, lower_bound=0.0,
181  upper_bound=0.0, consider_radius=False, sigma=1.0, term='C',
182  label=None, weight=1.0):
183  """Constructor
184  """
185 
186  super(YAxialPositionRestraint, self).__init__(
187  hier.get_model(), label=label, weight=weight)
188 
190  self.model, lower_bound, upper_bound, consider_radius, sigma)
192  hier, protein, resolution=1)
193  if term == 'C':
194  terminal = residues[-1]
195  # print (terminal, type(terminal))
196  yax.add_particle(terminal)
197  elif term == 'N':
198  terminal = residues[0]
199  # print (terminal, type(terminal))
200  yax.add_particle(terminal)
201  else:
202  for residue in residues:
203  # print (residue, type(residue))
204  yax.add_particle(residue)
205 
206  self.dataset = None
207  for p, state in IMP.pmi.tools._all_protocol_outputs(hier):
208  p.add_yaxial_restraint(state, residues, lower_bound,
209  upper_bound, sigma, self)
210 
211  self.rs.add_restraint(yax)
212 
213 
214 class YAxialPositionLowerRestraint(IMP.pmi.restraints.RestraintBase):
215  """Restrain a protein's y coordinate to above a lower bound.
216  """
217  def __init__(self, hier, protein, lower_bound=0.0,
218  consider_radius=False, sigma=1.0, label=None, weight=1.0):
219  """Constructor
220  """
221 
222  super(YAxialPositionLowerRestraint, self).__init__(
223  hier.get_model(), label=label, weight=weight)
224 
226  self.model, lower_bound, consider_radius, sigma)
228  hier, protein, resolution=1)
229  cterminal = residues[-1]
230 
231  yax.add_particle(cterminal)
232  self.rs.add_restraint(yax)
233 
234 
235 class YAxialPositionUpperRestraint(IMP.pmi.restraints.RestraintBase):
236  """Restrain a protein's y coordinate to below an upper bound.
237  """
238  def __init__(self, hier, protein, upper_bound=0.0,
239  consider_radius=False, sigma=1.0, label=None, weight=1.0):
240  """Constructor
241  """
242 
243  super(YAxialPositionUpperRestraint, self).__init__(
244  hier.get_model(), label=label, weight=weight)
245 
247  self.model, upper_bound, consider_radius, sigma)
249  hier, protein, resolution=1)
250  cterminal = residues[-1]
251 
252  yax.add_particle(cterminal)
253  self.rs.add_restraint(yax)
254 
255 
256 class MembraneSurfaceLocationRestraint(IMP.pmi.restraints.RestraintBase):
257  """Localize protein on the surface of a half torus in the xy plane.
258  """
259  def __init__(self, hier, protein,
260  tor_R=540.0, tor_r=127.5, tor_th=45.0, sigma=0.2,
261  resolution=1, label=None, weight=1.0):
262  """Constructor
263  """
264 
265  super(MembraneSurfaceLocationRestraint, self).__init__(
266  hier.get_model(), label=label, weight=weight)
267 
269  self.model, tor_R, tor_r, tor_th, sigma)
271  hier, protein, resolution=resolution)
272  for residue in residues:
273  # print (residue, type(residue))
274  msl.add_particle(residue)
275 
276  self.dataset = None
277  for p, state in IMP.pmi.tools._all_protocol_outputs(hier):
278  p.add_membrane_surface_location_restraint(
279  state, residues, tor_R, tor_r, tor_th, sigma, self)
280 
281  self.rs.add_restraint(msl)
282 
283 
285  IMP.pmi.restraints.RestraintBase):
286  """Localize one protein on the surface of a half torus in the xy plane.
287 
288  Create Membrane Surface Location CONDITIONAL Restraint
289  for Nup120 ALPS Motifs - Mutually Exclusive from (135,152,'Nup120')
290  and (197,216,'Nup120').
291  It returns a minimum penalty score from two potential ALPS motifs.
292  """
293  def __init__(self, hier, protein1, protein2,
294  tor_R=540.0, tor_r=127.5, tor_th=45.0, sigma=0.2,
295  resolution=1, label=None, weight=1.0):
296  """Constructor
297  """
298 
299  super(MembraneSurfaceLocationConditionalRestraint, self).__init__(
300  hier.get_model(), label=label, weight=weight)
301 
303  self.model, tor_R, tor_r, tor_th, sigma)
305  hier, protein1, resolution=resolution)
306  for residue in residues1:
307  # print (residue, type(residue))
308  msl.add_particle1(residue)
310  hier, protein2, resolution=resolution)
311  for residue in residues2:
312  # print (residue, type(residue))
313  msl.add_particle2(residue)
314 
315  # Approximate as two membrane restraints
316  self.dataset = None
317  for p, state in IMP.pmi.tools._all_protocol_outputs(hier):
318  for residues in residues1, residues2:
319  p.add_membrane_surface_location_restraint(
320  state, residues, tor_R, tor_r, tor_th, sigma, self)
321 
322  self.rs.add_restraint(msl)
323 
324 
325 class MembraneExclusionRestraint(IMP.pmi.restraints.RestraintBase):
326  """Keep protein away from a half torus in the xy plane.
327  """
328  def __init__(self, hier, protein=None,
329  tor_R=540.0, tor_r=127.5, tor_th=45.0, sigma=0.2,
330  resolution=1, label=None, weight=1.0):
331  """Constructor
332  """
333 
334  super(MembraneExclusionRestraint, self).__init__(
335  hier.get_model(), label=label, weight=weight)
336 
338  self.model, tor_R, tor_r, tor_th, sigma)
340  hier, protein, resolution=resolution)
341  for residue in residues:
342  mex.add_particle(residue)
343 
344  self.dataset = None
345  for p, state in IMP.pmi.tools._all_protocol_outputs(hier):
346  p.add_membrane_exclusion_restraint(
347  state, residues, tor_R, tor_r, tor_th, sigma, self)
348 
349  self.rs.add_restraint(mex)
Restrain a protein's y coordinate to above a lower bound.
Restrain a protein's z coordinate to within a given range.
Keep protein away from a half torus in the xy plane.
Restrain a protein's distance from the z axis to within a given range.
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.
def select_by_tuple_2
New tuple format: molname OR (start,stop,molname,copynum,statenum) Copy and state are optional...
Definition: tools.py:501
Try to keep particles away from a membrane.
Restrain a protein's y coordinate to within a given range.
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.
Try to keep particles localized on a membrane surface.
Restrain a protein's distance from the z axis to below an upper bound.
Restrain a protein's z coordinate to below an upper bound.
Localize protein on the surface of a half torus in the xy plane.
Restrain a protein's y coordinate to below an upper bound.
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.
Restrain particles by their y coordinate.
Restrain particles by their y coordinate.