PetitjeanShapeIndexDescriptor extends AbstractMolecularDescriptor implements IMolecularDescriptor { public PetitjeanShapeIndexDescriptor() {} PetitjeanShapeIndexDescriptor(); @Override DescriptorSpecification getSpecification(); @Override void setParameters(Object[] params); @Override Object[] getParameters(); @Override String[] getDescriptorNames(); @Override String[] getParameterNames(); @Override Object getParameterType(String name); @Override DescriptorValue calculate(IAtomContainer container); @Override IDescriptorResult getDescriptorResultType();  }
@Test public void testPetitjeanShapeIndexDescriptor() throws ClassNotFoundException, CDKException, Exception { String filename = "data/mdl/petitejean.sdf"; InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename); ISimpleChemObjectReader reader = new MDLV2000Reader(ins); ChemFile content = (ChemFile) reader.read((ChemObject) new ChemFile()); List cList = ChemFileManipulator.getAllAtomContainers(content); IAtomContainer ac = (IAtomContainer) cList.get(0); DescriptorValue result = descriptor.calculate(ac); DoubleArrayResult dar = (DoubleArrayResult) result.getValue(); Assert.assertEquals(0.5, dar.get(0), 0.00001); Assert.assertEquals(0.606477, dar.get(1), 0.000001); ac = (IAtomContainer) cList.get(1); result = descriptor.calculate(ac); dar = (DoubleArrayResult) result.getValue(); Assert.assertEquals(0.666666, dar.get(0), 0.000001); Assert.assertEquals(0.845452, dar.get(1), 0.000001); }