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)
235 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]
303 print "added next close atom %s to bounding box particles" % firstPname
306 peptideParticles = []
309 if (self.getChain(leaf) == self.getParam(
"peptide_chain")):
310 peptideParticles.append(
315 fixedAtoms = self.getFixedAtoms()
316 for flexPname
in self.flexibleAtoms.keys():
318 flexParticle = self.namesToParticles[flexPname]
320 print "processing position for pname %s" % flexPname
321 while(goodPosition == 0):
323 flexXyzDecorator.set_coordinates(
325 for fixedPname
in fixedAtoms.keys():
326 fixedParticle = self.namesToParticles[fixedPname]
329 fixedParticle).get_coordinates(
333 print "finding new position for %s" % flexPname
341 elif (initialPositionMethod ==
"random_full"):
343 for particleName
in self.flexibleAtoms.keys():
344 print "creating random position for particle %s" % particleName
345 p = self.namesToParticles[particleName]
348 myRandom = random.random()
350 xyzDecorator.set_coordinates(randomXyz)
354 elif (initialPositionMethod ==
"file"):
356 initialPositionFile = self.getParam(
"saved_initial_atom_positions")
357 print "reading initial positions from %s" % initialPositionFile
364 for initialLeaf
in initialLeaves:
365 name = self.quickParticleName(initialLeaf)
366 if ((name
in self.namesToParticles) == 1):
367 existingLeaf = self.namesToParticles[name]
372 existingLeafXyz.set_coordinates(
373 initialLeafXyz.get_coordinates())
375 print "Read in initial positions from file %s but this file contained particle %s which is not in current model" % (initialPositionFile, name)
377 print "Please specify valid initial position method (random or file)\n"
381 outputDir = self.getParam(
"output_directory")
382 initialAtomPositionFile = self.getParam(
383 "initial_atom_positions_output_file")
384 fullOutputFile = os.path.join(outputDir, initialAtomPositionFile)
385 print "writing output to file %s" % fullOutputFile
389 initialScore = self.model.evaluate(
False)
390 print "initial score for model is %s" % initialScore
393 def getNonBondedPairs(self):
394 nonBondedDefinition = self.getParam(
"non_bonded_definition")
396 if (nonBondedDefinition ==
"close_pairs"):
397 particlePairs = self.getClosePairs()
398 elif (nonBondedDefinition ==
"random"):
399 particlePairs = self.getRandomParticlePairs()
400 elif (nonBondedDefinition ==
"manual"):
401 particlePairs = self.readManualRestraints(nativeProtein, 6)
403 print "Please specify valid non bonded pair definition"
408 def getXyzDistance(self, pair):
416 def getClosePairs(self):
421 closePairDistance = float(self.getParam(
"close_pair_distance"))
424 useHardCutoff = self.getParam(
"use_hard_distance_cutoff")
428 self.model.evaluate(
False)
430 particlePairs = nbl.get_particle_pairs()
432 for pair
in particlePairs:
433 distance = self.getXyzDistance(pair)
434 q0 = self.quickParticleName(pair[0])
435 q1 = self.quickParticleName(pair[1])
437 if (useHardCutoff ==
"0" or (useHardCutoff ==
"1" and distance < closePairDistance)):
438 finalPairs.append([pair[0], pair[1]])
443 def addForceFieldRestraints(self):
445 useForcefieldRestraints = self.getParam(
"use_forcefield_restraints")
446 if (useForcefieldRestraints ==
"1"):
454 bonds = self.topology.add_bonds(self.protein)
455 angles = ff.create_angles(bonds)
456 dihedrals = ff.create_dihedrals(bonds)
457 impropers = self.topology.add_impropers(self.protein)
461 self.ffParticleGroups = self.initializeParticleNameDict(
464 self.createForceFieldRestraintsForModel(
472 self.createForceFieldRestraintsForModel(
480 self.createForceFieldRestraintsForModel(
483 "Dihedral Restraints",
485 self.createForceFieldRestraintsForModel(
488 "Improper Restraints",
495 print (
"Skipping forcefield restraints")
499 def createForceFieldRestraintsForModel(
506 maxForceFieldScore = float(self.getParam(
"max_forcefield_score"))
508 cont.add_particles(ffParticles)
510 singletonScore, cont, restraintName)
511 self.model.add_restraint(listBondRestraint)
515 decomposedRestraintTemp = listBondRestraint.create_decomposition()
516 decomposedRestraints = IMP.kernel.RestraintSet.get_from(
517 decomposedRestraintTemp)
518 rs_restraints = decomposedRestraints.get_restraints()
521 self.model.remove_restraint(listBondRestraint)
523 count = decomposedRestraints.get_number_of_restraints()
524 for i
in range(count):
526 r = decomposedRestraints.get_restraint(i)
528 if (self.allFlexibleAtoms(r) == 1):
530 self.model.add_restraint(r)
531 self.model.set_maximum_score(r, maxForceFieldScore)
532 self.addParticlesToGroups(r)
540 def addParticlesToGroups(self, r):
542 ps = r.get_input_particles()
546 if (self.isAtomParticle(p) == 0):
548 inputParticles.append(p.get_name())
550 for firstName
in inputParticles:
551 for secondName
in inputParticles:
552 if (firstName == secondName):
554 self.ffParticleGroups[firstName][secondName] = 1
559 def addExcludedVolumeRestraints(self):
561 restrainedParticles = atomicDominoUtilities.getRestrainedParticles(
562 self.protein, self.model, self.namesToParticles)
566 self.model.add_restraint(evr)
571 def addFlexFlexLjRestraints(self, scalingFactor):
572 if (self.initializedFlexFlexLjRestraints == 0):
573 print "adding initial lennard jones restraints between pairs of flexible atoms"
574 self.initializedFlexFlexLjRestraints = 1
580 for i
in range(len(leaves)):
582 for j
in range(i + 1, len(leaves)):
584 if ((self.quickParticleName(iLeaf)
in self.flexibleAtoms) == 1
and (self.quickParticleName(jLeaf)
in self.flexibleAtoms) == 1):
586 ps, [iLeaf, jLeaf],
"LennardJones %s_%s" %
588 self.model.add_restraint(ljpr)
590 self.protein, IMP.atom.CHAIN_TYPE)
591 peptideChainHierarchy =
None
592 print "scaling atomic radii by scaling factor %s" % scalingFactor
594 self.ff.add_radii(self.protein)
595 for pName
in self.flexibleAtoms.keys():
596 particle = self.namesToParticles[pName]
598 radius = xyzr.get_radius()
599 radius *= scalingFactor
600 xyzr.set_radius(radius)
604 def addFixedFlexibleLjRestraints(self):
605 print "adding initial fixed flexible lj restraints"
606 fixedAtoms = self.getFixedAtoms()
610 for flexPname
in self.flexibleAtoms.keys():
611 flexParticle = self.namesToParticles[flexPname]
612 for fixedPname
in fixedAtoms.keys():
613 fixedParticle = self.namesToParticles[fixedPname]
615 ps, [fixedParticle, flexParticle],
"LennardJones %s_%s" %
616 (flexPname, fixedPname))
617 self.model.add_restraint(ljpr)
620 def createDopeRestraint(self, pair):
621 q0 = self.quickParticleName(pair[0])
622 q1 = self.quickParticleName(pair[1])
624 prName =
"NonBonded %s_%s" % (q0, q1)
626 self.dopePairScore, pair, prName)
629 self.model.add_restraint(pairRestraint)
630 maxNonBondedScore = float(self.getParam(
"max_non_bonded_score"))
631 self.model.set_maximum_score(pairRestraint, maxNonBondedScore)
636 def addClosePairNonBondedRestraints(self):
637 particlePairs = self.getNonBondedPairs()
639 nonBondedRestraintType = self.getParam(
"non_bonded_restraint_type")
640 dopeCutoff = float(self.getParam(
"dope_cutoff"))
645 if (nonBondedRestraintType ==
"dope"):
648 self.dopePairScore = ps
650 self.nonBondedPairs = self.initializeParticleNameDict(
652 for pair
in particlePairs:
654 if (self.skipNonBondedPair(pair) == 1):
657 self.createDopeRestraint(pair)
660 self.nonBondedPairs[self.quickParticleName(pair[0])][
661 self.quickParticleName(pair[0])] = 1
662 self.nonBondedPairs[self.quickParticleName(pair[1])][
663 self.quickParticleName(pair[1])] = 1
665 print "Added %s non-bonded restraints" % nonBondedCount
666 self.model.evaluate(
False)
668 def addCompleteNonBondedRestraints(self):
672 for i
in range(len(leaves)):
674 for j
in range(i + 1, len(leaves)):
677 if ((self.quickParticleName(jLeaf)
in self.nonBondedPairs[self.quickParticleName(iLeaf)]) == 1):
679 if (self.skipNonBondedPair([iLeaf, jLeaf]) == 1):
682 self.createDopeRestraint([iLeaf, jLeaf])
687 print "added %s restraints for %s particles" % (counter, len(leaves))
688 self.model.evaluate(
False)
691 def writeAllRestraints(self):
692 print "write all restraints:"
693 for r
in IMP.get_restraints([self.model.get_root_restraint_set()]):
694 print self.quickRestraintName(r)
697 def initializeMdSchedule(self):
698 schedule = self.getParam(
"md_schedule")
699 stages = schedule.split()
702 print "unpacking stage %s" % stage
703 [steps, temperature, excludedVolume] = stage.split(
'_')
704 totalSteps += int(steps)
705 self.totalMdSteps = totalSteps
706 self.mdStages = stages
711 def createMdRootHandle(self):
714 outputDir = self.getParam(
"output_directory")
716 if (self.getParam(
"read_assignments_from_file") ==
"no"):
718 mdFileName = self.getParam(
"md_trajectory_output_file")
719 fileName = os.path.join(outputDir, mdFileName)
720 print "creating rmf file with filename %s" % fileName
721 rh = RMF.create_rmf_file(fileName)
722 my_kc = rh.add_category(
"my data")
728 mdFileName = self.getParam(
"saved_md_filename")
730 rh = RMF.open_rmf_file(mdFileName)
731 IMP.rmf.set_hierarchies(rh, [self.protein])
735 def evaluateModel(self):
736 return self.model.evaluate(
False)
738 def loadMdHelpers(self):
740 self.createMdRootHandle()
742 self.createMdOptimizer()
744 self.addMdOptimizerStates()
746 self.initializeMdSchedule()
748 self.createdMdOptimizer = 1
751 def createMdOptimizer(self):
752 print "creating md object"
757 md.set_velocity_cap(100.0)
758 self.mdOptimizer = md
760 def addMdOptimizerStates(self):
766 vsIndex = self.mdOptimizer.add_optimizer_state(vsos)
769 hdos = IMP.rmf.SaveHierarchyConfigurationOptimizerState(
770 [self.protein], self.rootHandle)
771 self.mdOptimizer.add_optimizer_state(hdos)
776 def readTrajectories(self):
778 cgFileName = self.getParam(
"cg_output_file")
779 bestCgScore = 10000000
781 bestCgRmsd = 10000000
784 outputDir = self.getParam(
"output_directory")
785 trajectoryFile = self.getParam(
"md_trajectory_output_file")
786 fullFile = os.path.join(outputDir, trajectoryFile)
787 rh = RMF.open_rmf_file(fullFile)
788 IMP.rmf.set_hierarchies(rh, [self.protein])
789 framesToRead = atomicDominoUtilities.getMdIntervalFrames(
790 rh, int(self.getParam(
"cg_interval")), self.protein)
792 if (len(framesToRead) > 0):
793 for cgNumber
in framesToRead:
795 outputDir = self.getParam(
"output_directory")
796 fullCgFileName = os.path.join(
798 (cgFileName, cgNumber))
799 rh = RMF.open_rmf_file(fullCgFileName)
800 IMP.rmf.set_hierarchies(rh, [self.protein])
802 frameCount = IMP.rmf.get_number_of_frames(rh, self.protein)
804 score = self.model.evaluate(
False)
805 rmsd = self.calculateNativeRmsd(self.flexibleAtoms)
806 print "cg number %s has score %s rmsd %s" % (cgNumber, score, rmsd)
807 if (score < bestCgScore):
809 bestCgScoreFile = fullCgFileName
810 if (rmsd < bestCgRmsd):
812 bestCgRmsdFile = fullCgFileName
815 self.singlePdbResults(
818 self.getParam(
"best_cg_score_output_file"))
819 self.singlePdbResults(
822 self.getParam(
"best_cg_rmsd_output_file"))
823 self.singlePdbResults(
825 (cgFileName, framesToRead[-1]), -1, self.getParam(
"final_cg_frame_output_file"))
826 finalCgRmsd = self.calculateNativeRmsd(self.flexibleAtoms)
827 self.bestCgScore = bestCgScore
828 self.bestCgRmsd = bestCgRmsd
829 self.finalCgRmsd = finalCgRmsd
831 def singlePdbResults(self, trajectoryFile, frame, outputPdbFile):
833 fullTrajectoryFile = os.path.join(
834 self.getParam(
"output_directory"),
836 fullOutputFile = os.path.join(
837 self.getParam(
"output_directory"),
839 rh = RMF.open_rmf_file(fullTrajectoryFile)
840 IMP.rmf.set_hierarchies(rh, [self.protein])
842 frame = IMP.rmf.get_number_of_frames(rh, self.protein) - 1
846 def calculateRmsd(self, otherProtein, flexibleAtoms):
847 otherNamesToParticles = atomicDominoUtilities.makeNamesToParticles(
851 for pName
in otherNamesToParticles.keys():
852 if ((pName
in flexibleAtoms) == 0):
854 otherParticle = otherNamesToParticles[pName]
855 modelParticle = self.namesToParticles[pName]
858 otherParticle).get_coordinates(
862 modelParticle).get_coordinates(
867 def calculateNativeRmsd(self, flexibleAtoms):
869 if (self.wroteNativeProtein == 0):
870 pdbName = self.getParam(
"native_pdb_input_file")
876 self.wroteNativeProtein = 1
878 return self.calculateRmsd(self.nativeProtein, flexibleAtoms)
881 def runMolecularDynamics(self):
882 self.initializedFlexFlexLjRestraints = 0
883 if (self.fixedNonFlexibleAtoms == 0):
884 print "error: before running md, must fix non flexible atoms"
887 for stage
in self.mdStages:
888 [steps, temperature, excludedVolume] = stage.split(
'_')
889 stepsSoFar += int(steps)
890 self.vsos.set_temperature(int(temperature))
891 if (excludedVolume ==
"1"):
892 self.addFixedFlexibleLjRestraints()
893 elif (excludedVolume !=
"0"):
895 if (self.getParam(
"excluded_volume_type") ==
"lj"):
896 self.addFlexFlexLjRestraints(float(excludedVolume))
897 elif (self.getParam(
"excluded_volume_type") ==
"ev"):
898 self.addExcludedVolumeRestraints(
901 "please set excluded_volume_type to either lj or ev"
903 print "running md at temperature %s for %s steps" % (temperature, steps)
904 self.mdOptimizer.optimize(int(steps))
913 print "model score after stage %s is %s" % (stage, self.model.evaluate(
False))
914 print "done running md"
917 cgInterval = int(self.getParam(
"cg_interval"))
918 outputDir = self.getParam(
"output_directory")
919 trajectoryFile = self.getParam(
"md_trajectory_output_file")
920 fullFile = os.path.join(outputDir, trajectoryFile)
921 print "open rmf %s" % fullFile
922 rh = RMF.open_rmf_file(fullFile)
923 IMP.rmf.set_hierarchies(rh, [self.protein])
924 framesToRead = atomicDominoUtilities.getMdIntervalFrames(
925 rh, cgInterval, self.protein)
927 for i
in framesToRead:
928 cgFileName =
"%s%s" % (self.getParam(
"cg_output_file"), i)
929 self.applyCg(i, cgFileName)
933 def applyCg(self, mdStepStart, cgFileName):
935 cgSteps = int(self.getParam(
"cg_steps"))
938 print "apply cg: loading md frame for cg step start %s" % mdStepStart
942 outputDir = self.getParam(
"output_directory")
943 fileName = os.path.join(outputDir, cgFileName)
944 print "creating cg hdf5 file %s" % fileName
945 rh = RMF.create_rmf_file(fileName)
946 my_kc = rh.add_category(
"my data")
951 firstScore = self.model.evaluate(
False)
953 print "creating optimizer state"
954 hdos = IMP.rmf.SaveHierarchyConfigurationOptimizerState(
956 hdos.set_skip_steps(0)
958 cg.add_optimizer_state(hdos)
962 secondScore = self.model.evaluate(
False)
963 print "cg score after md step %s before %s after %s" % (mdStepStart, firstScore, secondScore)
967 def fixNonFlexibleAtoms(self):
968 if (self.createdMdOptimizer == 0):
969 self.createMdOptimizer()
973 self.fixedNonFlexibleAtoms = 1
976 if ((self.quickParticleName(leaf)
in self.flexibleAtoms) == 0):
978 xyzDecorator.set_coordinates_are_optimized(0)
980 def writeOutput(self):
981 restraintCount = self.model.get_number_of_restraints()
983 flexiblePeptideAtoms = 0
984 flexibleProteinAtoms = 0
985 fixedPeptideAtoms = 0
986 fixedProteinAtoms = 0
989 if ((self.quickParticleName(leaf)
in self.flexibleAtoms) == 0):
990 if (self.getChain(leaf) == self.getParam(
"peptide_chain")):
991 fixedPeptideAtoms += 1
993 fixedProteinAtoms += 1
995 if (self.getChain(leaf) == self.getParam(
"peptide_chain")):
996 flexiblePeptideAtoms += 1
998 flexibleProteinAtoms += 1
999 print "Flexible peptide atoms: %s" % flexiblePeptideAtoms
1000 print "Fixed peptide atoms: %s" % fixedPeptideAtoms
1001 print "Flexible protein atoms: %s" % flexibleProteinAtoms
1002 print "Fixed protein atoms: %s" % fixedProteinAtoms
1003 print "Total number of restraints: %s" % restraintCount
1005 def writeOsOutput(self):
1007 print "Best cg score: %s" % self.bestCgScore
1008 print "best cg rmsd: %s" % self.bestCgRmsd
1009 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.
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.
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.
Class for storing model, its restraints, constraints, and particles.
Score the dihedral angle.
Harmonic function (symmetric about the mean)