Hi,

"Egon Willighagen" <[EMAIL PROTECTED]> wrote:

> On Feb 8, 2008 1:46 PM, Nina Jeliazkova <[EMAIL PROTECTED]> wrote:
> > My experience with the latest code says that if you parse an aromatic
> > smiles (as below), all the aromatic bonds will correctly have aromatic
> > flag turned on, but the bond order will be single everywhere. This
> > causes lot of confusion for further processing, and could be the reason
> > inchi is not generated.
> 
> If this is indeed the problem, please try the use of the
DeduceBondSystemTool:
> 
>
http://cheminfo.informatics.indiana.edu/~rguha/code/java/nightly/api/org/openscience/cdk/smiles/DeduceBondSystemTool.html
> 
> ... to create a kekule representation.

Actually, I can't get it working.
Even for benzene, all the bonds stay single after using DeduceBondSystemTool. 

public void testDeduceBondOrders() throws Exception  {
        SmilesParser p = new
SmilesParser(DefaultChemObjectBuilder.getInstance());
        IMolecule m = p.parseSmiles("c1ccccc1");
        boolean b = CDKHueckelAromaticityDetector.detectAromaticity(m);
        assertTrue(b);
        DeduceBondSystemTool dbst = new DeduceBondSystemTool();
        IMolecule m1 = dbst.fixAromaticBondOrders(m);
        int single_bonds = 0;
        int double_bonds = 0;
        int aromatic_bonds = 0;
        for (int i=0; i<m1.getBondCount();i++) {
            
            Order o = m1.getBond(i).getOrder();
            if (o.equals(Order.DOUBLE)) double_bonds++;
            if (o.equals(Order.SINGLE)) single_bonds++;
            if (m1.getBond(i).getFlag(CDKConstants.ISAROMATIC))
                aromatic_bonds++;
        }
        assertEquals(6,aromatic_bonds);
        assertEquals(3,single_bonds);
        assertEquals(3,double_bonds);
        
    }

Do this work for others and I am misusing the code somehow?

Regards,
Nina

> 
> Egon





-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to