예제 #1
0
        public void TestMMFF94PartialCharges()
        {
            double[] testResult = { -0.99, 0.314, 0.66, -0.57, -0.65, 0.36, 0.36, 0, 0, 0.5 };
            var      sp         = CDK.SmilesParser;
            var      ac         = sp.ParseSmiles("NCC(=O)O");

            AddExplicitHydrogens(ac);
            MMFF94PartialCharges mmff = new MMFF94PartialCharges();

            mmff.AssignMMFF94PartialCharges(ac);
            for (int i = 0; i < ac.Atoms.Count; i++)
            {
                Assert.AreEqual(testResult[i], (ac.Atoms[i].GetProperty <double>("MMFF94charge")), 0.05);
                //Debug.WriteLine("CHARGE AT " + ac.GetAtomAt(i).Symbol + " " + ac.GetAtomAt(i).GetProperty("MMFF94charge"));
            }
        }
 public void Ctor()
 {
     #region
     SmilesParser   sp = new SmilesParser();
     IAtomContainer ac = sp.ParseSmiles("CC");
     AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(ac);
     AtomContainerManipulator.ConvertImplicitToExplicitHydrogens(ac);
     MMFF94PartialCharges mmff = new MMFF94PartialCharges();
     mmff.AssignMMFF94PartialCharges(ac);
     #endregion
     foreach (var atom in ac.Atoms)
     {
         Console.WriteLine(
             #region result
             atom.GetProperty <double>("MMFF94charge")
             #endregion
             );
     }
 }