IMP logo
IMP Reference Guide  2.19.0
The Integrative Modeling Platform
modeller/__init__.py
1 # This file was automatically generated by SWIG (https://www.swig.org).
2 # Version 4.1.1
3 #
4 # Do not make changes to this file unless you know what you are doing - modify
5 # the SWIG interface file instead.
6 
7 
8 # This wrapper is part of IMP,
9 # Copyright 2007-2023 IMP Inventors. All rights reserved.
10 
11 from __future__ import print_function, division, absolute_import
12 
13 
14 
15 from sys import version_info as _swig_python_version_info
16 import _IMP_modeller
17 
18 try:
19  import builtins as __builtin__
20 except ImportError:
21  import __builtin__
22 
23 def _swig_repr(self):
24  try:
25  strthis = "proxy of " + self.this.__repr__()
26  except __builtin__.Exception:
27  strthis = ""
28  return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
29 
30 
31 def _swig_setattr_nondynamic_instance_variable(set):
32  def set_instance_attr(self, name, value):
33  if name == "this":
34  set(self, name, value)
35  elif name == "thisown":
36  self.this.own(value)
37  elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
38  set(self, name, value)
39  else:
40  raise AttributeError("You cannot add instance attributes to %s" % self)
41  return set_instance_attr
42 
43 
44 def _swig_setattr_nondynamic_class_variable(set):
45  def set_class_attr(cls, name, value):
46  if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
47  set(cls, name, value)
48  else:
49  raise AttributeError("You cannot add class attributes to %s" % cls)
50  return set_class_attr
51 
52 
53 def _swig_add_metaclass(metaclass):
54  """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
55  def wrapper(cls):
56  return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
57  return wrapper
58 
59 
60 class _SwigNonDynamicMeta(type):
61  """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
62  __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)
63 
64 
65 import weakref
66 
67 class IMP_MODELLER_SwigPyIterator(object):
68  r"""Proxy of C++ swig::IMP_MODELLER_SwigPyIterator class."""
69 
70  thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
71 
72  def __init__(self, *args, **kwargs):
73  raise AttributeError("No constructor defined - class is abstract")
74  __repr__ = _swig_repr
75  __swig_destroy__ = _IMP_modeller.delete_IMP_MODELLER_SwigPyIterator
76 
77  def value(self):
78  r"""value(IMP_MODELLER_SwigPyIterator self) -> PyObject *"""
79  return _IMP_modeller.IMP_MODELLER_SwigPyIterator_value(self)
80 
81  def incr(self, n=1):
82  r"""incr(IMP_MODELLER_SwigPyIterator self, size_t n=1) -> IMP_MODELLER_SwigPyIterator"""
83  return _IMP_modeller.IMP_MODELLER_SwigPyIterator_incr(self, n)
84 
85  def decr(self, n=1):
86  r"""decr(IMP_MODELLER_SwigPyIterator self, size_t n=1) -> IMP_MODELLER_SwigPyIterator"""
87  return _IMP_modeller.IMP_MODELLER_SwigPyIterator_decr(self, n)
88 
89  def distance(self, x):
90  r"""distance(IMP_MODELLER_SwigPyIterator self, IMP_MODELLER_SwigPyIterator x) -> ptrdiff_t"""
91  return _IMP_modeller.IMP_MODELLER_SwigPyIterator_distance(self, x)
92 
93  def equal(self, x):
94  r"""equal(IMP_MODELLER_SwigPyIterator self, IMP_MODELLER_SwigPyIterator x) -> bool"""
95  return _IMP_modeller.IMP_MODELLER_SwigPyIterator_equal(self, x)
96 
97  def copy(self):
98  r"""copy(IMP_MODELLER_SwigPyIterator self) -> IMP_MODELLER_SwigPyIterator"""
99  return _IMP_modeller.IMP_MODELLER_SwigPyIterator_copy(self)
100 
101  def next(self):
102  r"""next(IMP_MODELLER_SwigPyIterator self) -> PyObject *"""
103  return _IMP_modeller.IMP_MODELLER_SwigPyIterator_next(self)
104 
105  def __next__(self):
106  r"""__next__(IMP_MODELLER_SwigPyIterator self) -> PyObject *"""
107  return _IMP_modeller.IMP_MODELLER_SwigPyIterator___next__(self)
108 
109  def previous(self):
110  r"""previous(IMP_MODELLER_SwigPyIterator self) -> PyObject *"""
111  return _IMP_modeller.IMP_MODELLER_SwigPyIterator_previous(self)
112 
113  def advance(self, n):
114  r"""advance(IMP_MODELLER_SwigPyIterator self, ptrdiff_t n) -> IMP_MODELLER_SwigPyIterator"""
115  return _IMP_modeller.IMP_MODELLER_SwigPyIterator_advance(self, n)
116 
117  def __eq__(self, x):
118  r"""__eq__(IMP_MODELLER_SwigPyIterator self, IMP_MODELLER_SwigPyIterator x) -> bool"""
119  return _IMP_modeller.IMP_MODELLER_SwigPyIterator___eq__(self, x)
120 
121  def __ne__(self, x):
122  r"""__ne__(IMP_MODELLER_SwigPyIterator self, IMP_MODELLER_SwigPyIterator x) -> bool"""
123  return _IMP_modeller.IMP_MODELLER_SwigPyIterator___ne__(self, x)
124 
125  def __iadd__(self, n):
126  r"""__iadd__(IMP_MODELLER_SwigPyIterator self, ptrdiff_t n) -> IMP_MODELLER_SwigPyIterator"""
127  return _IMP_modeller.IMP_MODELLER_SwigPyIterator___iadd__(self, n)
128 
129  def __isub__(self, n):
130  r"""__isub__(IMP_MODELLER_SwigPyIterator self, ptrdiff_t n) -> IMP_MODELLER_SwigPyIterator"""
131  return _IMP_modeller.IMP_MODELLER_SwigPyIterator___isub__(self, n)
132 
133  def __add__(self, n):
134  r"""__add__(IMP_MODELLER_SwigPyIterator self, ptrdiff_t n) -> IMP_MODELLER_SwigPyIterator"""
135  return _IMP_modeller.IMP_MODELLER_SwigPyIterator___add__(self, n)
136 
137  def __sub__(self, *args):
138  r"""
139  __sub__(IMP_MODELLER_SwigPyIterator self, ptrdiff_t n) -> IMP_MODELLER_SwigPyIterator
140  __sub__(IMP_MODELLER_SwigPyIterator self, IMP_MODELLER_SwigPyIterator x) -> ptrdiff_t
141  """
142  return _IMP_modeller.IMP_MODELLER_SwigPyIterator___sub__(self, *args)
143  def __iter__(self):
144  return self
145 
146 # Register IMP_MODELLER_SwigPyIterator in _IMP_modeller:
147 _IMP_modeller.IMP_MODELLER_SwigPyIterator_swigregister(IMP_MODELLER_SwigPyIterator)
148 
149 _value_types=[]
150 _object_types=[]
151 _raii_types=[]
152 _plural_types=[]
153 
154 IMP_DEBUG = _IMP_modeller.IMP_DEBUG
155 
156 IMP_RELEASE = _IMP_modeller.IMP_RELEASE
157 
158 IMP_SILENT = _IMP_modeller.IMP_SILENT
159 
160 IMP_PROGRESS = _IMP_modeller.IMP_PROGRESS
161 
162 IMP_TERSE = _IMP_modeller.IMP_TERSE
163 
164 IMP_VERBOSE = _IMP_modeller.IMP_VERBOSE
165 
166 IMP_MEMORY = _IMP_modeller.IMP_MEMORY
167 
168 IMP_NONE = _IMP_modeller.IMP_NONE
169 
170 IMP_USAGE = _IMP_modeller.IMP_USAGE
171 
172 IMP_INTERNAL = _IMP_modeller.IMP_INTERNAL
173 
174 IMP_KERNEL_HAS_LOG4CXX = _IMP_modeller.IMP_KERNEL_HAS_LOG4CXX
175 
176 IMP_COMPILER_HAS_CEREAL_RAW_POINTER = _IMP_modeller.IMP_COMPILER_HAS_CEREAL_RAW_POINTER
177 
178 IMP_COMPILER_HAS_DEBUG_VECTOR = _IMP_modeller.IMP_COMPILER_HAS_DEBUG_VECTOR
179 
180 IMP_COMPILER_HAS_RANDOM_SHUFFLE = _IMP_modeller.IMP_COMPILER_HAS_RANDOM_SHUFFLE
181 
182 IMP_COMPILER_HAS_THREE_WAY = _IMP_modeller.IMP_COMPILER_HAS_THREE_WAY
183 
184 IMP_KERNEL_HAS_BOOST_RANDOM = _IMP_modeller.IMP_KERNEL_HAS_BOOST_RANDOM
185 
186 IMP_KERNEL_HAS_NUMPY = _IMP_modeller.IMP_KERNEL_HAS_NUMPY
187 
188 IMP_KERNEL_HAS_GPERFTOOLS = _IMP_modeller.IMP_KERNEL_HAS_GPERFTOOLS
189 
190 IMP_KERNEL_HAS_TCMALLOC_HEAPCHECKER = _IMP_modeller.IMP_KERNEL_HAS_TCMALLOC_HEAPCHECKER
191 
192 IMP_KERNEL_HAS_TCMALLOC_HEAPPROFILER = _IMP_modeller.IMP_KERNEL_HAS_TCMALLOC_HEAPPROFILER
193 
194 IMPKERNEL_SHOW_WARNINGS = _IMP_modeller.IMPKERNEL_SHOW_WARNINGS
195 
196 
197 import sys
198 class _DirectorObjects(object):
199  """@internal Simple class to keep references to director objects
200  to prevent premature deletion."""
201  def __init__(self):
202  self._objects = []
203  def register(self, obj):
204  """Take a reference to a director object; will only work for
205  refcounted C++ classes"""
206  if hasattr(obj, 'get_ref_count'):
207  self._objects.append(obj)
208  def cleanup(self):
209  """Only drop our reference and allow cleanup by Python if no other
210  Python references exist (we hold 3 references: one in self._objects,
211  one in x, and one in the argument list for getrefcount) *and* no
212  other C++ references exist (the Python object always holds one)"""
213  objs = [x for x in self._objects if sys.getrefcount(x) > 3 \
214  or x.get_ref_count() > 1]
215 # Do in two steps so the references are kept until the end of the
216 # function (deleting references may trigger a fresh call to this method)
217  self._objects = objs
218  def get_object_count(self):
219  """Get number of director objects (useful for testing only)"""
220  return len(self._objects)
221 _director_objects = _DirectorObjects()
222 
223 class _ostream(object):
224  r"""Proxy of C++ std::ostream class."""
225 
226  thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
227 
228  def __init__(self, *args, **kwargs):
229  raise AttributeError("No constructor defined")
230  __repr__ = _swig_repr
231 
232  def write(self, osa_buf):
233  r"""write(_ostream self, char const * osa_buf)"""
234  return _IMP_modeller._ostream_write(self, osa_buf)
235 
236 # Register _ostream in _IMP_modeller:
237 _IMP_modeller._ostream_swigregister(_ostream)
238 IMP_C_OPEN_BINARY = _IMP_modeller.IMP_C_OPEN_BINARY
239 
240 import IMP
241 IMP_CGAL_HAS_BOOST_FILESYSTEM = _IMP_modeller.IMP_CGAL_HAS_BOOST_FILESYSTEM
242 
243 IMP_CGAL_HAS_BOOST_PROGRAMOPTIONS = _IMP_modeller.IMP_CGAL_HAS_BOOST_PROGRAMOPTIONS
244 
245 IMP_CGAL_HAS_BOOST_RANDOM = _IMP_modeller.IMP_CGAL_HAS_BOOST_RANDOM
246 
247 IMP_CGAL_HAS_BOOST_SYSTEM = _IMP_modeller.IMP_CGAL_HAS_BOOST_SYSTEM
248 
249 IMP_CGAL_HAS_NUMPY = _IMP_modeller.IMP_CGAL_HAS_NUMPY
250 
251 IMPCGAL_SHOW_WARNINGS = _IMP_modeller.IMPCGAL_SHOW_WARNINGS
252 
253 import IMP.cgal
254 IMP_ALGEBRA_HAS_IMP_CGAL = _IMP_modeller.IMP_ALGEBRA_HAS_IMP_CGAL
255 
256 IMP_ALGEBRA_HAS_BOOST_FILESYSTEM = _IMP_modeller.IMP_ALGEBRA_HAS_BOOST_FILESYSTEM
257 
258 IMP_ALGEBRA_HAS_BOOST_PROGRAMOPTIONS = _IMP_modeller.IMP_ALGEBRA_HAS_BOOST_PROGRAMOPTIONS
259 
260 IMP_ALGEBRA_HAS_BOOST_RANDOM = _IMP_modeller.IMP_ALGEBRA_HAS_BOOST_RANDOM
261 
262 IMP_ALGEBRA_HAS_BOOST_SYSTEM = _IMP_modeller.IMP_ALGEBRA_HAS_BOOST_SYSTEM
263 
264 IMP_ALGEBRA_HAS_CGAL = _IMP_modeller.IMP_ALGEBRA_HAS_CGAL
265 
266 IMP_ALGEBRA_HAS_NUMPY = _IMP_modeller.IMP_ALGEBRA_HAS_NUMPY
267 
268 IMP_ALGEBRA_HAS_ANN = _IMP_modeller.IMP_ALGEBRA_HAS_ANN
269 
270 IMPALGEBRA_SHOW_WARNINGS = _IMP_modeller.IMPALGEBRA_SHOW_WARNINGS
271 
272 import IMP.algebra
273 IMP_DISPLAY_HAS_IMP_CGAL = _IMP_modeller.IMP_DISPLAY_HAS_IMP_CGAL
274 
275 IMP_DISPLAY_HAS_BOOST_FILESYSTEM = _IMP_modeller.IMP_DISPLAY_HAS_BOOST_FILESYSTEM
276 
277 IMP_DISPLAY_HAS_BOOST_PROGRAMOPTIONS = _IMP_modeller.IMP_DISPLAY_HAS_BOOST_PROGRAMOPTIONS
278 
279 IMP_DISPLAY_HAS_BOOST_RANDOM = _IMP_modeller.IMP_DISPLAY_HAS_BOOST_RANDOM
280 
281 IMP_DISPLAY_HAS_BOOST_SYSTEM = _IMP_modeller.IMP_DISPLAY_HAS_BOOST_SYSTEM
282 
283 IMP_DISPLAY_HAS_CGAL = _IMP_modeller.IMP_DISPLAY_HAS_CGAL
284 
285 IMP_DISPLAY_HAS_NUMPY = _IMP_modeller.IMP_DISPLAY_HAS_NUMPY
286 
287 IMPDISPLAY_SHOW_WARNINGS = _IMP_modeller.IMPDISPLAY_SHOW_WARNINGS
288 
289 import IMP.display
290 IMP_SCORE_FUNCTOR_HAS_IMP_CGAL = _IMP_modeller.IMP_SCORE_FUNCTOR_HAS_IMP_CGAL
291 
292 IMP_SCORE_FUNCTOR_HAS_BOOST_FILESYSTEM = _IMP_modeller.IMP_SCORE_FUNCTOR_HAS_BOOST_FILESYSTEM
293 
294 IMP_SCORE_FUNCTOR_HAS_BOOST_PROGRAMOPTIONS = _IMP_modeller.IMP_SCORE_FUNCTOR_HAS_BOOST_PROGRAMOPTIONS
295 
296 IMP_SCORE_FUNCTOR_HAS_BOOST_RANDOM = _IMP_modeller.IMP_SCORE_FUNCTOR_HAS_BOOST_RANDOM
297 
298 IMP_SCORE_FUNCTOR_HAS_BOOST_SYSTEM = _IMP_modeller.IMP_SCORE_FUNCTOR_HAS_BOOST_SYSTEM
299 
300 IMP_SCORE_FUNCTOR_HAS_CGAL = _IMP_modeller.IMP_SCORE_FUNCTOR_HAS_CGAL
301 
302 IMP_SCORE_FUNCTOR_HAS_HDF5 = _IMP_modeller.IMP_SCORE_FUNCTOR_HAS_HDF5
303 
304 IMP_SCORE_FUNCTOR_HAS_NUMPY = _IMP_modeller.IMP_SCORE_FUNCTOR_HAS_NUMPY
305 
306 IMPSCOREFUNCTOR_SHOW_WARNINGS = _IMP_modeller.IMPSCOREFUNCTOR_SHOW_WARNINGS
307 
308 import IMP.score_functor
309 IMP_CORE_HAS_IMP_CGAL = _IMP_modeller.IMP_CORE_HAS_IMP_CGAL
310 
311 IMP_CORE_HAS_IMP_KERNEL = _IMP_modeller.IMP_CORE_HAS_IMP_KERNEL
312 
313 IMP_CORE_HAS_BOOST_FILESYSTEM = _IMP_modeller.IMP_CORE_HAS_BOOST_FILESYSTEM
314 
315 IMP_CORE_HAS_BOOST_PROGRAMOPTIONS = _IMP_modeller.IMP_CORE_HAS_BOOST_PROGRAMOPTIONS
316 
317 IMP_CORE_HAS_BOOST_RANDOM = _IMP_modeller.IMP_CORE_HAS_BOOST_RANDOM
318 
319 IMP_CORE_HAS_BOOST_SYSTEM = _IMP_modeller.IMP_CORE_HAS_BOOST_SYSTEM
320 
321 IMP_CORE_HAS_CGAL = _IMP_modeller.IMP_CORE_HAS_CGAL
322 
323 IMP_CORE_HAS_HDF5 = _IMP_modeller.IMP_CORE_HAS_HDF5
324 
325 IMP_CORE_HAS_NUMPY = _IMP_modeller.IMP_CORE_HAS_NUMPY
326 
327 IMPCORE_SHOW_WARNINGS = _IMP_modeller.IMPCORE_SHOW_WARNINGS
328 
329 import IMP.core
330 IMP_MODELLER_HAS_IMP_ALGEBRA = _IMP_modeller.IMP_MODELLER_HAS_IMP_ALGEBRA
331 
332 IMP_MODELLER_HAS_IMP_CGAL = _IMP_modeller.IMP_MODELLER_HAS_IMP_CGAL
333 
334 IMP_MODELLER_HAS_IMP_DISPLAY = _IMP_modeller.IMP_MODELLER_HAS_IMP_DISPLAY
335 
336 IMP_MODELLER_HAS_IMP_KERNEL = _IMP_modeller.IMP_MODELLER_HAS_IMP_KERNEL
337 
338 IMP_MODELLER_HAS_IMP_SCORE_FUNCTOR = _IMP_modeller.IMP_MODELLER_HAS_IMP_SCORE_FUNCTOR
339 
340 IMP_MODELLER_HAS_BOOST_FILESYSTEM = _IMP_modeller.IMP_MODELLER_HAS_BOOST_FILESYSTEM
341 
342 IMP_MODELLER_HAS_BOOST_PROGRAMOPTIONS = _IMP_modeller.IMP_MODELLER_HAS_BOOST_PROGRAMOPTIONS
343 
344 IMP_MODELLER_HAS_BOOST_RANDOM = _IMP_modeller.IMP_MODELLER_HAS_BOOST_RANDOM
345 
346 IMP_MODELLER_HAS_BOOST_SYSTEM = _IMP_modeller.IMP_MODELLER_HAS_BOOST_SYSTEM
347 
348 IMP_MODELLER_HAS_CGAL = _IMP_modeller.IMP_MODELLER_HAS_CGAL
349 
350 IMP_MODELLER_HAS_HDF5 = _IMP_modeller.IMP_MODELLER_HAS_HDF5
351 
352 IMP_MODELLER_HAS_NUMPY = _IMP_modeller.IMP_MODELLER_HAS_NUMPY
353 
354 IMP_MODELLER_HAS_PYTHON_IHM = _IMP_modeller.IMP_MODELLER_HAS_PYTHON_IHM
355 
356 IMPMODELLER_SHOW_WARNINGS = _IMP_modeller.IMPMODELLER_SHOW_WARNINGS
357 
358 
359 
360 import math
361 import imp
362 import os
363 import sys
364 import tempfile
365 import shutil
366 import IMP.atom
367 import IMP.container
368 import modeller.scripts
369 import modeller.optimizers
370 
371 
372 # Use Modeller 10 class names
373 if not hasattr(modeller.terms, 'EnergyTerm'):
374  modeller.terms.EnergyTerm = modeller.terms.energy_term
375  modeller.Selection = modeller.selection
376 
377 
378 class _TempDir(object):
379  """Make a temporary directory that is deleted when the object is."""
380 
381  def __init__(self):
382  self.tmpdir = tempfile.mkdtemp()
383 
384  def __del__(self):
385  shutil.rmtree(self.tmpdir, ignore_errors=True)
386 
387 
388 class IMPRestraints(modeller.terms.EnergyTerm):
389  """A Modeller restraint which evaluates an IMP scoring function.
390  This can be used to incorporate IMP Restraints into an existing
391  comparative modeling pipeline, or to use Modeller optimizers or
392  protocols.
393  """
394 
395  _physical_type = modeller.physical.absposition
396 
397  def __init__(self, particles, scoring_function=None):
398  """Constructor.
399  @param particles A list of the IMP atoms (as Particle objects),
400  same order as the Modeller atoms.
401  @param scoring_function An IMP::ScoringFunction object that will
402  be incorporated into the Modeller score (molpdf).
403  @note since Modeller, unlike IMP, is sensitive to the ordering
404  of atoms, it usually makes sense to create the model in
405  Modeller and then use ModelLoader to load it into IMP,
406  since that will preserve the Modeller atom ordering in IMP.
407  """
408  modeller.terms.EnergyTerm.__init__(self)
409  self._particles = particles
410  if scoring_function:
411  self._sf = scoring_function
412  else:
413  self._sf = particles[0].get_model()
414 
415  def eval(self, mdl, deriv, indats):
416  atoms = self.indices_to_atoms(mdl, indats)
417  _copy_modeller_coords_to_imp(atoms, self._particles)
418  if len(self._particles) == 0:
419  score = 0.
420  else:
421  score = self._sf.evaluate(deriv)
422  if deriv:
423  dvx = [0.] * len(indats)
424  dvy = [0.] * len(indats)
425  dvz = [0.] * len(indats)
426  _get_imp_derivs(self._particles, dvx, dvy, dvz)
427  return (score, dvx, dvy, dvz)
428  else:
429  return score
430 
431 
433  """An IMP restraint using all defined Modeller restraints.
434  This is useful if you want to use Modeller restraints with an IMP
435  optimizer, or in combination with IMP restraints.
436 
437  @note Currently only the coordinates of the atoms are translated
438  between Modeller and IMP; thus, a Modeller restraint which
439  uses any other attribute (e.g. charge) will not react if
440  this attribute is changed by IMP.
441  """
442 
443  def __init__(self, model, modeller_model, particles):
444  """Constructor.
445  @param model The IMP Model object.
446  @param modeller_model The Modeller model object.
447  @param particles A list of the IMP atoms (as Particle objects),
448  in the same order as the Modeller atoms.
449  @note since Modeller, unlike IMP, is sensitive to the ordering
450  of atoms, it usually makes sense to create the model in
451  Modeller and then use ModelLoader to load it into IMP,
452  since that will preserve the Modeller atom ordering in IMP.
453  """
454  def get_particle(x):
455  if hasattr(x, 'get_particle'):
456  return x.get_particle()
457  else:
458  return x
459  IMP.Restraint.__init__(self, model, "ModellerRestraints %1%")
460  self._modeller_model = modeller_model
461  self._particles = [get_particle(x) for x in particles]
462 
463  def unprotected_evaluate(self, accum):
464  atoms = self._modeller_model.atoms
465  sel = modeller.Selection(self._modeller_model)
466  _copy_imp_coords_to_modeller(self._particles, atoms)
467  energies = sel.energy()
468  if accum:
469  _add_modeller_derivs_to_imp(atoms, self._particles, accum)
470 
471  return energies[0]
472 
473  def get_version_info(self):
474  return IMP.VersionInfo("IMP developers", "0.1")
475  def do_show(self, fh):
476  fh.write("ModellerRestraints")
477  def do_get_inputs(self):
478  return self._particles
479 
480 
481 def _copy_imp_coords_to_modeller(particles, atoms):
482  """Copy atom coordinates from IMP to Modeller"""
483  xkey = IMP.FloatKey("x")
484  ykey = IMP.FloatKey("y")
485  zkey = IMP.FloatKey("z")
486  for (num, at) in enumerate(atoms):
487  at.x = particles[num].get_value(xkey)
488  at.y = particles[num].get_value(ykey)
489  at.z = particles[num].get_value(zkey)
490 
491 
492 def _copy_modeller_coords_to_imp(atoms, particles):
493  """Copy atom coordinates from Modeller to IMP"""
494  xkey = IMP.FloatKey("x")
495  ykey = IMP.FloatKey("y")
496  zkey = IMP.FloatKey("z")
497  for (num, at) in enumerate(atoms):
498  particles[num].set_value(xkey, at.x)
499  particles[num].set_value(ykey, at.y)
500  particles[num].set_value(zkey, at.z)
501 
502 
503 def _add_modeller_derivs_to_imp(atoms, particles, accum):
504  """Add atom derivatives from Modeller to IMP"""
505  for (num, at) in enumerate(atoms):
506  xyz = IMP.core.XYZ(particles[num])
507  xyz.add_to_derivative(0, at.dvx, accum)
508  xyz.add_to_derivative(1, at.dvy, accum)
509  xyz.add_to_derivative(2, at.dvz, accum)
510 
511 
512 def _get_imp_derivs(particles, dvx, dvy, dvz):
513  """Move atom derivatives from IMP to Modeller"""
514  xkey = IMP.FloatKey("x")
515  ykey = IMP.FloatKey("y")
516  zkey = IMP.FloatKey("z")
517  for idx in range(0, len(dvx)):
518  dvx[idx] = particles[idx].get_derivative(xkey)
519  dvy[idx] = particles[idx].get_derivative(ykey)
520  dvz[idx] = particles[idx].get_derivative(zkey)
521 
522 
523 # Generators to create IMP UnaryFunction objects from Modeller parameters:
524 def _HarmonicLowerBoundGenerator(parameters, modalities):
525  (mean, stdev) = parameters
527  return IMP.core.HarmonicLowerBound(mean, k)
528 
529 def _HarmonicUpperBoundGenerator(parameters, modalities):
530  (mean, stdev) = parameters
532  return IMP.core.HarmonicUpperBound(mean, k)
533 
534 def _HarmonicGenerator(parameters, modalities):
535  (mean, stdev) = parameters
537  return IMP.core.Harmonic(mean, k)
538 
539 def _CosineGenerator(parameters, modalities):
540  (phase, force_constant) = parameters
541  (periodicity,) = modalities
542  return IMP.core.Cosine(force_constant, periodicity, phase)
543 
544 def _LinearGenerator(parameters, modalities):
545  (scale,) = parameters
546  return IMP.core.Linear(0, scale)
547 
548 def _SplineGenerator(parameters, modalities):
549  (open, low, high, delta, lowderiv, highderiv) = parameters[:6]
550  values = []
551  for v in parameters[6:]:
552  values.append(v)
553  if open < 0.0:
554  return IMP.core.ClosedCubicSpline(values, low, delta)
555  else:
556  return IMP.core.OpenCubicSpline(values, low, delta)
557 
558 #: Mapping from Modeller math form number to a unary function generator
559 _unary_func_generators = {
560  1: _HarmonicLowerBoundGenerator,
561  2: _HarmonicUpperBoundGenerator,
562  3: _HarmonicGenerator,
563  7: _CosineGenerator,
564  8: _LinearGenerator,
565  10: _SplineGenerator,
566 }
567 
568 # Generators to make IMP Restraint objects from Modeller features
569 def _DistanceRestraintGenerator(form, modalities, atoms, parameters):
570  unary_func_gen = _unary_func_generators[form]
571  return IMP.core.DistanceRestraint(atoms[0].get_model(),
572  unary_func_gen(parameters, modalities),
573  atoms[0], atoms[1])
574 
575 def _AngleRestraintGenerator(form, modalities, atoms, parameters):
576  unary_func_gen = _unary_func_generators[form]
577  return IMP.core.AngleRestraint(atoms[0].get_model(),
578  unary_func_gen(parameters, modalities),
579  atoms[0], atoms[1], atoms[2])
580 
581 def _MultiBinormalGenerator(form, modalities, atoms, parameters):
582  nterms = modalities[0]
583  if len(parameters) != nterms * 6:
584  raise ValueError("Incorrect number of parameters (%d) for multiple "
585  "binormal restraint - expecting %d (%d terms * 6)" \
586  % (len(parameters), nterms * 6, nterms))
587  r = IMP.core.MultipleBinormalRestraint(atoms[0].get_model(),
588  atoms[:4], atoms[4:8])
589  for i in range(nterms):
591  t.set_weight(parameters[i])
592  t.set_means((parameters[nterms + i * 2],
593  parameters[nterms + i * 2 + 1]))
594  t.set_standard_deviations((parameters[nterms * 3 + i * 2],
595  parameters[nterms * 3 + i * 2 + 1]))
596  t.set_correlation(parameters[nterms * 5 + i])
597  r.add_term(t)
598  return r
599 
600 def _DihedralRestraintGenerator(form, modalities, atoms, parameters):
601  if form == 9:
602  return _MultiBinormalGenerator(form, modalities, atoms, parameters)
603  unary_func_gen = _unary_func_generators[form]
604  return IMP.core.DihedralRestraint(atoms[0].get_model(),
605  unary_func_gen(parameters, modalities),
606  atoms[0], atoms[1], atoms[2], atoms[3])
607 
608 def _get_protein_atom_particles(protein):
609  """Given a protein particle, get the flattened list of all child atoms"""
610  atom_particles = []
611  for ichain in range(protein.get_number_of_children()):
612  chain = protein.get_child(ichain)
613  for ires in range(chain.get_number_of_children()):
614  residue = chain.get_child(ires)
615  for iatom in range(residue.get_number_of_children()):
616  atom = residue.get_child(iatom)
617  atom_particles.append(atom.get_particle())
618  return atom_particles
619 
620 def _load_restraints_line(line, atom_particles):
621  """Parse a single Modeller restraints file line and return the
622  corresponding IMP restraint."""
623  spl = line.split()
624  typ = spl.pop(0)
625  if typ == 'MODELLER5':
626  return
627  elif typ != 'R':
628  raise NotImplementedError("Only 'R' lines currently read from " + \
629  "Modeller restraints files")
630  form = int(spl.pop(0))
631  modalities = [int(spl.pop(0))]
632  features = [int(spl.pop(0))]
633 # Discard group
634  spl.pop(0)
635  natoms = [int(spl.pop(0))]
636  nparam = int(spl.pop(0))
637  nfeat = int(spl.pop(0))
638  for i in range(nfeat - 1):
639  modalities.append(int(spl.pop(0)))
640  features.append(int(spl.pop(0)))
641  natoms.append(int(spl.pop(0)))
642  atoms = [int(spl.pop(0)) for x in range(natoms[0])]
643  for i in range(len(atoms)):
644  atoms[i] = atom_particles[atoms[i] - 1]
645  parameters = [float(spl.pop(0)) for x in range(nparam)]
646  restraint_generators = {
647  1 : _DistanceRestraintGenerator,
648  2 : _AngleRestraintGenerator,
649  3 : _DihedralRestraintGenerator,
650  4 : _DihedralRestraintGenerator,
651  }
652  restraint_gen = restraint_generators[features[0]]
653  return restraint_gen(form, modalities, atoms, parameters)
654 
655 
656 def _load_entire_restraints_file(filename, protein):
657  """Yield a set of IMP restraints from a Modeller restraints file."""
658  atoms = _get_protein_atom_particles(protein)
659  with open(filename, 'r') as fh:
660  for line in fh:
661  try:
662  rsr = _load_restraints_line(line, atoms)
663  if rsr is not None:
664  yield rsr
665  except Exception as err:
666  print("Cannot read restraints file line:\n" + line)
667  raise
668 
669 
670 def _copy_residue(r, model):
671  """Copy residue information from modeller to imp"""
672 #print "residue "+str(r)
673  p=IMP.Particle(model)
675  r.index)
676  p.set_name(str("residue "+r.num));
677  return p
678 
679 
680 def _copy_atom(a, model):
681  """Copy atom information from modeller"""
682 #print "atom "+str(a)
683  p=IMP.Particle(model)
685  xyzd= IMP.core.XYZ.setup_particle(p, IMP.algebra.Vector3D(a.x, a.y, a.z))
686 # Alignment structures don't have charges or atom types; models do
687  if hasattr(a, 'charge'):
689  if hasattr(a, 'type'):
690  IMP.atom.CHARMMAtom.setup_particle(p, a.type.name)
691  ap.set_input_index(a.index)
692  return p
693 
694 def _copy_chain(c, model):
695  """Copy chain information from modeller"""
696 #print "atom "+str(a)
697  p=IMP.Particle(model)
698 #set the chain name
699  cp = IMP.atom.Chain.setup_particle(p,c.name)
700  return p
701 
702 def _get_forcefield(submodel):
703  if submodel == 3:
705  IMP.atom.get_data_path('top_heav.lib'),
706  IMP.atom.get_data_path('par.lib'))
707  else:
709  IMP.atom.get_data_path('top.lib'),
710  IMP.atom.get_data_path('par.lib'))
711  return ff
712 
713 def add_soft_sphere_radii(hierarchy, submodel, scale=1.0, filename=None):
714  """Add radii to the hierarchy using the Modeller radius library, radii.lib.
715  Each radius is scaled by the given scale (Modeller usually scales radii
716  by a factor of 0.82). submodel specifies the topology submodel, which is
717  the column in radii.lib to use."""
718  if filename is None:
719  filename = IMP.atom.get_data_path('radii.lib')
720  radii = {}
721  with open(filename) as fh:
722  for line in fh:
723  if line.startswith('#'): continue
724  spl = line.split()
725  if len(spl) > 11:
726  radii[spl[0]] = float(spl[submodel])
727  atoms = IMP.atom.get_by_type(hierarchy, IMP.atom.ATOM_TYPE)
728  for a in atoms:
729  p = a.get_particle()
730  ct = IMP.atom.CHARMMAtom(p).get_charmm_type()
731  if ct in radii:
732  radius = radii[ct] * scale
734  IMP.core.XYZR(p).set_radius(radius)
735  else:
737 
738 
739 class ModelLoader(object):
740  """Read a Modeller model into IMP. After creating this object, the atoms
741  in the Modeller model can be loaded into IMP using the load_atoms()
742  method, then optionally any Modeller static restraints can be read in
743  with load_static_restraints() or load_static_restraints_file().
744 
745  This class can also be used to read Modeller alignment structures;
746  however, only load_atoms() will be useful in such a case (since
747  alignment structures don't have restraints or other information).
748 
749  """
750 
751  def __init__(self, modeller_model):
752  """Constructor.
753  @param modeller_model The Modeller model or alignment structure
754  object to read.
755  """
756  self._modeller_model = modeller_model
757 
758  def load_atoms(self, model):
759  """Construct an IMP::atom::Hierarchy that contains the same atoms as
760  the Modeller model or alignment structure.
761 
762  IMP atoms created from a Modeller model will be given charges and
763  CHARMM types, extracted from the model. Alignment structures don't
764  contain this information, so the IMP atoms won't either.
765 
766  @param model The IMP::Model object in which the hierarchy will be
767  created. The highest level hierarchy node is a PROTEIN.
768  @return the newly-created root IMP::atom::Hierarchy.
769  """
770  pp = IMP.Particle(model)
772  self._atoms = {}
773  for chain in self._modeller_model.chains:
774  cp = IMP.Particle(model)
775  hcp = IMP.atom.Chain.setup_particle(cp, chain.name)
776 # We don't really know the type yet
777  hpp.add_child(hcp)
778  for residue in chain.residues:
779  rp = _copy_residue(residue, model)
780  hrp = IMP.atom.Hierarchy(rp)
781  hcp.add_child(hrp)
782  for atom in residue.atoms:
783  ap = _copy_atom(atom, model)
784  hap = IMP.atom.Hierarchy(ap)
785  hrp.add_child(hap)
786  self._atoms[atom.index] = ap
787  lastres = hrp
788  self._modeller_hierarchy = hpp
789  return hpp
790 
791  def _get_nonbonded_list(self, atoms, pair_filter, edat, distance):
792  nbl = IMP.container.ClosePairContainer(atoms, distance,
793  edat.update_dynamic)
794 
795 # Exclude the same sets of atoms as Modeller
796  if pair_filter is None:
797  pair_filter = IMP.atom.StereochemistryPairFilter()
798  if edat.excl_local[0]:
799  pair_filter.set_bonds(list(self.load_bonds()))
800  if edat.excl_local[1]:
801  pair_filter.set_angles(list(self.load_angles()))
802  if edat.excl_local[2]:
803  pair_filter.set_dihedrals(list(self.load_dihedrals()))
804  nbl.add_pair_filter(pair_filter)
805  return nbl
806 
807  def load_bonds(self):
808  """Load the Modeller bond topology into the IMP model. Each bond is
809  represented in IMP as an IMP::atom::Bond, with no defined length
810  or stiffness. These bonds are primarily useful as input to
811  IMP::atom::StereochemistryPairFilter, to exclude bond interactions
812  from the nonbonded list. Typically the contribution to the scoring
813  function from the bonds is included in the Modeller static restraints
814  (use load_static_restraints() or load_static_restraints_file() to
815  load these). If you want to regenerate the stereochemistry in IMP,
816  do not use these functions (as then stereochemistry scoring terms
817  and exclusions would be double-counted) and instead use the
818  IMP::atom::CHARMMTopology class.
819 
820  You must call load_atoms() prior to using this function.
821  @see load_angles(), load_dihedrals(), load_impropers()
822  @return A generator listing all of the bonds.
823  """
824  if not hasattr(self, '_modeller_hierarchy'):
825  raise ValueError("Call load_atoms() first.")
826  for (maa, mab) in self._modeller_model.bonds:
827  pa = self._atoms[maa.index]
828  pb = self._atoms[mab.index]
830  ba= IMP.atom.Bonded(pa)
831  else:
834  bb= IMP.atom.Bonded(pb)
835  else:
837  yield IMP.atom.create_bond(ba, bb,
838  IMP.atom.Bond.SINGLE).get_particle()
839 
840  def load_angles(self):
841  """Load the Modeller angle topology into the IMP model.
842  See load_bonds() for more details."""
843  return self._internal_load_angles(self._modeller_model.angles,
845 
846  def load_dihedrals(self):
847  """Load the Modeller dihedral topology into the IMP model.
848  See load_bonds() for more details."""
849  return self._internal_load_angles(self._modeller_model.dihedrals,
851 
852  def load_impropers(self):
853  """Load the Modeller improper topology into the IMP model.
854  See load_bonds() for more details."""
855  return self._internal_load_angles(self._modeller_model.impropers,
857 
858  def _internal_load_angles(self, angles, angle_class):
859  if not hasattr(self, '_modeller_hierarchy'):
860  raise ValueError("Call load_atoms() first.")
861  for modeller_atoms in angles:
862  imp_particles = [self._atoms[x.index] for x in modeller_atoms]
863  p = IMP.Particle(imp_particles[0].get_model())
864  a = angle_class.setup_particle(p,
865  *[IMP.core.XYZ(x) for x in imp_particles])
866  yield a.get_particle()
867 
868  def load_static_restraints_file(self, filename):
869  """Convert a Modeller static restraints file into equivalent
870  IMP::Restraints. load_atoms() must have been called first to read
871  in the atoms that the restraints will act upon.
872  @param filename Name of the Modeller restraints file. The restraints
873  in this file are assumed to act upon the model read in by
874  load_atoms(); no checking is done to enforce this.
875  @return A Python generator of the newly-created IMP::Restraint
876  objects.
877  """
878  if not hasattr(self, '_modeller_hierarchy'):
879  raise ValueError("Call load_atoms() first.")
880  return _load_entire_restraints_file(filename, self._modeller_hierarchy)
881 
882 
884  """Convert the current set of Modeller static restraints into equivalent
885  IMP::Restraints. load_atoms() must have been called first to read
886  in the atoms that the restraints will act upon.
887  @return A Python generator of the newly-created IMP::Restraint
888  objects.
889  """
890  class _RestraintGenerator(object):
891  """Simple generator wrapper"""
892  def __init__(self, gen):
893  self._gen = gen
894  def __iter__(self, *args, **keys):
895  return self
896  def close(self, *args, **keys):
897  return self._gen.close(*args, **keys)
898  def next(self):
899  return next(self._gen)
900  __next__ = next
901  def send(self, *args, **keys):
902  return self._gen.send(*args, **keys)
903  def throw(self, *args, **keys):
904  return self._gen.throw(*args, **keys)
905 # Write current restraints into a temporary file
906  t = _TempDir()
907  rsrfile = os.path.join(t.tmpdir, 'restraints.rsr')
908  self._modeller_model.restraints.write(file=rsrfile)
909 # Read the file back in
910  gen = self.load_static_restraints_file(rsrfile)
911  wrap = _RestraintGenerator(gen)
912 # Ensure that tmpdir remains until we're done with the generator
913  wrap._tempdir = t
914  return wrap
915 
916  def load_dynamic_restraints(self, pair_filter=None):
917  """Convert Modeller dynamic restraints into IMP::Restraint objects.
918 
919  For each currently active Modeller dynamic restraint
920  (e.g. soft-sphere, electrostatics) an equivalent IMP::Restraint
921  is created.
922  load_atoms() must have been called first to read
923  in the atoms that the restraints will act upon.
924 
925  If pair_filter is given, it is an IMP::PairFilter object to exclude
926  pairs from the nonbonded lists used by the dynamic restraints.
927  Otherwise, an IMP::atom::StereochemistryPairFilter object is created
928  to exclude Modeller bonds, angles and dihedrals, as specified by
929  edat.excl_local. (Note that this calls load_bonds(), load_angles()
930  and load_dihedrals(), so will create duplicate lists of bonds if
931  those methods are called manually as well.)
932 
933  @note Currently only soft-sphere, electrostatic and Lennard-Jones
934  restraints are loaded.
935  @return A Python generator of the newly-created IMP::Restraint
936  objects.
937  """
938  if not hasattr(self, '_modeller_hierarchy'):
939  raise ValueError("Call load_atoms() first.")
940  edat = self._modeller_model.env.edat
941  libs = self._modeller_model.env.libs
942  atoms = IMP.atom.get_leaves(self._modeller_hierarchy)
943  m = atoms[0].get_model()
945 
946  if edat.dynamic_sphere:
947 # Note: cannot use Modeller's cutoff distance, as that is
948 # center-to-center; IMP's is sphere surface-surface
949  nbl = self._get_nonbonded_list(atoms, pair_filter, edat, 0.)
950 # No way to get Modeller radii, so we have to reassign them
951  add_soft_sphere_radii(self._modeller_hierarchy,
952  libs.topology.submodel, edat.radii_factor)
953  k = \
957  yield IMP.container.PairsRestraint(ps, nbl)
958 
959  if edat.dynamic_lennard or edat.dynamic_coulomb:
960 # 3.0 is roughly the max. atom diameter
961  d = max(edat.contact_shell - 3.0, 0.0)
962  nbl = self._get_nonbonded_list(atoms, pair_filter, edat, d)
963  ff = _get_forcefield(libs.topology.submodel)
964  ff.add_radii(self._modeller_hierarchy)
965 
966  if edat.dynamic_lennard:
967  ff.add_well_depths(self._modeller_hierarchy)
968  sf = IMP.atom.ForceSwitch(edat.lennard_jones_switch[0],
969  edat.lennard_jones_switch[1])
971  yield IMP.container.PairsRestraint(ps, nbl)
972 
973  if edat.dynamic_coulomb:
974  sf = IMP.atom.ForceSwitch(edat.coulomb_switch[0],
975  edat.coulomb_switch[1])
977  ps.set_relative_dielectric(edat.relative_dielectric)
978  yield IMP.container.PairsRestraint(ps, nbl)
979 
980 
981 
982 def get_module_version():
983  r"""get_module_version() -> std::string const"""
984  return _IMP_modeller.get_module_version()
985 
986 def get_example_path(fname):
987  r"""get_example_path(std::string fname) -> std::string"""
988  return _IMP_modeller.get_example_path(fname)
989 
990 def get_data_path(fname):
991  r"""get_data_path(std::string fname) -> std::string"""
992  return _IMP_modeller.get_data_path(fname)
993 
994 from . import _version_check
995 _version_check.check_version(get_module_version())
996 __version__ = get_module_version()
997 
998 
static CHARMMAtom setup_particle(Model *m, ParticleIndex pi, String charmm_type)
Create a decorator with the passed CHARMM type.
Definition: CHARMMAtom.h:37
static Charged setup_particle(Model *m, ParticleIndex pi, Float charge)
Definition: Charged.h:46
Lower bound harmonic function (non-zero when feature < mean)
def load_static_restraints
Convert the current set of Modeller static restraints into equivalent IMP::Restraints.
std::string get_example_path(std::string file_name)
Return the full path to one of this module's example files.
def load_bonds
Load the Modeller bond topology into the IMP model.
A Modeller restraint which evaluates an IMP scoring function.
Coulomb (electrostatic) score between a pair of particles.
static Atom setup_particle(Model *m, ParticleIndex pi, Atom other)
Definition: atom/Atom.h:246
Various classes to hold sets of particles.
Upper bound harmonic function (non-zero when feature > mean)
static XYZR setup_particle(Model *m, ParticleIndex pi)
Definition: XYZR.h:48
A decorator for a particle which has bonds.
def load_impropers
Load the Modeller improper topology into the IMP model.
Make CGAL functionality available to IMP.
Cosine function.
Definition: Cosine.h:25
virtual double unprotected_evaluate(DerivativeAccumulator *da) const
Return the unweighted score for the restraint.
std::string get_module_version()
Return the version of this module, as a string.
std::string get_data_path(std::string file_name)
Return the full path to one of this module's data files.
Dihedral restraint between four particles.
def load_static_restraints_file
Convert a Modeller static restraints file into equivalent IMP::Restraints.
The type of an atom.
A score on the distance between the surfaces of two spheres.
Return all close unordered pairs of particles taken from the SingletonContainer.
static Residue setup_particle(Model *m, ParticleIndex pi, ResidueType t, int index, int insertion_code)
Definition: Residue.h:160
A single binormal term in a MultipleBinormalRestraint.
def load_dynamic_restraints
Convert Modeller dynamic restraints into IMP::Restraint objects.
Distance restraint between two particles.
static XYZ setup_particle(Model *m, ParticleIndex pi)
Definition: XYZ.h:51
Composable functors to implement scores via compile-time composition.
An IMP restraint using all defined Modeller restraints.
static bool get_is_setup(const IMP::ParticleAdaptor &p)
Definition: XYZR.h:47
CHARMM force field parameters.
Bond create_bond(Bonded a, Bonded b, Bond o)
Connect the two wrapped particles by a custom bond.
def load_dihedrals
Load the Modeller dihedral topology into the IMP model.
static Float get_k_from_standard_deviation(Float sd, Float t=297.15)
Return the k to use for a given Gaussian standard deviation.
Definition: core/Harmonic.h:67
Angle restraint between three particles.
static Hierarchy setup_particle(Model *m, ParticleIndex pi, ParticleIndexesAdaptor children=ParticleIndexesAdaptor())
Create a Hierarchy of level t by adding the needed attributes.
ParticleIndexPairs get_indexes(const ParticlePairsTemp &ps)
Get the indexes from a list of particle pairs.
Lennard-Jones score between a pair of particles.
A particle that describes an angle between three particles.
The standard decorator for manipulating molecular structures.
Store a list of ParticleIndexes.
static Bonded setup_particle(Model *m, ParticleIndex pi)
The type for a residue.
def load_atoms
Construct an IMP::atom::Hierarchy that contains the same atoms as the Modeller model or alignment str...
Version and module information for Objects.
Definition: VersionInfo.h:29
A decorator for a particle with x,y,z coordinates.
Definition: XYZ.h:30
Modeller-style multiple binormal (phi/psi) restraint.
Linear function
Definition: Linear.h:22
def add_soft_sphere_radii
Add radii to the hierarchy using the Modeller radius library, radii.lib.
A particle that describes a dihedral angle between four particles.
def load_angles
Load the Modeller angle topology into the IMP model.
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...
static bool get_is_setup(const IMP::ParticleAdaptor &p)
virtual VersionInfo get_version_info() const
Get information about the module and version of the object.
Definition: Object.h:206
VectorD< 3 > Vector3D
Definition: VectorD.h:425
A filter that excludes bonds, angles and dihedrals.
Read a Modeller model into IMP.
Class to handle individual particles of a Model object.
Definition: Particle.h:43
std::string get_data_path(std::string file_name)
Return the full path to one of this module's data files.
Smooth interaction scores by switching the derivatives (force switch).
Output IMP model data in various file formats.
Functionality for loading, creating, manipulating and scoring atomic structures.
static Chain setup_particle(Model *m, ParticleIndex pi, std::string id)
Definition: Chain.h:81
Hierarchies get_leaves(const Selection &h)
Applies a PairScore to each Pair in a list.
virtual ModelObjectsTemp do_get_inputs() const =0
Closed cubic spline function.
A decorator for an atom that has a defined CHARMM type.
Definition: CHARMMAtom.h:24
A restraint is a term in an IMP ScoringFunction.
Definition: Restraint.h:56
Harmonic function (symmetric about the mean)
Definition: core/Harmonic.h:27
A decorator for a particle with x,y,z coordinates and a radius.
Definition: XYZR.h:27