1 from __future__
import print_function
17 from .
import atomicDominoUtilities
22 def __init__(self, parameterFileName):
23 self.createdMdOptimizer = 0
24 self.fixedNonFlexibleAtoms = 0
25 self.readParameters(parameterFileName)
26 self.wroteNativeProtein = 0
28 def loadHelpers(self):
29 self.loadDockingHelpers()
32 def readParameters(self, parameterFileName):
33 self.parameters = atomicDominoUtilities.readParameters(
37 def loadDockingHelpers(self):
38 outputDir = self.getParam(
"output_directory")
39 mkdirProcess = subprocess.Popen(
42 self.getParam(
'output_directory')],
44 stderr=subprocess.PIPE)
45 output = mkdirProcess.communicate()
47 self.namesToParticles = atomicDominoUtilities.makeNamesToParticles(
55 def initializeParticleNameDict(self, leaves):
59 name = self.quickParticleName(leaf)
60 particleDict[name] = {}
69 def createModel(self):
71 pdbName = self.getParam(
"native_pdb_input_file")
85 topology = ff.create_topology(self.protein)
86 topology.apply_default_patches()
88 topology.add_atom_types(self.protein)
90 ff.add_radii(self.protein)
91 ff.add_well_depths(self.protein)
93 self.topology = topology
96 def getParam(self, paramName):
97 paramValue = self.parameters[paramName]
101 def quickRestraintName(self, r):
103 ps = r.get_input_particles()
106 if (self.isAtomParticle(p) == 0):
109 if ((self.quickParticleName(p)
in self.flexibleAtoms) == 1):
111 nameList.append(
"%s_%s" % (self.quickParticleName(p), isFlexible))
113 return "%s acting on %s" % (r.get_name(),
" , ".join(nameList))
115 def quickParticleName(self, particle):
116 return atomicDominoUtilities.quickParticleName(particle)
119 def logTime(self, label):
120 nextTime = time.asctime(time.localtime(time.time()))
121 print(
"%s:\t %s" % (label, nextTime))
122 nextTimeEntry = [label, nextTime]
123 self.times.append(nextTimeEntry)
124 self.rawTimes.append(time.time())
127 def outputTimes(self):
128 print(
"Time for each step:")
129 for timeEntry
in self.times:
132 print(
"%s:\t%s" % (label, value))
134 def getFlexibleAtoms(self):
135 return self.flexibleAtoms
138 def getChain(self, particle):
142 chainId = chain.get_id()
146 def getResidue(self, particle):
149 residueNumber = residue.get_index()
152 def isAtomParticle(self, p):
153 return atomicDominoUtilities.isAtomParticle(p)
157 def allFlexibleAtoms(self, r):
158 ps = r.get_input_particles()
160 if (self.isAtomParticle(p) == 0):
162 if ((self.quickParticleName(p)
in self.flexibleAtoms) == 0):
169 def skipNonBondedPair(self, pair):
172 if (self.getResidue(pair[0]) == self.getResidue(pair[1])):
176 if ((self.quickParticleName(pair[0])
in self.flexibleAtoms) == 0
and (self.quickParticleName(pair[1])
in self.flexibleAtoms) == 0):
184 peptideChain = self.getParam(
"peptide_chain")
185 self.flexibleAtoms = {}
187 if (self.getParam(
"flexible_protein") ==
"yes"):
190 particlePairs = self.getClosePairs()
192 for pair
in particlePairs:
195 p0Chain = self.getChain(p0)
196 p1Chain = self.getChain(p1)
197 if (p0Chain == peptideChain
or p1Chain == peptideChain):
198 self.flexibleAtoms[self.quickParticleName(p0)] = 1
199 self.flexibleAtoms[self.quickParticleName(p1)] = 1
205 if (self.getChain(leaf) == peptideChain):
206 self.flexibleAtoms[self.quickParticleName(leaf)] = 1
207 self.fixNonFlexibleAtoms()
211 def getFixedAtoms(self):
215 leafName = self.quickParticleName(leaf)
216 if (leafName
in self.flexibleAtoms) == 0:
217 fixedAtoms[leafName] = 1
223 def initializeRandomExisting(self):
228 if ((self.quickParticleName(leaf)
in self.flexibleAtoms) == 1):
229 particlesToVary.append(self.quickParticleName(leaf))
230 atomToCoordinates = {}
231 for pName
in particlesToVary:
232 randomPname = random.choice(particlesToVary)
233 randomP = self.namesToParticles[randomPname]
234 print(
"setting coordinates for particle %s to the ones currently set for particle %s" % (pName, randomPname))
235 atomToCoordinates[pName] =
IMP.core.XYZ(randomP).get_coordinates()
237 for pName
in particlesToVary:
238 particle = self.namesToParticles[pName]
240 xyz.set_coordinates(atomToCoordinates[pName])
246 def setInitialPositions(self):
247 initialPositionMethod = self.getParam(
"initial_position_method")
252 if (initialPositionMethod ==
"random"):
254 myRandom = random.random()
255 initialOffset = float(
256 self.getParam(
"initial_atom_offset")) + myRandom
257 for particleName
in self.flexibleAtoms.keys():
258 p = self.namesToParticles[particleName]
260 coordinates = xyzDecorator.get_coordinates()
266 xyzDecorator.set_coordinates(randomXyz)
270 elif (initialPositionMethod ==
"random_existing"):
271 print(
"start random existing")
272 xyzs = self.initializeRandomExisting()
276 elif (initialPositionMethod ==
"random_existing_box"):
277 xyzs = self.initializeRandomExisting()
278 initialOffset = float(self.getParam(
"initial_atom_offset"))
279 for xyzDecorator
in xyzs:
280 coordinates = xyzDecorator.get_coordinates()
285 xyzDecorator.set_coordinates(randomXyz)
287 elif (initialPositionMethod ==
"random_box"):
295 for firstPname
in self.nonBondedPairs.keys():
296 secondPnames = self.nonBondedPairs[firstPname]
297 for secondPname
in secondPnames.keys():
298 if ((secondPname
in self.flexibleAtoms) == 0):
299 fixedAtom = self.namesToParticles[firstPname]
302 print(
"added next close atom %s to bounding box particles" % firstPname)
305 peptideParticles = []
308 if (self.getChain(leaf) == self.getParam(
"peptide_chain")):
313 fixedAtoms = self.getFixedAtoms()
314 for flexPname
in self.flexibleAtoms.keys():
316 flexParticle = self.namesToParticles[flexPname]
318 print(
"processing position for pname %s" % flexPname)
319 while(goodPosition == 0):
321 flexXyzDecorator.set_coordinates(
323 for fixedPname
in fixedAtoms.keys():
324 fixedParticle = self.namesToParticles[fixedPname]
329 print(
"finding new position for %s" % flexPname)
337 elif (initialPositionMethod ==
"random_full"):
339 for particleName
in self.flexibleAtoms.keys():
340 print(
"creating random position for particle %s" % particleName)
341 p = self.namesToParticles[particleName]
344 myRandom = random.random()
346 xyzDecorator.set_coordinates(randomXyz)
350 elif (initialPositionMethod ==
"file"):
352 initialPositionFile = self.getParam(
"saved_initial_atom_positions")
353 print(
"reading initial positions from %s" % initialPositionFile)
360 for initialLeaf
in initialLeaves:
361 name = self.quickParticleName(initialLeaf)
362 if ((name
in self.namesToParticles) == 1):
363 existingLeaf = self.namesToParticles[name]
366 existingLeafXyz.set_coordinates(
367 initialLeafXyz.get_coordinates())
369 print(
"Read in initial positions from file %s but this file contained particle %s which is not in current model" % (initialPositionFile, name))
371 print(
"Please specify valid initial position method (random or file)\n")
375 outputDir = self.getParam(
"output_directory")
376 initialAtomPositionFile = self.getParam(
377 "initial_atom_positions_output_file")
378 fullOutputFile = os.path.join(outputDir, initialAtomPositionFile)
379 print(
"writing output to file %s" % fullOutputFile)
383 initialScore = self.model.evaluate(
False)
384 print(
"initial score for model is %s" % initialScore)
387 def getNonBondedPairs(self):
388 nonBondedDefinition = self.getParam(
"non_bonded_definition")
390 if (nonBondedDefinition ==
"close_pairs"):
391 particlePairs = self.getClosePairs()
392 elif (nonBondedDefinition ==
"random"):
393 particlePairs = self.getRandomParticlePairs()
394 elif (nonBondedDefinition ==
"manual"):
395 particlePairs = self.readManualRestraints(nativeProtein, 6)
397 print(
"Please specify valid non bonded pair definition")
402 def getXyzDistance(self, pair):
410 def getClosePairs(self):
415 closePairDistance = float(self.getParam(
"close_pair_distance"))
418 useHardCutoff = self.getParam(
"use_hard_distance_cutoff")
422 self.model.evaluate(
False)
424 particlePairs = nbl.get_particle_pairs()
426 for pair
in particlePairs:
427 distance = self.getXyzDistance(pair)
428 q0 = self.quickParticleName(pair[0])
429 q1 = self.quickParticleName(pair[1])
431 if (useHardCutoff ==
"0" or (useHardCutoff ==
"1" and distance < closePairDistance)):
432 finalPairs.append([pair[0], pair[1]])
437 def addForceFieldRestraints(self):
439 useForcefieldRestraints = self.getParam(
"use_forcefield_restraints")
440 if (useForcefieldRestraints ==
"1"):
448 bonds = self.topology.add_bonds(self.protein)
449 angles = ff.create_angles(bonds)
450 dihedrals = ff.create_dihedrals(bonds)
451 impropers = self.topology.add_impropers(self.protein)
455 self.ffParticleGroups = self.initializeParticleNameDict(
458 self.createForceFieldRestraintsForModel(
466 self.createForceFieldRestraintsForModel(
474 self.createForceFieldRestraintsForModel(
477 "Dihedral Restraints",
479 self.createForceFieldRestraintsForModel(
482 "Improper Restraints",
489 print (
"Skipping forcefield restraints")
493 def createForceFieldRestraintsForModel(
500 maxForceFieldScore = float(self.getParam(
"max_forcefield_score"))
502 cont.add_particles(ffParticles)
504 singletonScore, cont, restraintName)
505 self.model.add_restraint(listBondRestraint)
509 decomposedRestraintTemp = listBondRestraint.create_decomposition()
510 decomposedRestraints = IMP.kernel.RestraintSet.get_from(
511 decomposedRestraintTemp)
512 rs_restraints = decomposedRestraints.get_restraints()
515 self.model.remove_restraint(listBondRestraint)
517 count = decomposedRestraints.get_number_of_restraints()
518 for i
in range(count):
520 r = decomposedRestraints.get_restraint(i)
522 if (self.allFlexibleAtoms(r) == 1):
524 self.model.add_restraint(r)
525 self.model.set_maximum_score(r, maxForceFieldScore)
526 self.addParticlesToGroups(r)
534 def addParticlesToGroups(self, r):
536 ps = r.get_input_particles()
540 if (self.isAtomParticle(p) == 0):
542 inputParticles.append(p.get_name())
544 for firstName
in inputParticles:
545 for secondName
in inputParticles:
546 if (firstName == secondName):
548 self.ffParticleGroups[firstName][secondName] = 1
553 def addExcludedVolumeRestraints(self):
555 restrainedParticles = atomicDominoUtilities.getRestrainedParticles(
556 self.protein, self.model, self.namesToParticles)
560 self.model.add_restraint(evr)
565 def addFlexFlexLjRestraints(self, scalingFactor):
566 if (self.initializedFlexFlexLjRestraints == 0):
567 print(
"adding initial lennard jones restraints between pairs of flexible atoms")
568 self.initializedFlexFlexLjRestraints = 1
574 for i
in range(len(leaves)):
576 for j
in range(i + 1, len(leaves)):
578 if ((self.quickParticleName(iLeaf)
in self.flexibleAtoms) == 1
and (self.quickParticleName(jLeaf)
in self.flexibleAtoms) == 1):
580 ps, [iLeaf, jLeaf],
"LennardJones %s_%s" %
582 self.model.add_restraint(ljpr)
584 self.protein, IMP.atom.CHAIN_TYPE)
585 peptideChainHierarchy =
None
586 print(
"scaling atomic radii by scaling factor %s" % scalingFactor)
588 self.ff.add_radii(self.protein)
589 for pName
in self.flexibleAtoms.keys():
590 particle = self.namesToParticles[pName]
592 radius = xyzr.get_radius()
593 radius *= scalingFactor
594 xyzr.set_radius(radius)
598 def addFixedFlexibleLjRestraints(self):
599 print(
"adding initial fixed flexible lj restraints")
600 fixedAtoms = self.getFixedAtoms()
604 for flexPname
in self.flexibleAtoms.keys():
605 flexParticle = self.namesToParticles[flexPname]
606 for fixedPname
in fixedAtoms.keys():
607 fixedParticle = self.namesToParticles[fixedPname]
609 ps, [fixedParticle, flexParticle],
"LennardJones %s_%s" %
610 (flexPname, fixedPname))
611 self.model.add_restraint(ljpr)
614 def createDopeRestraint(self, pair):
615 q0 = self.quickParticleName(pair[0])
616 q1 = self.quickParticleName(pair[1])
618 prName =
"NonBonded %s_%s" % (q0, q1)
620 self.dopePairScore, pair, prName)
623 self.model.add_restraint(pairRestraint)
624 maxNonBondedScore = float(self.getParam(
"max_non_bonded_score"))
625 self.model.set_maximum_score(pairRestraint, maxNonBondedScore)
630 def addClosePairNonBondedRestraints(self):
631 particlePairs = self.getNonBondedPairs()
633 nonBondedRestraintType = self.getParam(
"non_bonded_restraint_type")
634 dopeCutoff = float(self.getParam(
"dope_cutoff"))
639 if (nonBondedRestraintType ==
"dope"):
642 self.dopePairScore = ps
644 self.nonBondedPairs = self.initializeParticleNameDict(
646 for pair
in particlePairs:
648 if (self.skipNonBondedPair(pair) == 1):
651 self.createDopeRestraint(pair)
654 self.nonBondedPairs[self.quickParticleName(pair[0])][
655 self.quickParticleName(pair[0])] = 1
656 self.nonBondedPairs[self.quickParticleName(pair[1])][
657 self.quickParticleName(pair[1])] = 1
659 print(
"Added %s non-bonded restraints" % nonBondedCount)
660 self.model.evaluate(
False)
662 def addCompleteNonBondedRestraints(self):
666 for i
in range(len(leaves)):
668 for j
in range(i + 1, len(leaves)):
671 if ((self.quickParticleName(jLeaf)
in self.nonBondedPairs[self.quickParticleName(iLeaf)]) == 1):
673 if (self.skipNonBondedPair([iLeaf, jLeaf]) == 1):
676 self.createDopeRestraint([iLeaf, jLeaf])
681 print(
"added %s restraints for %s particles" % (counter, len(leaves)))
682 self.model.evaluate(
False)
685 def writeAllRestraints(self):
686 print(
"write all restraints:")
687 for r
in IMP.get_restraints([self.model.get_root_restraint_set()]):
688 print(self.quickRestraintName(r))
691 def initializeMdSchedule(self):
692 schedule = self.getParam(
"md_schedule")
693 stages = schedule.split()
696 print(
"unpacking stage %s" % stage)
697 [steps, temperature, excludedVolume] = stage.split(
'_')
698 totalSteps += int(steps)
699 self.totalMdSteps = totalSteps
700 self.mdStages = stages
705 def createMdRootHandle(self):
708 outputDir = self.getParam(
"output_directory")
710 if (self.getParam(
"read_assignments_from_file") ==
"no"):
712 mdFileName = self.getParam(
"md_trajectory_output_file")
713 fileName = os.path.join(outputDir, mdFileName)
714 print(
"creating rmf file with filename %s" % fileName)
715 rh = RMF.create_rmf_file(fileName)
716 my_kc = rh.add_category(
"my data")
722 mdFileName = self.getParam(
"saved_md_filename")
724 rh = RMF.open_rmf_file(mdFileName)
725 IMP.rmf.set_hierarchies(rh, [self.protein])
729 def evaluateModel(self):
730 return self.model.evaluate(
False)
732 def loadMdHelpers(self):
734 self.createMdRootHandle()
736 self.createMdOptimizer()
738 self.addMdOptimizerStates()
740 self.initializeMdSchedule()
742 self.createdMdOptimizer = 1
745 def createMdOptimizer(self):
746 print(
"creating md object")
751 md.set_velocity_cap(100.0)
752 self.mdOptimizer = md
754 def addMdOptimizerStates(self):
760 vsIndex = self.mdOptimizer.add_optimizer_state(vsos)
763 hdos = IMP.rmf.SaveHierarchyConfigurationOptimizerState(
764 [self.protein], self.rootHandle)
765 self.mdOptimizer.add_optimizer_state(hdos)
770 def readTrajectories(self):
772 cgFileName = self.getParam(
"cg_output_file")
773 bestCgScore = 10000000
775 bestCgRmsd = 10000000
778 outputDir = self.getParam(
"output_directory")
779 trajectoryFile = self.getParam(
"md_trajectory_output_file")
780 fullFile = os.path.join(outputDir, trajectoryFile)
781 rh = RMF.open_rmf_file(fullFile)
782 IMP.rmf.set_hierarchies(rh, [self.protein])
783 framesToRead = atomicDominoUtilities.getMdIntervalFrames(
784 rh, int(self.getParam(
"cg_interval")), self.protein)
786 if (len(framesToRead) > 0):
787 for cgNumber
in framesToRead:
789 outputDir = self.getParam(
"output_directory")
790 fullCgFileName = os.path.join(
792 (cgFileName, cgNumber))
793 rh = RMF.open_rmf_file(fullCgFileName)
794 IMP.rmf.set_hierarchies(rh, [self.protein])
796 frameCount = IMP.rmf.get_number_of_frames(rh, self.protein)
798 score = self.model.evaluate(
False)
799 rmsd = self.calculateNativeRmsd(self.flexibleAtoms)
800 print(
"cg number %s has score %s rmsd %s" % (cgNumber, score, rmsd))
801 if (score < bestCgScore):
803 bestCgScoreFile = fullCgFileName
804 if (rmsd < bestCgRmsd):
806 bestCgRmsdFile = fullCgFileName
809 self.singlePdbResults(
812 self.getParam(
"best_cg_score_output_file"))
813 self.singlePdbResults(
816 self.getParam(
"best_cg_rmsd_output_file"))
817 self.singlePdbResults(
819 (cgFileName, framesToRead[-1]), -1, self.getParam(
"final_cg_frame_output_file"))
820 finalCgRmsd = self.calculateNativeRmsd(self.flexibleAtoms)
821 self.bestCgScore = bestCgScore
822 self.bestCgRmsd = bestCgRmsd
823 self.finalCgRmsd = finalCgRmsd
825 def singlePdbResults(self, trajectoryFile, frame, outputPdbFile):
827 fullTrajectoryFile = os.path.join(
828 self.getParam(
"output_directory"),
830 fullOutputFile = os.path.join(
831 self.getParam(
"output_directory"),
833 rh = RMF.open_rmf_file(fullTrajectoryFile)
834 IMP.rmf.set_hierarchies(rh, [self.protein])
836 frame = IMP.rmf.get_number_of_frames(rh, self.protein) - 1
840 def calculateRmsd(self, otherProtein, flexibleAtoms):
841 otherNamesToParticles = atomicDominoUtilities.makeNamesToParticles(
845 for pName
in otherNamesToParticles.keys():
846 if ((pName
in flexibleAtoms) == 0):
848 otherParticle = otherNamesToParticles[pName]
849 modelParticle = self.namesToParticles[pName]
857 def calculateNativeRmsd(self, flexibleAtoms):
859 if (self.wroteNativeProtein == 0):
860 pdbName = self.getParam(
"native_pdb_input_file")
866 self.wroteNativeProtein = 1
868 return self.calculateRmsd(self.nativeProtein, flexibleAtoms)
871 def runMolecularDynamics(self):
872 self.initializedFlexFlexLjRestraints = 0
873 if (self.fixedNonFlexibleAtoms == 0):
874 print(
"error: before running md, must fix non flexible atoms")
877 for stage
in self.mdStages:
878 [steps, temperature, excludedVolume] = stage.split(
'_')
879 stepsSoFar += int(steps)
880 self.vsos.set_temperature(int(temperature))
881 if (excludedVolume ==
"1"):
882 self.addFixedFlexibleLjRestraints()
883 elif (excludedVolume !=
"0"):
885 if (self.getParam(
"excluded_volume_type") ==
"lj"):
886 self.addFlexFlexLjRestraints(float(excludedVolume))
887 elif (self.getParam(
"excluded_volume_type") ==
"ev"):
888 self.addExcludedVolumeRestraints(
891 "please set excluded_volume_type to either lj or ev"
893 print(
"running md at temperature %s for %s steps" % (temperature, steps))
894 self.mdOptimizer.optimize(int(steps))
903 print(
"model score after stage %s is %s" % (stage, self.model.evaluate(
False)))
904 print(
"done running md")
907 cgInterval = int(self.getParam(
"cg_interval"))
908 outputDir = self.getParam(
"output_directory")
909 trajectoryFile = self.getParam(
"md_trajectory_output_file")
910 fullFile = os.path.join(outputDir, trajectoryFile)
911 print(
"open rmf %s" % fullFile)
912 rh = RMF.open_rmf_file(fullFile)
913 IMP.rmf.set_hierarchies(rh, [self.protein])
914 framesToRead = atomicDominoUtilities.getMdIntervalFrames(
915 rh, cgInterval, self.protein)
917 for i
in framesToRead:
918 cgFileName =
"%s%s" % (self.getParam(
"cg_output_file"), i)
919 self.applyCg(i, cgFileName)
923 def applyCg(self, mdStepStart, cgFileName):
925 cgSteps = int(self.getParam(
"cg_steps"))
928 print(
"apply cg: loading md frame for cg step start %s" % mdStepStart)
932 outputDir = self.getParam(
"output_directory")
933 fileName = os.path.join(outputDir, cgFileName)
934 print(
"creating cg hdf5 file %s" % fileName)
935 rh = RMF.create_rmf_file(fileName)
936 my_kc = rh.add_category(
"my data")
941 firstScore = self.model.evaluate(
False)
943 print(
"creating optimizer state")
944 hdos = IMP.rmf.SaveHierarchyConfigurationOptimizerState(
946 hdos.set_skip_steps(0)
948 cg.add_optimizer_state(hdos)
952 secondScore = self.model.evaluate(
False)
953 print(
"cg score after md step %s before %s after %s" % (mdStepStart, firstScore, secondScore))
957 def fixNonFlexibleAtoms(self):
958 if (self.createdMdOptimizer == 0):
959 self.createMdOptimizer()
963 self.fixedNonFlexibleAtoms = 1
966 if ((self.quickParticleName(leaf)
in self.flexibleAtoms) == 0):
968 xyzDecorator.set_coordinates_are_optimized(0)
970 def writeOutput(self):
971 restraintCount = self.model.get_number_of_restraints()
973 flexiblePeptideAtoms = 0
974 flexibleProteinAtoms = 0
975 fixedPeptideAtoms = 0
976 fixedProteinAtoms = 0
979 if ((self.quickParticleName(leaf)
in self.flexibleAtoms) == 0):
980 if (self.getChain(leaf) == self.getParam(
"peptide_chain")):
981 fixedPeptideAtoms += 1
983 fixedProteinAtoms += 1
985 if (self.getChain(leaf) == self.getParam(
"peptide_chain")):
986 flexiblePeptideAtoms += 1
988 flexibleProteinAtoms += 1
989 print(
"Flexible peptide atoms: %s" % flexiblePeptideAtoms)
990 print(
"Fixed peptide atoms: %s" % fixedPeptideAtoms)
991 print(
"Flexible protein atoms: %s" % flexibleProteinAtoms)
992 print(
"Fixed protein atoms: %s" % fixedProteinAtoms)
993 print(
"Total number of restraints: %s" % restraintCount)
995 def writeOsOutput(self):
997 print(
"Best cg score: %s" % self.bestCgScore)
998 print(
"best cg rmsd: %s" % self.bestCgRmsd)
999 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.