/** * Constructor for the Electronegativity object. * * @param maxIterations The maximal number of Iteration * @param maxResonStruc The maximal number of Resonance Structures */ public Electronegativity(int maxIterations, int maxResonStruc) { peoe = new GasteigerMarsiliPartialCharges(); maxI = maxIterations; maxRS = maxResonStruc; }
/** * Constructor for the Electronegativity object. * * @param maxIterations The maximal number of Iteration * @param maxResonStruc The maximal number of Resonance Structures */ public Electronegativity(int maxIterations, int maxResonStruc) { peoe = new GasteigerMarsiliPartialCharges(); maxI = maxIterations; maxRS = maxResonStruc; }
/** * Constructor for the PartialSigmaChargeDescriptor object */ public PartialSigmaChargeDescriptor() { peoe = new GasteigerMarsiliPartialCharges(); }
/** * Constructor for the BondPartialSigmaChargeDescriptor object. */ public BondPartialSigmaChargeDescriptor() { peoe = new GasteigerMarsiliPartialCharges(); }
/** * Constructor for the Electronegativity object. * * @param maxIterations The maximal number of Iteration * @param maxResonStruc The maximal number of Resonance Structures */ public PiElectronegativity(int maxIterations, int maxResonStruc) { peoe = new GasteigerMarsiliPartialCharges(); pepe = new GasteigerPEPEPartialCharges(); maxI = maxIterations; maxRS = maxResonStruc; }
/** * Constructor for the BondPartialTChargeDescriptor object. */ public BondPartialTChargeDescriptor() { peoe = new GasteigerMarsiliPartialCharges(); pepe = new GasteigerPEPEPartialCharges(); }
/** * Constructor for the PartialTChargePEOEDescriptor object */ public PartialTChargePEOEDescriptor() { peoe = new GasteigerMarsiliPartialCharges(); pepe = new GasteigerPEPEPartialCharges(); }
/** * Constructor for the Electronegativity object. * * @param maxIterations The maximal number of Iteration * @param maxResonStruc The maximal number of Resonance Structures */ public PiElectronegativity(int maxIterations, int maxResonStruc) { peoe = new GasteigerMarsiliPartialCharges(); pepe = new GasteigerPEPEPartialCharges(); maxI = maxIterations; maxRS = maxResonStruc; }
/** * */ @Test public void testGetChiCatHydrogen() throws Exception { GasteigerMarsiliPartialCharges peoe = new GasteigerMarsiliPartialCharges(); Assert.assertEquals(20, peoe.getMaxGasteigerIters(), 0.01); }
private static double[] listcharges(IAtomContainer container) throws CDKException { int natom = container.getAtomCount(); double[] charges = new double[natom]; try { IAtomContainer mol = container.getBuilder().newInstance(IAtomContainer.class, ((IAtomContainer) container.clone())); GasteigerMarsiliPartialCharges peoe = new GasteigerMarsiliPartialCharges(); peoe.assignGasteigerMarsiliSigmaPartialCharges(mol, true); for (int i = 0; i < natom; i++) { IAtom atom = mol.getAtom(i); charges[i] = atom.getCharge(); } } catch (Exception ex1) { throw new CDKException("Problems with assignGasteigerMarsiliPartialCharges due to " + ex1.toString(), ex1); } return charges; }
private static double[] listcharges(IAtomContainer container) throws CDKException { int natom = container.getAtomCount(); double[] charges = new double[natom]; try { IAtomContainer mol = container.getBuilder().newInstance(IAtomContainer.class, ((IAtomContainer) container.clone())); GasteigerMarsiliPartialCharges peoe = new GasteigerMarsiliPartialCharges(); peoe.assignGasteigerMarsiliSigmaPartialCharges(mol, true); for (int i = 0; i < natom; i++) { IAtom atom = mol.getAtom(i); charges[i] = atom.getCharge(); } } catch (Exception ex1) { throw new CDKException("Problems with assignGasteigerMarsiliPartialCharges due to " + ex1.toString(), ex1); } return charges; }
/** * */ @Test public void testGetStepSize() throws Exception { GasteigerMarsiliPartialCharges peoe = new GasteigerMarsiliPartialCharges(); Assert.assertEquals(5, peoe.getStepSize()); }
/** * */ @Test public void testGetMaxGasteigerIters() throws Exception { GasteigerMarsiliPartialCharges peoe = new GasteigerMarsiliPartialCharges(); Assert.assertEquals(20, peoe.getMaxGasteigerIters(), 0.01); }
/** * */ @Test public void testGetMaxGasteigerDamp() throws Exception { GasteigerMarsiliPartialCharges peoe = new GasteigerMarsiliPartialCharges(); Assert.assertEquals(20, peoe.getMaxGasteigerIters(), 0.01); }
/** * */ @Test public void testSetChiCatHydrogen_Double() throws Exception { GasteigerMarsiliPartialCharges peoe = new GasteigerMarsiliPartialCharges(); double DEOC_HYDROGEN = 22; peoe.setChiCatHydrogen(DEOC_HYDROGEN); Assert.assertEquals(DEOC_HYDROGEN, peoe.getChiCatHydrogen(), 0.01); }
/** * */ @Test public void testSetMaxGasteigerIters_Double() throws Exception { GasteigerMarsiliPartialCharges peoe = new GasteigerMarsiliPartialCharges(); double MX_ITERATIONS = 10; peoe.setMaxGasteigerIters(MX_ITERATIONS); Assert.assertEquals(MX_ITERATIONS, peoe.getMaxGasteigerIters(), 0.01); }
/** * */ @Test public void testSetMaxGasteigerDamp_Double() throws Exception { GasteigerMarsiliPartialCharges peoe = new GasteigerMarsiliPartialCharges(); double MX_DAMP = 1; peoe.setMaxGasteigerDamp(MX_DAMP); Assert.assertEquals(MX_DAMP, peoe.getMaxGasteigerDamp(), 0.01); }
/** * */ @Test public void testSetStepSize() throws Exception { GasteigerMarsiliPartialCharges peoe = new GasteigerMarsiliPartialCharges(); int STEP_SIZE = 22; peoe.setStepSize(STEP_SIZE); Assert.assertEquals(STEP_SIZE, peoe.getStepSize()); }
@Test(expected = CDKException.class) public void testUndefinedPartialCharge() throws Exception { String filename = "data/mdl/burden_undefined.sdf"; InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename); ISimpleChemObjectReader reader = new MDLV2000Reader(ins); ChemFile content = reader.read(new ChemFile()); reader.close(); List<IAtomContainer> cList = ChemFileManipulator.getAllAtomContainers(content); IAtomContainer ac = cList.get(0); Assert.assertNotNull(ac); addExplicitHydrogens(ac); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(ac); Aromaticity.cdkLegacy().apply(ac); addExplicitHydrogens(ac); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(ac); lpcheck.saturate(ac); GasteigerMarsiliPartialCharges peoe = new GasteigerMarsiliPartialCharges(); peoe.calculateCharges(ac); } }
/** * */ @Test public void testAssignGasteigerMarsiliSigmaPartialCharges_IAtomContainer_Boolean() throws Exception { double[] testResult = {0.07915, -0.25264, 0.05783, 0.05783, 0.05783}; GasteigerMarsiliPartialCharges peoe = new GasteigerMarsiliPartialCharges(); 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.assignGasteigerMarsiliSigmaPartialCharges(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); } }