示例#1
0
        public void PhenolLabelling()
        {
            var m = Smi("OC1=CC=CC=C1");

            long[] labels = Canon.Label(m, GraphUtil.ToAdjList(m));
            Assert.IsTrue(Compares.AreEqual(new long[] { 1, 7, 5, 3, 2, 4, 6 }, labels));
        }
示例#2
0
        public void CanonicallyLabelEthaneWithInConsistentHydrogenRepresentation2()
        {
            var m      = Smi("CC([H])([H])");
            var labels = Canon.Label(m, GraphUtil.ToAdjList(m));

            Assert.IsTrue(Compares.AreEqual(new long[] { 3, 4, 1, 2 }, labels));
        }
示例#3
0
        public void CanonicallyLabelCaffeineWithExplicitHydrogenRepresentation()
        {
            var m      = Smi("[H]C1=NC2=C(N1C([H])([H])[H])C(=O)N(C(=O)N2C([H])([H])[H])C([H])([H])[H]");
            var labels = Canon.Label(m, GraphUtil.ToAdjList(m));

            Assert.IsTrue(Compares.AreEqual(
                              new long[] { 1, 14, 13, 16, 18, 19, 22, 2, 3, 4, 15, 11, 20, 17, 12, 21, 24, 8, 9, 10, 23, 5, 6, 7 },
                              labels));
        }
示例#4
0
        public void Main()
        {
            #region
            IAtomContainer m = TestMoleculeFactory.MakeAlphaPinene();
            int[][]        g = GraphUtil.ToAdjList(m);

            // obtain canon labelling
            long[] canon_labels = Canon.Label(m, g);

            // obtain symmetry classes
            long[] symmetry_labels = Canon.Symmetry(m, g);
            #endregion
        }
示例#5
0
        public void AtomComparatorLabelling()
        {
            var m      = Smi("c1ccccc1O");
            var labels = Canon.Label(m, GraphUtil.ToAdjList(m), new AtomNumberComparer());

            for (int i = 0; i < labels.Length; i++)
            {
                m.Atoms[i].SetProperty(CDKPropertyName.AtomAtomMapping, (int)labels[i]);
            }
            Assert.AreEqual("[CH:4]1=[CH:2][CH:1]=[CH:3][CH:5]=[C:6]1[OH:7]", SmiGen(m));
            var labels2 = Canon.Label(m, GraphUtil.ToAdjList(m), new AtomNumberComparer2());

            for (int i = 0; i < labels.Length; i++)
            {
                m.Atoms[i].SetProperty(CDKPropertyName.AtomAtomMapping, (int)labels2[i]);
            }
            Assert.AreEqual("[CH:5]1=[CH:3][CH:2]=[CH:4][CH:6]=[C:7]1[OH:1]", SmiGen(m));
        }