IPBondLearningDescriptor extends AbstractBondDescriptor { @Override public DescriptorValue calculate(IBond bond, IAtomContainer atomContainer) { double value = 0; String originalAtomtypeName1 = bond.getBegin().getAtomTypeName(); Integer originalNeighborCount1 = bond.getBegin().getFormalNeighbourCount(); IAtomType.Hybridization originalHybridization1 = bond.getBegin().getHybridization(); Integer originalValency1 = bond.getBegin().getValency(); String originalAtomtypeName2 = bond.getEnd().getAtomTypeName(); Integer originalNeighborCount2 = bond.getEnd().getFormalNeighbourCount(); IAtomType.Hybridization originalHybridization2 = bond.getEnd().getHybridization(); Integer originalValency2 = bond.getEnd().getValency(); Double originalBondOrderSum1 = bond.getBegin().getBondOrderSum(); Order originalMaxBondOrder1 = bond.getBegin().getMaxBondOrder(); Double originalBondOrderSum2 = bond.getEnd().getBondOrderSum(); Order originalMaxBondOrder2 = bond.getEnd().getMaxBondOrder(); if (!isCachedAtomContainer(atomContainer)) { try { AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(atomContainer); LonePairElectronChecker lpcheck = new LonePairElectronChecker(); lpcheck.saturate(atomContainer); } catch (CDKException e) { return getDummyDescriptorValue(e); } } if (!bond.getOrder().equals(IBond.Order.SINGLE)) { try { value = IonizationPotentialTool.predictIP(atomContainer, bond); } catch (CDKException e) { return getDummyDescriptorValue(e); } } bond.getBegin().setAtomTypeName(originalAtomtypeName1); bond.getBegin().setHybridization(originalHybridization1); bond.getBegin().setValency(originalValency1); bond.getBegin().setFormalNeighbourCount(originalNeighborCount1); bond.getEnd().setAtomTypeName(originalAtomtypeName2); bond.getEnd().setHybridization(originalHybridization2); bond.getEnd().setValency(originalValency2); bond.getEnd().setFormalNeighbourCount(originalNeighborCount2); bond.getBegin().setMaxBondOrder(originalMaxBondOrder1); bond.getBegin().setBondOrderSum(originalBondOrderSum1); bond.getEnd().setMaxBondOrder(originalMaxBondOrder2); bond.getEnd().setBondOrderSum(originalBondOrderSum2); return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(value), DESCRIPTOR_NAMES); } IPBondLearningDescriptor(); @Override DescriptorSpecification getSpecification(); @Override void setParameters(Object[] params); @Override Object[] getParameters(); @Override String[] getDescriptorNames(); @Override DescriptorValue calculate(IBond bond, IAtomContainer atomContainer); @Override String[] getParameterNames(); @Override Object getParameterType(String name);  }
@Test @Category(SlowTest.class) public void testIPDescriptor_1() throws Exception { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("CCCC=CCCCC"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getBond(3), mol).getValue()).doubleValue(); double resultAccordingNIST = 8.80; Assert.assertEquals(result, resultAccordingNIST, 0.051); }
@Test @Category(SlowTest.class) public void testIPDescriptor_2() throws java.lang.Exception { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("CC1CCC=C1"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getBond(4), mol).getValue()).doubleValue(); double resultAccordingNIST = 8.95; Assert.assertEquals(result, resultAccordingNIST, 0.1); }
@Test @Category(SlowTest.class) public void testIPDescriptor_3() throws java.lang.Exception { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("C=CCCCC"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getBond(0), mol).getValue()).doubleValue(); double resultAccordingNIST = 9.44; Assert.assertEquals(result, resultAccordingNIST, 0.3); }
@Test @Category(SlowTest.class) public void testIPDescriptorReaction1() throws java.lang.Exception { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("C=CCCCC"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getBond(0), mol).getValue()).doubleValue(); double resultAccordingNIST = 9.44; Assert.assertEquals(resultAccordingNIST, result, 0.3); }
@Test @Category(SlowTest.class) public void testIPDescriptorReaction2() throws java.lang.Exception { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("CCCCCC"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getBond(0), mol).getValue()).doubleValue(); double resultAccordingNIST = 0.0; Assert.assertEquals(resultAccordingNIST, result, 0.0001); }
@Test @Category(SlowTest.class) public void testIPTripleDescriptor1() throws java.lang.Exception { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("C#CCC"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getBond(0), mol).getValue()).doubleValue(); double resultAccordingNIST = 9.44; Assert.assertEquals(resultAccordingNIST, result, 0.75); }
@Test @Category(SlowTest.class) public void testIPTripleDescriptor2() throws java.lang.Exception { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("C(#CC(C)(C)C)C(C)(C)C"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getBond(0), mol).getValue()).doubleValue(); double resultAccordingNIST = 8.98; Assert.assertEquals(resultAccordingNIST, result, 0.1); }
@Test @Category(SlowTest.class) public void testIPPySystemReaction1() throws java.lang.Exception { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("C=CC=C"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getBond(0), mol).getValue()).doubleValue(); double resultAccordingNIST = 9.072; Assert.assertEquals(resultAccordingNIST, result, 2.11); }