10 #ifndef RD_MMFFCONVENIENCE_H 11 #define RD_MMFFCONVENIENCE_H 44 ROMol &mol,
int maxIters = 1000, std::string mmffVariant =
"MMFF94",
45 double nonBondedThresh = 10.0,
int confId = -1,
46 bool ignoreInterfragInteractions =
true) {
50 if (mmffMolProperties.
isValid()) {
52 mol, nonBondedThresh, confId, ignoreInterfragInteractions);
58 return std::make_pair(res, e);
60 #ifdef RDK_THREADSAFE_SSS 63 std::vector<std::pair<int, double> > *res,
64 unsigned int threadIdx,
65 unsigned int numThreads,
int maxIters) {
70 if (i % numThreads != threadIdx)
continue;
71 for (
unsigned int aidx = 0; aidx < mol->
getNumAtoms(); ++aidx) {
72 ff.
positions()[aidx] = &(*cit)->getAtomPos(aidx);
75 int needsMore = ff.
minimize(maxIters);
77 (*res)[i] = std::make_pair(needsMore, e);
105 std::vector<std::pair<int, double> > &res,
106 int numThreads = 1,
int maxIters = 1000,
107 std::string mmffVariant =
"MMFF94",
108 double nonBondedThresh = 10.0,
109 bool ignoreInterfragInteractions =
true) {
113 if (mmffMolProperties.
isValid()) {
115 mol, nonBondedThresh, -1, ignoreInterfragInteractions);
116 if (numThreads == 1) {
120 for (
unsigned int aidx = 0; aidx < mol.
getNumAtoms(); ++aidx) {
121 ff->
positions()[aidx] = &(*cit)->getAtomPos(aidx);
124 int needsMore = ff->
minimize(maxIters);
126 res[i] = std::make_pair(needsMore, e);
129 #ifdef RDK_THREADSAFE_SSS 131 boost::thread_group tg;
132 for (
int ti = 0; ti < numThreads; ++ti) {
134 new boost::thread(detail::MMFFOptimizeMoleculeConfsHelper_, *ff,
135 &mol, &res, ti, numThreads, maxIters));
143 res[i] = std::make_pair(static_cast<int>(-1), static_cast<double>(-1));
int minimize(unsigned int snapshotFreq, RDKit::SnapshotVect *snapshotVect, unsigned int maxIts=200, double forceTol=1e-4, double energyTol=1e-6)
minimizes the energy of the system by following gradients
unsigned int getNumAtoms(bool onlyExplicit=1) const
returns our number of atoms
RDGeom::PointPtrVect & positions()
returns a reference to our points (a PointPtrVect)
double calcEnergy(std::vector< double > *contribs=NULL) const
calculates and returns the energy (in kcal/mol) based on existing
unsigned int getNumConformers() const
std::pair< int, double > MMFFOptimizeMolecule(ROMol &mol, int maxIters=1000, std::string mmffVariant="MMFF94", double nonBondedThresh=10.0, int confId=-1, bool ignoreInterfragInteractions=true)
Convenience function for optimizing a molecule using MMFF.
ROMol is a molecule class that is intended to have a fixed topology.
void initialize()
does initialization
unsigned int getNumThreadsToUse(int target)
void MMFFOptimizeMoleculeConfs(ROMol &mol, std::vector< std::pair< int, double > > &res, int numThreads=1, int maxIters=1000, std::string mmffVariant="MMFF94", double nonBondedThresh=10.0, bool ignoreInterfragInteractions=true)
Convenience function for optimizing all of a molecule's conformations using.
ConformerIterator endConformers()
ConformerIterator beginConformers()
ForceFields::ForceField * constructForceField(ROMol &mol, double nonBondedThresh=100.0, int confId=-1, bool ignoreInterfragInteractions=true)
Builds and returns a MMFF force field for a molecule.
A class to store forcefields and handle minimization.