/** * */ @Test public void testSetMaxResoStruc_Int() throws Exception { GasteigerPEPEPartialCharges peoe = new GasteigerPEPEPartialCharges(); int MX_RESON = 1; peoe.setMaxResoStruc(MX_RESON); Assert.assertEquals(MX_RESON, peoe.getMaxResoStruc()); }
@Override public void calculateCharges(IAtomContainer container) throws CDKException { try { this.assignGasteigerPiPartialCharges(container, true); } catch (Exception exception) { throw new CDKException("Could not calculate Gasteiger-Marsili PEPE charges: " + exception.getMessage(), exception); } }
/** * */ @Test public void testSetMaxGasteigerIters_Double() throws Exception { GasteigerPEPEPartialCharges peoe = new GasteigerPEPEPartialCharges(); int MX_ITERATIONS = 10; peoe.setMaxGasteigerIters(MX_ITERATIONS); Assert.assertEquals(MX_ITERATIONS, peoe.getMaxGasteigerIters()); }
/** * */ @Test public void testSetStepSize() throws Exception { GasteigerPEPEPartialCharges peoe = new GasteigerPEPEPartialCharges(); int STEP_SIZE = 22; peoe.setStepSize(STEP_SIZE); Assert.assertEquals(STEP_SIZE, peoe.getStepSize()); }
if (maxIterations != -1) pepe.setMaxGasteigerIters(maxIterations); if (maxResonStruc != -1) pepe.setMaxResoStruc(maxResonStruc); it.next().setCharge(0.0); pepe.assignGasteigerPiPartialCharges(ac, true); for (int i = 0; i < ac.getAtomCount(); i++) cacheDescriptorValue(ac.getAtom(i), ac, new DoubleResult(peoeAtom.get(i)
PiElectronegativity pielectronegativity = new PiElectronegativity(); GasteigerMarsiliPartialCharges peoe = new GasteigerMarsiliPartialCharges(); GasteigerPEPEPartialCharges pepe = new GasteigerPEPEPartialCharges(); Polarizability pol = new Polarizability(); StabilizationCharges stabil = new StabilizationCharges(); container.getAtom(i).setCharge(0.0); try { pepe.assignGasteigerPiPartialCharges(container, true); } catch (Exception e) { e.printStackTrace();
/** * Constructor for the BondPartialPiChargeDescriptor object. */ public BondPartialPiChargeDescriptor() { pepe = new GasteigerPEPEPartialCharges(); }
/** * @cdk.bug 2013689 * @throws Exception */ @Test public void testAromaticBondOrders() throws Exception { GasteigerPEPEPartialCharges peoe = new GasteigerPEPEPartialCharges(); String smiles1 = "c1ccccc1"; SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol1 = sp.parseSmiles(smiles1); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol1); Aromaticity.cdkLegacy().apply(mol1); addExplicitHydrogens(mol1); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol1); lpcheck.saturate(mol1); List<Boolean> oldBondOrders = new ArrayList<Boolean>(); for (int i = 0; i < mol1.getBondCount(); i++) oldBondOrders.add(mol1.getBond(i).getFlag(CDKConstants.ISAROMATIC)); peoe.calculateCharges(mol1); List<Boolean> newBondOrders = new ArrayList<Boolean>(); for (int i = 0; i < mol1.getBondCount(); i++) newBondOrders.add(mol1.getBond(i).getFlag(CDKConstants.ISAROMATIC)); for (int i = 0; i < oldBondOrders.size(); i++) { Assert.assertEquals("bond " + i + " does not match", oldBondOrders.get(i), newBondOrders.get(i)); } }
/** * */ @Test public void testGetStepSize() throws Exception { GasteigerPEPEPartialCharges peoe = new GasteigerPEPEPartialCharges(); Assert.assertEquals(5, peoe.getStepSize()); }
/** * */ @Test public void testGetMaxResoStruc() throws Exception { GasteigerPEPEPartialCharges peoe = new GasteigerPEPEPartialCharges(); Assert.assertEquals(50, peoe.getMaxResoStruc()); }
/** * */ @Test public void testGetMaxGasteigerIters() throws Exception { GasteigerPEPEPartialCharges peoe = new GasteigerPEPEPartialCharges(); Assert.assertEquals(8, peoe.getMaxGasteigerIters()); }
/** * */ @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)); } }
iSet.addAtomContainer(molPi); gasteigerFactors = pepe.assignrPiMarsilliFactors(iSet); int stepSize = pepe.getStepSize(); int start = (stepSize * (atomPosition) + atomPosition); double q = atomi.getCharge();
if (maxIterations != -1) pepe.setMaxGasteigerIters(maxIterations); if (maxResonStruc != -1) pepe.setMaxResoStruc(maxResonStruc); it.next().setCharge(0.0); pepe.assignGasteigerPiPartialCharges(ac, true); for (int i = 0; i < ac.getBondCount(); i++) { IBond bondi = ac.getBond(i);
/** * */ @Test public void testAssignGasteigerPiPartialCharges_IAtomContainer_Boolean() throws Exception { double[] testResult = {0.0, 0.0, 0.0, 0.0, 0.0}; 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); peoe.assignGasteigerPiPartialCharges(molecule, true); for (int i = 0; i < molecule.getAtomCount(); i++) { //logger.debug("Charge for atom:"+i+" S:"+mol.getAtomAt(i).getSymbol()+" Charge:"+mol.getAtomAt(i).getCharge()); Assert.assertEquals(testResult[i], molecule.getAtom(i).getCharge(), 0.01); } }
/** * Constructor for the PartialPiChargeDescriptor object */ public PartialPiChargeDescriptor() { pepe = new GasteigerPEPEPartialCharges(); }
/** * A unit test for JUnit with methylenfluoride * * @cdk.inchi InChI=1/CH3F/c1-2/h1H3 */ @Test public void testCalculateCharges_IAtomContainer() throws Exception { double[] testResult = {0.0, 0.0, 0.0, 0.0, 0.0}; 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); peoe.calculateCharges(molecule); for (int i = 0; i < molecule.getAtomCount(); i++) { //logger.debug("Charge for atom:"+i+" S:"+mol.getAtomAt(i).getSymbol()+" Charge:"+mol.getAtomAt(i).getCharge()); Assert.assertEquals(testResult[i], molecule.getAtom(i).getCharge(), 0.01); } }
iSet.addAtomContainer(molPi); gasteigerFactors = pepe.assignrPiMarsilliFactors(iSet); int stepSize = pepe.getStepSize(); int start = (stepSize * (atomPosition) + atomPosition); double q = atomi.getCharge();
if (maxIterations != -1) pepe.setMaxGasteigerIters(maxIterations); if (maxResonStruc != -1) pepe.setMaxResoStruc(maxResonStruc); try { for (int i = 0; i < ac.getAtomCount(); i++) ac.getAtom(i).setCharge(0.0); pepe.assignGasteigerPiPartialCharges(ac, true); for (int i = 0; i < ac.getAtomCount(); i++) {
PiElectronegativity pielectronegativity = new PiElectronegativity(); GasteigerMarsiliPartialCharges peoe = new GasteigerMarsiliPartialCharges(); GasteigerPEPEPartialCharges pepe = new GasteigerPEPEPartialCharges(); Polarizability pol = new Polarizability(); StabilizationCharges stabil = new StabilizationCharges(); container.getAtom(i).setCharge(0.0); try { pepe.assignGasteigerPiPartialCharges(container, true); } catch (Exception e) { e.printStackTrace();