/** * calculate the electronegativity of orbitals sigma. * * @param ac IAtomContainer * @param atom atom for which effective atom electronegativity should be calculated * * @return piElectronegativity */ public double calculateSigmaElectronegativity(IAtomContainer ac, IAtom atom) { return calculateSigmaElectronegativity(ac, atom, maxI, maxRS); }
/** * calculate the electronegativity of orbitals sigma. * * @param ac IAtomContainer * @param atom atom for which effective atom electronegativity should be calculated * * @return piElectronegativity */ public double calculateSigmaElectronegativity(IAtomContainer ac, IAtom atom) { return calculateSigmaElectronegativity(ac, atom, maxI, maxRS); }
/** * The method calculates the sigma electronegativity of a given bond * It is needed to call the addExplicitHydrogensToSatisfyValency method from the class tools.HydrogenAdder. * *@param atomContainer AtomContainer *@return return the sigma electronegativity */ @Override public DescriptorValue calculate(IBond aBond, IAtomContainer atomContainer) { IAtomContainer ac; IBond bond; try { ac = (IAtomContainer) atomContainer.clone(); bond = ac.getBond(atomContainer.indexOf(aBond)); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(ac); } catch (CDKException e) { return getDummyDescriptorValue(e); } catch (CloneNotSupportedException e) { return getDummyDescriptorValue(e); } if (maxIterations != -1 && maxIterations != 0) electronegativity.setMaxIterations(maxIterations); double electroAtom1 = electronegativity.calculateSigmaElectronegativity(ac, bond.getBegin()); double electroAtom2 = electronegativity.calculateSigmaElectronegativity(ac, bond.getEnd()); return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult( Math.abs(electroAtom1 - electroAtom2)), NAMES); }
results[0] += electronegativity.calculateSigmaElectronegativity(container, atom);
/** * The method calculates the sigma electronegativity of a given atom * It is needed to call the addExplicitHydrogensToSatisfyValency method from the class tools.HydrogenAdder. * *@param atom The IAtom for which the DescriptorValue is requested *@param ac AtomContainer *@return return the sigma electronegativity */ @Override public DescriptorValue calculate(IAtom atom, IAtomContainer ac) { IAtomContainer clone; IAtom localAtom; try { clone = (IAtomContainer) ac.clone(); localAtom = clone.getAtom(ac.indexOf(atom)); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(clone); } catch (CDKException e) { return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult( Double.NaN), NAMES, e); } catch (CloneNotSupportedException e) { return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult( Double.NaN), NAMES, e); } if (maxIterations != -1 && maxIterations != 0) electronegativity.setMaxIterations(maxIterations); double result = electronegativity.calculateSigmaElectronegativity(clone, localAtom); return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(result), NAMES); }
results[0] = electronegativity.calculateSigmaElectronegativity(container, atom);
/** * A unit test suite for JUnit. * * @cdk.inchi InChI=1/CH3F/c1-2/h1H3 * * @return The test suite * @throws Exception */ @Test public void testCalculateSigmaElectronegativity_IAtomContainer_IAtom() throws Exception { double[] testResult = {11.308338, 8.7184094, 7.5289848, 7.5289848, 7.5289848}; Electronegativity pe = new Electronegativity(); IAtomContainer molecule = builder.newInstance(IAtomContainer.class); molecule.addAtom(new Atom("F")); molecule.addAtom(new Atom("C")); molecule.addBond(0, 1, IBond.Order.SINGLE); addExplicitHydrogens(molecule); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule); lpcheck.saturate(molecule); for (int i = 0; i < molecule.getAtomCount(); i++) Assert.assertEquals(testResult[i], pe.calculateSigmaElectronegativity(molecule, molecule.getAtom(i)), 0.001); }
/** * A unit test suite for JUnit. * * @cdk.inchi InChI=1/CH3F/c1-2/h1H3 * * @return The test suite * @throws Exception */ @Test public void testCalculateSigmaElectronegativity_IAtomContainer_IAtom_Int_Int() throws Exception { double[] testResult = {11.308338, 8.7184094, 7.5289848, 7.5289848, 7.5289848}; Electronegativity pe = new Electronegativity(); IAtomContainer molecule = builder.newInstance(IAtomContainer.class); molecule.addAtom(new Atom("F")); molecule.addAtom(new Atom("C")); molecule.addBond(0, 1, IBond.Order.SINGLE); addExplicitHydrogens(molecule); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule); lpcheck.saturate(molecule); for (int i = 0; i < molecule.getAtomCount(); i++) { Assert.assertEquals(testResult[i], pe.calculateSigmaElectronegativity(molecule, molecule.getAtom(i), 6, 50), 0.001); } }