10 #ifndef RD_MMFFCONVENIENCE_H 11 #define RD_MMFFCONVENIENCE_H 15 #ifdef RDK_THREADSAFE_SSS 16 #include <boost/thread.hpp> 41 std::string mmffVariant=
"MMFF94",
42 double nonBondedThresh=10.0,
int confId=-1,
43 bool ignoreInterfragInteractions=
true ){
47 if (mmffMolProperties.
isValid()) {
49 ignoreInterfragInteractions);
55 return std::make_pair(res,e);
57 #ifdef RDK_THREADSAFE_SSS 61 std::vector< std::pair<int, double> > *res,
62 unsigned int threadIdx,
63 unsigned int numThreads,
69 if(i%numThreads != threadIdx)
continue;
70 for(
unsigned int aidx=0;aidx<mol->
getNumAtoms();++aidx){
71 ff.
positions()[aidx]=&(*cit)->getAtomPos(aidx);
76 (*res)[i] = std::make_pair(needsMore,e);
98 std::vector< std::pair<int, double> > &res,
99 unsigned int numThreads=1,
101 std::string mmffVariant=
"MMFF94",
102 double nonBondedThresh=10.0,
103 bool ignoreInterfragInteractions=
true ){
105 #ifndef RDK_THREADSAFE_SSS 113 nonBondedThresh,(*cit)->getId(),
114 ignoreInterfragInteractions);
117 #ifdef RDK_THREADSAFE_SSS 120 if(mmffMolProperties.
isValid()) {
122 ignoreInterfragInteractions);
123 boost::thread_group tg;
124 for(
unsigned int ti=0;ti<numThreads;++ti){
125 tg.add_thread(
new boost::thread(detail::MMFFOptimizeMoleculeConfsHelper_,
127 &mol,&res,ti,numThreads,maxIters));
134 res[i] = std::make_pair(static_cast<int>(-1),static_cast<double>(-1));
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.
double calcEnergy() const
calculates and returns the energy (in kcal/mol) based on existing positions in the forcefield ...
unsigned int getNumConformers() const
RDGeom::PointPtrVect & positions()
returns a reference to our points (a PointPtrVect)
unsigned int getNumAtoms(bool onlyExplicit=1) const
returns our number of atoms
int minimize(unsigned int maxIts=200, double forceTol=1e-4, double energyTol=1e-6)
minimizes the energy of the system by following gradients
ROMol is a molecule class that is intended to have a fixed topology.
void MMFFOptimizeMoleculeConfs(ROMol &mol, std::vector< std::pair< int, double > > &res, unsigned 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 MMFF. ...
void initialize()
does initialization
Includes a bunch of functionality for handling Atom and Bond queries.
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.