void calcCrippenDescriptors(const ROMol &mol, double &logp, double &mr, bool includeHs, bool force) { if (!force && mol.hasProp(common_properties::_crippenLogP)) { mol.getProp(common_properties::_crippenLogP, logp); mol.getProp(common_properties::_crippenMR, mr); return; } // this isn't as bad as it looks, we aren't actually going // to harm the molecule in any way! ROMol *workMol = const_cast<ROMol *>(&mol); if (includeHs) { workMol = MolOps::addHs(mol, false, false); } std::vector<double> logpContribs(workMol->getNumAtoms()); std::vector<double> mrContribs(workMol->getNumAtoms()); getCrippenAtomContribs(*workMol, logpContribs, mrContribs, force); logp = 0.0; for (std::vector<double>::const_iterator iter = logpContribs.begin(); iter != logpContribs.end(); ++iter) { logp += *iter; } mr = 0.0; for (std::vector<double>::const_iterator iter = mrContribs.begin(); iter != mrContribs.end(); ++iter) { mr += *iter; } if (includeHs) { delete workMol; } mol.setProp(common_properties::_crippenLogP, logp, true); mol.setProp(common_properties::_crippenMR, mr, true); };
std::vector<double> calcSlogP_VSA(const ROMol &mol, std::vector<double> *bins, bool force) { // FIX: use force value to include caching std::vector<double> lbins; if (!bins) { double blist[11] = {-0.4, -0.2, 0, 0.1, 0.15, 0.2, 0.25, 0.3, 0.4, 0.5, 0.6}; lbins.resize(11); std::copy(blist, blist + 11, lbins.begin()); } else { lbins.resize(bins->size()); std::copy(bins->begin(), bins->end(), lbins.begin()); } std::vector<double> res(lbins.size() + 1, 0); std::vector<double> vsaContribs(mol.getNumAtoms()); double tmp; getLabuteAtomContribs(mol, vsaContribs, tmp, true, force); std::vector<double> logpContribs(mol.getNumAtoms()); std::vector<double> mrContribs(mol.getNumAtoms()); getCrippenAtomContribs(mol, logpContribs, mrContribs, force); assignContribsToBins(vsaContribs, logpContribs, lbins, res); return res; }
std::vector<double> calcSMR_VSA(const ROMol &mol, std::vector<double> *bins, bool force) { std::vector<double> lbins; if (!bins) { double blist[9] = {1.29, 1.82, 2.24, 2.45, 2.75, 3.05, 3.63, 3.8, 4.0}; lbins.resize(9); std::copy(blist, blist + 9, lbins.begin()); } else { lbins.resize(bins->size()); std::copy(bins->begin(), bins->end(), lbins.begin()); } std::vector<double> res(lbins.size() + 1, 0); std::vector<double> vsaContribs(mol.getNumAtoms()); double tmp; getLabuteAtomContribs(mol, vsaContribs, tmp, true, force); std::vector<double> logpContribs(mol.getNumAtoms()); std::vector<double> mrContribs(mol.getNumAtoms()); getCrippenAtomContribs(mol, logpContribs, mrContribs, force); assignContribsToBins(vsaContribs, mrContribs, lbins, res); return res; }