示例#1
0
        public void TestBug2846213()
        {
            var            filename = "NCDK.Data.MDL.bug2846213.mol";
            var            ins      = ResourceLoader.GetAsStream(filename);
            var            reader   = new MDLV2000Reader(ins, ChemObjectReaderMode.Strict);
            ChemFile       chemFile = (ChemFile)reader.Read((ChemObject) new ChemFile());
            IAtomContainer ac       = ChemFileManipulator.GetAllAtomContainers(chemFile).First();

            long[] morganNumbers = MorganNumbersTools.GetMorganNumbers(ac);
            Assert.IsFalse(morganNumbers[7] == morganNumbers[8]);
        }
示例#2
0
        public void TestPhenylamine()
        {
            // This is an array with the expected Morgan Numbers for a-pinene
            string[] reference = { "C-457", "C-428", "C-325", "C-354", "C-325", "C-428", "N-251" };

            IAtomContainer mol = TestMoleculeFactory.MakePhenylAmine();

            string[] morganNumbers = MorganNumbersTools.GetMorganNumbersWithElementSymbol(mol);
            Assert.AreEqual(reference.Length, morganNumbers.Length);
            for (int f = 0; f < morganNumbers.Length; f++)
            {
                //Debug.WriteLine(morganNumbers[f]);
                Assert.AreEqual(reference[f], morganNumbers[f]);
            }
        }
示例#3
0
        public void TestGetMorganNumbers_IAtomContainer()
        {
            // This is an array with the expected Morgan Numbers for a-pinene
            long[] reference = { 28776, 17899, 23549, 34598, 31846, 36393, 9847, 45904, 15669, 15669 };

            IAtomContainer mol = TestMoleculeFactory.MakeAlphaPinene();

            long[] morganNumbers = MorganNumbersTools.GetMorganNumbers(mol);
            Assert.AreEqual(reference.Length, morganNumbers.Length);
            for (int f = 0; f < morganNumbers.Length; f++)
            {
                //Debug.WriteLine(morganNumbers[f]);
                Assert.AreEqual(reference[f], morganNumbers[f]);
            }
        }