/** * Reverse the atom order of the provided chemical graph. * * @param g chemical graph * @return a copy of the original graph with the order of the atoms * reversed */ public static Graph reverse(Graph g) { return g.permute(reverse(g.order())); }
/** * Randomise the atom order of the provided chemical graph. * * @param g chemical graph * @return a copy of the original graph with the order of the atoms * randomised */ public static Graph randomise(Graph g) { return g.permute(random(g.order())); }
for (int i = 0; i < is.length; i++) p[is[i]] = i; return g.permute(p);
/** * * @param ac * @return * @throws CDKException * @throws IOException */ public static String create(IAtomContainer ac) throws CDKException, IOException { EdgeToBondMap bonds = withSpaceFor(ac); int[][] graph = toAdjList(ac, bonds); long[] labels = label(ac, graph, betterInvariants(ac, graph, bonds)); Graph g = CDK2BEAM.toBeamGraph(ac); g = g.permute(toPermutation(labels)); g = g.resonate(); // ensure consistent Kekule form return g.toSmiles(); }
g = g.permute(labels);