public void TestAcetonitrile()
        {
            var mol    = AtomTyperTests.ParseSmiles("CC#N");
            var desc   = new JPlogPDescriptor();
            var answer = desc.Calculate(mol);
            var output = answer.Value;

            Assert.AreEqual(0.4, output, 0.1);
        }
        public void TestFluorobenzene()
        {
            var mol    = AtomTyperTests.ParseSmiles("Fc1ccccc1");
            var desc   = new JPlogPDescriptor();
            var answer = desc.Calculate(mol);
            var output = answer.Value;

            Assert.AreEqual(2.0, output, 0.1);
        }
        public void TestPropionicAcid()
        {
            var mol    = AtomTyperTests.ParseSmiles("CCC(=O)O");
            var desc   = new JPlogPDescriptor();
            var answer = desc.Calculate(mol);
            var output = answer.Value;

            Assert.AreEqual(0.3, output, 0.1);
        }
        public void TestPyridine()
        {
            var mol    = AtomTyperTests.ParseSmiles("c1ncccc1");
            var desc   = new JPlogPDescriptor();
            var answer = desc.Calculate(mol);
            var output = answer.Value;

            Assert.AreEqual(0.9, output, 0.1);
        }
Exemple #5
0
        public void TestDoubleBondHetero()
        {
            var desc     = new JPlogPDescriptor();
            var molecule = ParseSmiles("c1nnccc1");
            var atom     = molecule.Atoms[1];

            Assert.IsFalse(JPlogPDescriptor.JPlogPCalculator.DoubleBondHetero(atom));

            molecule = ParseSmiles("CC(=O)C");
            atom     = molecule.Atoms[1];
            Assert.IsTrue(JPlogPDescriptor.JPlogPCalculator.DoubleBondHetero(atom));
        }
        public void TestSimpleTextFields()
        {
            var attributes = (DescriptorSpecificationAttribute)typeof(JPlogPDescriptor).GetCustomAttributes(typeof(DescriptorSpecificationAttribute), true)[0];

            Assert.AreEqual("JPlogP developed at Lhasa Limited www.lhasalimited.org", attributes.Reference);
            Assert.AreEqual("Jeffrey Plante - Lhasa Limited", attributes.Vendor);

            var mol    = AtomTyperTests.ParseSmiles("C");
            var desc   = new JPlogPDescriptor();
            var answer = desc.Calculate(mol);

            Assert.IsTrue(answer.Keys.Contains("JLogP"));
            Assert.AreEqual(1, answer.Keys.Count());
        }
Exemple #7
0
        public void TestNextToAromatic()
        {
            var desc     = new JPlogPDescriptor();
            var molecule = ParseSmiles("c1nnccc1");
            var atom     = molecule.Atoms[0];

            Assert.IsFalse(JPlogPDescriptor.JPlogPCalculator.NextToAromatic(atom));

            molecule = ParseSmiles("C=C=C");
            atom     = molecule.Atoms[0];
            Assert.IsFalse(JPlogPDescriptor.JPlogPCalculator.NextToAromatic(atom));

            molecule = ParseSmiles("Nc1ccccc1");
            atom     = molecule.Atoms[0];
            Assert.IsTrue(JPlogPDescriptor.JPlogPCalculator.NextToAromatic(atom));
        }
Exemple #8
0
        public void TestGetPolarBondArray()
        {
            var desc     = new JPlogPDescriptor();
            var molecule = ParseSmiles("c1nnccc1");
            var atom     = molecule.Atoms[0];

            Assert.AreEqual(1, JPlogPDescriptor.JPlogPCalculator.GetPolarBondArray(atom)[1]);

            molecule = ParseSmiles("CO");
            atom     = molecule.Atoms[0];
            Assert.AreEqual(1, JPlogPDescriptor.JPlogPCalculator.GetPolarBondArray(atom)[0]);

            molecule = ParseSmiles("C=O");
            atom     = molecule.Atoms[0];
            Assert.AreEqual(1, JPlogPDescriptor.JPlogPCalculator.GetPolarBondArray(atom)[2]);

            molecule = ParseSmiles("C#N");
            atom     = molecule.Atoms[0];
            Assert.AreEqual(1, JPlogPDescriptor.JPlogPCalculator.GetPolarBondArray(atom)[3]);
        }