IPMolecularLearningDescriptor extends AbstractMolecularDescriptor implements IMolecularDescriptor { public DescriptorValue calculatePlus(IAtomContainer container) throws CDKException { ArrayList<Double> dar = new ArrayList<Double>(); for (Iterator<IAtom> itA = container.atoms().iterator(); itA.hasNext();) { IAtom atom = itA.next(); double value = IonizationPotentialTool.predictIP(container, atom); if (value != 0) dar.add(value); } for (Iterator<IBond> itB = container.bonds().iterator(); itB.hasNext();) { IBond bond = itB.next(); if (bond.getOrder() == IBond.Order.DOUBLE & bond.getBegin().getSymbol().equals("C") & bond.getEnd().getSymbol().equals("C")) { double value = IonizationPotentialTool.predictIP(container, bond); if (value != 0) dar.add(value); } } DoubleArrayResult results = arrangingEnergy(dar); return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), results, getDescriptorNames(), null); } IPMolecularLearningDescriptor(); @Override DescriptorSpecification getSpecification(); @Override void setParameters(Object[] params); @Override Object[] getParameters(); @Override String[] getDescriptorNames(); @Override DescriptorValue calculate(IAtomContainer atomContainer); DescriptorValue calculatePlus(IAtomContainer container); @Override IDescriptorResult getDescriptorResultType(); @Override String[] getParameterNames(); @Override Object getParameterType(String name);  }
@Test @Category(SlowTest.class) public void testIPDescriptor_2() throws Exception { IAtomContainer mol = sp.parseSmiles("COCCCC=O"); addExplicitHydrogens(mol); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); lpcheck.saturate(mol); IPMolecularLearningDescriptor descriptor = new IPMolecularLearningDescriptor(); DoubleArrayResult dar = ((DoubleArrayResult) (descriptor).calculatePlus(mol).getValue()); double resultAccordingNIST = 9.37; Assert.assertEquals(2, dar.length()); Assert.assertEquals(resultAccordingNIST, dar.get(0), 0.3); }
@Test @Category(SlowTest.class) public void testIPDescriptor_3() throws Exception { IAtomContainer mol = sp.parseSmiles("C=CCCC(=O)C"); addExplicitHydrogens(mol); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); lpcheck.saturate(mol); IPMolecularLearningDescriptor descriptor = new IPMolecularLearningDescriptor(); DoubleArrayResult dar = ((DoubleArrayResult) ((IPMolecularLearningDescriptor) descriptor).calculatePlus(mol) .getValue()); double resultAccordingNIST = 9.50; Assert.assertEquals(2, dar.length()); Assert.assertEquals(resultAccordingNIST, dar.get(0), 0.6); }
@Test @Category(SlowTest.class) public void testBug_2787332_triclosan() throws Exception { IAtomContainer mol = builder.newInstance(IAtomContainer.class); mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addAtom(builder.newInstance(IAtom.class, "O")); mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addAtom(builder.newInstance(IAtom.class, "Cl")); mol.addAtom(builder.newInstance(IAtom.class, "Cl")); mol.addAtom(builder.newInstance(IAtom.class, "O")); mol.addAtom(builder.newInstance(IAtom.class, "Cl")); mol.addBond(0, 1, Order.SINGLE); mol.addBond(1, 2, Order.DOUBLE); mol.addBond(2, 3, Order.SINGLE); mol.addBond(3, 4, Order.DOUBLE); mol.addBond(4, 5, Order.SINGLE); mol.addBond(5, 0, Order.DOUBLE); mol.addBond(5, 6, Order.SINGLE); mol.addBond(6, 7, Order.SINGLE); mol.addBond(7, 8, Order.DOUBLE); mol.addBond(8, 9, Order.SINGLE); mol.addBond(9, 10, Order.DOUBLE); mol.addBond(10, 11, Order.SINGLE); mol.addBond(11, 12, Order.DOUBLE); mol.addBond(12, 7, Order.SINGLE); mol.addBond(0, 13, Order.SINGLE); mol.addBond(2, 14, Order.SINGLE); mol.addBond(10, 16, Order.SINGLE); mol.addBond(12, 15, Order.SINGLE); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); CDKHydrogenAdder adder = CDKHydrogenAdder.getInstance(mol.getBuilder()); adder.addImplicitHydrogens(mol); AtomContainerManipulator.convertImplicitToExplicitHydrogens(mol); IPMolecularLearningDescriptor descriptor = new IPMolecularLearningDescriptor(); DoubleArrayResult dar = ((DoubleArrayResult) ((IPMolecularLearningDescriptor) descriptor).calculatePlus(mol) .getValue()); Assert.assertEquals(6, dar.length()); }