コード例 #1
0
        public IAtomContainer Reconstruct(string signature)
        {
            ColoredTree tree = AbstractVertexSignature.Parse(signature);
            MoleculeFromSignatureBuilder builder = new MoleculeFromSignatureBuilder(CDK.Builder);

            builder.MakeFromColoredTree(tree);
            return(builder.GetAtomContainer());
        }
コード例 #2
0
        // 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());
            }
        }