move the _VSA descriptors into C++

This commit is contained in:
Greg Landrum
2011-03-21 05:02:12 +00:00
parent f598ac672c
commit 6fa65fbc68
11 changed files with 432 additions and 42 deletions

View File

@@ -9,7 +9,7 @@ SET(CMAKE_SWIG_FLAGS "")
SET_SOURCE_FILES_PROPERTIES(RDKFuncs.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(RDKFuncs.i PROPERTIES SWIG_FLAGS "-module RDKFuncs")
if(MSVC)
set(RDKit_Wrapper_Libs FileParsers SmilesParse
set(RDKit_Wrapper_Libs PartialCharges FileParsers SmilesParse
Depictor ChemTransforms Subgraphs
ForceFieldHelpers ForceField MolAlign Optimizer Alignment EigenSolvers
DistGeomHelpers DistGeometry
@@ -17,7 +17,7 @@ if(MSVC)
Subgraphs GraphMol DataStructs
RDGeometryLib RDGeneral)
else(MSVC)
set(RDKit_Wrapper_Libs FileParsers_static SmilesParse_static
set(RDKit_Wrapper_Libs PartialCharges_static FileParsers_static SmilesParse_static
Depictor_static ChemTransforms_static Subgraphs_static
ForceFieldHelpers_static ForceField_static MolAlign_static Optimizer_static Alignment_static EigenSolvers_static
DistGeomHelpers_static DistGeometry_static

View File

@@ -72,7 +72,9 @@ typedef std::list<int > INT_LIST;
%template(ROMol_Vect) std::vector< boost::shared_ptr<RDKit::ROMol> >;
%template(Int_Vect) std::vector<int>;
%template(Double_Vect) std::vector<double>;
%rename(equals) std::vector<int>::operator==;
%rename(equals) std::vector<double>::operator==;
%template(Int_Pair) std::pair<int, int >;
%template(Match_Vect) std::vector<std::pair<int,int> >;
%template(ROMol_Vect_Vect) std::vector< std::vector< boost::shared_ptr<RDKit::ROMol> > >;

View File

@@ -296,6 +296,40 @@ public class WrapperTests {
assertEquals(tmp,12.89,0.01);
tmp=RDKFuncs.calcTPSA(m3);
assertEquals(tmp,37.30,0.01);
}
@Test public void testVSADescriptors() {
ROMol m1,m2,m3;
m1 = RDKFuncs.MolFromSmiles("CO");
m2 = RDKFuncs.MolFromSmiles("CCO");
Double_Vect v;
v = RDKFuncs.calcSlogP_VSA(m1);
assertEquals(v.get(0),0.0,0.001);
assertEquals(v.get(1),12.216,0.001);
v = RDKFuncs.calcSlogP_VSA(m2);
assertEquals(v.get(0),0.0,0.001);
assertEquals(v.get(1),11.713,0.001);
assertEquals(v.get(4),6.924,0.001);
v = RDKFuncs.calcSMR_VSA(m1);
assertEquals(v.get(0),5.106,0.001);
assertEquals(v.get(1),0.0,0.001);
assertEquals(v.get(5),7.110,0.001);
v = RDKFuncs.calcSMR_VSA(m2);
assertEquals(v.get(0),5.106,0.001);
assertEquals(v.get(4),6.924,0.001);
assertEquals(v.get(5),6.607,0.001);
v = RDKFuncs.calcPEOE_VSA(m1);
assertEquals(v.get(0),5.106,0.001);
assertEquals(v.get(7),7.110,0.001);
assertEquals(v.get(5),0.000,0.001);
v = RDKFuncs.calcPEOE_VSA(m2);
assertEquals(v.get(0),5.106,0.001);
assertEquals(v.get(6),6.924,0.001);
assertEquals(v.get(7),6.607,0.001);
}
/*@Test*/ public void testMemory2() {
ChemicalReaction rxn;

View File

@@ -1,13 +1,13 @@
rdkit_library(Descriptors
Crippen.cpp MolDescriptors.cpp MolSurf.cpp Lipinski.cpp
LINK_LIBRARIES SmilesParse FileParsers Subgraphs SubstructMatch)
LINK_LIBRARIES PartialCharges SmilesParse FileParsers Subgraphs SubstructMatch)
rdkit_headers(Crippen.h Lipinski.h
MolDescriptors.h
MolSurf.h DEST GraphMol/Descriptors)
rdkit_test(testDescriptors test.cpp
LINK_LIBRARIES Descriptors FileParsers SmilesParse Subgraphs SubstructMatch GraphMol DataStructs RDGeneral RDGeometryLib )
LINK_LIBRARIES PartialCharges Descriptors FileParsers SmilesParse Subgraphs SubstructMatch GraphMol DataStructs RDGeneral RDGeometryLib )
add_subdirectory(Wrap)

View File

@@ -11,7 +11,9 @@
#include <GraphMol/RDKitBase.h>
#include <GraphMol/Descriptors/MolDescriptors.h>
#include <GraphMol/PartialCharges/GasteigerCharges.h>
#include <vector>
#include <algorithm>
namespace RDKit{
namespace Descriptors {
@@ -229,5 +231,95 @@ namespace RDKit{
return res;
}
namespace {
void assignContribsToBins(const std::vector<double> &contribs,
const std::vector<double> &binProp,
std::vector<double> &bins,
std::vector<double> &res){
PRECONDITION(contribs.size()==binProp.size(),"mismatched array sizes");
PRECONDITION(res.size()>=bins.size()+1,"mismatched array sizes");
for(unsigned int i=0;i<contribs.size();++i){
double cVal = contribs[i];
double bVal = binProp[i];
unsigned int idx=std::upper_bound(bins.begin(),bins.end(),bVal)-bins.begin();
res[idx]+=cVal;
}
}
}
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;
}
std::vector<double> calcPEOE_VSA(const ROMol &mol,std::vector<double> *bins,
bool force){
std::vector<double> lbins;
if(!bins){
double blist[13]={-.3,-.25,-.20,-.15,-.10,-.05,0,.05,.10,.15,.20,.25,.30};
lbins.resize(13);
std::copy(blist,blist+13,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> chgs(mol.getNumAtoms(),0.0);
computeGasteigerCharges(mol,chgs);
assignContribsToBins(vsaContribs,chgs,lbins,res);
return res;
}
} // end of namespace Descriptors
} // end of namespace RDKit

View File

@@ -15,6 +15,9 @@
*/
#ifndef __RD_MOLSURF_H__
#define __RD_MOLSURF_H__
#include<vector>
namespace RDKit{
class ROMol;
namespace Descriptors {
@@ -92,7 +95,13 @@ namespace RDKit{
double calcTPSA(const ROMol &mol,
bool force=false);
std::vector<double> calcSlogP_VSA(const ROMol &mol,std::vector<double> *bins=0,
bool force=false);
std::vector<double> calcSMR_VSA(const ROMol &mol,std::vector<double> *bins=0,
bool force=false);
std::vector<double> calcPEOE_VSA(const ROMol &mol,std::vector<double> *bins=0,
bool force=false);
} // end of namespace Descriptors
} //end of namespace RDKit

View File

@@ -307,6 +307,73 @@ namespace {
}
return res;
}
python::list CalcSlogPVSA(const RDKit::ROMol &mol,
python::object bins,
bool force){
std::vector<double> *lbins=0;
if(bins){
unsigned int nBins=python::extract<unsigned int>(bins.attr("__len__")());
if(nBins){
lbins = new std::vector<double>(nBins,0.0);
for(unsigned int i=0;i<nBins;++i){
(*lbins)[i] = python::extract<double>(bins[i]);
}
}
}
std::vector<double> res;
res=RDKit::Descriptors::calcSlogP_VSA(mol,lbins,force);
python::list pyres;
for(std::vector<double>::const_iterator iv=res.begin();iv!=res.end();++iv){
pyres.append(*iv);
}
return pyres;
}
python::list CalcSMRVSA(const RDKit::ROMol &mol,
python::object bins,
bool force){
std::vector<double> *lbins=0;
if(bins){
unsigned int nBins=python::extract<unsigned int>(bins.attr("__len__")());
if(nBins){
lbins = new std::vector<double>(nBins,0.0);
for(unsigned int i=0;i<nBins;++i){
(*lbins)[i] = python::extract<double>(bins[i]);
}
}
}
std::vector<double> res;
res=RDKit::Descriptors::calcSMR_VSA(mol,lbins,force);
python::list pyres;
for(std::vector<double>::const_iterator iv=res.begin();iv!=res.end();++iv){
pyres.append(*iv);
}
return pyres;
}
python::list CalcPEOEVSA(const RDKit::ROMol &mol,
python::object bins,
bool force){
std::vector<double> *lbins=0;
if(bins){
unsigned int nBins=python::extract<unsigned int>(bins.attr("__len__")());
if(nBins){
lbins = new std::vector<double>(nBins,0.0);
for(unsigned int i=0;i<nBins;++i){
(*lbins)[i] = python::extract<double>(bins[i]);
}
}
}
std::vector<double> res;
res=RDKit::Descriptors::calcPEOE_VSA(mol,lbins,force);
python::list pyres;
for(std::vector<double>::const_iterator iv=res.begin();iv!=res.end();++iv){
pyres.append(*iv);
}
return pyres;
}
}
BOOST_PYTHON_MODULE(rdMolDescriptors) {
@@ -463,7 +530,6 @@ BOOST_PYTHON_MODULE(rdMolDescriptors) {
python::arg("force")=false),
docString.c_str());
docString="returns the TPSA value for a molecule";
python::def("CalcTPSA",
RDKit::Descriptors::calcTPSA,
@@ -529,6 +595,23 @@ BOOST_PYTHON_MODULE(rdMolDescriptors) {
docString.c_str());
python::scope().attr("_CalcNumHeteroatoms_version")=RDKit::Descriptors::NumHeteroatomsVersion;
docString="returns the SlogP VSA contributions for a molecule";
python::def("SlogP_VSA_",
CalcSlogPVSA,
(python::arg("mol"),
python::arg("bins")=python::list(),
python::arg("force")=false));
docString="returns the SMR VSA contributions for a molecule";
python::def("SMR_VSA_",
CalcSMRVSA,
(python::arg("mol"),
python::arg("bins")=python::list(),
python::arg("force")=false));
docString="returns the PEOE VSA contributions for a molecule";
python::def("PEOE_VSA_",
CalcPEOEVSA,
(python::arg("mol"),
python::arg("bins")=python::list(),
python::arg("force")=false));
}

View File

@@ -355,8 +355,6 @@ void testLipinski1(){
std::cerr<<" failed: "<<idx<<" "<<oVal<<" "<<nVal<<std::endl;
}
TEST_ASSERT(oVal==nVal);
delete mol;
}
@@ -364,6 +362,156 @@ void testLipinski1(){
BOOST_LOG(rdErrorLog) << " done" << std::endl;
}
void testVSADescriptors(){
BOOST_LOG(rdErrorLog) << "-------------------------------------" << std::endl;
BOOST_LOG(rdErrorLog) << " Test VSA descriptors." << std::endl;
{
ROMol *mol;
std::vector<double> vals;
mol = SmilesToMol("CO");
vals = calcSlogP_VSA(*mol);
TEST_ASSERT(vals.size()==12);
for(unsigned int i=0;i<vals.size();++i){
switch(i){
case 1:
TEST_ASSERT(feq(vals[i],12.216,.001));
break;
default:
TEST_ASSERT(feq(vals[i],0,.001));
}
}
delete mol;
mol = SmilesToMol("CCO");
vals = calcSlogP_VSA(*mol);
TEST_ASSERT(vals.size()==12);
for(unsigned int i=0;i<vals.size();++i){
switch(i){
case 1:
TEST_ASSERT(feq(vals[i],11.713,.001));
break;
case 4:
TEST_ASSERT(feq(vals[i],6.924,.001));
break;
default:
TEST_ASSERT(feq(vals[i],0,.001));
}
}
delete mol;
mol = SmilesToMol("Fc1ccccc1");
vals = calcSlogP_VSA(*mol);
TEST_ASSERT(vals.size()==12);
for(unsigned int i=0;i<vals.size();++i){
switch(i){
case 3:
TEST_ASSERT(feq(vals[i],5.817,.001));
break;
case 5:
TEST_ASSERT(feq(vals[i],30.332,.001));
break;
case 9:
TEST_ASSERT(feq(vals[i],4.390,.001));
break;
default:
TEST_ASSERT(feq(vals[i],0,.001));
}
}
delete mol;
}
{
ROMol *mol;
std::vector<double> vals;
mol = SmilesToMol("CO");
vals = calcSMR_VSA(*mol);
TEST_ASSERT(vals.size()==10);
for(unsigned int i=0;i<vals.size();++i){
switch(i){
case 0:
TEST_ASSERT(feq(vals[i],5.106,.001));
break;
case 5:
TEST_ASSERT(feq(vals[i],7.110,.001));
break;
default:
TEST_ASSERT(feq(vals[i],0,.001));
}
}
delete mol;
mol = SmilesToMol("CCO");
vals = calcSMR_VSA(*mol);
TEST_ASSERT(vals.size()==10);
for(unsigned int i=0;i<vals.size();++i){
switch(i){
case 0:
TEST_ASSERT(feq(vals[i],5.106,.001));
break;
case 4:
TEST_ASSERT(feq(vals[i],6.924,.001));
break;
case 5:
TEST_ASSERT(feq(vals[i],6.607,.001));
break;
default:
TEST_ASSERT(feq(vals[i],0,.001));
}
}
delete mol;
}
{
ROMol *mol;
std::vector<double> vals;
mol = SmilesToMol("CO");
vals = calcPEOE_VSA(*mol);
TEST_ASSERT(vals.size()==14);
for(unsigned int i=0;i<vals.size();++i){
switch(i){
case 0:
TEST_ASSERT(feq(vals[i],5.106,.001));
break;
case 7:
TEST_ASSERT(feq(vals[i],7.110,.001));
break;
default:
TEST_ASSERT(feq(vals[i],0,.001));
}
}
delete mol;
mol = SmilesToMol("CCO");
vals = calcPEOE_VSA(*mol);
TEST_ASSERT(vals.size()==14);
for(unsigned int i=0;i<vals.size();++i){
switch(i){
case 0:
TEST_ASSERT(feq(vals[i],5.106,.001));
break;
case 6:
TEST_ASSERT(feq(vals[i],6.924,.001));
break;
case 7:
TEST_ASSERT(feq(vals[i],6.607,.001));
break;
default:
TEST_ASSERT(feq(vals[i],0,.001));
}
}
delete mol;
}
BOOST_LOG(rdErrorLog) << " done" << std::endl;
}
//-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//
//-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
@@ -377,5 +525,6 @@ int main(){
testLabute();
testTPSA();
testLipinski1();
testVSADescriptors();
#endif
}

View File

@@ -1,6 +1,6 @@
// $Id$
//
// Copyright (C) 2003-2009 Greg Landrum and Rational Discovery LLC
// Copyright (C) 2003-2011 Greg Landrum and Rational Discovery LLC
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
@@ -25,33 +25,33 @@ namespace Gasteiger {
* conjugated system. So for example the two nitrogens in the benzamidine system start the iteration
* with equal charges of 0.5
*/
void splitChargeConjugated(const ROMol *mol, DOUBLE_VECT &charges) {
void splitChargeConjugated(const ROMol &mol, DOUBLE_VECT &charges) {
int aix;
int natms = mol->getNumAtoms();
int natms = mol.getNumAtoms();
INT_VECT marker;
INT_VECT_CI mci;
int aax, yax;
double formal;
const Atom *at, *aat, *yat;
for (aix = 0; aix < natms; aix++) {
at = mol->getAtomWithIdx(aix);
at = mol.getAtomWithIdx(aix);
formal = at->getFormalCharge();
//std::cout << aix << " formal charges:" << formal << "\n";
marker.resize(0);
if ((fabs(formal) > EPS_DOUBLE) && (fabs(charges[aix]) < EPS_DOUBLE) ) {
marker.push_back(aix);
ROMol::OEDGE_ITER bnd1, end1, bnd2, end2;
boost::tie(bnd1,end1) = mol->getAtomBonds(at);
boost::tie(bnd1,end1) = mol.getAtomBonds(at);
while (bnd1 != end1) {
if ((*mol)[*bnd1]->getIsConjugated()) {
aax = (*mol)[*bnd1]->getOtherAtomIdx(aix);
aat = mol->getAtomWithIdx(aax);
boost::tie(bnd2,end2) = mol->getAtomBonds(aat);
if (mol[*bnd1]->getIsConjugated()) {
aax = mol[*bnd1]->getOtherAtomIdx(aix);
aat = mol.getAtomWithIdx(aax);
boost::tie(bnd2,end2) = mol.getAtomBonds(aat);
while (bnd2 != end2) {
if ((*bnd1) != (*bnd2)) {
if ((*mol)[*bnd2]->getIsConjugated()) {
yax = (*mol)[*bnd2]->getOtherAtomIdx(aax);
yat = mol->getAtomWithIdx(yax);
if (mol[*bnd2]->getIsConjugated()) {
yax = mol[*bnd2]->getOtherAtomIdx(aax);
yat = mol.getAtomWithIdx(yax);
if (at->getAtomicNum() == yat->getAtomicNum()) {
formal += yat->getFormalCharge();
marker.push_back(yax);
@@ -77,24 +77,35 @@ namespace Gasteiger {
} // end of namespace Gasteiger
namespace RDKit {
/*! \brief compute the gaseiger partial charges and return a new molecule with the charges set
void computeGasteigerCharges(const ROMol *mol,int nIter, bool throwOnParamFailure) {
PRECONDITION(mol,"bad molecule");
computeGasteigerCharges(*mol,nIter,throwOnParamFailure);
}
void computeGasteigerCharges(const ROMol &mol,int nIter, bool throwOnParamFailure) {
std::vector<double> chgs(mol.getNumAtoms());
computeGasteigerCharges(mol,chgs,nIter,throwOnParamFailure);
}
/*! \brief compute the Gasteiger partial charges and return a new molecule with the charges set
*
* Ref : J.Gasteiger, M. Marsili, "Iterative Equalization of Oribital Electronegatiity
* A Rapid Access to Atomic Charges", Tetrahedron Vol 36 p3219 1980
*/
void computeGasteigerCharges(const ROMol *mol, int nIter, bool throwOnParamFailure) {
void computeGasteigerCharges(const ROMol &mol, std::vector<double> &charges,
int nIter, bool throwOnParamFailure) {
PRECONDITION(charges.size()>=mol.getNumAtoms(),"bad array size");
PeriodicTable *table = PeriodicTable::getTable();
GasteigerParams *params = GasteigerParams::getParams();
double damp = DAMP;
int natms = mol->getNumAtoms();
int natms = mol.getNumAtoms();
// space for parameters for each atom in the molecule
std::vector<DOUBLE_VECT> atmPs;
atmPs.reserve(natms);
// space for computed values
DOUBLE_VECT charges; // partial charges
charges.resize(natms, 0.0);
std::fill(charges.begin(),charges.end(),0.0);
DOUBLE_VECT hChrg; // total charge on the implicit hydrogen on each heavy atom
hChrg.resize(natms, 0.0);
@@ -114,7 +125,7 @@ namespace RDKit {
// now read in the parameters
ROMol::ConstAtomIterator ai;
for (ai = mol->beginAtoms(); ai != mol->endAtoms(); ai++) {
for (ai = mol.beginAtoms(); ai != mol.endAtoms(); ai++) {
std::string elem = table->getElementSymbol((*ai)->getAtomicNum());
std::string mode;
@@ -135,10 +146,10 @@ namespace RDKit {
} else if ((*ai)->getAtomicNum() == 16) {
// we have a sulfur atom with no hydribidation information
// check how many oxygens we have on the sulfer
boost::tie(nbrIdx,endIdx) = mol->getAtomNeighbors(*ai);
boost::tie(nbrIdx,endIdx) = mol.getAtomNeighbors(*ai);
int no = 0;
while (nbrIdx != endIdx) {
if (mol->getAtomWithIdx(*nbrIdx)->getAtomicNum() == 8){
if (mol.getAtomWithIdx(*nbrIdx)->getAtomicNum() == 8){
no++;
}
nbrIdx++;
@@ -189,7 +200,7 @@ namespace RDKit {
for (aix = 0; aix < natms; aix++) {
dq = 0.0;
boost::tie(nbrIdx,endIdx) = mol->getAtomNeighbors(mol->getAtomWithIdx(aix));
boost::tie(nbrIdx,endIdx) = mol.getAtomNeighbors(mol.getAtomWithIdx(aix));
while (nbrIdx != endIdx) {
dx = energ[*nbrIdx] - energ[aix];
if (dx < 0.0) {
@@ -202,7 +213,7 @@ namespace RDKit {
}
// now loop over the implicit hydrogens and get their contributions
// since hydrogens don't connect to anything else, update their charges at the same time
niHs = mol->getAtomWithIdx(aix)->getTotalNumHs();
niHs = mol.getAtomWithIdx(aix)->getTotalNumHs();
if (niHs > 0) {
qHs = hChrg[aix]/niHs;
enr = hParams[0] + qHs*(hParams[1] + hParams[2]*qHs);
@@ -229,9 +240,10 @@ namespace RDKit {
}
for (aix = 0; aix < natms; aix++) {
mol->getAtomWithIdx(aix)->setProp("_GasteigerCharge", charges[aix], true);
mol.getAtomWithIdx(aix)->setProp("_GasteigerCharge", charges[aix], true);
// set the implicit hydrogen charges
mol->getAtomWithIdx(aix)->setProp("_GasteigerHCharge", hChrg[aix], true);
mol.getAtomWithIdx(aix)->setProp("_GasteigerHCharge", hChrg[aix], true);
}
}
}

View File

@@ -1,5 +1,5 @@
//
// Copyright (C) 2003-2006 Rational Discovery LLC
// Copyright (C) 2003-2011 Rational Discovery LLC
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
@@ -10,10 +10,16 @@
#ifndef _RD_GASTEIGERCHARGES_H
#define _RD_GASTEIGERCHARGES_H
#include <vector>
namespace RDKit {
class ROMol;
void computeGasteigerCharges(const ROMol *mol, int nIter=12,
bool throwOnParamFailure=false);
void computeGasteigerCharges(const ROMol &mol, int nIter=12,
bool throwOnParamFailure=false);
void computeGasteigerCharges(const ROMol &mol,std::vector<double> &charges,
int nIter=12,bool throwOnParamFailure=false);
}
#endif

View File

@@ -108,7 +108,7 @@ def _pyLabuteHelper(mol,includeHs=1,force=0):
# original default bins from assuming Labute values are logs
# mrBins=[1.29, 1.82, 2.24, 2.45, 2.75, 3.05, 3.63]
mrBins=[1.29, 1.82, 2.24, 2.45, 2.75, 3.05, 3.63,3.8,4.0]
def SMR_VSA_(mol,bins=None,force=1):
def pySMR_VSA_(mol,bins=None,force=1):
""" *Internal Use Only*
"""
if not force:
@@ -135,13 +135,14 @@ def SMR_VSA_(mol,bins=None,force=1):
mol._smrVSA=ans
return ans
SMR_VSA_ = rdMolDescriptors.SMR_VSA_
#
# Original bins (from Labute paper) are:
# [-0.4,-0.2,0,0.1,0.15,0.2,0.25,0.3,0.4]
#
logpBins=[-0.4,-0.2,0,0.1,0.15,0.2,0.25,0.3,0.4,0.5,0.6]
def SlogP_VSA_(mol,bins=None,force=1):
def pySlogP_VSA_(mol,bins=None,force=1):
""" *Internal Use Only*
"""
if not force:
@@ -168,9 +169,10 @@ def SlogP_VSA_(mol,bins=None,force=1):
mol._slogpVSA=ans
return ans
SlogP_VSA_ = rdMolDescriptors.SlogP_VSA_
chgBins=[-.3,-.25,-.20,-.15,-.10,-.05,0,.05,.10,.15,.20,.25,.30]
def PEOE_VSA_(mol,bins=None,force=1):
def pyPEOE_VSA_(mol,bins=None,force=1):
""" *Internal Use Only*
"""
if not force:
@@ -210,6 +212,7 @@ def PEOE_VSA_(mol,bins=None,force=1):
mol._peoeVSA=ans
return ans
PEOE_VSA_=rdMolDescriptors.PEOE_VSA_
#-------------------------------------------------
# install the various VSA descriptors in the namespace
@@ -285,7 +288,7 @@ LabuteASA=lambda *x,**y:rdMolDescriptors.CalcLabuteASA(*x,**y)
LabuteASA.version=rdMolDescriptors._CalcLabuteASA_version
def _TPSAContribs(mol,verbose=False):
def _pyTPSAContribs(mol,verbose=False):
""" DEPRECATED: this has been reimplmented in C++
calculates atomic contributions to a molecules TPSA
@@ -396,7 +399,7 @@ def _TPSAContribs(mol,verbose=False):
res[atom.GetIdx()] = tmp
return res
def _TPSA(mol,verbose=False):
def _pyTPSA(mol,verbose=False):
""" DEPRECATED: this has been reimplmented in C++
calculates the polar surface area of a molecule based upon fragments
@@ -408,12 +411,12 @@ def _TPSA(mol,verbose=False):
Implementation based on the Daylight contrib program tpsa.c
"""
contribs = _TPSAContribs(mol,verbose=verbose)
contribs = _pyTPSAContribs(mol,verbose=verbose)
res = 0.0
for contrib in contribs:
res += contrib
return res
_TPSA.version="1.0.1"
_pyTPSA.version="1.0.1"
TPSA=lambda *x,**y:rdMolDescriptors.CalcTPSA(*x,**y)
TPSA.version=rdMolDescriptors._CalcTPSA_version