IonizationPotentialTool { public static double predictIP(IAtomContainer container, IAtom atom) throws CDKException { double value = 0; if (container.getConnectedLonePairsCount(atom) == 0) return value; if (familyHalogen(atom)) value = getDTHalogenF(getQSARs(container, atom)); else if (familyOxygen(atom)) value = getDTOxygenF(getQSARs(container, atom)); else if (familyNitrogen(atom)) value = getDTNitrogenF(getQSARs(container, atom)); return value; }  static double predictIP(IAtomContainer container, IAtom atom); static double predictIP(IAtomContainer container, IBond bond); static double[] getQSARs(IAtomContainer container, IAtom atom); static double[] getQSARs(IAtomContainer container, IBond bond);  }
@Test public void testBenzene() throws Exception { String smiles = "c1ccccc1"; SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer molecule = sp.parseSmiles(smiles); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule); addExplicitHydrogens(molecule); Aromaticity.cdkLegacy().apply(molecule); lpcheck.saturate(molecule); List<Double> carbonIPs = new ArrayList<Double>(); Iterator<IAtom> atoms = molecule.atoms().iterator(); while (atoms.hasNext()) { IAtom atom = atoms.next(); if (atom.getSymbol().equals("H")) continue; carbonIPs.add(IonizationPotentialTool.predictIP(molecule, atom)); } double firstIP = carbonIPs.get(0); for (double ip : carbonIPs) { Assert.assertEquals(firstIP, ip, 0.0001); } }