16 import atomicDominoUtilities
21 def __init__(self, parameterFileName):
22 self.createdMdOptimizer = 0
23 self.fixedNonFlexibleAtoms = 0
24 self.readParameters(parameterFileName)
25 self.wroteNativeProtein = 0
27 def loadHelpers(self):
28 self.loadDockingHelpers()
31 def readParameters(self, parameterFileName):
32 self.parameters = atomicDominoUtilities.readParameters(
36 def loadDockingHelpers(self):
37 outputDir = self.getParam(
"output_directory")
38 mkdirProcess = subprocess.Popen(
41 self.getParam(
'output_directory')],
43 stderr=subprocess.PIPE)
44 output = mkdirProcess.communicate()
46 self.namesToParticles = atomicDominoUtilities.makeNamesToParticles(
54 def initializeParticleNameDict(self, leaves):
58 name = self.quickParticleName(leaf)
59 particleDict[name] = {}
68 def createModel(self):
70 pdbName = self.getParam(
"native_pdb_input_file")
84 topology = ff.create_topology(self.protein)
85 topology.apply_default_patches()
87 topology.add_atom_types(self.protein)
89 ff.add_radii(self.protein)
90 ff.add_well_depths(self.protein)
92 self.topology = topology
95 def getParam(self, paramName):
96 paramValue = self.parameters[paramName]
100 def quickRestraintName(self, r):
102 ps = r.get_input_particles()
105 if (self.isAtomParticle(p) == 0):
108 if ((self.quickParticleName(p)
in self.flexibleAtoms) == 1):
110 nameList.append(
"%s_%s" % (self.quickParticleName(p), isFlexible))
112 return "%s acting on %s" % (r.get_name(),
" , ".join(nameList))
114 def quickParticleName(self, particle):
115 return atomicDominoUtilities.quickParticleName(particle)
118 def logTime(self, label):
119 nextTime = time.asctime(time.localtime(time.time()))
120 print "%s:\t %s" % (label, nextTime)
121 nextTimeEntry = [label, nextTime]
122 self.times.append(nextTimeEntry)
123 self.rawTimes.append(time.time())
126 def outputTimes(self):
127 print "Time for each step:"
128 for timeEntry
in self.times:
131 print "%s:\t%s" % (label, value)
133 def getFlexibleAtoms(self):
134 return self.flexibleAtoms
137 def getChain(self, particle):
141 chainId = chain.get_id()
145 def getResidue(self, particle):
148 residueNumber = residue.get_index()
151 def isAtomParticle(self, p):
152 return atomicDominoUtilities.isAtomParticle(p)
156 def allFlexibleAtoms(self, r):
157 ps = r.get_input_particles()
159 if (self.isAtomParticle(p) == 0):
161 if ((self.quickParticleName(p)
in self.flexibleAtoms) == 0):
168 def skipNonBondedPair(self, pair):
171 if (self.getResidue(pair[0]) == self.getResidue(pair[1])):
175 if ((self.quickParticleName(pair[0])
in self.flexibleAtoms) == 0
and (self.quickParticleName(pair[1])
in self.flexibleAtoms) == 0):
183 peptideChain = self.getParam(
"peptide_chain")
184 self.flexibleAtoms = {}
186 if (self.getParam(
"flexible_protein") ==
"yes"):
189 particlePairs = self.getClosePairs()
191 for pair
in particlePairs:
194 p0Chain = self.getChain(p0)
195 p1Chain = self.getChain(p1)
196 if (p0Chain == peptideChain
or p1Chain == peptideChain):
197 self.flexibleAtoms[self.quickParticleName(p0)] = 1
198 self.flexibleAtoms[self.quickParticleName(p1)] = 1
204 if (self.getChain(leaf) == peptideChain):
205 self.flexibleAtoms[self.quickParticleName(leaf)] = 1
206 self.fixNonFlexibleAtoms()
210 def getFixedAtoms(self):
214 leafName = self.quickParticleName(leaf)
215 if (leafName
in self.flexibleAtoms) == 0:
216 fixedAtoms[leafName] = 1
222 def initializeRandomExisting(self):
227 if ((self.quickParticleName(leaf)
in self.flexibleAtoms) == 1):
228 particlesToVary.append(self.quickParticleName(leaf))
229 atomToCoordinates = {}
230 for pName
in particlesToVary:
231 randomPname = random.choice(particlesToVary)
232 randomP = self.namesToParticles[randomPname]
233 print "setting coordinates for particle %s to the ones currently set for particle %s" % (pName, randomPname)
234 atomToCoordinates[pName] =
IMP.core.XYZ(randomP).get_coordinates()
236 for pName
in particlesToVary:
237 particle = self.namesToParticles[pName]
239 xyz.set_coordinates(atomToCoordinates[pName])
245 def setInitialPositions(self):
246 initialPositionMethod = self.getParam(
"initial_position_method")
251 if (initialPositionMethod ==
"random"):
253 myRandom = random.random()
254 initialOffset = float(
255 self.getParam(
"initial_atom_offset")) + myRandom
256 for particleName
in self.flexibleAtoms.keys():
257 p = self.namesToParticles[particleName]
259 coordinates = xyzDecorator.get_coordinates()
265 xyzDecorator.set_coordinates(randomXyz)
269 elif (initialPositionMethod ==
"random_existing"):
270 print "start random existing"
271 xyzs = self.initializeRandomExisting()
275 elif (initialPositionMethod ==
"random_existing_box"):
276 xyzs = self.initializeRandomExisting()
277 initialOffset = float(self.getParam(
"initial_atom_offset"))
278 for xyzDecorator
in xyzs:
279 coordinates = xyzDecorator.get_coordinates()
284 xyzDecorator.set_coordinates(randomXyz)
286 elif (initialPositionMethod ==
"random_box"):
294 for firstPname
in self.nonBondedPairs.keys():
295 secondPnames = self.nonBondedPairs[firstPname]
296 for secondPname
in secondPnames.keys():
297 if ((secondPname
in self.flexibleAtoms) == 0):
298 fixedAtom = self.namesToParticles[firstPname]
301 print "added next close atom %s to bounding box particles" % firstPname
304 peptideParticles = []
307 if (self.getChain(leaf) == self.getParam(
"peptide_chain")):
312 fixedAtoms = self.getFixedAtoms()
313 for flexPname
in self.flexibleAtoms.keys():
315 flexParticle = self.namesToParticles[flexPname]
317 print "processing position for pname %s" % flexPname
318 while(goodPosition == 0):
320 flexXyzDecorator.set_coordinates(
322 for fixedPname
in fixedAtoms.keys():
323 fixedParticle = self.namesToParticles[fixedPname]
328 print "finding new position for %s" % flexPname
336 elif (initialPositionMethod ==
"random_full"):
338 for particleName
in self.flexibleAtoms.keys():
339 print "creating random position for particle %s" % particleName
340 p = self.namesToParticles[particleName]
343 myRandom = random.random()
345 xyzDecorator.set_coordinates(randomXyz)
349 elif (initialPositionMethod ==
"file"):
351 initialPositionFile = self.getParam(
"saved_initial_atom_positions")
352 print "reading initial positions from %s" % initialPositionFile
359 for initialLeaf
in initialLeaves:
360 name = self.quickParticleName(initialLeaf)
361 if ((name
in self.namesToParticles) == 1):
362 existingLeaf = self.namesToParticles[name]
365 existingLeafXyz.set_coordinates(
366 initialLeafXyz.get_coordinates())
368 print "Read in initial positions from file %s but this file contained particle %s which is not in current model" % (initialPositionFile, name)
370 print "Please specify valid initial position method (random or file)\n"
374 outputDir = self.getParam(
"output_directory")
375 initialAtomPositionFile = self.getParam(
376 "initial_atom_positions_output_file")
377 fullOutputFile = os.path.join(outputDir, initialAtomPositionFile)
378 print "writing output to file %s" % fullOutputFile
382 initialScore = self.model.evaluate(
False)
383 print "initial score for model is %s" % initialScore
386 def getNonBondedPairs(self):
387 nonBondedDefinition = self.getParam(
"non_bonded_definition")
389 if (nonBondedDefinition ==
"close_pairs"):
390 particlePairs = self.getClosePairs()
391 elif (nonBondedDefinition ==
"random"):
392 particlePairs = self.getRandomParticlePairs()
393 elif (nonBondedDefinition ==
"manual"):
394 particlePairs = self.readManualRestraints(nativeProtein, 6)
396 print "Please specify valid non bonded pair definition"
401 def getXyzDistance(self, pair):
409 def getClosePairs(self):
414 closePairDistance = float(self.getParam(
"close_pair_distance"))
417 useHardCutoff = self.getParam(
"use_hard_distance_cutoff")
421 self.model.evaluate(
False)
423 particlePairs = nbl.get_particle_pairs()
425 for pair
in particlePairs:
426 distance = self.getXyzDistance(pair)
427 q0 = self.quickParticleName(pair[0])
428 q1 = self.quickParticleName(pair[1])
430 if (useHardCutoff ==
"0" or (useHardCutoff ==
"1" and distance < closePairDistance)):
431 finalPairs.append([pair[0], pair[1]])
436 def addForceFieldRestraints(self):
438 useForcefieldRestraints = self.getParam(
"use_forcefield_restraints")
439 if (useForcefieldRestraints ==
"1"):
447 bonds = self.topology.add_bonds(self.protein)
448 angles = ff.create_angles(bonds)
449 dihedrals = ff.create_dihedrals(bonds)
450 impropers = self.topology.add_impropers(self.protein)
454 self.ffParticleGroups = self.initializeParticleNameDict(
457 self.createForceFieldRestraintsForModel(
465 self.createForceFieldRestraintsForModel(
473 self.createForceFieldRestraintsForModel(
476 "Dihedral Restraints",
478 self.createForceFieldRestraintsForModel(
481 "Improper Restraints",
488 print (
"Skipping forcefield restraints")
492 def createForceFieldRestraintsForModel(
499 maxForceFieldScore = float(self.getParam(
"max_forcefield_score"))
501 cont.add_particles(ffParticles)
503 singletonScore, cont, restraintName)
504 self.model.add_restraint(listBondRestraint)
508 decomposedRestraintTemp = listBondRestraint.create_decomposition()
509 decomposedRestraints = IMP.kernel.RestraintSet.get_from(
510 decomposedRestraintTemp)
511 rs_restraints = decomposedRestraints.get_restraints()
514 self.model.remove_restraint(listBondRestraint)
516 count = decomposedRestraints.get_number_of_restraints()
517 for i
in range(count):
519 r = decomposedRestraints.get_restraint(i)
521 if (self.allFlexibleAtoms(r) == 1):
523 self.model.add_restraint(r)
524 self.model.set_maximum_score(r, maxForceFieldScore)
525 self.addParticlesToGroups(r)
533 def addParticlesToGroups(self, r):
535 ps = r.get_input_particles()
539 if (self.isAtomParticle(p) == 0):
541 inputParticles.append(p.get_name())
543 for firstName
in inputParticles:
544 for secondName
in inputParticles:
545 if (firstName == secondName):
547 self.ffParticleGroups[firstName][secondName] = 1
552 def addExcludedVolumeRestraints(self):
554 restrainedParticles = atomicDominoUtilities.getRestrainedParticles(
555 self.protein, self.model, self.namesToParticles)
559 self.model.add_restraint(evr)
564 def addFlexFlexLjRestraints(self, scalingFactor):
565 if (self.initializedFlexFlexLjRestraints == 0):
566 print "adding initial lennard jones restraints between pairs of flexible atoms"
567 self.initializedFlexFlexLjRestraints = 1
573 for i
in range(len(leaves)):
575 for j
in range(i + 1, len(leaves)):
577 if ((self.quickParticleName(iLeaf)
in self.flexibleAtoms) == 1
and (self.quickParticleName(jLeaf)
in self.flexibleAtoms) == 1):
579 ps, [iLeaf, jLeaf],
"LennardJones %s_%s" %
581 self.model.add_restraint(ljpr)
583 self.protein, IMP.atom.CHAIN_TYPE)
584 peptideChainHierarchy =
None
585 print "scaling atomic radii by scaling factor %s" % scalingFactor
587 self.ff.add_radii(self.protein)
588 for pName
in self.flexibleAtoms.keys():
589 particle = self.namesToParticles[pName]
591 radius = xyzr.get_radius()
592 radius *= scalingFactor
593 xyzr.set_radius(radius)
597 def addFixedFlexibleLjRestraints(self):
598 print "adding initial fixed flexible lj restraints"
599 fixedAtoms = self.getFixedAtoms()
603 for flexPname
in self.flexibleAtoms.keys():
604 flexParticle = self.namesToParticles[flexPname]
605 for fixedPname
in fixedAtoms.keys():
606 fixedParticle = self.namesToParticles[fixedPname]
608 ps, [fixedParticle, flexParticle],
"LennardJones %s_%s" %
609 (flexPname, fixedPname))
610 self.model.add_restraint(ljpr)
613 def createDopeRestraint(self, pair):
614 q0 = self.quickParticleName(pair[0])
615 q1 = self.quickParticleName(pair[1])
617 prName =
"NonBonded %s_%s" % (q0, q1)
619 self.dopePairScore, pair, prName)
622 self.model.add_restraint(pairRestraint)
623 maxNonBondedScore = float(self.getParam(
"max_non_bonded_score"))
624 self.model.set_maximum_score(pairRestraint, maxNonBondedScore)
629 def addClosePairNonBondedRestraints(self):
630 particlePairs = self.getNonBondedPairs()
632 nonBondedRestraintType = self.getParam(
"non_bonded_restraint_type")
633 dopeCutoff = float(self.getParam(
"dope_cutoff"))
638 if (nonBondedRestraintType ==
"dope"):
641 self.dopePairScore = ps
643 self.nonBondedPairs = self.initializeParticleNameDict(
645 for pair
in particlePairs:
647 if (self.skipNonBondedPair(pair) == 1):
650 self.createDopeRestraint(pair)
653 self.nonBondedPairs[self.quickParticleName(pair[0])][
654 self.quickParticleName(pair[0])] = 1
655 self.nonBondedPairs[self.quickParticleName(pair[1])][
656 self.quickParticleName(pair[1])] = 1
658 print "Added %s non-bonded restraints" % nonBondedCount
659 self.model.evaluate(
False)
661 def addCompleteNonBondedRestraints(self):
665 for i
in range(len(leaves)):
667 for j
in range(i + 1, len(leaves)):
670 if ((self.quickParticleName(jLeaf)
in self.nonBondedPairs[self.quickParticleName(iLeaf)]) == 1):
672 if (self.skipNonBondedPair([iLeaf, jLeaf]) == 1):
675 self.createDopeRestraint([iLeaf, jLeaf])
680 print "added %s restraints for %s particles" % (counter, len(leaves))
681 self.model.evaluate(
False)
684 def writeAllRestraints(self):
685 print "write all restraints:"
686 for r
in IMP.get_restraints([self.model.get_root_restraint_set()]):
687 print self.quickRestraintName(r)
690 def initializeMdSchedule(self):
691 schedule = self.getParam(
"md_schedule")
692 stages = schedule.split()
695 print "unpacking stage %s" % stage
696 [steps, temperature, excludedVolume] = stage.split(
'_')
697 totalSteps += int(steps)
698 self.totalMdSteps = totalSteps
699 self.mdStages = stages
704 def createMdRootHandle(self):
707 outputDir = self.getParam(
"output_directory")
709 if (self.getParam(
"read_assignments_from_file") ==
"no"):
711 mdFileName = self.getParam(
"md_trajectory_output_file")
712 fileName = os.path.join(outputDir, mdFileName)
713 print "creating rmf file with filename %s" % fileName
714 rh = RMF.create_rmf_file(fileName)
715 my_kc = rh.add_category(
"my data")
721 mdFileName = self.getParam(
"saved_md_filename")
723 rh = RMF.open_rmf_file(mdFileName)
724 IMP.rmf.set_hierarchies(rh, [self.protein])
728 def evaluateModel(self):
729 return self.model.evaluate(
False)
731 def loadMdHelpers(self):
733 self.createMdRootHandle()
735 self.createMdOptimizer()
737 self.addMdOptimizerStates()
739 self.initializeMdSchedule()
741 self.createdMdOptimizer = 1
744 def createMdOptimizer(self):
745 print "creating md object"
750 md.set_velocity_cap(100.0)
751 self.mdOptimizer = md
753 def addMdOptimizerStates(self):
759 vsIndex = self.mdOptimizer.add_optimizer_state(vsos)
762 hdos = IMP.rmf.SaveHierarchyConfigurationOptimizerState(
763 [self.protein], self.rootHandle)
764 self.mdOptimizer.add_optimizer_state(hdos)
769 def readTrajectories(self):
771 cgFileName = self.getParam(
"cg_output_file")
772 bestCgScore = 10000000
774 bestCgRmsd = 10000000
777 outputDir = self.getParam(
"output_directory")
778 trajectoryFile = self.getParam(
"md_trajectory_output_file")
779 fullFile = os.path.join(outputDir, trajectoryFile)
780 rh = RMF.open_rmf_file(fullFile)
781 IMP.rmf.set_hierarchies(rh, [self.protein])
782 framesToRead = atomicDominoUtilities.getMdIntervalFrames(
783 rh, int(self.getParam(
"cg_interval")), self.protein)
785 if (len(framesToRead) > 0):
786 for cgNumber
in framesToRead:
788 outputDir = self.getParam(
"output_directory")
789 fullCgFileName = os.path.join(
791 (cgFileName, cgNumber))
792 rh = RMF.open_rmf_file(fullCgFileName)
793 IMP.rmf.set_hierarchies(rh, [self.protein])
795 frameCount = IMP.rmf.get_number_of_frames(rh, self.protein)
797 score = self.model.evaluate(
False)
798 rmsd = self.calculateNativeRmsd(self.flexibleAtoms)
799 print "cg number %s has score %s rmsd %s" % (cgNumber, score, rmsd)
800 if (score < bestCgScore):
802 bestCgScoreFile = fullCgFileName
803 if (rmsd < bestCgRmsd):
805 bestCgRmsdFile = fullCgFileName
808 self.singlePdbResults(
811 self.getParam(
"best_cg_score_output_file"))
812 self.singlePdbResults(
815 self.getParam(
"best_cg_rmsd_output_file"))
816 self.singlePdbResults(
818 (cgFileName, framesToRead[-1]), -1, self.getParam(
"final_cg_frame_output_file"))
819 finalCgRmsd = self.calculateNativeRmsd(self.flexibleAtoms)
820 self.bestCgScore = bestCgScore
821 self.bestCgRmsd = bestCgRmsd
822 self.finalCgRmsd = finalCgRmsd
824 def singlePdbResults(self, trajectoryFile, frame, outputPdbFile):
826 fullTrajectoryFile = os.path.join(
827 self.getParam(
"output_directory"),
829 fullOutputFile = os.path.join(
830 self.getParam(
"output_directory"),
832 rh = RMF.open_rmf_file(fullTrajectoryFile)
833 IMP.rmf.set_hierarchies(rh, [self.protein])
835 frame = IMP.rmf.get_number_of_frames(rh, self.protein) - 1
839 def calculateRmsd(self, otherProtein, flexibleAtoms):
840 otherNamesToParticles = atomicDominoUtilities.makeNamesToParticles(
844 for pName
in otherNamesToParticles.keys():
845 if ((pName
in flexibleAtoms) == 0):
847 otherParticle = otherNamesToParticles[pName]
848 modelParticle = self.namesToParticles[pName]
856 def calculateNativeRmsd(self, flexibleAtoms):
858 if (self.wroteNativeProtein == 0):
859 pdbName = self.getParam(
"native_pdb_input_file")
865 self.wroteNativeProtein = 1
867 return self.calculateRmsd(self.nativeProtein, flexibleAtoms)
870 def runMolecularDynamics(self):
871 self.initializedFlexFlexLjRestraints = 0
872 if (self.fixedNonFlexibleAtoms == 0):
873 print "error: before running md, must fix non flexible atoms"
876 for stage
in self.mdStages:
877 [steps, temperature, excludedVolume] = stage.split(
'_')
878 stepsSoFar += int(steps)
879 self.vsos.set_temperature(int(temperature))
880 if (excludedVolume ==
"1"):
881 self.addFixedFlexibleLjRestraints()
882 elif (excludedVolume !=
"0"):
884 if (self.getParam(
"excluded_volume_type") ==
"lj"):
885 self.addFlexFlexLjRestraints(float(excludedVolume))
886 elif (self.getParam(
"excluded_volume_type") ==
"ev"):
887 self.addExcludedVolumeRestraints(
890 "please set excluded_volume_type to either lj or ev"
892 print "running md at temperature %s for %s steps" % (temperature, steps)
893 self.mdOptimizer.optimize(int(steps))
902 print "model score after stage %s is %s" % (stage, self.model.evaluate(
False))
903 print "done running md"
906 cgInterval = int(self.getParam(
"cg_interval"))
907 outputDir = self.getParam(
"output_directory")
908 trajectoryFile = self.getParam(
"md_trajectory_output_file")
909 fullFile = os.path.join(outputDir, trajectoryFile)
910 print "open rmf %s" % fullFile
911 rh = RMF.open_rmf_file(fullFile)
912 IMP.rmf.set_hierarchies(rh, [self.protein])
913 framesToRead = atomicDominoUtilities.getMdIntervalFrames(
914 rh, cgInterval, self.protein)
916 for i
in framesToRead:
917 cgFileName =
"%s%s" % (self.getParam(
"cg_output_file"), i)
918 self.applyCg(i, cgFileName)
922 def applyCg(self, mdStepStart, cgFileName):
924 cgSteps = int(self.getParam(
"cg_steps"))
927 print "apply cg: loading md frame for cg step start %s" % mdStepStart
931 outputDir = self.getParam(
"output_directory")
932 fileName = os.path.join(outputDir, cgFileName)
933 print "creating cg hdf5 file %s" % fileName
934 rh = RMF.create_rmf_file(fileName)
935 my_kc = rh.add_category(
"my data")
940 firstScore = self.model.evaluate(
False)
942 print "creating optimizer state"
943 hdos = IMP.rmf.SaveHierarchyConfigurationOptimizerState(
945 hdos.set_skip_steps(0)
947 cg.add_optimizer_state(hdos)
951 secondScore = self.model.evaluate(
False)
952 print "cg score after md step %s before %s after %s" % (mdStepStart, firstScore, secondScore)
956 def fixNonFlexibleAtoms(self):
957 if (self.createdMdOptimizer == 0):
958 self.createMdOptimizer()
962 self.fixedNonFlexibleAtoms = 1
965 if ((self.quickParticleName(leaf)
in self.flexibleAtoms) == 0):
967 xyzDecorator.set_coordinates_are_optimized(0)
969 def writeOutput(self):
970 restraintCount = self.model.get_number_of_restraints()
972 flexiblePeptideAtoms = 0
973 flexibleProteinAtoms = 0
974 fixedPeptideAtoms = 0
975 fixedProteinAtoms = 0
978 if ((self.quickParticleName(leaf)
in self.flexibleAtoms) == 0):
979 if (self.getChain(leaf) == self.getParam(
"peptide_chain")):
980 fixedPeptideAtoms += 1
982 fixedProteinAtoms += 1
984 if (self.getChain(leaf) == self.getParam(
"peptide_chain")):
985 flexiblePeptideAtoms += 1
987 flexibleProteinAtoms += 1
988 print "Flexible peptide atoms: %s" % flexiblePeptideAtoms
989 print "Fixed peptide atoms: %s" % fixedPeptideAtoms
990 print "Flexible protein atoms: %s" % flexibleProteinAtoms
991 print "Fixed protein atoms: %s" % fixedProteinAtoms
992 print "Total number of restraints: %s" % restraintCount
994 def writeOsOutput(self):
996 print "Best cg score: %s" % self.bestCgScore
997 print "best cg rmsd: %s" % self.bestCgRmsd
998 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,.
Simple conjugate gradients optimizer.
algebra::BoundingBoxD< 3 > get_bounding_box(const Hierarchy &h)
Get a bounding box for the Hierarchy.
void load_frame(RMF::FileConstHandle file, unsigned int frame)
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_rmsd(const core::XYZs &s0, const core::XYZs &s1, const IMP::algebra::Transformation3D &tr_for_second)
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)
Lennard-Jones score between a pair of particles.
Simple molecular dynamics optimizer.
Store a kernel::ParticleIndexes.
A decorator for a particle representing an atom.
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,.
A decorator for a particle with x,y,z coordinates.
Score the bond based on a UnaryFunction,.
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...
Prevent a set of particles and rigid bodies from inter-penetrating.
void add_dope_score_data(atom::Hierarchy h)
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)
Support for the RMF file format for storing hierarchical molecular data and markup.
Divide-and-conquer inferential optimization in discrete space.
Class for storing model, its restraints, constraints, and particles.
Score the dihedral angle.
Harmonic function (symmetric about the mean)
A decorator for a particle with x,y,z coordinates and a radius.