@Test public void testDoubleValue() { DoubleResult result = new DoubleResult(5); Assert.assertEquals(5.0, result.doubleValue(), 0.000001); }
@Test public void testno1000() throws ClassNotFoundException, CDKException, java.lang.Exception { Object[] params = {new Boolean(true), new Boolean(false)}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("Clc1cccc(c1)/C=C/[N+](=O)[O-]"); // xlogp training set molecule no1000 assertAtomTypesPerceived(mol); addExplicitHydrogens(mol); //logger.debug("no10000:"+((DoubleResult)descriptor.calculate(mol).getValue()).doubleValue()+"\n"); Assert.assertEquals(2.809, ((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), 1.0); //at: 16 }
@Test public void testApirinBug1296383() throws ClassNotFoundException, CDKException, java.lang.Exception { Object[] params = {new Boolean(true), new Boolean(false)}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("CC(=O)OC1=CC=CC=C1C(=O)O"); // aspirin assertAtomTypesPerceived(mol); addExplicitHydrogens(mol); //logger.debug("Aspirin:"+((DoubleResult)descriptor.calculate(mol).getValue()).doubleValue()+"\n"); Assert.assertEquals(1.422, ((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), 0.1); //at: 16 }
@Test public void testno1596() throws ClassNotFoundException, CDKException, java.lang.Exception { // the xlogp program value is 0.44 because of paralleled donor pair correction factor Object[] params = {new Boolean(true), new Boolean(false)}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("Nc2ccc(S(=O)(=O)c1ccc(N)cc1)cc2"); // xlogp training set molecule no1596 assertAtomTypesPerceived(mol); addExplicitHydrogens(mol); //logger.debug("no1596:"+((DoubleResult)descriptor.calculate(mol).getValue()).doubleValue()+"\n"); Assert.assertEquals(0.86, ((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), 1.0); //at: 16 }
@Test public void testno1429() throws ClassNotFoundException, CDKException, java.lang.Exception { Object[] params = {new Boolean(true), new Boolean(false)}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("O=C(OC)CNC(=O)c1ccc(N)cc1"); // xlogp training set molecule no1429 assertAtomTypesPerceived(mol); addExplicitHydrogens(mol); //logger.debug("no1429:"+((DoubleResult)descriptor.calculate(mol).getValue()).doubleValue()+"\n"); Assert.assertEquals(0.31, ((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), 1.0); //at: 16 }
@Test public void testAprindine() throws ClassNotFoundException, CDKException, java.lang.Exception { //even here the amid assignment is very strange Object[] params = {new Boolean(true), new Boolean(false)}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("CCN(CC)CCCN(C2Cc1ccccc1C2)c3ccccc3"); // xlogp training set molecule Aprindine assertAtomTypesPerceived(mol); addExplicitHydrogens(mol); //logger.debug("Aprindine:"+((DoubleResult)descriptor.calculate(mol).getValue()).doubleValue()+"\n"); Assert.assertEquals(5.03, ((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), 1.0); //at: 16 }
@Test public void testTPSA5() throws Exception { IAtomContainer mol = sp.parseSmiles("c1ccncc1"); addExplicitHydrogens(mol); Assert.assertEquals(12.892, ((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), 0.01); }
@Ignore @Test public void testno688() throws ClassNotFoundException, CDKException, java.lang.Exception { Object[] params = {new Boolean(true), new Boolean(false)}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("O=C(O)c1[nH0]cccc1"); // xlogp training set molecule no688 assertAtomTypesPerceived(mol); addExplicitHydrogens(mol); //logger.debug("no688:"+((DoubleResult)descriptor.calculate(mol).getValue()).doubleValue()+"\n"); Assert.assertEquals(-1.69, ((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), 0.1); //at: 16 }
@Ignore @Test public void testno937() throws ClassNotFoundException, CDKException, java.lang.Exception { Object[] params = {new Boolean(true), new Boolean(false)}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("ClCC(O)C[nH0]1c([nH0]cc1[N+](=O)[O-])C"); // xlogp training set molecule no937 assertAtomTypesPerceived(mol); addExplicitHydrogens(mol); //logger.debug("no937:"+((DoubleResult)descriptor.calculate(mol).getValue()).doubleValue()+"\n"); Assert.assertEquals(0.66, ((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), 0.1); //at: 16 }
@Test public void testTPSA4() throws Exception { IAtomContainer mol = sp.parseSmiles("C#N=CC(CNC)N1CC1"); addExplicitHydrogens(mol); Assert.assertEquals(28.632, ((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), 0.01); }
@Test public void testTPSA7() throws java.lang.Exception { IAtomContainer mol = sp.parseSmiles("C(I)I");//at: 16 addExplicitHydrogens(mol); Assert.assertEquals(0.0, ((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), 0.1); //at: 16 }
@Test public void testCompound() throws Exception { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("CCCCC1CCCCC1"); Assert.assertThat(((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), closeTo(4.322, 0.001)); } }
@Test public void testPyridine() throws CDKException { parser = new SmilesParser(SilentChemObjectBuilder.getInstance()); IAtomContainer struct = parseSmiles("c1ncccc1"); JPlogPDescriptor desc = new JPlogPDescriptor(); DescriptorValue answer = desc.calculate(struct); DoubleResult result = (DoubleResult) answer.getValue(); double output = result.doubleValue(); assertEquals(0.9, output, 0.1); }
@Test public void testCyclic() throws Exception { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("C1CCC2CCCCC2C1"); Assert.assertThat(((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), closeTo(4.459, 0.001)); }
@Test public void testWeightDescriptor() throws ClassNotFoundException, CDKException, java.lang.Exception { Object[] params = {"*"}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("CCC"); Assert.assertEquals(44.06, ((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), 0.1); }
@Test public void testFluorobenzene() throws CDKException { parser = new SmilesParser(SilentChemObjectBuilder.getInstance()); IAtomContainer struct = parseSmiles("Fc1ccccc1"); JPlogPDescriptor desc = new JPlogPDescriptor(); DescriptorValue answer = desc.calculate(struct); DoubleResult result = (DoubleResult) answer.getValue(); double output = result.doubleValue(); assertEquals(2.0, output, 0.1); }
@Test public void testDescriptor1() throws InvalidSmilesException { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol1 = sp.parseSmiles("CC"); double value = ((DoubleResult) descriptor.calculate(mol1.getBond(0), mol1).getValue()).doubleValue(); Assert.assertEquals(0, value, 0.0000); }
@Test public void testMethane() { IChemObjectBuilder builder = SilentChemObjectBuilder.getInstance(); IAtomContainer methane = builder.newInstance(IAtomContainer.class); methane.addAtom(builder.newInstance(IAtom.class, "C")); IDescriptorResult result = descriptor.calculate(methane).getValue(); Assert.assertTrue(result instanceof DoubleResult); Assert.assertEquals(1.57, ((DoubleResult) result).doubleValue(), 0.01); }
@Test public void testClenbuterol() throws Exception { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("Clc1cc(cc(Cl)c1N)C(O)CNC(C)(C)C"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); Aromaticity.cdkLegacy().apply(mol); DoubleResult result = (DoubleResult) descriptor.calculate(mol).getValue(); Assert.assertEquals(0.353, result.doubleValue(), 0.01); }
@Test public void testAromaticBenzene() throws java.lang.Exception { Object[] params = {false, true}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("C1=CC=CC=C1"); // benzene Aromaticity aromaticity = new Aromaticity(ElectronDonation.daylight(), Cycles.all()); aromaticity.apply(mol); assertAtomTypesPerceived(mol); addExplicitHydrogens(mol); Assert.assertThat(((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), closeTo(2.02, 0.01)); }