if (centers.elementType(w) == Stereocenters.Type.Tricoordinate && centers.isStereocenter(w) && !isInSmallRing(bond, 7)) { IStereoElement element = createGeometric(v, w, centers); if (element != null) elements.add(element);
@Test public void e_but2ene() { IAtomContainer m = new AtomContainer(4, 3, 0, 0); m.addAtom(atom("C", 1, -2.19d, 1.64d)); m.addAtom(atom("C", 1, -1.36d, 1.64d)); m.addAtom(atom("C", 3, -2.60d, 0.92d)); m.addAtom(atom("C", 3, -0.95d, 2.35d)); m.addBond(0, 1, IBond.Order.DOUBLE); m.addBond(0, 2, IBond.Order.SINGLE); m.addBond(1, 3, IBond.Order.SINGLE); StereoElementFactory factory = StereoElementFactory.using2DCoordinates(m); IDoubleBondStereochemistry element = factory.createGeometric(m.getBond(0), null); assertNotNull(element); assertThat(element.getStereo(), is(OPPOSITE)); }
@Test public void e_but2ene_3d() { IAtomContainer m = new AtomContainer(4, 3, 0, 0); m.addAtom(atom("C", 1, -0.19d, 0.09d, -0.27d)); m.addAtom(atom("C", 1, 0.22d, -1.15d, 0.05d)); m.addAtom(atom("C", 3, 0.21d, 0.75d, -1.49d)); m.addAtom(atom("C", 3, -0.17d, -1.82d, 1.27d)); m.addBond(0, 1, IBond.Order.DOUBLE); m.addBond(0, 2, IBond.Order.SINGLE); m.addBond(1, 3, IBond.Order.SINGLE); StereoElementFactory factory = StereoElementFactory.using3DCoordinates(m); IDoubleBondStereochemistry element = factory.createGeometric(m.getBond(0), null); assertNotNull(element); assertThat(element.getStereo(), is(OPPOSITE)); }
@Test public void z_but2ene_3d() { IAtomContainer m = new AtomContainer(4, 3, 0, 0); m.addAtom(atom("C", 1, 0.05d, -1.28d, 0.13d)); m.addAtom(atom("C", 1, -0.72d, -0.58d, -0.72d)); m.addAtom(atom("C", 3, 1.11d, -0.74d, 0.95d)); m.addAtom(atom("C", 3, -0.65d, 0.85d, -0.94d)); m.addBond(0, 1, IBond.Order.DOUBLE); m.addBond(0, 2, IBond.Order.SINGLE); m.addBond(1, 3, IBond.Order.SINGLE); StereoElementFactory factory = StereoElementFactory.using3DCoordinates(m); IDoubleBondStereochemistry element = factory.createGeometric(m.getBond(0), null); assertNotNull(element); assertThat(element.getStereo(), is(TOGETHER)); }
@Test public void z_but2ene() { IAtomContainer m = new AtomContainer(4, 3, 0, 0); m.addAtom(atom("C", 3, -2.46d, 1.99d)); m.addAtom(atom("C", 1, -1.74d, 0.68d)); m.addAtom(atom("C", 1, -0.24d, 0.65d)); m.addAtom(atom("C", 3, 0.54d, 1.94d)); m.addBond(0, 1, IBond.Order.SINGLE); m.addBond(1, 2, IBond.Order.DOUBLE); m.addBond(2, 3, IBond.Order.SINGLE); StereoElementFactory factory = StereoElementFactory.using2DCoordinates(m); IDoubleBondStereochemistry element = factory.createGeometric(m.getBond(1), null); assertNotNull(element); assertThat(element.getStereo(), is(TOGETHER)); }
@Test public void unspec_but2ene_byCoordinates() { IAtomContainer m = new AtomContainer(4, 3, 0, 0); m.addAtom(atom("C", 1, -1.37d, 1.64d)); m.addAtom(atom("C", 1, -2.19d, 1.63d)); m.addAtom(atom("C", 3, -2.59d, 0.90d)); m.addAtom(atom("C", 3, -0.52d, 1.73d)); m.addBond(0, 1, IBond.Order.DOUBLE); m.addBond(1, 2, IBond.Order.SINGLE); m.addBond(0, 3, IBond.Order.SINGLE); StereoElementFactory factory = StereoElementFactory.using2DCoordinates(m); IDoubleBondStereochemistry element = factory.createGeometric(m.getBond(0), null); assertNull(element); }
@Test public void unspec_but2ene_wavyBond() { IAtomContainer m = new AtomContainer(4, 3, 0, 0); m.addAtom(atom("C", 1, -1.27d, 1.48d)); m.addAtom(atom("C", 1, -2.10d, 1.46d)); m.addAtom(atom("C", 3, -2.50d, 0.74d)); m.addAtom(atom("C", 3, -0.87d, 2.20d)); m.addBond(0, 1, IBond.Order.DOUBLE); m.addBond(1, 2, IBond.Order.SINGLE); m.addBond(0, 3, IBond.Order.SINGLE, IBond.Stereo.UP_OR_DOWN); StereoElementFactory factory = StereoElementFactory.using2DCoordinates(m); IDoubleBondStereochemistry element = factory.createGeometric(m.getBond(0), null); assertNull(element); }
@Test public void unspec_but2ene_crossBond() { IAtomContainer m = new AtomContainer(4, 3, 0, 0); m.addAtom(atom("C", 1, -1.27d, 1.48d)); m.addAtom(atom("C", 1, -2.10d, 1.46d)); m.addAtom(atom("C", 3, -2.50d, 0.74d)); m.addAtom(atom("C", 3, -0.87d, 2.20d)); m.addBond(0, 1, IBond.Order.DOUBLE, IBond.Stereo.E_OR_Z); m.addBond(1, 2, IBond.Order.SINGLE); m.addBond(0, 3, IBond.Order.SINGLE); StereoElementFactory factory = StereoElementFactory.using2DCoordinates(m); IDoubleBondStereochemistry element = factory.createGeometric(m.getBond(0), null); assertNull(element); }