IMP logo
IMP Reference Guide  2.7.0
The Integrative Modeling Platform
samplers.py
1 """@namespace IMP.pmi.samplers
2  Sampling of the system.
3 """
4 
5 from __future__ import print_function
6 import IMP
7 import IMP.core
8 from IMP.pmi.tools import get_restraint_set
9 
10 class _SerialReplicaExchange(object):
11  """Dummy replica exchange class used in non-MPI builds.
12  It should act similarly to IMP.mpi.ReplicaExchange on a single processor.
13  """
14  def __init__(self):
15  self.__params = {}
16  def get_number_of_replicas(self):
17  return 1
18  def create_temperatures(self, tmin, tmax, nrep):
19  return [tmin]
20  def get_my_index(self):
21  return 0
22  def set_my_parameter(self, key, val):
23  self.__params[key] = val
24  def get_my_parameter(self, key):
25  return self.__params[key]
26  def get_friend_index(self, step):
27  return 0
28  def get_friend_parameter(self, key, findex):
29  return self.get_my_parameter(key)
30  def do_exchange(self, myscore, fscore, findex):
31  return False
32  def set_was_used(self,was_used):
33  self.was_used = was_used
34 
35 
36 class MonteCarlo(object):
37  """Sample using Monte Carlo"""
38 
39  # check that isd is installed
40  try:
41  import IMP.isd
42  isd_available = True
43  except ImportError:
44  isd_available = False
45 
46  def __init__(self, m, objects=None, temp=1.0, filterbyname=None):
47  """Setup Monte Carlo sampling
48  @param m The IMP Model
49  @param objects What to sample. Use flat list of particles or
50  (deprecated) 'MC Sample Objects' from PMI1
51  @param temp The MC temperature
52  @param filterbyname Not used
53  """
54  self.losp = [
55  "Rigid_Bodies",
56  "Floppy_Bodies",
57  "Nuisances",
58  "X_coord",
59  "Weights"
60  "Surfaces"]
61  self.simulated_annealing = False
62  self.selfadaptive = False
63  # that is -1 because mc has not yet run
64  self.nframe = -1
65  self.temp = temp
66  self.mvs = []
67  self.mvslabels = []
68  self.label = "None"
69  self.m = m
70 
71  # check if using PMI1 or just passed a list of movers
72  gather_objects = False
73  try:
74  objects[0].get_particles_to_sample()
75  gather_objects = True
76  except:
77  self.mvs = objects
78 
79  if gather_objects:
80  for ob in objects:
81  pts = ob.get_particles_to_sample()
82  for k in pts.keys():
83 
84  if "Rigid_Bodies" in k:
85  mvs = self.get_rigid_body_movers(
86  pts[k][0],
87  pts[k][1],
88  pts[k][2])
89  for mv in mvs:
90  mv.set_name(k)
91  self.mvs += mvs
92 
93  if "SR_Bodies" in k:
94  print(len(pts[k]))
95  mvs = self.get_super_rigid_body_movers(
96  pts[k][0],
97  pts[k][1],
98  pts[k][2])
99  for mv in mvs:
100  mv.set_name(k)
101  self.mvs += mvs
102 
103  if "Floppy_Bodies" in k:
104  mvs = self.get_floppy_body_movers(pts[k][0], pts[k][1])
105  for mv in mvs:
106  mv.set_name(k)
107  self.mvs += mvs
108 
109  if "X_coord" in k:
110  mvs = self.get_X_movers(pts[k][0], pts[k][1])
111  for mv in mvs:
112  mv.set_name(k)
113  self.mvs += mvs
114 
115  if "Nuisances" in k:
116  if not self.isd_available:
117  raise ValueError("isd module needed to use nuisances")
118  mvs = self.get_nuisance_movers(pts[k][0], pts[k][1])
119  for mv in mvs:
120  mv.set_name(k)
121  self.mvs += mvs
122 
123  if "Weights" in k:
124  if not self.isd_available:
125  raise ValueError("isd module needed to use weights")
126  mvs = self.get_weight_movers(pts[k][0], pts[k][1])
127  for mv in mvs:
128  mv.set_name(k)
129  self.mvs += mvs
130 
131  if "Surfaces" in k:
132  mvs = self.get_surface_movers(
133  pts[k][0],
134  pts[k][1],
135  pts[k][2],
136  pts[k][3])
137  for mv in mvs:
138  mv.set_name(k)
139  self.mvs += mvs
140 
141  # SerialMover
142  self.smv = IMP.core.SerialMover(self.mvs)
143 
144  self.mc = IMP.core.MonteCarlo(self.m)
145  self.mc.set_scoring_function(get_restraint_set(self.m))
146  self.mc.set_return_best(False)
147  self.mc.set_kt(self.temp)
148  self.mc.add_mover(self.smv)
149 
150  def set_kt(self, temp):
151  self.temp = temp
152  self.mc.set_kt(temp)
153 
154  def get_mc(self):
155  return self.mc
156 
157  def set_scoring_function(self, objectlist):
158  rs = IMP.RestraintSet(self.m, 1.0, 'sfo')
159  for ob in objectlist:
160  rs.add_restraint(ob.get_restraint())
162  self.mc.set_scoring_function(sf)
163 
164  def set_simulated_annealing(
165  self,
166  min_temp,
167  max_temp,
168  min_temp_time,
169  max_temp_time):
170  self.simulated_annealing = True
171  self.tempmin = min_temp
172  self.tempmax = max_temp
173  self.timemin = min_temp_time
174  self.timemax = max_temp_time
175 
176  def set_self_adaptive(self, isselfadaptive=True):
177  self.selfadaptive = isselfadaptive
178 
180  '''
181  Return a dictionary with the mover parameters for nuisance parameters
182  '''
183  output = {}
184  for i in range(self.get_number_of_movers()):
185  mv = self.smv.get_mover(i)
186  name = mv.get_name()
187  if "Nuisances" in name:
188  stepsize = IMP.core.NormalMover.get_from(mv).get_sigma()
189  output[name] = stepsize
190  return output
191 
192  def get_number_of_movers(self):
193  return len(self.smv.get_movers())
194 
195  def get_particle_types():
196  return self.losp
197 
198  def optimize(self, nstep):
199  self.nframe += 1
200  self.mc.optimize(nstep * self.get_number_of_movers())
201 
202  # apply simulated annealing protocol
203  if self.simulated_annealing:
204  self.temp = self.temp_simulated_annealing()
205  self.mc.set_kt(self.temp)
206 
207  # apply self adaptive protocol
208  if self.selfadaptive:
209  for i, mv in enumerate(self.smv.get_movers()):
210  name = mv.get_name()
211 
212  if "Nuisances" in name:
213  mvacc = mv.get_number_of_accepted()
214  mvprp = mv.get_number_of_proposed()
215  accept = float(mvacc) / float(mvprp)
216  nmv = IMP.core.NormalMover.get_from(mv)
217  stepsize = nmv.get_sigma()
218 
219  if 0.4 > accept or accept > 0.6:
220  nmv.set_sigma(stepsize * 2 * accept)
221  if accept < 0.05:
222  accept = 0.05
223  nmv.set_sigma(stepsize * 2 * accept)
224  if accept > 1.0:
225  accept = 1.0
226  nmv.set_sigma(stepsize * 2 * accept)
227 
228  if "Weights" in name:
229 
230  mvacc = mv.get_number_of_accepted()
231  mvprp = mv.get_number_of_proposed()
232  accept = float(mvacc) / float(mvprp)
233  wmv = IMP.isd.WeightMover.get_from(mv)
234  stepsize = wmv.get_radius()
235 
236  if 0.4 > accept or accept > 0.6:
237  wmv.set_radius(stepsize * 2 * accept)
238  if accept < 0.05:
239  accept = 0.05
240  wmv.set_radius(stepsize * 2 * accept)
241  if accept > 1.0:
242  accept = 1.0
243  wmv.set_radius(stepsize * 2 * accept)
244 
245  @IMP.deprecated_method("2.5", "Use optimize() instead.")
246  def run(self, *args, **kwargs):
247  self.optimize(*args, **kwargs)
248 
249  def get_nuisance_movers(self, nuisances, maxstep):
250  mvs = []
251  for nuisance in nuisances:
252  print(nuisance, maxstep)
253  mvs.append(
254  IMP.core.NormalMover([nuisance],
255  IMP.FloatKeys([IMP.FloatKey("nuisance")]),
256  maxstep))
257  return mvs
258 
259  def get_rigid_body_movers(self, rbs, maxtrans, maxrot):
260  mvs = []
261  for rb in rbs:
262  mvs.append(IMP.core.RigidBodyMover(rb.get_model(), rb,
263  maxtrans, maxrot))
264  return mvs
265 
266  def get_super_rigid_body_movers(self, rbs, maxtrans, maxrot):
267  mvs = []
268  for rb in rbs:
269  if len(rb) == 2:
270  # normal Super Rigid Body
271  srbm = IMP.pmi.TransformMover(self.m, maxtrans, maxrot)
272  elif len(rb) == 3:
273  if type(rb[2]) == tuple and type(rb[2][0]) == float \
274  and type(rb[2][1]) == float and type(rb[2][2]) == float \
275  and len(rb[2])== 3:
276  # super rigid body with 2D rotation, rb[2] is the axis
277  srbm = IMP.pmi.TransformMover(
278  self.m,
279  IMP.algebra.Vector3D(rb[2]),
280  maxtrans,
281  maxrot)
282  #elif type(rb[2]) == tuple and type(rb[2][0]) == IMP.Particle \
283  # and type(rb[2][1]) == IMP.Particle and len(rb[2])== 2:
284  # # super rigid body with bond rotation
285 
286  # srbm = IMP.pmi.TransformMover(
287  # self.m,
288  # rb[2][0],rb[2][1],
289  # 0, #no translation
290  # maxrot)
291  else:
292  print("Setting up a super rigid body with wrong parameters")
293  raise
294 
295  for xyz in rb[0]:
296  srbm.add_xyz_particle(xyz)
297  for rb in rb[1]:
298  srbm.add_rigid_body_particle(rb)
299  mvs.append(srbm)
300  return mvs
301 
302  def get_floppy_body_movers(self, fbs, maxtrans):
303  mvs = []
304  for fb in fbs:
305  # check is that is a rigid body member:
307  # if so force the particles to move anyway
308  floatkeys = [IMP.FloatKey(4), IMP.FloatKey(5), IMP.FloatKey(6)]
309  for fk in floatkeys:
310  fb.set_is_optimized(fk, True)
311  mvs.append(
312  IMP.core.BallMover(fb.get_model(), fb,
313  IMP.FloatKeys(floatkeys),
314  maxtrans))
315  else:
316  # otherwise use the normal ball mover
317  mvs.append(IMP.core.BallMover(fb.get_model(), fb, maxtrans))
318  return mvs
319 
320  def get_X_movers(self, fbs, maxtrans):
321  mvs = []
322  Xfloatkey = IMP.core.XYZ.get_xyz_keys()[0]
323  for fb in fbs:
324  # check is that is a rigid body member:
326  raise ValueError("particle is part of a rigid body")
327  else:
328  # otherwise use the normal ball mover
329  mvs.append(IMP.core.NormalMover([fb], [Xfloatkey], maxtrans))
330  return mvs
331 
332  def get_weight_movers(self, weights, maxstep):
333  mvs = []
334  for weight in weights:
335  if(weight.get_number_of_states() > 1):
336  mvs.append(IMP.isd.WeightMover(weight, maxstep))
337  return mvs
338 
339  def get_surface_movers(self, surfaces, maxtrans, maxrot, refprob):
340  mvs = []
341  for surface in surfaces:
342  mvs.append(IMP.core.SurfaceMover(surface, maxtrans, maxrot,
343  refprob))
344  return mvs
345 
346  def temp_simulated_annealing(self):
347  if self.nframe % (self.timemin + self.timemax) < self.timemin:
348  value = 0.0
349  else:
350  value = 1.0
351  temp = self.tempmin + (self.tempmax - self.tempmin) * value
352  return temp
353 
354  def set_label(self, label):
355  self.label = label
356 
357  def get_frame_number(self):
358  return self.nframe
359 
360  def get_output(self):
361  output = {}
362  acceptances = []
363  for i, mv in enumerate(self.smv.get_movers()):
364  mvname = mv.get_name()
365  mvacc = mv.get_number_of_accepted()
366  mvprp = mv.get_number_of_proposed()
367  try:
368  mvacr = float(mvacc) / float(mvprp)
369  except:
370  mvacr = 0.0
371  output["MonteCarlo_Acceptance_" +
372  mvname + "_" + str(i)] = str(mvacr)
373  if "Nuisances" in mvname:
374  output["MonteCarlo_StepSize_" + mvname + "_" +
375  str(i)] = str(IMP.core.NormalMover.get_from(mv).get_sigma())
376  if "Weights" in mvname:
377  output["MonteCarlo_StepSize_" + mvname + "_" +
378  str(i)] = str(IMP.isd.WeightMover.get_from(mv).get_radius())
379  output["MonteCarlo_Temperature"] = str(self.mc.get_kt())
380  output["MonteCarlo_Nframe"] = str(self.nframe)
381  return output
382 
383 
384 class MolecularDynamics(object):
385  """Sample using molecular dynamics"""
386 
387  def __init__(self,m,objects,kt,gamma=0.01,maximum_time_step=1.0,sf=None):
388  """Setup MD
389  @param m The IMP Model
390  @param objects What to sample. Use flat list of particles or (deprecated) 'MD Sample Objects' from PMI1
391  @param kt Temperature
392  @param gamma Viscosity parameter
393  @param maximum_time_step MD max time step
394  """
395  self.m=m
396 
397  # check if using PMI1 objects dictionary, or just list of particles
398  try:
399  for obj in objects:
400  to_sample=obj.get_particles_to_sample()['Floppy_Bodies_SimplifiedModel'][0]
401  except:
402  to_sample = objects
403 
404  self.ltstate=IMP.atom.LangevinThermostatOptimizerState(self.m,to_sample,
405  kt/0.0019872041,
406  gamma)
407  self.md = IMP.atom.MolecularDynamics(self.m)
408  self.md.set_maximum_time_step(maximum_time_step)
409  if sf:
410  self.md.set_scoring_function(sf)
411  else:
412  self.md.set_scoring_function(get_restraint_set(self.m))
413  self.md.add_optimizer_state(self.ltstate)
414  self.simulated_annealing = False
415  self.nframe = -1
416  def set_kt(self,kt):
417  temp=kt/0.0019872041
418  self.ltstate.set_temperature(temp)
419  self.md.assign_velocities(temp)
420 
421  def set_simulated_annealing(self, min_temp, max_temp, min_temp_time,
422  max_temp_time):
423  self.simulated_annealing = True
424  self.tempmin = min_temp
425  self.tempmax = max_temp
426  self.timemin = min_temp_time
427  self.timemax = max_temp_time
428 
429  def temp_simulated_annealing(self):
430  if self.nframe % (self.timemin + self.timemax) < self.timemin:
431  value = 0.0
432  else:
433  value = 1.0
434  temp = self.tempmin + (self.tempmax - self.tempmin) * value
435  return temp
436 
437  def set_gamma(self,gamma):
438  self.ltstate.set_gamma(gamma)
439 
440  def optimize(self,nsteps):
441  # apply simulated annealing protocol
442  self.nframe+=1
443  if self.simulated_annealing:
444  self.temp = self.temp_simulated_annealing()
445  self.set_kt(self.temp)
446  self.md.optimize(nsteps)
447 
448  def get_output(self):
449  output={}
450  output["MolecularDynamics_KineticEnergy"]=str(self.md.get_kinetic_energy())
451  return output
452 
453 class ConjugateGradients(object):
454  """Sample using conjugate gradients"""
455 
456  def __init__(self, m, objects):
457  self.m = m
458  self.nframe = -1
459  self.cg = IMP.core.ConjugateGradients(self.m)
460  self.cg.set_scoring_function(get_restraint_set(self.m))
461 
462  def set_label(self, label):
463  self.label = label
464 
465  def get_frame_number(self):
466  return self.nframe
467 
468  @IMP.deprecated_method("2.5", "Use optimize() instead.")
469  def run(self, *args, **kwargs):
470  self.optimize(*args, **kwargs)
471 
472  def optimize(self, nstep):
473  self.nframe += 1
474  self.cg.optimize(nstep)
475 
476  def set_scoring_function(self, objectlist):
477  rs = IMP.RestraintSet(self.m, 1.0, 'sfo')
478  for ob in objectlist:
479  rs.add_restraint(ob.get_restraint())
481  self.cg.set_scoring_function(sf)
482 
483  def get_output(self):
484  output = {}
485  acceptances = []
486  output["ConjugatedGradients_Nframe"] = str(self.nframe)
487  return output
488 
489 
490 class ReplicaExchange(object):
491  """Sample using replica exchange"""
492 
493  def __init__(
494  self,
495  model,
496  tempmin,
497  tempmax,
498  samplerobjects,
499  test=True,
500  replica_exchange_object=None):
501  '''
502  samplerobjects can be a list of MonteCarlo or MolecularDynamics
503  '''
504 
505 
506  self.m = model
507  self.samplerobjects = samplerobjects
508  # min and max temperature
509  self.TEMPMIN_ = tempmin
510  self.TEMPMAX_ = tempmax
511 
512  if replica_exchange_object is None:
513  # initialize Replica Exchange class
514  try:
515  import IMP.mpi
516  print('ReplicaExchange: MPI was found. Using Parallel Replica Exchange')
517  self.rem = IMP.mpi.ReplicaExchange()
518  except ImportError:
519  print('ReplicaExchange: Could not find MPI. Using Serial Replica Exchange')
520  self.rem = _SerialReplicaExchange()
521 
522  else:
523  # get the replica exchange class instance from elsewhere
524  print('got existing rex object')
525  self.rem = replica_exchange_object
526 
527  # get number of replicas
528  nproc = self.rem.get_number_of_replicas()
529 
530  if nproc % 2 != 0 and test == False:
531  raise Exception("number of replicas has to be even. set test=True to run with odd number of replicas.")
532  # create array of temperatures, in geometric progression
533  temp = self.rem.create_temperatures(
534  self.TEMPMIN_,
535  self.TEMPMAX_,
536  nproc)
537  # get replica index
538  self.temperatures = temp
539 
540  myindex = self.rem.get_my_index()
541  # set initial value of the parameter (temperature) to exchange
542  self.rem.set_my_parameter("temp", [self.temperatures[myindex]])
543  for so in self.samplerobjects:
544  so.set_kt(self.temperatures[myindex])
545  self.nattempts = 0
546  self.nmintemp = 0
547  self.nmaxtemp = 0
548  self.nsuccess = 0
549 
550  def get_temperatures(self):
551  return self.temperatures
552 
553  def get_my_temp(self):
554  return self.rem.get_my_parameter("temp")[0]
555 
556  def get_my_index(self):
557  return self.rem.get_my_index()
558 
559  def swap_temp(self, nframe, score=None):
560  if score is None:
561  score = self.m.evaluate(False)
562  # get my replica index and temperature
563  myindex = self.rem.get_my_index()
564  mytemp = self.rem.get_my_parameter("temp")[0]
565 
566  if mytemp == self.TEMPMIN_:
567  self.nmintemp += 1
568 
569  if mytemp == self.TEMPMAX_:
570  self.nmaxtemp += 1
571 
572  # score divided by kbt
573  myscore = score / mytemp
574 
575  # get my friend index and temperature
576  findex = self.rem.get_friend_index(nframe)
577  ftemp = self.rem.get_friend_parameter("temp", findex)[0]
578  # score divided by kbt
579  fscore = score / ftemp
580 
581  # try exchange
582  flag = self.rem.do_exchange(myscore, fscore, findex)
583 
584  self.nattempts += 1
585  # if accepted, change temperature
586  if (flag):
587  for so in self.samplerobjects:
588  so.set_kt(ftemp)
589  self.nsuccess += 1
590 
591  def get_output(self):
592  output = {}
593  acceptances = []
594  if self.nattempts != 0:
595  output["ReplicaExchange_SwapSuccessRatio"] = str(
596  float(self.nsuccess) / self.nattempts)
597  output["ReplicaExchange_MinTempFrequency"] = str(
598  float(self.nmintemp) / self.nattempts)
599  output["ReplicaExchange_MaxTempFrequency"] = str(
600  float(self.nmaxtemp) / self.nattempts)
601  else:
602  output["ReplicaExchange_SwapSuccessRatio"] = str(0)
603  output["ReplicaExchange_MinTempFrequency"] = str(0)
604  output["ReplicaExchange_MaxTempFrequency"] = str(0)
605  output["ReplicaExchange_CurrentTemp"] = str(self.get_my_temp())
606  return output
607 
608 
609 class PyMCMover(object):
610  # only works if the sampled particles are rigid bodies
611 
612  def __init__(self, representation, mcchild, n_mc_steps):
613 
614  # mcchild must be pmi.samplers.MonteCarlo
615  # representation must be pmi.representation
616 
617  self.rbs = representation.get_rigid_bodies()
618 
619  self.mc = mcchild
620  self.n_mc_steps = n_mc_steps
621 
622  def store_move(self):
623  # get all xyz coordinates of all rigid bodies of all copies
624  self.oldcoords = []
625  for copy in self.rbs:
626  crd = []
627  for rb in copy:
628  crd.append(rb.get_reference_frame())
629  self.oldcoords.append(crd)
630 
631  def propose_move(self, prob):
632  self.mc.run(self.n_mc_steps)
633 
634  def reset_move(self):
635  # reset each copy to crd
636  for copy, crd in zip(self.rbs, self.oldcoords):
637  for rb, ref in zip(copy, crd):
638  rb.set_reference_frame(ref)
639 
640  def get_number_of_steps(self):
641  return self.n_mc_steps
642 
643  def set_number_of_steps(self, nsteps):
644  self.n_mc_steps = nsteps
645 
646 
647 class PyMC(object):
648 
649  def __init__(self, model):
650  from math import exp
651  import random
652 
653  self.m = model
654  self.restraints = None
655  self.first_call = True
656  self.nframe = -1
657 
658  def add_mover(self, mv):
659  self.mv = mv
660 
661  def set_kt(self, kT):
662  self.kT = kT
663 
664  def set_return_best(self, thing):
665  pass
666 
667  def set_move_probability(self, thing):
668  pass
669 
670  def get_energy(self):
671  if self.restraints:
672  pot = sum([r.evaluate(False) for r in self.restraints])
673  else:
674  pot = self.m.evaluate(False)
675  return pot
676 
677  def metropolis(self, old, new):
678  deltaE = new - old
679  print(": old %f new %f deltaE %f new_epot: %f" % (old, new, deltaE,
680  self.m.evaluate(
681  False)), end=' ')
682  kT = self.kT
683  if deltaE < 0:
684  return True
685  else:
686  return exp(-deltaE / kT) > random.uniform(0, 1)
687 
688  def optimize(self, nsteps):
689  self.naccept = 0
690  self.nframe += 1
691  print("=== new MC call")
692  # store initial coordinates
693  if self.first_call:
694  self.mv.store_move()
695  self.first_call = False
696  for i in range(nsteps):
697  print("MC step %d " % i, end=' ')
698  # get total energy
699  old = self.get_energy()
700  # make a MD move
701  self.mv.propose_move(1)
702  # get new total energy
703  new = self.get_energy()
704  if self.metropolis(old, new):
705  # move was accepted: store new conformation
706  self.mv.store_move()
707  self.naccept += 1
708  print("accepted ")
709  else:
710  # move rejected: restore old conformation
711  self.mv.reset_move()
712  print(" ")
713 
714  def get_number_of_forward_steps(self):
715  return self.naccept
716 
717  def set_restraints(self, restraints):
718  self.restraints = restraints
719 
720  def set_scoring_function(self, objects):
721  # objects should be pmi.restraints
722  rs = IMP.RestraintSet(self.m, 1.0, 'sfo')
723  for ob in objects:
724  rs.add_restraint(ob.get_restraint())
725  self.set_restraints([rs])
726 
727  def get_output(self):
728  output = {}
729  acceptances = []
730  output["PyMC_Temperature"] = str(self.kT)
731  output["PyMC_Nframe"] = str(self.nframe)
732  return output
733 
734 
735 # 3
def __init__
samplerobjects can be a list of MonteCarlo or MolecularDynamics
Definition: samplers.py:493
A Monte Carlo optimizer.
Definition: MonteCarlo.h:45
A class to implement Hamiltonian Replica Exchange.
Maintains temperature during molecular dynamics.
Sample using molecular dynamics.
Definition: samplers.py:384
def get_nuisance_movers_parameters
Return a dictionary with the mover parameters for nuisance parameters.
Definition: samplers.py:179
Miscellaneous utilities.
Definition: tools.py:1
Modify the transformation of a rigid body.
Simple conjugate gradients optimizer.
Sample using conjugate gradients.
Definition: samplers.py:453
Move continuous particle variables by perturbing them within a ball.
Modify a surface orientation.
Definition: SurfaceMover.h:34
Object used to hold a set of restraints.
Definition: RestraintSet.h:36
Simple molecular dynamics optimizer.
def deprecated_method
Python decorator to mark a method as deprecated.
Definition: __init__.py:9635
Code that uses the MPI parallel library.
A mover that perturbs a Weight particle.
Definition: WeightMover.h:20
Modify the transformation of a rigid body.
def __init__
Setup Monte Carlo sampling.
Definition: samplers.py:46
Modify a set of continuous variables using a normal distribution.
Definition: NormalMover.h:20
Basic functionality that is expected to be used by a wide variety of IMP users.
Sample using Monte Carlo.
Definition: samplers.py:36
The general base class for IMP exceptions.
Definition: exception.h:49
VectorD< 3 > Vector3D
Definition: VectorD.h:395
static const FloatKeys & get_xyz_keys()
Get a vector containing the keys for x,y,z.
Applies a list of movers one at a time.
Definition: SerialMover.h:23
static bool get_is_setup(const IMP::ParticleAdaptor &p)
Definition: rigid_bodies.h:640
Sample using replica exchange.
Definition: samplers.py:490
Inferential scoring building on methods developed as part of the Inferential Structure Determination ...