Menu

#970 OBBond.IsEster(): mis-identification of carboxylic acids

2.3.x
open
nobody
2
2015-12-11
2015-12-11
No

I just found a possible bug in the identification of ester bonds.
Basically, the method OBBond.IsEster() returns true with

HOW TO REPRODUCE IT:

$ cat> testester.py << EOF
import pybel
ob = pybel.ob
smi = [ 'OC(=O)', 'CC(O)=O', 'O=C(O)c1ccccc1']
for s in smi:
    mol = pybel.readstring('smi',s).OBMol
    for b in ob.OBMolBondIter(mol):
        if b.IsEster():
            print "FOUND ESTER BOND"
 ^D
 $ python testester.py
 FOUND ESTER BOND

The test is positive with formic, acetic and benzoic acid, and it doesn't seem to be affected by the input format (I've tested Mol2).

Discussion

MongoDB Logo MongoDB