📄 xlogpdescriptortest.java
字号:
/* $RCSfile$ * $Author: egonw $ * $Date: 2007-01-04 17:32:54 +0000 (Do, 04 Jan 2007) $ * $Revision: 7635 $ * * Copyright (C) 2004-2007 The Chemistry Development Kit (CDK) project * * Contact: cdk-devel@lists.sourceforge.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */package org.openscience.cdk.test.qsar.descriptors.molecular;import junit.framework.Test;import junit.framework.TestSuite;import org.openscience.cdk.DefaultChemObjectBuilder;import org.openscience.cdk.exception.CDKException;import org.openscience.cdk.interfaces.IMolecule;import org.openscience.cdk.qsar.IMolecularDescriptor;import org.openscience.cdk.qsar.descriptors.molecular.XLogPDescriptor;import org.openscience.cdk.qsar.result.DoubleResult;import org.openscience.cdk.smiles.SmilesParser;import org.openscience.cdk.test.CDKTestCase;import org.openscience.cdk.tools.HydrogenAdder;/** * TestSuite that runs all QSAR tests. * * @cdk.module test-qsar */public class XLogPDescriptorTest extends CDKTestCase { public XLogPDescriptorTest() { } public static Test suite() { return new TestSuite(XLogPDescriptorTest.class); }// public void testXLogPDescriptor() throws ClassNotFoundException, CDKException, java.lang.Exception {// // // each test is for one or more atom types:// // 1. Test for cumarine// IMolecularDescriptor descriptor = new XLogPDescriptor();// Object[] params = {new Boolean(true)};// descriptor.setParameters(params);// SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());// IMolecule mol = sp.parseSmiles("COc1ccccc1C(C3=C(O)c2ccccc2CC3=O)c5c(O)c4ccccc4oc5=O"); // a cumarine// HydrogenAdder hAdder = new HydrogenAdder();// hAdder.addExplicitHydrogensToSatisfyValency(mol);// logger.debug("Cumarine:"+((DoubleResult)descriptor.calculate(mol).getValue()).doubleValue());// //assertEquals(4.54, ((DoubleResult)descriptor.calculate(mol).getValue()).doubleValue(), 0.1); //at: 16// // //} public void testno688() throws ClassNotFoundException, CDKException, java.lang.Exception { IMolecularDescriptor descriptor = new XLogPDescriptor(); Object[] params = {new Boolean(true), new Boolean(false)}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IMolecule mol = sp.parseSmiles("O=C(O)c1[nH0]cccc1"); // xlogp training set molecule no688 HydrogenAdder hAdder = new HydrogenAdder(); hAdder.addExplicitHydrogensToSatisfyValency(mol); //logger.debug("no688:"+((DoubleResult)descriptor.calculate(mol).getValue()).doubleValue()+"\n"); assertEquals(-1.69, ((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), 0.1); //at: 16 } public void testno1596() throws ClassNotFoundException, CDKException, java.lang.Exception { // the xlogp program value is 0.44 bevause of paralleled donor pair correction factor IMolecularDescriptor descriptor = new XLogPDescriptor(); Object[] params = {new Boolean(true), new Boolean(false)}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IMolecule mol = sp.parseSmiles("Nc2ccc(S(=O)(=O)c1ccc(N)cc1)cc2"); // xlogp training set molecule no1596 HydrogenAdder hAdder = new HydrogenAdder(); hAdder.addExplicitHydrogensToSatisfyValency(mol); //logger.debug("no1596:"+((DoubleResult)descriptor.calculate(mol).getValue()).doubleValue()+"\n"); assertEquals(0.86, ((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), 0.1); //at: 16 } public void testno367() throws ClassNotFoundException, CDKException, java.lang.Exception { IMolecularDescriptor descriptor = new XLogPDescriptor(); Object[] params = {new Boolean(true), new Boolean(false)}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IMolecule mol = sp.parseSmiles("O=C(O)C(N)CCCN"); // xlogp training set molecule no367 HydrogenAdder hAdder = new HydrogenAdder(); hAdder.addExplicitHydrogensToSatisfyValency(mol); //logger.debug("no367:"+((DoubleResult)descriptor.calculate(mol).getValue()).doubleValue()+"\n"); assertEquals(-3.30, ((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), 0.1); //at: 16 } public void testno1837() throws ClassNotFoundException, CDKException, java.lang.Exception { IMolecularDescriptor descriptor = new XLogPDescriptor(); Object[] params = {new Boolean(true), new Boolean(false)}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IMolecule mol = sp.parseSmiles("O=P(N1CC1)(N2CC2)N3CC3"); // xlogp training set molecule no1837 HydrogenAdder hAdder = new HydrogenAdder(); hAdder.addExplicitHydrogensToSatisfyValency(mol); //logger.debug("no1837:"+((DoubleResult)descriptor.calculate(mol).getValue()).doubleValue()+"\n"); assertEquals(-1.19, ((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), 0.1); //at: 16 } public void testno87() throws ClassNotFoundException, CDKException, java.lang.Exception { IMolecularDescriptor descriptor = new XLogPDescriptor(); Object[] params = {new Boolean(true), new Boolean(false)}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IMolecule mol = sp.parseSmiles("c1cc2ccc3ccc4ccc5cccc6c(c1)c2c3c4c56"); // xlogp training set molecule no87 HydrogenAdder hAdder = new HydrogenAdder(); hAdder.addExplicitHydrogensToSatisfyValency(mol); //logger.debug("no87:"+((DoubleResult)descriptor.calculate(mol).getValue()).doubleValue()+"\n"); assertEquals(7.00, ((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), 0.1); //at: 16 } public void testno1782() throws ClassNotFoundException, CDKException, java.lang.Exception { IMolecularDescriptor descriptor = new XLogPDescriptor(); Object[] params = {new Boolean(true), new Boolean(false)}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IMolecule mol = sp.parseSmiles("S1C2N(C(=O)C2NC(=O)C(c2ccccc2)C(=O)O)C(C(=O)O)C1(C)C"); // xlogp training set molecule no30 HydrogenAdder hAdder = new HydrogenAdder(); hAdder.addExplicitHydrogensToSatisfyValency(mol); //logger.debug("no1782:"+((DoubleResult)descriptor.calculate(mol).getValue()).doubleValue()+"\n"); assertEquals(1.84, ((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), 0.1); //at: 16 } public void testno30() throws ClassNotFoundException, CDKException, java.lang.Exception { IMolecularDescriptor descriptor = new XLogPDescriptor(); Object[] params = {new Boolean(true), new Boolean(false)}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IMolecule mol = sp.parseSmiles("C(#Cc1ccccc1)c1ccccc1"); // xlogp training set molecule no30 HydrogenAdder hAdder = new HydrogenAdder(); hAdder.addExplicitHydrogensToSatisfyValency(mol); //logger.debug("no30:"+((DoubleResult)descriptor.calculate(mol).getValue()).doubleValue()+"\n"); assertEquals(4.62, ((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), 0.1); //at: 16
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -