CorrectGeometricConfiguration { public static IAtomContainer correct(IAtomContainer container) { if (!Iterables.isEmpty(container.stereoElements())) new CorrectGeometricConfiguration(container); return container; } CorrectGeometricConfiguration(IAtomContainer container);   CorrectGeometricConfiguration(IAtomContainer container, int[][] graph); static IAtomContainer correct(IAtomContainer container);  }
@Test public void cis() { IAtomContainer m = new AtomContainer(5, 4, 0, 0); m.addAtom(atom("C", 3, -0.74d, 5.00d)); m.addAtom(atom("C", 1, -1.49d, 3.70d)); m.addAtom(atom("C", 1, -0.74d, 2.40d)); m.addAtom(atom("C", 2, -1.49d, 1.10d)); m.addAtom(atom("C", 3, -0.74d, -0.20d)); m.addBond(0, 1, IBond.Order.SINGLE); m.addBond(1, 2, IBond.Order.DOUBLE); m.addBond(2, 3, IBond.Order.SINGLE); m.addBond(3, 4, IBond.Order.SINGLE); m.addStereoElement(new DoubleBondStereochemistry(m.getBond(1), new IBond[]{m.getBond(0), m.getBond(2)}, TOGETHER)); CorrectGeometricConfiguration.correct(m); assertPoint(m.getAtom(0), -0.74, 5.0, 0.1); assertPoint(m.getAtom(1), -1.49, 3.7, 0.1); assertPoint(m.getAtom(2), -0.74, 2.4, 0.1); assertPoint(m.getAtom(3), 0.76, 2.4, 0.1); assertPoint(m.getAtom(4), 1.51, 1.10, 0.1); }
@Test public void trans() { IAtomContainer m = new AtomContainer(5, 4, 0, 0); m.addAtom(atom("C", 3, -0.74d, 5.00d)); m.addAtom(atom("C", 1, -1.49d, 3.70d)); m.addAtom(atom("C", 1, -0.74d, 2.40d)); m.addAtom(atom("C", 2, 0.76d, 2.40d)); m.addAtom(atom("C", 3, 1.51d, 1.10d)); m.addBond(0, 1, IBond.Order.SINGLE); m.addBond(1, 2, IBond.Order.DOUBLE); m.addBond(2, 3, IBond.Order.SINGLE); m.addBond(3, 4, IBond.Order.SINGLE); m.addStereoElement(new DoubleBondStereochemistry(m.getBond(1), new IBond[]{m.getBond(0), m.getBond(2)}, OPPOSITE)); CorrectGeometricConfiguration.correct(m); assertPoint(m.getAtom(0), -0.74, 5.0, 0.1); assertPoint(m.getAtom(1), -1.49, 3.7, 0.1); assertPoint(m.getAtom(2), -0.74d, 2.40d, 0.1); assertPoint(m.getAtom(3), -1.49d, 1.10d, 0.1); assertPoint(m.getAtom(4), -0.74d, -0.20d, 0.1); }