Skip to content

Commit 596258a

Browse files
egonwrajarshi
authored andcommitted
The Bioclipse test case of failing bond order assignment
Change-Id: I86f9bc709bfd3b3e1a3b816914e2dc32bbad6df0 Signed-off-by: Rajarshi Guha <rajarshi.guha@gmail.com>
1 parent d9c147d commit 596258a

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

src/test/org/openscience/cdk/smiles/DeduceBondSystemToolTest.java

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,32 @@ public void testLargeRingSystem() throws Exception {
103103
}
104104
Assert.assertEquals(13, doubleBondCount);
105105
}
106-
106+
107+
/**
108+
* @cdk.bug 3506770
109+
*/
110+
@Test
111+
public void testLargeBioclipseUseCase() throws Exception {
112+
String smiles = "COc1ccc2[C@@H]3[C@H](COc2c1)C(C)(C)OC4=C3C(=O)C(=O)C5=C4OC(C)(C)[C@@H]6COc7cc(OC)ccc7[C@H]56";
113+
SmilesParser smilesParser = new SmilesParser(DefaultChemObjectBuilder.getInstance());
114+
IMolecule molecule = smilesParser.parseSmiles(smiles);
115+
116+
DeduceBondSystemTool dbst = new DeduceBondSystemTool(new AllRingsFinder());
117+
molecule = dbst.fixAromaticBondOrders(molecule);
118+
Assert.assertNotNull(molecule);
119+
120+
molecule = (IMolecule) AtomContainerManipulator.removeHydrogens(molecule);
121+
Assert.assertEquals(40, molecule.getAtomCount());
122+
123+
// we should have 14 double bonds
124+
int doubleBondCount = 0;
125+
for (int i = 0; i < molecule.getBondCount(); i++) {
126+
IBond bond = molecule.getBond(i);
127+
if (bond.getOrder() == Order.DOUBLE) doubleBondCount++;
128+
}
129+
Assert.assertEquals(10, doubleBondCount);
130+
}
131+
107132
@Test(timeout=1000)
108133
public void testPyrrole_CustomRingFinder() throws Exception {
109134
String smiles = "c2ccc3n([H])c1ccccc1c3(c2)";

0 commit comments

Comments
 (0)