private static void addExtendedCisTransConfig(ExtendedCisTrans ect, GraphBuilder gb, Map<IAtom, Integer> indices, IAtomContainer container) { IAtom[] ends = ExtendedCisTrans.findTerminalAtoms(container, ect.getFocus()); IBond[] carriers = ect.getCarriers().toArray(new IBond[2]); if (ends != null) { Configuration.DoubleBond config; if (ect.getConfigOrder() == IStereoElement.TOGETHER) config = Configuration.DoubleBond.TOGETHER; else if (ect.getConfigOrder() == IStereoElement.OPPOSITE) config = Configuration.DoubleBond.OPPOSITE; else config = Configuration.DoubleBond.UNSPECIFIED; gb.extendedGeometric(indices.get(ends[0]), indices.get(ends[1])) .configure(indices.get(carriers[0].getOther(ends[0])), indices.get(carriers[1].getOther(ends[1])), config); } } }
@Test public void extendedExtendedTrans3() throws Exception { IAtomContainer mol = load("C/C=C=C=C/C"); for (IStereoElement se : mol.stereoElements()) { if (se instanceof ExtendedCisTrans) { ExtendedCisTrans ect = (ExtendedCisTrans) se; assertThat(ect.getConfigOrder(), is(IStereoElement.OPPOSITE)); assertThat(ect.getFocus(), is(mol.getBond(2))); assertThat(ect.getCarriers().get(0), is(mol.getBond(0))); assertThat(ect.getCarriers().get(1), is(mol.getBond(4))); } } }
} else if (se instanceof ExtendedCisTrans) { ExtendedCisTrans db = (ExtendedCisTrans) se; int config = db.getConfigOrder();
@Test public void extendedExtendedCis3() throws Exception { IAtomContainer mol = load("C/C=C=C=C\\C"); for (IStereoElement se : mol.stereoElements()) { if (se instanceof ExtendedCisTrans) { ExtendedCisTrans ect = (ExtendedCisTrans) se; assertThat(ect.getConfigOrder(), is(IStereoElement.TOGETHER)); assertThat(ect.getFocus(), is(mol.getBond(2))); assertThat(ect.getCarriers().get(0), is(mol.getBond(0))); assertThat(ect.getCarriers().get(1), is(mol.getBond(4))); } } }
@Test public void extendedExtendedCis5() throws Exception { IAtomContainer mol = load("C/C=C=C=C=C=C\\C"); for (IStereoElement se : mol.stereoElements()) { if (se instanceof ExtendedCisTrans) { ExtendedCisTrans ect = (ExtendedCisTrans) se; assertThat(ect.getConfigOrder(), is(IStereoElement.TOGETHER)); assertThat(ect.getFocus(), is(mol.getBond(3))); assertThat(ect.getCarriers().get(0), is(mol.getBond(0))); assertThat(ect.getCarriers().get(1), is(mol.getBond(6))); } } }
/** * (E)-hexa-2,3,4-triene * @cdk.smiles C/C=C=C=C/C */ @Test public void e_hexa234triene_3D() { IAtomContainer mol = new AtomContainer(); mol.addAtom(atom("C", 1, 0.29d, 0.01d, 0.02d)); mol.addAtom(atom("C", 0, -0.56d, -0.90d, 0.25d)); mol.addAtom(atom("C", 0, -1.37d, -1.75d, 0.46d)); mol.addAtom(atom("C", 1, -2.24d, -2.65d, 0.67d)); mol.addAtom(atom("C", 3, -3.66d, -2.36d, 0.68d)); mol.addAtom(atom("C", 3, 1.69d, -0.32d, -0.11d)); mol.addBond(0,1,IBond.Order.DOUBLE); mol.addBond(1,2,IBond.Order.DOUBLE); mol.addBond(2,3,IBond.Order.DOUBLE); mol.addBond(3,4,IBond.Order.SINGLE); mol.addBond(0,5,IBond.Order.SINGLE); StereoElementFactory factory = StereoElementFactory.using3DCoordinates(mol); List<IBond> dbs = new ArrayList<>(); dbs.add(mol.getBond(0)); dbs.add(mol.getBond(1)); dbs.add(mol.getBond(2)); ExtendedCisTrans element = factory.createExtendedCisTrans(dbs, Stereocenters.of(mol)); assertNotNull(element); assertThat(element.getConfigOrder(), is(IStereoElement.OPPOSITE)); }
/** * (Z)-hexa-2,3,4-triene * @cdk.smiles C/C=C=C=C\C */ @Test public void z_hexa234triene() { IAtomContainer mol = new AtomContainer(); mol.addAtom(atom("C", 1, 2.48d, 0.00d)); mol.addAtom(atom("C", 0, 1.65d, 0.00d)); mol.addAtom(atom("C", 0, 0.83d, 0.00d)); mol.addAtom(atom("C", 1, 0.00d, 0.00d)); mol.addAtom(atom("C", 3, -0.41d, -0.71d)); mol.addAtom(atom("C", 3, 2.92d, -0.69d)); mol.addBond(0,1,IBond.Order.DOUBLE); mol.addBond(1,2,IBond.Order.DOUBLE); mol.addBond(2,3,IBond.Order.DOUBLE); mol.addBond(3,4,IBond.Order.SINGLE); mol.addBond(0,5,IBond.Order.SINGLE); StereoElementFactory factory = StereoElementFactory.using2DCoordinates(mol); List<IBond> dbs = new ArrayList<>(); dbs.add(mol.getBond(0)); dbs.add(mol.getBond(1)); dbs.add(mol.getBond(2)); ExtendedCisTrans element = factory.createExtendedCisTrans(dbs, Stereocenters.of(mol)); assertNotNull(element); assertThat(element.getConfigOrder(), is(IStereoElement.TOGETHER)); }
/** * (E)-hexa-2,3,4-triene * @cdk.smiles C/C=C=C=C/C */ @Test public void e_hexa234triene() { IAtomContainer mol = new AtomContainer(); mol.addAtom(atom("C", 1, 2.48d, 0.00d)); mol.addAtom(atom("C", 0, 1.65d, 0.00d)); mol.addAtom(atom("C", 0, 0.83d, 0.00d)); mol.addAtom(atom("C", 1, 0.00d, 0.00d)); mol.addAtom(atom("C", 3, -0.41d, -0.71d)); mol.addAtom(atom("C", 3, 2.89d, 0.71d)); mol.addBond(0,1,IBond.Order.DOUBLE); mol.addBond(1,2,IBond.Order.DOUBLE); mol.addBond(2,3,IBond.Order.DOUBLE); mol.addBond(3,4,IBond.Order.SINGLE); mol.addBond(0,5,IBond.Order.SINGLE); StereoElementFactory factory = StereoElementFactory.using2DCoordinates(mol); List<IBond> dbs = new ArrayList<>(); dbs.add(mol.getBond(0)); dbs.add(mol.getBond(1)); dbs.add(mol.getBond(2)); ExtendedCisTrans element = factory.createExtendedCisTrans(dbs, Stereocenters.of(mol)); assertNotNull(element); assertThat(element.getConfigOrder(), is(IStereoElement.OPPOSITE)); }
/** * (Z)-hexa-2,3,4-triene * @cdk.smiles C/C=C=C=C\C */ @Test public void z_hexa234triene_3D() { IAtomContainer mol = new AtomContainer(); mol.addAtom(atom("C", 1, -0.09d, -0.45d, -1.07d)); mol.addAtom(atom("C", 0, -0.67d, -1.04d, -0.11d)); mol.addAtom(atom("C", 0, -1.23d, -1.59d, 0.79d)); mol.addAtom(atom("C", 1, -1.84d, -2.17d, 1.74d)); mol.addAtom(atom("C", 3, -3.13d, -1.73d, 2.21d)); mol.addAtom(atom("C", 3, -0.70d, 0.69d, -1.73d)); mol.addBond(0,1,IBond.Order.DOUBLE); mol.addBond(1,2,IBond.Order.DOUBLE); mol.addBond(2,3,IBond.Order.DOUBLE); mol.addBond(3,4,IBond.Order.SINGLE); mol.addBond(0,5,IBond.Order.SINGLE); StereoElementFactory factory = StereoElementFactory.using3DCoordinates(mol); List<IBond> dbs = new ArrayList<>(); dbs.add(mol.getBond(0)); dbs.add(mol.getBond(1)); dbs.add(mol.getBond(2)); ExtendedCisTrans element = factory.createExtendedCisTrans(dbs, Stereocenters.of(mol)); assertNotNull(element); assertThat(element.getConfigOrder(), is(IStereoElement.TOGETHER)); }