private IStereoElement newExtendedTetrahedral(int u, Graph g, IAtom[] atoms) { int[] terminals = findExtendedTetrahedralEnds(g, u); int[] xs = new int[]{-1, terminals[0], -1, terminals[1]}; int n = 0; for (Edge e : g.edges(terminals[0])) { if (e.bond().order() == 1) xs[n++] = e.other(terminals[0]); } n = 2; for (Edge e : g.edges(terminals[1])) { if (e.bond().order() == 1) xs[n++] = e.other(terminals[1]); } Arrays.sort(xs); Stereo stereo = g.configurationOf(u).shorthand() == Configuration.CLOCKWISE ? Stereo.CLOCKWISE : Stereo.ANTI_CLOCKWISE; return new org.openscience.cdk.stereo.ExtendedTetrahedral(atoms[u], new IAtom[]{atoms[xs[0]], atoms[xs[1]], atoms[xs[2]], atoms[xs[3]]}, stereo); }
private Atom reducedAtom(Graph g, int u) { Atom a = g.atom(u); int sum = 0; for (Edge e : g.edges(u)) { sum += e.bond().order(); } return ToSubsetAtoms.toSubset(g.atom(u), g, u); }
if (v == p) continue; if (e.bond().order() == 2 && hasAdjDirectionalLabels(g, e)) {
boolean safeToClean(Graph g, int v, Map<Edge,Edge> replacements) { final int d = g.degree(v); for (int j = 0; j < d; ++j) { final Edge e = g.edgeAt(v, j); if (e.bond().order() == 2) { int w = e.other(v); final int d2 = g.degree(w); for (int j2 = 0; j2 < d2; ++j2) { final Edge f = g.edgeAt(w, j2); if (isDirectional(f, replacements)) return false; } } } return true; }
private Atom asBracketAtom(int u, Graph g) { Atom a = g.atom(u); int sum = a.aromatic() ? 1 : 0; for (Edge e : g.edges(u)) { sum += e.bond().order(); } return new AtomImpl.BracketAtom(-1, a.element(), a.aromatic() ? a.element().aromaticImplicitHydrogens(sum) : a.element().implicitHydrogens(sum), 0, 0, a.aromatic()); }