IPAtomicLearningDescriptor extends AbstractAtomicDescriptor { @Override public DescriptorValue calculate(IAtom atom, IAtomContainer container) { double value = 0; String originalAtomtypeName = atom.getAtomTypeName(); Integer originalNeighborCount = atom.getFormalNeighbourCount(); Integer originalValency = atom.getValency(); IAtomType.Hybridization originalHybrid = atom.getHybridization(); Double originalBondOrderSum = atom.getBondOrderSum(); Order originalMaxBondOrder = atom.getMaxBondOrder(); if (!isCachedAtomContainer(container)) { try { AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(container); LonePairElectronChecker lpcheck = new LonePairElectronChecker(); lpcheck.saturate(container); } catch (CDKException e) { return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult( Double.NaN), getDescriptorNames(), e); } } try { value = IonizationPotentialTool.predictIP(container, atom); } catch (CDKException e) { return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult( Double.NaN), getDescriptorNames(), e); } atom.setAtomTypeName(originalAtomtypeName); atom.setFormalNeighbourCount(originalNeighborCount); atom.setValency(originalValency); atom.setHybridization(originalHybrid); atom.setMaxBondOrder(originalMaxBondOrder); atom.setBondOrderSum(originalBondOrderSum); return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(value), getDescriptorNames()); } IPAtomicLearningDescriptor(); @Override DescriptorSpecification getSpecification(); @Override void setParameters(Object[] params); @Override Object[] getParameters(); @Override String[] getDescriptorNames(); @Override DescriptorValue calculate(IAtom atom, IAtomContainer container); @Override String[] getParameterNames(); @Override Object getParameterType(String name);  }
@Test public void testIPDescriptor0() throws ClassNotFoundException, CDKException, java.lang.Exception { IAtomContainer mol = builder.newInstance(IAtomContainer.class); mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addBond(0, 1, IBond.Order.SINGLE); mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addBond(1, 2, IBond.Order.SINGLE); mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addBond(1, 3, IBond.Order.SINGLE); mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addBond(3, 4, IBond.Order.SINGLE); mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addBond(3, 5, IBond.Order.SINGLE); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getAtom(3), mol).getValue()).doubleValue(); double resultAccordingNIST = 0.0; Assert.assertEquals(resultAccordingNIST, result, 0.0001); }
@Test @Category(SlowTest.class) public void testIPDescriptor1() throws Exception { IAtomContainer mol = builder.newInstance(IAtomContainer.class); mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addBond(0, 1, IBond.Order.SINGLE); mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addBond(1, 2, IBond.Order.SINGLE); mol.addAtom(builder.newInstance(IAtom.class, "Cl")); mol.addBond(2, 3, IBond.Order.SINGLE); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getAtom(3), mol).getValue()).doubleValue(); double resultAccordingNIST = 10.8; Assert.assertEquals(resultAccordingNIST, result, 0.4); }
@Test @Category(SlowTest.class) public void testIPDescriptor2() throws ClassNotFoundException, CDKException, java.lang.Exception { IAtomContainer mol = sp.parseSmiles("CC(CC)Cl"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getAtom(4), mol).getValue()).doubleValue(); double resultAccordingNIST = 10.57; Assert.assertEquals(resultAccordingNIST, result, 0.35); }
@Test @Category(SlowTest.class) public void testIPDescriptor_1() throws ClassNotFoundException, CDKException, java.lang.Exception { IAtomContainer mol = sp.parseSmiles("C-Cl"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getAtom(1), mol).getValue()).doubleValue(); double resultAccordingNIST = 11.26; Assert.assertEquals(resultAccordingNIST, result, 0.3); }
@Test @Category(SlowTest.class) public void testIPDescriptor_2() throws ClassNotFoundException, CDKException, java.lang.Exception { IAtomContainer mol = sp.parseSmiles("C-C-Br"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getAtom(2), mol).getValue()).doubleValue(); double resultAccordingNIST = 10.29; Assert.assertEquals(resultAccordingNIST, result, 0.8); }
@Test @Category(SlowTest.class) public void testIPDescriptor_4() throws ClassNotFoundException, CDKException, java.lang.Exception { IAtomContainer mol = sp.parseSmiles("C-C-O"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getAtom(2), mol).getValue()).doubleValue(); double resultAccordingNIST = 10.48; Assert.assertEquals(resultAccordingNIST, result, 0.5); }
@Test @Category(SlowTest.class) public void testIPDescriptor_5() throws ClassNotFoundException, CDKException, java.lang.Exception { IAtomContainer mol = sp.parseSmiles("N1(C)CCC(C)(C)CC1"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); LonePairElectronChecker lpcheck = new LonePairElectronChecker(); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getAtom(0), mol).getValue()).doubleValue(); double resultAccordingNIST = 7.77; Assert.assertEquals(resultAccordingNIST, result, 0.3); }
@Test @Category(SlowTest.class) public void testIPDescriptor_6() throws ClassNotFoundException, CDKException, java.lang.Exception { IAtomContainer mol = sp.parseSmiles("C-N-C"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); LonePairElectronChecker lpcheck = new LonePairElectronChecker(); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getAtom(1), mol).getValue()).doubleValue(); double resultAccordingNIST = 8.24; Assert.assertEquals(resultAccordingNIST, result, 0.5); }
@Test @Category(SlowTest.class) public void testIPDescriptor_7() throws ClassNotFoundException, CDKException, java.lang.Exception { IAtomContainer mol = sp.parseSmiles("C-C-N"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); LonePairElectronChecker lpcheck = new LonePairElectronChecker(); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getAtom(2), mol).getValue()).doubleValue(); double resultAccordingNIST = 8.9; Assert.assertEquals(resultAccordingNIST, result, 0.35); }
@Test @Category(SlowTest.class) public void testIPDescriptor_8() throws ClassNotFoundException, CDKException, java.lang.Exception { IAtomContainer mol = sp.parseSmiles("C-C-P-C-C"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); LonePairElectronChecker lpcheck = new LonePairElectronChecker(); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getAtom(2), mol).getValue()).doubleValue(); double resultAccordingNIST = 8.5; Assert.assertEquals(resultAccordingNIST, result, 0.38); }
@Test @Category(SlowTest.class) public void testIPDescriptor_9() throws ClassNotFoundException, CDKException, java.lang.Exception { IAtomContainer mol = sp.parseSmiles("O=C(C)CC(C)C"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getAtom(0), mol).getValue()).doubleValue(); double resultAccordingNIST = 9.3; Assert.assertEquals(resultAccordingNIST, result, 0.4); }
@Test @Category(SlowTest.class) public void testIPDescriptor_10() throws ClassNotFoundException, CDKException, java.lang.Exception { IAtomContainer mol = sp.parseSmiles("O=C1C2CCC1CC2"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getAtom(0), mol).getValue()).doubleValue(); double resultAccordingNIST = 9.01; Assert.assertEquals(resultAccordingNIST, result, 0.3); }
@Test @Category(SlowTest.class) public void testIPDescriptor_14() throws Exception { IAtomContainer mol = sp.parseSmiles("CCOCCCO"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getAtom(2), mol).getValue()).doubleValue(); Assert.assertFalse(Double.isNaN(result)); result = ((DoubleResult) descriptor.calculate(mol.getAtom(7), mol).getValue()).doubleValue(); Assert.assertFalse(Double.isNaN(result)); }
@Test @Category(SlowTest.class) public void testIPPySystemWithHeteroatomDescriptor3() throws Exception { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("O(C=CC=C)C"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getAtom(0), mol).getValue()).doubleValue(); double resultAccordingNIST = 8.03; Assert.assertEquals(resultAccordingNIST, result, 0.8); }
@Test @Category(SlowTest.class) public void testIPPySystemWithHeteroatomDescriptor2() throws Exception { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("OC=CC"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getAtom(0), mol).getValue()).doubleValue(); double resultAccordingNIST = 8.64; Assert.assertEquals(resultAccordingNIST, result, 0.21); }
@Test @Category(SlowTest.class) public void testIPPySystemWithHeteroatomDescriptor1() throws Exception { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("C1=C(C)CCS1"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); lpcheck.saturate(mol); double result = ((DoubleResult) descriptor.calculate(mol.getAtom(5), mol).getValue()).doubleValue(); double resultAccordingNIST = 7.77; Assert.assertEquals(resultAccordingNIST, result, 0.7); }