Exemplo n.º 1
0
        public void GetAutomorphismPartitionTest()
        {
            string acpString = "C0C1C2C3C4C5C6C7C8C9 0:1(2),1:2(1),2:3(2),3:4(1),"
                               + "4:5(2),5:6(1),6:7(2),7:8(1),8:9(2),5:9(1),0:9(1)";
            IAtomContainer ac = AtomContainerPrinter.FromString(acpString, builder);
            BondDiscretePartitionRefiner refiner = new BondDiscretePartitionRefiner();
            Partition autP     = refiner.GetAutomorphismPartition(ac);
            Partition expected = Partition.FromString("0|1|2|3|4|5|6|7|8|9|10");

            Assert.AreEqual(expected, autP);
        }
Exemplo n.º 2
0
        public void TestBiphenyl()
        {
            IAtomContainer mol = TestMoleculeFactory.MakeBiphenyl();

            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol);
            Aromaticity.CDKLegacy.Apply(mol);
            Assert.IsNotNull(mol, "Created molecule was null");

            BondDiscretePartitionRefiner refiner = new BondDiscretePartitionRefiner();

            refiner.Refine(mol);
            Partition autP = refiner.GetAutomorphismPartition();

            Assert.AreEqual(4, autP.Count, "Wrong number of equivalent classes");
            Partition expected = Partition.FromString("0,5,7,12|1,4,8,11|2,3,9,10|6");

            Assert.AreEqual(expected, autP, "Wrong class assignment");
        }