/** * Normalize the configuration to the lowest configuration order (1) - * the axis goes from the first to last carrier, the three middle carriers * are anti-clockwise looking from the first carrier. * @return the normalized configuration */ public TrigonalBipyramidal normalize() { int cfg = getConfigOrder(); if (cfg == 1) return this; IAtom[] carriers = invapply(getCarriers().toArray(new IAtom[5]), PERMUTATIONS[cfg-1]); return new TrigonalBipyramidal(getFocus(), carriers, 1); }
/** * Normalize the configuration to the lowest configuration order (1) - * the axis goes from the first to last carrier, the three middle carriers * are anti-clockwise looking from the first carrier. * @return the normalized configuration */ public TrigonalBipyramidal normalize() { int cfg = getConfigOrder(); if (cfg == 1) return this; IAtom[] carriers = invapply(getCarriers().toArray(new IAtom[5]), PERMUTATIONS[cfg-1]); return new TrigonalBipyramidal(getFocus(), carriers, 1); }
private void modifyAndLabel(TrigonalBipyramidal se) { List<IAtom> atoms = se.normalize().getCarriers(); List<IBond> bonds = new ArrayList<>(4); double blen = 0;
private void modifyAndLabel(TrigonalBipyramidal se) { List<IAtom> atoms = se.normalize().getCarriers(); List<IBond> bonds = new ArrayList<>(4); double blen = 0;
@Test public void normalize() throws InvalidSmilesException { SmilesParser smipar = new SmilesParser(SilentChemObjectBuilder.getInstance()); IAtomContainer mol = smipar.parseSmiles("C[As@TB3](Cl)(Cl)(C)Cl"); Iterator<IStereoElement> ses = mol.stereoElements().iterator(); assertTrue(ses.hasNext()); IStereoElement se = ses.next(); assertThat(se, instanceOf(TrigonalBipyramidal.class)); assertThat(se.getConfigOrder(), is(3)); TrigonalBipyramidal tb = (TrigonalBipyramidal) se; TrigonalBipyramidal tbNorm = tb.normalize(); assertThat(tbNorm.getCarriers(), is(Arrays.asList( mol.getAtom(0), mol.getAtom(2), mol.getAtom(3), mol.getAtom(5), mol.getAtom(4) ))); }