Pranav Thakur wrote:
> I would like to know how I can use OpenBabelGUI to calculate all the 
> atoms count of a SMILES and number of single bond, double bond and 
> triple bond present.

> I want output to be something like this:
> Number of triple bonds = 3
> Number of double bonds= 2
> Number of rings =1

Sorry not to reply earlier.

The GUI does not provide this straight out of the box, but can be 
extended as shown below, which may also be useful for more complicated 
queries. For flexibility and beautiful formatting you would need to 
use scripting - see, for instance, http://openbabel.org/wiki/Python.

Paste the following text into the file plugindefines.txt:

SmartsDescriptor
sbonds
*-*
Number of single bonds

SmartsDescriptor
dbonds
*=*
Number of double bonds

#SmartsDescriptor
#tbonds
#*#*
#Number of triple bonds

SmartsDescriptor
abonds
*:*
Number of aromatic bonds

SmartsDescriptor
bonds
*~*
Number of bonds\n
Add or remove hydrogens to count total or bonds between heavy atoms

SmartsDescriptor
atoms
*
Number of atoms\n
Add or remove hydrogens to count total or heavy atoms


When the GUI is restarted the descriptors sbond, dbonds, etc. will be 
available (see them listed in the menu item Plugins).

In the option "Appends properties or descriptors in list to title" 
enter, for instance:

sbonds dbonds

On doing a SMILES to SMILES conversion with "Add hydrogens(make 
explicit)" checked the numbers of bonds will appear after the title, e.g.

CC=C    propene 7 1

Additionally, entering _Number single,double bonds=  into the "Append 
to title" box gives
CC=C    propene_Number single,double bonds= 7 1

There is a bug which prevents triple bonds being counted, so the 
descriptor for it is commented out above. (Which also illustrates what 
the bug is!) The development code is corrected.




------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to