Vinay M wrote:
> Could anyone help to me find the calculations of Hydrogen Bond acceptor
> and Donor By Babel.
They are done by SMARTS. The following is from src/smartsdescriptors.cpp:
SmartsDescriptor theHBD("HBD", "[!#6;!H0]","Number of Hydrogen Bond
Donors (JoelLib)");
SmartsDescriptor theHBA1("HBA1",
"[$([!#6;+0]);!$([F,Cl,Br,I]);!$([o,s,nX3]);!$([Nv5,Pv5,Sv4,Sv6])]",
"Number of Hydrogen Bond Acceptors 1 (JoelLib)\n"
"\t Identification of Biological Activity Profiles Using
Substructural\n"
"\t Analysis and Genetic Algorithms -- Gillet, Willett and
Bradshaw,\n"
"\t U. of Sheffield and Glaxo Wellcome.\n"
"\t Presented at Random & Rational: Drug Discovery via Rational
Design\n"
"\t and Combinitorial Chemistry, Strategic Research Institute,
Princeton\n"
"\t NJ, Sept. 1995" );
SmartsDescriptor theHBA2("HBA2",
"[$([$([#8,#16]);!$(*=N~O);!$(*~N=O);X1,X2]),$([#7;v3;!$([nH]);!$(*(-a)-a)])]",
"Number of Hydrogen Bond Acceptors 2 (JoelLib)");
To access a descriptor from the commandline use something like:
babel infile.xxx -osmi --append HBD
which adds the result to the title. Or to add as a property in an sdf
or cml file:
babel infile.xxx outfile.sdf --add "HBD HBA1"
which shows that how to use multiple descriptors.
To use from C++:
OBMol* pmol;
OBDescriptor* pDesc = OBDescriptor::FindType("HBD");
if(pDesc) {
double value= pDesc->Predict(pmol);
}
//or to get a string value
std::string sresult;
pDesc->GetStringValue(pmol, sresult);
The code will look similar when using a scripting interface.
Smarts descriptors like the above can be made without having to
compile code, see data/plugindefines.txt. We could do with some more.
Chris
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
OpenBabel-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss