/** * Returns the specific type of the DescriptorResult object. * * The return value from this method really indicates what type of result will * be obtained from the {@link org.openscience.cdk.qsar.DescriptorValue} object. Note that the same result * can be achieved by interrogating the {@link org.openscience.cdk.qsar.DescriptorValue} object; this method * allows you to do the same thing, without actually calculating the descriptor. * * @return an object that implements the {@link org.openscience.cdk.qsar.result.IDescriptorResult} interface indicating * the actual type of values returned by the descriptor in the {@link org.openscience.cdk.qsar.DescriptorValue} object */ @Override public IDescriptorResult getDescriptorResultType() { return new IntegerResult(1); }
/** * * @return A topological descriptor combining distance and adjacency * information. */ @Override public int getEccentricConnectivityIndexDescriptor() { EccentricConnectivityIndexDescriptor eci = new EccentricConnectivityIndexDescriptor(); int value = ((IntegerResult) eci.calculate(molecule).getValue()).intValue(); return value; }
@Test public void testIntValue() { IntegerResult result = new IntegerResult(5); Assert.assertEquals(5, result.intValue()); }
@Test public void testToString() { IntegerResult result = new IntegerResult(5); Assert.assertEquals("5", result.toString()); }
@Test public void testLength() { IntegerResult result = new IntegerResult(5); Assert.assertEquals(1, result.length()); } }
@Test public void testViaFlags() throws Exception { IAtomContainer molecule = TestMoleculeFactory.makeBenzene(); for (Iterator bonds = molecule.bonds().iterator(); bonds.hasNext();) { ((IBond) bonds.next()).setFlag(CDKConstants.ISAROMATIC, true); } Assert.assertEquals(6, ((IntegerResult) descriptor.calculate(molecule).getValue()).intValue()); }
@Test public void test2LargestChainDescriptor() throws ClassNotFoundException, CDKException, java.lang.Exception { Object[] params = {new Boolean(true), new Boolean(true)}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("C=CC=Cc1ccccc1"); //logger.debug("test2>"+((IntegerResult)descriptor.calculate(mol).getValue()).intValue()); Assert.assertEquals(4, ((IntegerResult) descriptor.calculate(mol).getValue()).intValue()); }
/** * Returns the specific type of the DescriptorResult object. * * The return value from this method really indicates what type of result will * be obtained from the {@link org.openscience.cdk.qsar.DescriptorValue} object. Note that the same result * can be achieved by interrogating the {@link org.openscience.cdk.qsar.DescriptorValue} object; this method * allows you to do the same thing, without actually calculating the descriptor. * * @return an object that implements the {@link org.openscience.cdk.qsar.result.IDescriptorResult} interface indicating * the actual type of values returned by the descriptor in the {@link org.openscience.cdk.qsar.DescriptorValue} object */ @Override public IDescriptorResult getDescriptorResultType() { return new IntegerResult(1); }
@Test public void test4LargestChainDescriptor() throws ClassNotFoundException, CDKException, java.lang.Exception { Object[] params = {new Boolean(true), new Boolean(true)}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("CC=CNCC"); //logger.debug("test4>"+((IntegerResult)descriptor.calculate(mol).getValue()).intValue()); Assert.assertEquals(6, ((IntegerResult) descriptor.calculate(mol).getValue()).intValue()); }
/** * Returns the specific type of the DescriptorResult object. * * The return value from this method really indicates what type of result will * be obtained from the {@link org.openscience.cdk.qsar.DescriptorValue} object. Note that the same result * can be achieved by interrogating the {@link org.openscience.cdk.qsar.DescriptorValue} object; this method * allows you to do the same thing, without actually calculating the descriptor. * * @return an object that implements the {@link org.openscience.cdk.qsar.result.IDescriptorResult} interface indicating * the actual type of values returned by the descriptor in the {@link org.openscience.cdk.qsar.DescriptorValue} object */ @Override public IDescriptorResult getDescriptorResultType() { return new IntegerResult(1); }
@Test public void testSingleOAtom() throws ClassNotFoundException, CDKException, java.lang.Exception { Object[] params = {new Boolean(true), new Boolean(true)}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("O"); //logger.debug("test7>"+((IntegerResult)descriptor.calculate(mol).getValue()).intValue()); Assert.assertEquals(0, ((IntegerResult) descriptor.calculate(mol).getValue()).intValue()); }
/** * Returns the specific type of the DescriptorResult object. * <p> * The return value from this method really indicates what type of result will * be obtained from the {@link org.openscience.cdk.qsar.DescriptorValue} object. Note that the same result * can be achieved by interrogating the {@link org.openscience.cdk.qsar.DescriptorValue} object; this method * allows you to do the same thing, without actually calculating the descriptor. * * @return an object that implements the {@link org.openscience.cdk.qsar.result.IDescriptorResult} interface indicating * the actual type of values returned by the descriptor in the {@link org.openscience.cdk.qsar.DescriptorValue} object */ @Override public IDescriptorResult getDescriptorResultType() { return new IntegerResult(1); }
@Test public void test8LargestChainDescriptor() throws ClassNotFoundException, CDKException, java.lang.Exception { Object[] params = {new Boolean(true), new Boolean(true)}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("Cc1nn(c(c1)N)c1nc2c(s1)cccc2"); Assert.assertEquals(0, ((IntegerResult) descriptor.calculate(mol).getValue()).intValue()); }
/** * Returns the specific type of the DescriptorResult object. * * The return value from this method really indicates what type of result will * be obtained from the {@link org.openscience.cdk.qsar.DescriptorValue} object. Note that the same result * can be achieved by interrogating the {@link org.openscience.cdk.qsar.DescriptorValue} object; this method * allows you to do the same thing, without actually calculating the descriptor. * * @return an object that implements the {@link org.openscience.cdk.qsar.result.IDescriptorResult} interface indicating * the actual type of values returned by the descriptor in the {@link org.openscience.cdk.qsar.DescriptorValue} object */ @Override public IDescriptorResult getDescriptorResultType() { return new IntegerResult(1); }
@Test public void test7LargestChainDescriptor() throws ClassNotFoundException, CDKException, java.lang.Exception { Object[] params = {new Boolean(true), new Boolean(true)}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("CC=CC(C)=O"); //logger.debug("test7>"+((IntegerResult)descriptor.calculate(mol).getValue()).intValue()); Assert.assertEquals(5, ((IntegerResult) descriptor.calculate(mol).getValue()).intValue()); }
/** * Returns the specific type of the DescriptorResult object. * * The return value from this method really indicates what type of result will * be obtained from the {@link org.openscience.cdk.qsar.DescriptorValue} object. Note that the same result * can be achieved by interrogating the {@link org.openscience.cdk.qsar.DescriptorValue} object; this method * allows you to do the same thing, without actually calculating the descriptor. * * @return an object that implements the {@link org.openscience.cdk.qsar.result.IDescriptorResult} interface indicating * the actual type of values returned by the descriptor in the {@link org.openscience.cdk.qsar.DescriptorValue} object */ @Override public IDescriptorResult getDescriptorResultType() { return new IntegerResult(1); }
@Test public void test1LargestChainDescriptor() throws ClassNotFoundException, CDKException, java.lang.Exception { Object[] params = {new Boolean(true), new Boolean(true)}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("c1ccccc1"); // benzol //logger.debug("test1>:"+((IntegerResult)descriptor.calculate(mol).getValue()).intValue()); Assert.assertEquals(0, ((IntegerResult) descriptor.calculate(mol).getValue()).intValue()); }
/** * Returns the specific type of the DescriptorResult object. * * The return value from this method really indicates what type of result will * be obtained from the {@link org.openscience.cdk.qsar.DescriptorValue} object. Note that the same result * can be achieved by interrogating the {@link org.openscience.cdk.qsar.DescriptorValue} object; this method * allows you to do the same thing, without actually calculating the descriptor. * * @return an object that implements the {@link org.openscience.cdk.qsar.result.IDescriptorResult} interface indicating * the actual type of values returned by the descriptor in the {@link org.openscience.cdk.qsar.DescriptorValue} object */ @Override public IDescriptorResult getDescriptorResultType() { return new IntegerResult(1); }
@Test public void test9LargestChainDescriptor() throws ClassNotFoundException, CDKException, java.lang.Exception { Object[] params = {new Boolean(true), new Boolean(true)}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("Nc1c(cn[nH]1)C#N"); Assert.assertEquals(2, ((IntegerResult) descriptor.calculate(mol).getValue()).intValue()); }
/** * Returns the specific type of the DescriptorResult object. * * The return value from this method really indicates what type of result will * be obtained from the {@link org.openscience.cdk.qsar.DescriptorValue} object. Note that the same result * can be achieved by interrogating the {@link org.openscience.cdk.qsar.DescriptorValue} object; this method * allows you to do the same thing, without actually calculating the descriptor. * * @return an object that implements the {@link org.openscience.cdk.qsar.result.IDescriptorResult} interface indicating * the actual type of values returned by the descriptor in the {@link org.openscience.cdk.qsar.DescriptorValue} object */ @Override public IDescriptorResult getDescriptorResultType() { return new IntegerResult(1); }