16 import atomicDominoUtilities
20 def __init__(self, parameterFileName):
21 self.createdMdOptimizer = 0
22 self.fixedNonFlexibleAtoms = 0
23 self.readParameters(parameterFileName)
24 self.wroteNativeProtein = 0
26 def loadHelpers(self):
27 self.loadDockingHelpers()
30 def readParameters(self, parameterFileName):
31 self.parameters = atomicDominoUtilities.readParameters(parameterFileName)
34 def loadDockingHelpers(self):
35 outputDir = self.getParam(
"output_directory")
36 mkdirProcess = subprocess.Popen([
'mkdir',
'-p', self.getParam(
'output_directory')], shell=
False, stderr=subprocess.PIPE)
37 output = mkdirProcess.communicate()
39 self.namesToParticles = atomicDominoUtilities.makeNamesToParticles(self.protein)
45 def initializeParticleNameDict(self, leaves):
49 name = self.quickParticleName(leaf)
50 particleDict[name] = {}
59 def createModel(self):
61 pdbName = self.getParam(
"native_pdb_input_file")
72 topology = ff.create_topology(self.protein)
73 topology.apply_default_patches()
75 topology.add_atom_types(self.protein)
77 ff.add_radii(self.protein)
78 ff.add_well_depths(self.protein)
80 self.topology = topology
83 def getParam(self, paramName):
84 paramValue = self.parameters[paramName]
88 def quickRestraintName(self, r):
90 ps = r.get_input_particles()
93 if (self.isAtomParticle(p) == 0):
96 if (self.flexibleAtoms.has_key(self.quickParticleName(p)) == 1):
98 nameList.append(
"%s_%s" % (self.quickParticleName(p), isFlexible))
100 return "%s acting on %s" % (r.get_name(),
" , ".join(nameList))
102 def quickParticleName(self, particle):
103 return atomicDominoUtilities.quickParticleName(particle)
106 def logTime(self, label):
107 nextTime = time.asctime(time.localtime(time.time()))
108 print "%s:\t %s" % (label, nextTime)
109 nextTimeEntry = [label, nextTime]
110 self.times.append(nextTimeEntry)
111 self.rawTimes.append(time.time())
114 def outputTimes(self):
115 print "Time for each step:"
116 for timeEntry
in self.times:
119 print "%s:\t%s" % (label, value)
122 def getFlexibleAtoms(self):
123 return self.flexibleAtoms
126 def getChain(self, particle):
130 chainId = chain.get_id()
134 def getResidue(self, particle):
137 residueNumber = residue.get_index()
140 def isAtomParticle(self, p):
141 return atomicDominoUtilities.isAtomParticle(p)
144 def allFlexibleAtoms(self, r):
145 ps = r.get_input_particles()
147 if (self.isAtomParticle(p) == 0):
149 if (self.flexibleAtoms.has_key(self.quickParticleName(p)) == 0):
155 def skipNonBondedPair(self, pair):
158 if (self.getResidue(pair[0]) == self.getResidue(pair[1])):
162 if (self.flexibleAtoms.has_key(self.quickParticleName(pair[0])) == 0
and self.flexibleAtoms.has_key(self.quickParticleName(pair[1])) == 0):
170 peptideChain = self.getParam(
"peptide_chain")
171 self.flexibleAtoms = {}
173 if (self.getParam(
"flexible_protein") ==
"yes"):
175 particlePairs = self.getClosePairs()
177 for pair
in particlePairs:
180 p0Chain = self.getChain(p0)
181 p1Chain = self.getChain(p1)
182 if (p0Chain == peptideChain
or p1Chain == peptideChain):
183 self.flexibleAtoms[self.quickParticleName(p0)] = 1
184 self.flexibleAtoms[self.quickParticleName(p1)] = 1
190 if (self.getChain(leaf) == peptideChain):
191 self.flexibleAtoms[self.quickParticleName(leaf)] = 1
192 self.fixNonFlexibleAtoms()
195 def getFixedAtoms(self):
199 leafName = self.quickParticleName(leaf)
200 if self.flexibleAtoms.has_key(leafName) == 0:
201 fixedAtoms[leafName] = 1
207 def initializeRandomExisting(self):
212 if (self.flexibleAtoms.has_key(self.quickParticleName(leaf)) == 1):
213 particlesToVary.append(self.quickParticleName(leaf))
214 atomToCoordinates = {}
215 for pName
in particlesToVary:
216 randomPname = random.choice(particlesToVary)
217 randomP = self.namesToParticles[randomPname]
218 print "setting coordinates for particle %s to the ones currently set for particle %s" % (pName, randomPname)
221 for pName
in particlesToVary:
222 particle = self.namesToParticles[pName]
224 xyz.set_coordinates(atomToCoordinates[pName])
230 def setInitialPositions(self):
231 initialPositionMethod = self.getParam(
"initial_position_method")
235 if (initialPositionMethod ==
"random"):
237 myRandom = random.random()
238 initialOffset = float(self.getParam(
"initial_atom_offset")) + myRandom
239 for particleName
in self.flexibleAtoms.keys():
240 p = self.namesToParticles[particleName]
242 coordinates = xyzDecorator.get_coordinates()
248 xyzDecorator.set_coordinates(randomXyz)
251 elif (initialPositionMethod ==
"random_existing"):
252 print "start random existing"
253 xyzs = self.initializeRandomExisting()
256 elif (initialPositionMethod ==
"random_existing_box"):
257 xyzs = self.initializeRandomExisting()
258 initialOffset = float(self.getParam(
"initial_atom_offset"))
259 for xyzDecorator
in xyzs:
260 coordinates = xyzDecorator.get_coordinates()
265 xyzDecorator.set_coordinates(randomXyz)
267 elif (initialPositionMethod ==
"random_box"):
274 for firstPname
in self.nonBondedPairs.keys():
275 secondPnames = self.nonBondedPairs[firstPname]
276 for secondPname
in secondPnames.keys():
277 if (self.flexibleAtoms.has_key(secondPname) == 0):
278 fixedAtom = self.namesToParticles[firstPname]
281 print "added next close atom %s to bounding box particles" % firstPname
283 peptideParticles = []
286 if (self.getChain(leaf) == self.getParam(
"peptide_chain")):
290 fixedAtoms = self.getFixedAtoms()
291 for flexPname
in self.flexibleAtoms.keys():
293 flexParticle = self.namesToParticles[flexPname]
295 print "processing position for pname %s" % flexPname
296 while(goodPosition == 0):
299 for fixedPname
in fixedAtoms.keys():
300 fixedParticle = self.namesToParticles[fixedPname]
304 print "finding new position for %s" % flexPname
310 elif (initialPositionMethod ==
"random_full"):
312 for particleName
in self.flexibleAtoms.keys():
313 print "creating random position for particle %s" % particleName
314 p = self.namesToParticles[particleName]
317 myRandom = random.random()
319 xyzDecorator.set_coordinates(randomXyz)
323 elif (initialPositionMethod ==
"file"):
325 initialPositionFile = self.getParam(
"saved_initial_atom_positions")
326 print "reading initial positions from %s" % initialPositionFile
330 for initialLeaf
in initialLeaves:
331 name = self.quickParticleName(initialLeaf)
332 if (self.namesToParticles.has_key(name) == 1):
333 existingLeaf = self.namesToParticles[name]
336 existingLeafXyz.set_coordinates(initialLeafXyz.get_coordinates())
338 print "Read in initial positions from file %s but this file contained particle %s which is not in current model" % (initialPositionFile, name)
340 print "Please specify valid initial position method (random or file)\n"
344 outputDir = self.getParam(
"output_directory")
345 initialAtomPositionFile = self.getParam(
"initial_atom_positions_output_file")
346 fullOutputFile = os.path.join(outputDir, initialAtomPositionFile)
347 print "writing output to file %s" % fullOutputFile
351 initialScore = self.model.evaluate(
False)
352 print "initial score for model is %s" % initialScore
356 def getNonBondedPairs(self):
357 nonBondedDefinition = self.getParam(
"non_bonded_definition")
359 if (nonBondedDefinition ==
"close_pairs"):
360 particlePairs = self.getClosePairs()
361 elif (nonBondedDefinition ==
"random"):
362 particlePairs = self.getRandomParticlePairs()
363 elif (nonBondedDefinition ==
"manual"):
364 particlePairs = self.readManualRestraints(nativeProtein, 6)
366 print "Please specify valid non bonded pair definition"
371 def getXyzDistance(self, pair):
378 def getClosePairs(self):
383 closePairDistance = float(self.getParam(
"close_pair_distance"))
384 useHardCutoff = self.getParam(
"use_hard_distance_cutoff")
388 self.model.evaluate(
False)
390 particlePairs = nbl.get_particle_pairs()
392 for pair
in particlePairs:
393 distance = self.getXyzDistance(pair)
394 q0 = self.quickParticleName(pair[0])
395 q1 = self.quickParticleName(pair[1])
397 if (useHardCutoff ==
"0" or (useHardCutoff ==
"1" and distance < closePairDistance)):
398 finalPairs.append([pair[0], pair[1]])
403 def addForceFieldRestraints(self):
405 useForcefieldRestraints = self.getParam(
"use_forcefield_restraints")
406 if (useForcefieldRestraints ==
"1"):
413 bonds = self.topology.add_bonds(self.protein)
414 angles = ff.create_angles(bonds)
415 dihedrals = ff.create_dihedrals(bonds)
416 impropers = self.topology.add_impropers(self.protein)
427 print (
"Skipping forcefield restraints")
431 def createForceFieldRestraintsForModel(self, ffParticles, containerName, restraintName, singletonScore):
433 maxForceFieldScore = float(self.getParam(
"max_forcefield_score"))
435 cont.add_particles(ffParticles)
437 self.model.add_restraint(listBondRestraint)
440 decomposedRestraintTemp = listBondRestraint.create_decomposition()
441 decomposedRestraints = IMP.kernel.RestraintSet.get_from(decomposedRestraintTemp)
442 rs_restraints= decomposedRestraints.get_restraints()
445 self.model.remove_restraint(listBondRestraint)
447 count = decomposedRestraints.get_number_of_restraints()
448 for i
in range(count):
450 r = decomposedRestraints.get_restraint(i)
452 if (self.allFlexibleAtoms(r) == 1):
454 self.model.add_restraint(r)
455 self.model.set_maximum_score(r, maxForceFieldScore)
456 self.addParticlesToGroups(r)
463 def addParticlesToGroups(self, r):
465 ps = r.get_input_particles()
469 if (self.isAtomParticle(p) == 0):
471 inputParticles.append(p.get_name())
473 for firstName
in inputParticles:
474 for secondName
in inputParticles:
475 if (firstName == secondName):
477 self.ffParticleGroups[firstName][secondName] = 1
481 def addExcludedVolumeRestraints(self):
483 restrainedParticles = atomicDominoUtilities.getRestrainedParticles(self.protein, self.model, self.namesToParticles)
487 self.model.add_restraint(evr)
491 def addFlexFlexLjRestraints(self, scalingFactor):
492 if (self.initializedFlexFlexLjRestraints == 0):
493 print "adding initial lennard jones restraints between pairs of flexible atoms"
494 self.initializedFlexFlexLjRestraints = 1
500 for i
in range(len(leaves)):
502 for j
in range(i + 1, len(leaves)):
504 if (self.flexibleAtoms.has_key(self.quickParticleName(iLeaf)) == 1
and self.flexibleAtoms.has_key(self.quickParticleName(jLeaf)) == 1):
506 self.model.add_restraint(ljpr)
508 peptideChainHierarchy =
None
509 print "scaling atomic radii by scaling factor %s" % scalingFactor
510 self.ff.add_radii(self.protein)
511 for pName
in self.flexibleAtoms.keys():
512 particle = self.namesToParticles[pName]
514 radius = xyzr.get_radius()
515 radius *= scalingFactor
516 xyzr.set_radius(radius)
519 def addFixedFlexibleLjRestraints(self):
520 print "adding initial fixed flexible lj restraints"
521 fixedAtoms = self.getFixedAtoms()
525 for flexPname
in self.flexibleAtoms.keys():
526 flexParticle = self.namesToParticles[flexPname]
527 for fixedPname
in fixedAtoms.keys():
528 fixedParticle = self.namesToParticles[fixedPname]
529 ljpr =
IMP.core.PairRestraint(ps, [fixedParticle, flexParticle],
"LennardJones %s_%s" % (flexPname, fixedPname))
530 self.model.add_restraint(ljpr)
533 def createDopeRestraint(self, pair):
534 q0 = self.quickParticleName(pair[0])
535 q1 = self.quickParticleName(pair[1])
537 prName =
"NonBonded %s_%s" % (q0, q1)
541 self.model.add_restraint(pairRestraint)
542 maxNonBondedScore = float(self.getParam(
"max_non_bonded_score"))
543 self.model.set_maximum_score(pairRestraint, maxNonBondedScore)
548 def addClosePairNonBondedRestraints(self):
549 particlePairs = self.getNonBondedPairs()
551 nonBondedRestraintType = self.getParam(
"non_bonded_restraint_type")
552 dopeCutoff = float(self.getParam(
"dope_cutoff"))
557 if (nonBondedRestraintType ==
"dope"):
560 self.dopePairScore = ps
563 for pair
in particlePairs:
565 if (self.skipNonBondedPair(pair) == 1):
568 self.createDopeRestraint(pair)
571 self.nonBondedPairs[self.quickParticleName(pair[0])][self.quickParticleName(pair[0])] = 1
572 self.nonBondedPairs[self.quickParticleName(pair[1])][self.quickParticleName(pair[1])] = 1
574 print "Added %s non-bonded restraints" % nonBondedCount
575 self.model.evaluate(
False)
578 def addCompleteNonBondedRestraints(self):
582 for i
in range(len(leaves)):
584 for j
in range(i + 1, len(leaves)):
587 if (self.nonBondedPairs[self.quickParticleName(iLeaf)].has_key(self.quickParticleName(jLeaf)) == 1):
589 if (self.skipNonBondedPair([iLeaf, jLeaf]) == 1):
592 self.createDopeRestraint([iLeaf, jLeaf])
595 print "added %s restraints for %s particles" % (counter, len(leaves))
596 self.model.evaluate(
False)
600 def writeAllRestraints(self):
601 print "write all restraints:"
602 for r
in IMP.get_restraints([self.model.get_root_restraint_set()]):
603 print self.quickRestraintName(r)
608 def initializeMdSchedule(self):
609 schedule = self.getParam(
"md_schedule")
610 stages = schedule.split()
613 print "unpacking stage %s" % stage
614 [steps, temperature, excludedVolume] = stage.split(
'_')
615 totalSteps += int(steps)
616 self.totalMdSteps = totalSteps
617 self.mdStages = stages
622 def createMdRootHandle(self):
625 outputDir = self.getParam(
"output_directory")
627 if (self.getParam(
"read_assignments_from_file") ==
"no"):
629 mdFileName = self.getParam(
"md_trajectory_output_file")
630 fileName = os.path.join(outputDir, mdFileName)
631 print "creating rmf file with filename %s" % fileName
632 rh = RMF.create_rmf_file(fileName)
633 my_kc= rh.add_category(
"my data");
639 mdFileName = self.getParam(
"saved_md_filename")
641 rh = RMF.open_rmf_file(mdFileName)
642 IMP.rmf.set_hierarchies(rh, [self.protein])
646 def evaluateModel(self):
647 return self.model.evaluate(
False)
649 def loadMdHelpers(self):
651 self.createMdRootHandle()
653 self.createMdOptimizer()
655 self.addMdOptimizerStates()
657 self.initializeMdSchedule()
659 self.createdMdOptimizer = 1
663 def createMdOptimizer(self):
664 print "creating md object"
667 md.set_velocity_cap(100.0)
668 self.mdOptimizer = md
670 def addMdOptimizerStates(self):
674 vsIndex = self.mdOptimizer.add_optimizer_state(vsos)
677 hdos = IMP.rmf.SaveHierarchyConfigurationOptimizerState([self.protein], self.rootHandle)
678 hdos.set_skip_steps(0)
679 self.mdOptimizer.add_optimizer_state(hdos)
684 def readTrajectories(self):
686 cgFileName = self.getParam(
"cg_output_file")
687 bestCgScore = 10000000
689 bestCgRmsd = 10000000
692 outputDir = self.getParam(
"output_directory")
693 trajectoryFile = self.getParam(
"md_trajectory_output_file")
694 fullFile = os.path.join(outputDir, trajectoryFile)
695 rh = RMF.open_rmf_file(fullFile)
696 IMP.rmf.set_hierarchies(rh, [self.protein])
697 framesToRead = atomicDominoUtilities.getMdIntervalFrames(rh, int(self.getParam(
"cg_interval")), self.protein)
699 if (len(framesToRead) > 0):
700 for cgNumber
in framesToRead:
702 outputDir = self.getParam(
"output_directory")
703 fullCgFileName = os.path.join(outputDir,
"%s%s" % (cgFileName, cgNumber))
704 rh = RMF.open_rmf_file(fullCgFileName)
705 IMP.rmf.set_hierarchies(rh, [self.protein])
707 frameCount = IMP.rmf.get_number_of_frames(rh, self.protein)
709 score = self.model.evaluate(
False)
710 rmsd = self.calculateNativeRmsd(self.flexibleAtoms)
711 print "cg number %s has score %s rmsd %s" % (cgNumber, score, rmsd)
712 if (score < bestCgScore):
714 bestCgScoreFile = fullCgFileName
715 if (rmsd < bestCgRmsd):
717 bestCgRmsdFile = fullCgFileName
720 self.singlePdbResults(bestCgScoreFile, -1, self.getParam(
"best_cg_score_output_file"))
721 self.singlePdbResults(bestCgRmsdFile, -1, self.getParam(
"best_cg_rmsd_output_file"))
722 self.singlePdbResults(
"%s%s" % (cgFileName, framesToRead[-1]), -1, self.getParam(
"final_cg_frame_output_file"))
723 finalCgRmsd = self.calculateNativeRmsd(self.flexibleAtoms)
724 self.bestCgScore = bestCgScore
725 self.bestCgRmsd = bestCgRmsd
726 self.finalCgRmsd = finalCgRmsd
729 def singlePdbResults(self, trajectoryFile, frame, outputPdbFile):
731 fullTrajectoryFile = os.path.join(self.getParam(
"output_directory"), trajectoryFile)
732 fullOutputFile = os.path.join(self.getParam(
"output_directory"), outputPdbFile)
733 rh = RMF.open_rmf_file(fullTrajectoryFile)
734 IMP.rmf.set_hierarchies(rh, [self.protein])
736 frame = IMP.rmf.get_number_of_frames(rh, self.protein) - 1
740 def calculateRmsd(self, otherProtein, flexibleAtoms):
741 otherNamesToParticles = atomicDominoUtilities.makeNamesToParticles(otherProtein)
744 for pName
in otherNamesToParticles.keys():
745 if (flexibleAtoms.has_key(pName) == 0):
747 otherParticle = otherNamesToParticles[pName]
748 modelParticle = self.namesToParticles[pName]
754 def calculateNativeRmsd(self, flexibleAtoms):
756 if (self.wroteNativeProtein == 0):
757 pdbName = self.getParam(
"native_pdb_input_file")
760 self.wroteNativeProtein = 1
762 return self.calculateRmsd(self.nativeProtein, flexibleAtoms)
766 def runMolecularDynamics(self):
767 self.initializedFlexFlexLjRestraints = 0
768 if (self.fixedNonFlexibleAtoms == 0):
769 print "error: before running md, must fix non flexible atoms"
772 for stage
in self.mdStages:
773 [steps, temperature, excludedVolume] = stage.split(
'_')
774 stepsSoFar += int(steps)
775 self.vsos.set_temperature(int(temperature))
776 if (excludedVolume ==
"1"):
777 self.addFixedFlexibleLjRestraints()
778 elif (excludedVolume !=
"0"):
779 if (self.getParam(
"excluded_volume_type") ==
"lj"):
780 self.addFlexFlexLjRestraints(float(excludedVolume))
781 elif (self.getParam(
"excluded_volume_type") ==
"ev"):
782 self.addExcludedVolumeRestraints()
784 "please set excluded_volume_type to either lj or ev"
786 print "running md at temperature %s for %s steps" % (temperature, steps)
787 self.mdOptimizer.optimize(int(steps))
789 IMP.atom.write_pdb(self.protein, os.path.join(self.getParam(
"output_directory"),
"md_after_%s.pdb" % stepsSoFar))
790 print "model score after stage %s is %s" % (stage, self.model.evaluate(
False))
791 print "done running md"
796 cgInterval = int(self.getParam(
"cg_interval"))
797 outputDir = self.getParam(
"output_directory")
798 trajectoryFile = self.getParam(
"md_trajectory_output_file")
799 fullFile = os.path.join(outputDir, trajectoryFile)
800 print "open rmf %s" % fullFile
801 rh = RMF.open_rmf_file(fullFile)
802 IMP.rmf.set_hierarchies(rh, [self.protein])
803 framesToRead = atomicDominoUtilities.getMdIntervalFrames(rh, cgInterval, self.protein)
805 for i
in framesToRead:
806 cgFileName =
"%s%s" % (self.getParam(
"cg_output_file"), i)
807 self.applyCg(i, cgFileName)
810 def applyCg(self, mdStepStart, cgFileName):
812 cgSteps = int(self.getParam(
"cg_steps"))
815 print "apply cg: loading md frame for cg step start %s" % mdStepStart
819 outputDir = self.getParam(
"output_directory")
820 fileName = os.path.join(outputDir, cgFileName)
821 print "creating cg hdf5 file %s" % fileName
822 rh = RMF.create_rmf_file(fileName)
823 my_kc= rh.add_category(
"my data");
828 firstScore = self.model.evaluate(
False)
830 print "creating optimizer state"
831 hdos = IMP.rmf.SaveHierarchyConfigurationOptimizerState([self.protein], rh)
832 hdos.set_skip_steps(0)
833 cg.add_optimizer_state(hdos)
837 secondScore = self.model.evaluate(
False)
838 print "cg score after md step %s before %s after %s" % (mdStepStart, firstScore, secondScore)
843 def fixNonFlexibleAtoms(self):
844 if (self.createdMdOptimizer == 0):
845 self.createMdOptimizer()
849 self.fixedNonFlexibleAtoms = 1
852 if (self.flexibleAtoms.has_key(self.quickParticleName(leaf)) == 0):
854 xyzDecorator.set_coordinates_are_optimized(0)
857 def writeOutput(self):
858 restraintCount = self.model.get_number_of_restraints()
860 flexiblePeptideAtoms = 0
861 flexibleProteinAtoms = 0
862 fixedPeptideAtoms = 0
863 fixedProteinAtoms = 0
866 if (self.flexibleAtoms.has_key(self.quickParticleName(leaf)) == 0):
867 if (self.getChain(leaf) == self.getParam(
"peptide_chain")):
868 fixedPeptideAtoms += 1
870 fixedProteinAtoms += 1
872 if (self.getChain(leaf) == self.getParam(
"peptide_chain")):
873 flexiblePeptideAtoms += 1
875 flexibleProteinAtoms += 1
876 print "Flexible peptide atoms: %s" % flexiblePeptideAtoms
877 print "Fixed peptide atoms: %s" % fixedPeptideAtoms
878 print "Flexible protein atoms: %s" % flexibleProteinAtoms
879 print "Fixed protein atoms: %s" % fixedProteinAtoms
880 print "Total number of restraints: %s" % restraintCount
882 def writeOsOutput(self):
884 print "Best cg score: %s" % self.bestCgScore
885 print "best cg rmsd: %s" % self.bestCgRmsd
886 print "final cg rmsd: %s" % self.finalCgRmsd
Applies a SingletonScore to each Singleton in a list.
Chain get_chain(Hierarchy h)
void write_pdb(const Selection &mhd, base::TextOutput out, unsigned int model=1)
Score the angle based on a UnaryFunction,.
static XYZR decorate_particle(::IMP::kernel::Particle *p)
Simple conjugate gradients optimizer.
algebra::BoundingBoxD< 3 > get_bounding_box(const Hierarchy &h)
Get a bounding box for the Hierarchy.
Hierarchy get_residue(Hierarchy mhd, unsigned int index)
Get the residue with the specified index.
Return all close unordered pairs of particles taken from the SingletonContainer.
double get_distance(XYZR a, XYZR b)
Compute the sphere distance between a and b.
Vector3D get_random_vector_in(const Cylinder3D &c)
Generate a random vector in a cylinder with uniform density.
CHARMM force field parameters.
static Float get_k_from_standard_deviation(Float sd, Float t=297.15)
Return the k to use for a given Gaussian standard deviation.
Maintains temperature during molecular dynamics by velocity scaling.
Select all non-alternative ATOM records.
void add_hierarchy(RMF::FileHandle fh, atom::Hierarchy hs)
double get_rmsd(const Selection &s0, const Selection &s1, const IMP::algebra::Transformation3D &tr_for_second=IMP::algebra::get_identity_transformation_3d())
Lennard-Jones score between a pair of particles.
Simple molecular dynamics optimizer.
static Atom decorate_particle(::IMP::kernel::Particle *p)
Hierarchies get_by_type(Hierarchy mhd, GetByType t)
algebra::BoundingBoxD< 3 > get_bounding_box(const XYZRs &ps)
Get the bounding box.
Score the improper dihedral based on a UnaryFunction,.
Score the bond based on a UnaryFunction,.
See IMP.core for more information.
See IMP.algebra for more information.
Prevent a set of particles and rigid bodies from inter-penetrating.
void add_dope_score_data(atom::Hierarchy h)
static XYZ decorate_particle(::IMP::kernel::Particle *p)
double get_distance(const VectorD< D > &v1, const VectorD< D > &v2)
compute the distance between two vectors
Applies a PairScore to a Pair.
std::string get_data_path(std::string file_name)
Return the full path to installed data.
Smooth interaction scores by switching the derivatives (force switch).
void read_pdb(base::TextInput input, int model, Hierarchy h)
Hierarchies get_leaves(const Selection &h)
See IMP.rmf for more information.
See IMP.domino for more information.
void load_frame(RMF::FileConstHandle file, int frame)
Class for storing model, its restraints, constraints, and particles.
Score the dihedral angle.
Harmonic function (symmetric about the mean)