/** * The central atom in the cumulated system. * * @return the focus */ public IAtom focus() { return getFocus(); }
/** * The central atom in the cumulated system. * * @return the focus */ public IAtom focus() { return getFocus(); }
/** * Helper method to locate two terminal atoms in a container for this * extended tetrahedral element. The atoms are ordered such that the first * index is attached to the first two peripheral atoms and the second index * is attached to the second two peripheral atoms. * * @param container structure representation * @return the terminal atoms (ordered) */ public IAtom[] findTerminalAtoms(IAtomContainer container) { IAtom[] atoms = findTerminalAtoms(container, getFocus()); List<IAtom> carriers = getCarriers(); if (container.getBond(atoms[0], carriers.get(2)) != null || container.getBond(atoms[0], carriers.get(3)) != null) { IAtom tmp = atoms[0]; atoms[0] = atoms[1]; atoms[1] = tmp; } return atoms; }
/** * Helper method to locate two terminal atoms in a container for this * extended tetrahedral element. The atoms are ordered such that the first * index is attached to the first two peripheral atoms and the second index * is attached to the second two peripheral atoms. * * @param container structure representation * @return the terminal atoms (ordered) */ public IAtom[] findTerminalAtoms(IAtomContainer container) { IAtom[] atoms = findTerminalAtoms(container, getFocus()); List<IAtom> carriers = getCarriers(); if (container.getBond(atoms[0], carriers.get(2)) != null || container.getBond(atoms[0], carriers.get(3)) != null) { IAtom tmp = atoms[0]; atoms[0] = atoms[1]; atoms[1] = tmp; } return atoms; }
ExtendedTetrahedral tc = (ExtendedTetrahedral) stereo; IAtom focus = tc.getFocus(); IAtom[] carriers = tc.getCarriers().toArray(new IAtom[4]); IAtom[] ends = ExtendedTetrahedral.findTerminalAtoms(atomContainer, focus);
IAtom focus = tc.getFocus(); IAtom[] carriers = tc.getCarriers().toArray(new IAtom[4]); IAtom[] ends = ExtendedTetrahedral.findTerminalAtoms(org, focus);
@Test public void extendedTetrahedral7() throws InvalidSmilesException { IAtomContainer mol = load("CC=C=C=[C@]=C=C=CC"); for (IStereoElement se : mol.stereoElements()) { if (se instanceof ExtendedTetrahedral) { ExtendedTetrahedral et = (ExtendedTetrahedral) se; assertThat(et.getConfigOrder(), is(IStereoElement.LEFT)); assertThat(et.getFocus(), is(mol.getAtom(4))); assertThat(et.getCarriers().toArray(new IAtom[4]), is(new IAtom[]{ mol.getAtom(0), mol.getAtom(1), mol.getAtom(7), mol.getAtom(8) })); } } }