MDEDescriptor extends AbstractMolecularDescriptor implements IMolecularDescriptor { @Override public DescriptorValue calculate(IAtomContainer container) { IAtomContainer local = AtomContainerManipulator.removeHydrogens(container); DoubleArrayResult retval = new DoubleArrayResult(19); for (int i = 0; i < 19; i++) { retval.add(dedge(local, i)); } return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), retval, getDescriptorNames()); } MDEDescriptor(); @Override DescriptorSpecification getSpecification(); @Override void setParameters(Object[] params); @Override Object[] getParameters(); @Override String[] getDescriptorNames(); @Override DescriptorValue calculate(IAtomContainer container); @Override IDescriptorResult getDescriptorResultType(); @Override String[] getParameterNames(); @Override Object getParameterType(String name); static final int MDEC11; static final int MDEC12; static final int MDEC13; static final int MDEC14; static final int MDEC22; static final int MDEC23; static final int MDEC24; static final int MDEC33; static final int MDEC34; static final int MDEC44; static final int MDEO11; static final int MDEO12; static final int MDEO22; static final int MDEN11; static final int MDEN12; static final int MDEN13; static final int MDEN22; static final int MDEN23; static final int MDEN33; }
@Test public void testMDE1() throws ClassNotFoundException, CDKException, Exception { String filename = "data/mdl/mdeotest.sdf"; InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename); ISimpleChemObjectReader reader = new MDLV2000Reader(ins); ChemFile content = (ChemFile) reader.read(new ChemFile()); List cList = ChemFileManipulator.getAllAtomContainers(content); IAtomContainer ac = (IAtomContainer) cList.get(0); DoubleArrayResult result = (DoubleArrayResult) descriptor.calculate(ac).getValue(); Assert.assertEquals(0.0000, result.get(MDEDescriptor.MDEO11), 0.0001); Assert.assertEquals(1.1547, result.get(MDEDescriptor.MDEO12), 0.0001); Assert.assertEquals(2.9416, result.get(MDEDescriptor.MDEO22), 0.0001); }