JPlogPDescriptor extends AbstractMolecularDescriptor implements IMolecularDescriptor { @Override public DescriptorValue calculate(IAtomContainer container) { IAtomContainer struct; try { struct = (IAtomContainer) container.clone(); AtomContainerManipulator.percieveAtomTypesAndConfigureUnsetProperties(struct); CDKHydrogenAdder hAdder = CDKHydrogenAdder.getInstance(struct.getBuilder()); hAdder.addImplicitHydrogens(struct); AtomContainerManipulator.convertImplicitToExplicitHydrogens(struct); Aromaticity.cdkLegacy().apply(struct); } catch (CloneNotSupportedException e) { return getDummyDescriptorValue(e); } catch (CDKException e) { return getDummyDescriptorValue(e); } return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(jplogp.calcLogP(struct)), getDescriptorNames()); } JPlogPDescriptor(); @Override DescriptorSpecification getSpecification(); @Override String[] getParameterNames(); @Override Object getParameterType(String name); @Override void setParameters(Object[] params); @Override Object[] getParameters(); @Override String[] getDescriptorNames(); @Override IDescriptorResult getDescriptorResultType(); @Override DescriptorValue calculate(IAtomContainer container); static final Object[] WEIGHTS_CURR; static final Object[] WEIGHTS_PLANTE_2018; }
@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 testPropionicAcid() throws CDKException { parser = new SmilesParser(SilentChemObjectBuilder.getInstance()); IAtomContainer struct = parseSmiles("CCC(=O)O"); JPlogPDescriptor desc = new JPlogPDescriptor(); DescriptorValue answer = desc.calculate(struct); DoubleResult result = (DoubleResult) answer.getValue(); double output = result.doubleValue(); assertEquals(0.3, output, 0.1); }
@Test public void testAcetonitrile() throws CDKException { parser = new SmilesParser(SilentChemObjectBuilder.getInstance()); IAtomContainer struct = parseSmiles("CC#N"); JPlogPDescriptor desc = new JPlogPDescriptor(); DescriptorValue answer = desc.calculate(struct); DoubleResult result = (DoubleResult) answer.getValue(); double output = result.doubleValue(); assertEquals(0.4, output, 0.1); }
@Test public void testAniline() throws CDKException { parser = new SmilesParser(SilentChemObjectBuilder.getInstance()); IAtomContainer struct = parseSmiles("Nc1ccccc1"); JPlogPDescriptor desc = new JPlogPDescriptor(); DescriptorValue answer = desc.calculate(struct); DoubleResult result = (DoubleResult) answer.getValue(); double output = result.doubleValue(); assertEquals(1.2, output, 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); }