BondSigmaElectronegativityDescriptor extends AbstractBondDescriptor implements IBondDescriptor { @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); } BondSigmaElectronegativityDescriptor(); @Override DescriptorSpecification getSpecification(); @Override void setParameters(Object[] params); @Override Object[] getParameters(); @Override String[] getDescriptorNames(); @Override DescriptorValue calculate(IBond aBond, IAtomContainer atomContainer); @Override String[] getParameterNames(); @Override Object getParameterType(String name);  }
@Test public void testBondSigmaElectronegativityDescriptor_Methyl_chloride() throws java.lang.Exception { double[] testResult = {2.1612, 0.8751}; SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("CCl"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); for (int i = 0; i < 2; i++) { double result = ((DoubleResult) descriptor.calculate(mol.getBond(i), mol).getValue()).doubleValue(); Assert.assertEquals(testResult[i], result, 0.05); } }
@Test public void testBondSigmaElectronegativityDescriptor_Allyl_bromide() throws java.lang.Exception { double[] testResult = {0.2396, 0.3635, 1.7086, 0.3635, 0.338, 0.574, 0.969, 0.969}; SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("C=CCBr"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); for (int i = 0; i < 8; i++) { double result = ((DoubleResult) descriptor.calculate(mol.getBond(i), mol).getValue()).doubleValue(); Assert.assertEquals(testResult[i], result, 0.03); } }
@Test public void testBondSigmaElectronegativityDescriptor_Isopentyl_iodide() throws java.lang.Exception { double testResult = 0.1482; SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("C(C)(C)CCI"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); double result = ((DoubleResult) descriptor.calculate(mol.getBond(0), mol).getValue()).doubleValue(); Assert.assertEquals(testResult, result, 0.001); }
@Test public void testBondSigmaElectronegativityDescriptor_Ethoxy_ethane() throws java.lang.Exception { double[] testResult = {0.7939, 1.0715, 1.0715, 0.7939, 0.2749, 0.2749, 0.2749, 0.8796, 0.8796}; SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("CCOCC"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); for (int i = 0; i < 8; i++) { double result = ((DoubleResult) descriptor.calculate(mol.getBond(i), mol).getValue()).doubleValue(); Assert.assertEquals(testResult[i], result, 0.002); } }
@Test public void testBondSigmaElectronegativityDescriptor_Ethanolamine() throws java.lang.Exception { double[] testResult = {0.0074, 0.3728, 0.8547, 0.2367, 0.2367}; SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("NCCO"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); for (int i = 0; i < 5; i++) { double result = ((DoubleResult) descriptor.calculate(mol.getBond(i), mol).getValue()).doubleValue(); Assert.assertEquals(testResult[i], result, 0.06); } }
@Test public void testBondSigmaElectronegativityDescriptor_Allyl_mercaptan() throws java.lang.Exception { double[] testResult = {0.1832, 0.0143, 0.5307, 0.3593, 0.3593, 8.5917}; SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("C=CCS"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); addExplicitHydrogens(mol); for (int i = 0; i < 4; i++) { double result = ((DoubleResult) descriptor.calculate(mol.getBond(i), mol).getValue()).doubleValue(); Assert.assertEquals(testResult[i], result, 0.005); } }