Hi Egon

Wrt 2.below - You are not doing anything wrong!  I had forgotten that I put an 
optional clean-up step into the Smiles
parsing code (using the Smiles parser/Smiles creator) before the molecule is 
passed to the dbst.
FixAromaticBondOrders routine.  This means that the actual Smiles which gets 
passed on to generate 13 double bonds (4 x 3 + 1) is:

"O=C1Oc6ccccc6(C(O)C1C5c2ccccc2CC(c3ccc(cc3)c4ccccc4)C5)"

ie the pyranone ring is no longer marked as aromatic and the algorithm is happy 
to kekulise the four aromatic rings remaining.

If I pass the original Smiles: 
"Oc1c(C2CC(Cc3ccccc23)c4ccc(cc4)c5ccccc5)c(=O)oc6ccccc16" I get the same result 
as you do..
..and this is actually what should happen - every combination of double bonds 
which gets tried is rejected because of
the 'illegal' pyranone ring and so the original molecule with 1 double bond is 
returned - the same result as I believe the original
algorithm would have given if it hadn't timed out first (but < 1 sec vs > 100 
sec).  Sorry for the confusion.
Incidentally, there would be a performance advantage if the isStructureOK 
routine was modified to only check the
local interconnected ring group rather than the complete structure (even 
better, as stated before, if it just checked the local
double bond layout instead of perceived aromaticity). Btw - fun to try your 
code (either with the modified algorithm or the
original CDK version) on the Smiles for Acridine: "c1c2ccccc2nc3c1cccc3".  It 
usually returns 7 double bonds but, occasionally (1 in 30+ occasions),
it only returns 6 as discussed previously.

Kevin

-----Original Message-----
From: Egon Willighagen [mailto:[email protected]]
Sent: 16 March 2012 06:25
To: Lawson Kevin GBJH
Cc: [email protected]
Subject: Re: [Cdk-user] Deduce Bond System Tool


>> 2. The present algorithm's aromaticity test is not sufficient to demonstrate 
>> a molecule has all the double bonds layed out correctly

> I have added in that git branch a unit test, but I am only getting one
double bond...



> Kevin, what am I doing wrong?

+       @Test
+    public void testLargeRingSystem() throws Exception {
+        String smiles =
"Oc1c(C2CC(Cc3ccccc23)c4ccc(cc4)c5ccccc5)c(=O)oc6ccccc16";
+        SmilesParser smilesParser = new
SmilesParser(DefaultChemObjectBuilder.getInstance());
+        IMolecule molecule = smilesParser.parseSmiles(smiles);
+
+        DeduceBondSystemTool dbst = new DeduceBondSystemTool(new
AllRingsFinder());
+        molecule = dbst.fixAromaticBondOrders(molecule);
+        Assert.assertNotNull(molecule);
+
+        molecule = (IMolecule)
AtomContainerManipulator.removeHydrogens(molecule);
+        Assert.assertEquals(34, molecule.getAtomCount());
+
+        // we should have 14 double bonds
+        int doubleBondCount = 0;
+        for (int i = 0; i < molecule.getBondCount(); i++) {
+            IBond bond = molecule.getBond(i);
+            if (bond.getOrder() == Order.DOUBLE) doubleBondCount++;
+        }
+        Assert.assertEquals(14, doubleBondCount);
+    }

Egon




Syngenta Limited, Registered in England No 2710846
Registered Office : Syngenta Limited, European Regional Centre, Priestley Road, 
Surrey Research Park, Guildford, Surrey, GU2 7YH, United Kingdom



This message may contain confidential information. If you are not the 
designated recipient, please notify the sender immediately, and delete the 
original and any copies. Any use of the message by you is prohibited. 


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to