MMFF94PartialCharges implements IChargeCalculator { public MMFF94PartialCharges() { } MMFF94PartialCharges(); IAtomContainer assignMMFF94PartialCharges(IAtomContainer ac); @Override void calculateCharges(IAtomContainer container); static final String MMFF_94_CHARGE; }
@Test public void testMMFF94PartialCharges() throws Exception { double[] testResult = {-0.99, 0.314, 0.66, -0.57, -0.65, 0.36, 0.36, 0, 0, 0.5}; SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer ac = sp.parseSmiles("NCC(=O)O"); addExplicitHydrogens(ac); MMFF94PartialCharges mmff = new MMFF94PartialCharges(); mmff.assignMMFF94PartialCharges(ac); for (int i = 0; i < ac.getAtomCount(); i++) { Assert.assertEquals(testResult[i], ((Double) ac.getAtom(i).getProperty("MMFF94charge")).doubleValue(), 0.05); } }