GasteigerPEPEPartialCharges implements IChargeCalculator { public double[][] assignrPiMarsilliFactors(IAtomContainerSet setAc) { double[][] gasteigerFactors = new double[setAc.getAtomContainerCount()][(setAc.getAtomContainer(0) .getAtomCount() * (STEP_SIZE + 1))]; String AtomSymbol = ""; double[] factors = new double[]{0.0, 0.0, 0.0}; for (int k = 1; k < setAc.getAtomContainerCount(); k++) { IAtomContainer ac = setAc.getAtomContainer(k); for (int i = 0; i < ac.getAtomCount(); i++) { factors[0] = 0.0; factors[1] = 0.0; factors[2] = 0.0; AtomSymbol = ac.getAtom(i).getSymbol(); if (AtomSymbol.equals("H")) { factors[0] = 0.0; factors[1] = 0.0; factors[2] = 0.0; } else if (AtomSymbol.equals("C")) { factors[0] = 5.98; factors[1] = 7.93; factors[2] = 1.94; } else if (AtomSymbol.equals("O")) { if (ac.getMaximumBondOrder(ac.getAtom(i)) != IBond.Order.SINGLE) { factors[0] = 11.2; factors[1] = 13.24; factors[2] = 9.68; } else { factors[0] = 7.91; factors[1] = 14.76; factors[2] = 6.85; } } else if (AtomSymbol.equals("N")) { if (ac.getMaximumBondOrder(ac.getAtom(i)) != IBond.Order.SINGLE) { factors[0] = 8.95; factors[1] = 9.73; factors[2] = 2.67; } else { factors[0] = 4.54; factors[1] = 11.86; factors[2] = 7.32; } } else if (AtomSymbol.equals("P")) { if (ac.getMaximumBondOrder(ac.getAtom(i)) != IBond.Order.SINGLE) { factors[0] = 10.73; factors[1] = 11.16; factors[2] = 6.81; } else { factors[0] = 9.60; factors[1] = 13.32; factors[2] = 2.72; } } else if (AtomSymbol.equals("S")) { if (ac.getMaximumBondOrder(ac.getAtom(i)) != IBond.Order.SINGLE) { factors[0] = 7.73; factors[1] = 8.16; factors[2] = 1.81; } else { factors[0] = 6.60; factors[1] = 10.32; factors[2] = 3.72; } } else if (AtomSymbol.equals("F")) { factors[0] = 7.14; factors[1] = 13.86; factors[2] = 5.68; } else if (AtomSymbol.equals("Cl")) { factors[0] = 6.51; factors[1] = 11.02; factors[2] = 4.52; } else if (AtomSymbol.equals("Br")) { factors[0] = 5.20; factors[1] = 9.68; factors[2] = 4.48; } else if (AtomSymbol.equals("I")) { factors[0] = 4.95; factors[1] = 8.81; factors[2] = 3.86; } gasteigerFactors[k][STEP_SIZE * i + i] = factors[0]; gasteigerFactors[k][STEP_SIZE * i + i + 1] = factors[1]; gasteigerFactors[k][STEP_SIZE * i + i + 2] = factors[2]; gasteigerFactors[k][STEP_SIZE * i + i + 5] = ac.getAtom(i).getCharge(); if (factors[0] == 0 && factors[1] == 0 && factors[2] == 0) { gasteigerFactors[k][STEP_SIZE * i + i + 3] = 1; } else { gasteigerFactors[k][STEP_SIZE * i + i + 3] = factors[0] + factors[1] + factors[2]; } } } return gasteigerFactors; } GasteigerPEPEPartialCharges(); void setMaxGasteigerIters(int iters); void setMaxResoStruc(int numbReson); int getMaxGasteigerIters(); int getMaxResoStruc(); IAtomContainer assignGasteigerPiPartialCharges(IAtomContainer ac, boolean setCharge); @Override void calculateCharges(IAtomContainer container); int getStepSize(); void setStepSize(int step); double[][] assignrPiMarsilliFactors(IAtomContainerSet setAc);  }
@Test public void testAssignrPiMarsilliFactors_IAtomContainerSet() throws Exception { GasteigerPEPEPartialCharges peoe = new GasteigerPEPEPartialCharges(); IAtomContainer molecule = builder.newInstance(IAtomContainer.class); molecule.addAtom(new Atom("C")); molecule.addAtom(new Atom("F")); molecule.addBond(0, 1, IBond.Order.SINGLE); addExplicitHydrogens(molecule); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule); lpcheck.saturate(molecule); for (Iterator<IAtom> it = molecule.atoms().iterator(); it.hasNext();) it.next().setCharge(0.0); IAtomContainerSet set = builder.newInstance(IAtomContainerSet.class); set.addAtomContainer(molecule); set.addAtomContainer(molecule); addExplicitHydrogens(molecule); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule); lpcheck.saturate(molecule); Assert.assertNotNull(peoe.assignrPiMarsilliFactors(set)); }