Exemplo n.º 1
0
        public void UnlabelledHydrogens()
        {
            IAtomContainer container = CDK.SmilesParser
                                       .ParseSmiles("[H]C([H])([H])[H]");

            Assert.IsTrue(Compares.AreEqual(new long[] { 2, 1, 3, 4, 5 }, InChINumbersTools.GetUSmilesNumbers(container)));
        }
Exemplo n.º 2
0
        public void Bug1370()
        {
            IAtomContainer container = CDK.SmilesParser
                                       .ParseSmiles("O=[Bi]Cl");

            Assert.IsTrue(Compares.AreEqual(new long[] { 3, 1, 2 }, InChINumbersTools.GetUSmilesNumbers(container)));
        }
Exemplo n.º 3
0
 public void ParseMultipleDisconnected()
 {
     // O.N1C=NC=C1.O.O=O
     Assert.IsTrue(Compares.AreEqual(
                       new long[] { 8, 4, 3, 5, 2, 1, 9, 6, 7 },
                       InChINumbersTools.ParseUSmilesNumbers(
                           "AuxInfo=1/1/N:5,6,3,4,2;8,9;1;7/E:(1,2)(4,5);(1,2);;/F:6,5,3,2,4;3m/E:;m;;/rA:9ONCNCCOOO/rB:;s2;d3;s4;s2d5;;;d8;/rC:;;;;;;;;;",
                           Mock(9))));
 }
Exemplo n.º 4
0
 public void ParseDisconnected()
 {
     // O.N1C=NC=C1
     Assert.IsTrue(Compares.AreEqual(
                       new long[] { 6, 4, 3, 5, 2, 1 },
                       InChINumbersTools.ParseUSmilesNumbers(
                           "AuxInfo=1/1/N:5,6,3,4,2;1/E:(1,2)(4,5);/F:6,5,3,2,4;m/rA:6ONCNCC/rB:;s2;d3;s4;s2d5;/rC:;;;;;;",
                           Mock(6))));
 }
Exemplo n.º 5
0
 public void ParseRecMet()
 {
     // C(=O)O[Pt](N)(N)Cl
     Assert.IsTrue(Compares.AreEqual(
                       new long[] { 7, 6, 1, 5, 3, 4, 2 },
                       InChINumbersTools.ParseUSmilesNumbers(
                           "AuxInfo=1/1/N:3,2,4;7;5;6;1/E:(2,3);;;;/F:5m/E:m;;;;/CRV:;;2*1-1;/rA:7PtOCONNCl/rB:s1;s2;d3;s1;s1;s1;/rC:;;;;;;;/R:/0/N:3,7,5,6,4,2,1/E:(3,4)",
                           Mock(7))));
 }
Exemplo n.º 6
0
        public void ParseFixedH()
        {
            // N1C=NC=C1
            Assert.IsTrue(Compares.AreEqual(
                              new long[] { 4, 3, 5, 2, 1 },

                              InChINumbersTools.ParseUSmilesNumbers(
                                  "AuxInfo=1/1/N:4,5,2,3,1/E:(1,2)(4,5)/F:5,4,2,1,3/rA:5NCNCC/rB:s1;d2;s3;s1d4;/rC:;;;;;",
                                  Mock(5))));
        }
Exemplo n.º 7
0
        public void FixedH()
        {
            var    parser        = CDK.SmilesParser;
            var    atomContainer = parser.ParseSmiles("N1C=NC2=CC=CC=C12");
            string auxInfo       = InChINumbersTools.AuxInfo(atomContainer, InChIOption.FixedH);
            string expected      = "AuxInfo=1/1/" + "N:6,7,5,8,2,4,9,3,1/" + "E:(1,2)(3,4)(6,7)(8,9)/" + "F:7,6,8,5,2,9,4,1,3/"
                                   + "rA:9NCNCCCCCC/" + "rB:s1;d2;s3;d4;s5;d6;s7;s1s4d8;/" + "rC:;;;;;;;;;";

            Assert.AreEqual(expected, auxInfo);
        }
Exemplo n.º 8
0
        public void TestSimpleNumbering()
        {
            IAtomContainer container = new AtomContainer();

            container.Atoms.Add(new Atom("O"));
            container.Atoms.Add(new Atom("C"));
            container.AddBond(container.Atoms[0], container.Atoms[1], BondOrder.Single);
            long[] numbers = InChINumbersTools.GetNumbers(container);
            Assert.AreEqual(2, numbers.Length);
            Assert.AreEqual(2, numbers[0]);
            Assert.AreEqual(1, numbers[1]);
        }
Exemplo n.º 9
0
        public void TestGlycine_uSmiles()
        {
            var parser        = CDK.SmilesParser;
            var atomContainer = parser.ParseSmiles("C(C(=O)O)N");

            long[] numbers = InChINumbersTools.GetNumbers(atomContainer);
            Assert.AreEqual(5, numbers.Length);
            Assert.AreEqual(1, numbers[0]);
            Assert.AreEqual(2, numbers[1]);
            Assert.AreEqual(4, numbers[2]);
            Assert.AreEqual(5, numbers[3]);
            Assert.AreEqual(3, numbers[4]);
        }
Exemplo n.º 10
0
        public void TestHydrogens()
        {
            IAtomContainer container = new AtomContainer();

            container.Atoms.Add(new Atom("H"));
            container.Atoms.Add(new Atom("C"));
            container.AddBond(container.Atoms[0], container.Atoms[1], BondOrder.Single);
            container.Atoms.Add(new Atom("H"));
            container.AddBond(container.Atoms[1], container.Atoms[2], BondOrder.Single);
            container.Atoms.Add(new Atom("H"));
            container.AddBond(container.Atoms[1], container.Atoms[3], BondOrder.Single);
            container.Atoms.Add(new Atom("H"));
            container.AddBond(container.Atoms[1], container.Atoms[4], BondOrder.Single);
            long[] numbers = InChINumbersTools.GetNumbers(container);
            Assert.AreEqual(5, numbers.Length);
            Assert.AreEqual(0, numbers[0]);
            Assert.AreEqual(1, numbers[1]);
            Assert.AreEqual(0, numbers[2]);
            Assert.AreEqual(0, numbers[3]);
            Assert.AreEqual(0, numbers[4]);
        }
Exemplo n.º 11
0
        public void Protons()
        {
            IAtomContainer container = CDK.SmilesParser
                                       .ParseSmiles("[H+].[H+].F[Si-2](F)(F)(F)(F)F");

            Assert.IsTrue(Compares.AreDeepEqual(new long[] { 8, 9, 1, 7, 2, 3, 4, 5, 6 }, InChINumbersTools.GetUSmilesNumbers(container)));
        }
Exemplo n.º 12
0
        public void FavorCarbonyl()
        {
            IAtomContainer container = CDK.SmilesParser.ParseSmiles("P([O-])=O");

            Assert.IsTrue(Compares.AreEqual(new long[] { 3, 2, 1 }, InChINumbersTools.GetUSmilesNumbers(container)));
        }
Exemplo n.º 13
0
 public void ParseStandard()
 {
     Assert.IsTrue(Compares.AreEqual(
                       new long[] { 3, 2, 1 },
                       InChINumbersTools.ParseUSmilesNumbers("AuxInfo=1/0/N:3,2,1/rA:3OCC/rB:s1;s2;/rC:;;;", Mock(3))));
 }