Beispiel #1
0
        public void BuckyballTest()
        {
            var mol = MoleculeReader.ReadMolfile("NCDK.FaulonSignatures.Data.buckyball.mol");
            var mqg = new MoleculeQuotientGraph(mol);

            Console.Out.WriteLine(mqg);
            Assert.AreEqual(32, mqg.GetVertexCount());
            Assert.AreEqual(49, mqg.GetEdgeCount());
            Assert.AreEqual(6, mqg.NumberOfLoopEdges());
        }
Beispiel #2
0
        public void DodecahedraneTest()
        {
            var mol = new Molecule();

            for (int i = 0; i < 20; i++)
            {
                mol.AddAtom("C");
            }
            mol.AddSingleBond(0, 1);
            mol.AddSingleBond(0, 4);
            mol.AddSingleBond(1, 2);
            mol.AddSingleBond(2, 7);
            mol.AddSingleBond(3, 4);
            mol.AddSingleBond(3, 8);
            mol.AddSingleBond(5, 10);
            mol.AddSingleBond(5, 11);
            mol.AddSingleBond(6, 11);
            mol.AddSingleBond(6, 12);
            mol.AddSingleBond(7, 13);
            mol.AddSingleBond(8, 14);
            mol.AddSingleBond(9, 10);
            mol.AddSingleBond(9, 14);
            mol.AddSingleBond(12, 17);
            mol.AddSingleBond(13, 18);
            mol.AddSingleBond(15, 16);
            mol.AddSingleBond(15, 19);
            mol.AddSingleBond(16, 17);
            mol.AddSingleBond(18, 19);

            mol.AddBond(0, 5, Molecule.BondOrder.Double);
            mol.AddBond(1, 6, Molecule.BondOrder.Double);
            mol.AddBond(2, 3, Molecule.BondOrder.Double);
            mol.AddBond(4, 9, Molecule.BondOrder.Double);
            mol.AddBond(7, 12, Molecule.BondOrder.Double);
            mol.AddBond(8, 13, Molecule.BondOrder.Double);
            mol.AddBond(10, 15, Molecule.BondOrder.Double);
            mol.AddBond(11, 16, Molecule.BondOrder.Double);
            mol.AddBond(17, 18, Molecule.BondOrder.Double);
            mol.AddBond(14, 19, Molecule.BondOrder.Double);

            for (int i = 0; i < 20; i++)
            {
                Assert.AreEqual(4, mol.GetTotalOrder(i), "Atom " + i + " has wrong order");
            }

            var mqg = new MoleculeQuotientGraph(mol);

            Console.Out.WriteLine(mqg);
            Assert.AreEqual(5, mqg.GetVertexCount());
            Assert.AreEqual(9, mqg.GetEdgeCount());
            Assert.AreEqual(3, mqg.NumberOfLoopEdges());
        }
Beispiel #3
0
        public void BuckyballWithoutMultipleBonds()
        {
            var mol = MoleculeReader.ReadMolfile("NCDK.FaulonSignatures.Data.buckyball.mol");

            foreach (Molecule.Bond bond in mol.Bonds())
            {
                bond.order = Molecule.BondOrder.Single;
            }
            var mqg = new MoleculeQuotientGraph(mol);

            Console.Out.WriteLine(mqg);
            Assert.AreEqual(1, mqg.GetVertexCount());
            Assert.AreEqual(1, mqg.GetEdgeCount());
            Assert.AreEqual(1, mqg.NumberOfLoopEdges());
        }
Beispiel #4
0
        public void FaulonsBuckySignatures()
        {
            var mol = MoleculeReader.ReadMolfile("data/buckyball.mol");

            try
            {
                var filename = "data/buckysigs3.txt";
                var sigs     = ReadSigs2(filename);
                var mqg      = new MoleculeQuotientGraph(mol, sigs);
                Console.Out.WriteLine(mqg);
                Assert.AreEqual(32, mqg.GetVertexCount());
                Assert.AreEqual(49, mqg.GetEdgeCount());
                Assert.AreEqual(6, mqg.NumberOfLoopEdges());
            }
            catch (Exception e)
            {
                Console.Out.WriteLine(e);
                return;
            }
        }