public IAtomContainer Reconstruct(string signature) { ColoredTree tree = AbstractVertexSignature.Parse(signature); MoleculeFromSignatureBuilder builder = new MoleculeFromSignatureBuilder(CDK.Builder); builder.MakeFromColoredTree(tree); return(builder.GetAtomContainer()); }
// XXX DOES NOT YET WORK - reconstructed graph may be isomorphic, // but not automorphic public void Reconstruct(SimpleGraph graph) { SimpleGraphSignature signature = new SimpleGraphSignature(graph); foreach (var symmetryClass in signature.GetSymmetryClasses()) { string signatureString = symmetryClass.GetSignatureString(); ColoredTree tree = AbstractVertexSignature.Parse(signatureString); SimpleGraphBuilder builder = new SimpleGraphBuilder(); SimpleGraph reconstruction = builder.FromTree(tree); Assert.AreEqual(reconstruction.ToString(), graph.ToString()); } }