Exemplo n.º 1
0
        public virtual void TestGetAtomTypeFromJmol()
        {
            AtomTypeFactory factory  = AtomTypeFactory.GetInstance("NCDK.Config.Data.jmol_atomtypes.txt");
            IAtomType       atomType = factory.GetAtomType("H");

            Assert.IsNotNull(atomType);
            Assert.AreEqual("H", atomType.Symbol);
            Assert.AreEqual("H", atomType.AtomTypeName);
        }
Exemplo n.º 2
0
        public virtual void TestGetAtomTypeFromPDB()
        {
            AtomTypeFactory factory  = AtomTypeFactory.GetInstance("NCDK.Config.Data.pdb_atomtypes.xml");
            IAtomType       atomType = factory.GetAtomType("ALA.CA");

            Assert.IsNotNull(atomType);
            Assert.AreEqual("C", atomType.Symbol);
            Assert.AreEqual("ALA.CA", atomType.AtomTypeName);
        }
Exemplo n.º 3
0
        public virtual void TestGetAtomTypeFromOWL()
        {
            AtomTypeFactory factory = AtomTypeFactory.GetInstance("NCDK.Dict.Data.cdk-atom-types.owl");
            IAtomType       atomType;

            atomType = factory.GetAtomType("C.sp3");
            Assert.IsNotNull(atomType);
            Assert.AreEqual("C", atomType.Symbol);
            Assert.AreEqual("C.sp3", atomType.AtomTypeName);
            Assert.AreEqual(Hybridization.SP3, atomType.Hybridization);
            Assert.AreEqual(0, atomType.FormalCharge);
            Assert.AreEqual(4, atomType.FormalNeighbourCount);
            Assert.IsNotNull(atomType.GetProperty <object>(CDKPropertyName.LonePairCount));
            Assert.AreEqual(0, atomType.GetProperty <int>(CDKPropertyName.LonePairCount));
            Assert.AreEqual(0, atomType.GetProperty <int>(CDKPropertyName.PiBondCount));
            Assert.AreEqual(BondOrder.Single, atomType.MaxBondOrder);
            Assert.AreEqual(4.0, atomType.BondOrderSum.Value, 0.1);

            atomType = factory.GetAtomType("N.sp2.radical");
            Assert.IsNotNull(atomType);
            Assert.AreEqual("N", atomType.Symbol);
            Assert.AreEqual("N.sp2.radical", atomType.AtomTypeName);
            Assert.AreEqual(Hybridization.SP2, atomType.Hybridization);
            Assert.AreEqual(0, atomType.FormalCharge);
            Assert.AreEqual(1, atomType.FormalNeighbourCount);
            Assert.IsNotNull(atomType.GetProperty <object>(CDKPropertyName.LonePairCount));
            Assert.AreEqual(1, atomType.GetProperty <int>(CDKPropertyName.LonePairCount));
            Assert.AreEqual(1, atomType.GetProperty <int>(CDKPropertyName.PiBondCount));
            Assert.AreEqual(BondOrder.Double, atomType.MaxBondOrder);
            Assert.AreEqual(2.0, atomType.BondOrderSum.Value, 0.1);

            atomType = factory.GetAtomType("N.planar3");
            Assert.IsNotNull(atomType);
            Assert.AreEqual("N", atomType.Symbol);
            Assert.AreEqual("N.planar3", atomType.AtomTypeName);
            Assert.AreEqual(Hybridization.Planar3, atomType.Hybridization);
            Assert.AreEqual(0, atomType.FormalCharge);
            Assert.AreEqual(3, atomType.FormalNeighbourCount);
            Assert.IsNotNull(atomType.GetProperty <object>(CDKPropertyName.LonePairCount));
            Assert.AreEqual(1, atomType.GetProperty <int>(CDKPropertyName.LonePairCount));
            Assert.AreEqual(0, atomType.GetProperty <int>(CDKPropertyName.PiBondCount));
            Assert.AreEqual(BondOrder.Single, atomType.MaxBondOrder);
            Assert.AreEqual(3.0, atomType.BondOrderSum.Value, 0.1);
        }
Exemplo n.º 4
0
        public virtual void TestGetAtomType_String()
        {
            var atomType = atf.GetAtomType("C4");

            Assert.IsNotNull(atomType);
            Assert.AreEqual("C", atomType.Symbol);
            Assert.AreEqual("C4", atomType.AtomTypeName);
            Assert.AreEqual(4.0, atomType.BondOrderSum ?? 0, 0.001);
            Assert.AreEqual(BondOrder.Triple, atomType.MaxBondOrder);
        }
Exemplo n.º 5
0
        public virtual void TestGetAtomTypeFromOWL_Sybyl()
        {
            AtomTypeFactory factory = AtomTypeFactory.GetInstance("NCDK.Dict.Data.sybyl-atom-types.owl");

            IAtomType atomType;

            atomType = factory.GetAtomType("C.3");
            Assert.IsNotNull(atomType);
            Assert.AreEqual("C", atomType.Symbol);
            Assert.AreEqual("C.3", atomType.AtomTypeName);
            Assert.AreEqual(4, atomType.FormalNeighbourCount);
            Assert.AreEqual(Hybridization.SP3, atomType.Hybridization);
            Assert.AreEqual(0, atomType.FormalCharge);
            Assert.AreEqual(0, atomType.GetProperty <int?>(CDKPropertyName.LonePairCount));
            Assert.AreEqual(0, atomType.GetProperty <int?>(CDKPropertyName.PiBondCount));
        }