test_class.file: descriptor/qsarbond/src/test/java/org/openscience/cdk/qsar/descriptors/bond/BondPartialPiChargeDescriptorTest.java
test_class.identifier: BondPartialPiChargeDescriptorTest
test_class.superclass: extends BondDescriptorTest
test_case.body: @Test
      public void testBondPiElectronegativityDescriptor_Isopentyl_iodide() throws ClassNotFoundException, CDKException,
              java.lang.Exception {
          descriptor = new BondPartialPiChargeDescriptor();
          double testResult = 0.0; /*
                                    * from Petra online:
                                    * http://www2.chemie.uni-erlangen
                                    * .de/services/petra/smiles.phtml
                                    */
  
          SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
          IAtomContainer mol = sp.parseSmiles("C(C)(C)CCI");
          addExplicitHydrogens(mol);
          for (int i = 0; i < 6; i++) {
              double result = ((DoubleResult) descriptor.calculate(mol.getBond(i), mol).getValue()).doubleValue();
              Assert.assertEquals(testResult, result, 0.001);
          }
      }
test_case.class_method_signature: BondPartialPiChargeDescriptorTest.testBondPiElectronegativityDescriptor_Isopentyl_iodide()
test_case.full_signature: @Test public void testBondPiElectronegativityDescriptor_Isopentyl_iodide()
test_case.identifier: testBondPiElectronegativityDescriptor_Isopentyl_iodide
test_case.invocations: getInstance parseSmiles addExplicitHydrogens doubleValue getValue calculate getBond assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testBondPiElectronegativityDescriptor_Isopentyl_iodide()
focal_class.declarator: pepe          = null
focal_class.modifier: private
focal_class.original_string: private GasteigerPEPEPartialCharges pepe          = null;
focal_class.type: GasteigerPEPEPartialCharges
focal_class.var_name: pepe
focal_class.declarator: maxIterations = -1
focal_class.modifier: private
focal_class.original_string: private int                         maxIterations = -1;
focal_class.type: int
focal_class.var_name: maxIterations
focal_class.declarator: maxResonStruc = -1
focal_class.modifier: private
focal_class.original_string: private int                         maxResonStruc = -1;
focal_class.type: int
focal_class.var_name: maxResonStruc
focal_class.declarator: lpeChecker    = true
focal_class.modifier: private
focal_class.original_string: private boolean                     lpeChecker    = true;
focal_class.type: boolean
focal_class.var_name: lpeChecker
focal_class.declarator: NAMES = {"pepeB"}
focal_class.modifier: private static final
focal_class.original_string: private static final String[] NAMES = {"pepeB"};
focal_class.type: String[]
focal_class.var_name: NAMES
focal_class.file: descriptor/qsarbond/src/main/java/org/openscience/cdk/qsar/descriptors/bond/BondPartialPiChargeDescriptor.java
focal_class.identifier: BondPartialPiChargeDescriptor
focal_class.class_method_signature: BondPartialPiChargeDescriptor.BondPartialPiChargeDescriptor()
focal_class.full_signature: public  BondPartialPiChargeDescriptor()
focal_class.identifier: BondPartialPiChargeDescriptor
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  BondPartialPiChargeDescriptor()
focal_class.class_method_signature: BondPartialPiChargeDescriptor.getSpecification()
focal_class.full_signature: @Override public DescriptorSpecification getSpecification()
focal_class.identifier: getSpecification
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: DescriptorSpecification
focal_class.signature: DescriptorSpecification getSpecification()
focal_class.class_method_signature: BondPartialPiChargeDescriptor.setParameters(Object[] params)
focal_class.full_signature: @Override public void setParameters(Object[] params)
focal_class.identifier: setParameters
focal_class.modifiers: @Override public
focal_class.parameters: (Object[] params)
focal_class.return: void
focal_class.signature: void setParameters(Object[] params)
focal_class.class_method_signature: BondPartialPiChargeDescriptor.getParameters()
focal_class.full_signature: @Override public Object[] getParameters()
focal_class.identifier: getParameters
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Object[]
focal_class.signature: Object[] getParameters()
focal_class.class_method_signature: BondPartialPiChargeDescriptor.getDescriptorNames()
focal_class.full_signature: @Override public String[] getDescriptorNames()
focal_class.identifier: getDescriptorNames
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String[]
focal_class.signature: String[] getDescriptorNames()
focal_class.class_method_signature: BondPartialPiChargeDescriptor.getDummyDescriptorValue(Exception e)
focal_class.full_signature: private DescriptorValue getDummyDescriptorValue(Exception e)
focal_class.identifier: getDummyDescriptorValue
focal_class.modifiers: private
focal_class.parameters: (Exception e)
focal_class.return: DescriptorValue
focal_class.signature: DescriptorValue getDummyDescriptorValue(Exception e)
focal_class.class_method_signature: BondPartialPiChargeDescriptor.calculate(IBond bond, IAtomContainer ac)
focal_class.full_signature: @Override public DescriptorValue calculate(IBond bond, IAtomContainer ac)
focal_class.identifier: calculate
focal_class.modifiers: @Override public
focal_class.parameters: (IBond bond, IAtomContainer ac)
focal_class.return: DescriptorValue
focal_class.signature: DescriptorValue calculate(IBond bond, IAtomContainer ac)
focal_class.class_method_signature: BondPartialPiChargeDescriptor.getParameterNames()
focal_class.full_signature: @Override public String[] getParameterNames()
focal_class.identifier: getParameterNames
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String[]
focal_class.signature: String[] getParameterNames()
focal_class.class_method_signature: BondPartialPiChargeDescriptor.getParameterType(String name)
focal_class.full_signature: @Override public Object getParameterType(String name)
focal_class.identifier: getParameterType
focal_class.modifiers: @Override public
focal_class.parameters: (String name)
focal_class.return: Object
focal_class.signature: Object getParameterType(String name)
focal_class.superclass: extends AbstractBondDescriptor
focal_method.body: @Override
      public DescriptorValue calculate(IBond bond, IAtomContainer ac) {
          // FIXME: for now I'll cache a few modified atomic properties, and restore them at the end of this method
          Double originalCharge1 = bond.getBegin().getCharge();
          String originalAtomtypeName1 = bond.getBegin().getAtomTypeName();
          Integer originalNeighborCount1 = bond.getBegin().getFormalNeighbourCount();
          IAtomType.Hybridization originalHybridization1 = bond.getBegin().getHybridization();
          Integer originalValency1 = bond.getBegin().getValency();
          Double originalCharge2 = bond.getEnd().getCharge();
          String originalAtomtypeName2 = bond.getEnd().getAtomTypeName();
          Integer originalNeighborCount2 = bond.getEnd().getFormalNeighbourCount();
          IAtomType.Hybridization originalHybridization2 = bond.getEnd().getHybridization();
          Integer originalValency2 = bond.getEnd().getValency();
          Double originalBondOrderSum1 = bond.getBegin().getBondOrderSum();
          Order originalMaxBondOrder1 = bond.getBegin().getMaxBondOrder();
          Double originalBondOrderSum2 = bond.getEnd().getBondOrderSum();
          Order originalMaxBondOrder2 = bond.getEnd().getMaxBondOrder();
          if (!isCachedAtomContainer(ac)) {
              try {
                  AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(ac);
                  if (lpeChecker) {
                      LonePairElectronChecker lpcheck = new LonePairElectronChecker();
                      lpcheck.saturate(ac);
                  }
              } catch (CDKException e) {
                  return getDummyDescriptorValue(e);
              }
  
              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 (Iterator<IBond> it = ac.bonds().iterator(); it.hasNext();) {
                      IBond bondi = it.next();
                      double result = Math.abs(bondi.getBegin().getCharge() - bondi.getEnd().getCharge());
                      cacheDescriptorValue(bondi, ac, new DoubleResult(result));
                  }
              } catch (Exception ex1) {
                  return getDummyDescriptorValue(ex1);
              }
          }
          bond.getBegin().setCharge(originalCharge1);
          bond.getBegin().setAtomTypeName(originalAtomtypeName1);
          bond.getBegin().setHybridization(originalHybridization1);
          bond.getBegin().setValency(originalValency1);
          bond.getBegin().setFormalNeighbourCount(originalNeighborCount1);
          bond.getEnd().setCharge(originalCharge2);
          bond.getEnd().setAtomTypeName(originalAtomtypeName2);
          bond.getEnd().setHybridization(originalHybridization2);
          bond.getEnd().setValency(originalValency2);
          bond.getEnd().setFormalNeighbourCount(originalNeighborCount2);
          bond.getBegin().setMaxBondOrder(originalMaxBondOrder1);
          bond.getBegin().setBondOrderSum(originalBondOrderSum1);
          bond.getEnd().setMaxBondOrder(originalMaxBondOrder2);
          bond.getEnd().setBondOrderSum(originalBondOrderSum2);
  
          return getCachedDescriptorValue(bond) != null ? new DescriptorValue(getSpecification(), getParameterNames(),
                  getParameters(), getCachedDescriptorValue(bond), NAMES) : null;
      }
focal_method.class_method_signature: BondPartialPiChargeDescriptor.calculate(IBond bond, IAtomContainer ac)
focal_method.full_signature: @Override public DescriptorValue calculate(IBond bond, IAtomContainer ac)
focal_method.identifier: calculate
focal_method.invocations: getCharge getBegin getAtomTypeName getBegin getFormalNeighbourCount getBegin getHybridization getBegin getValency getBegin getCharge getEnd getAtomTypeName getEnd getFormalNeighbourCount getEnd getHybridization getEnd getValency getEnd getBondOrderSum getBegin getMaxBondOrder getBegin getBondOrderSum getEnd getMaxBondOrder getEnd isCachedAtomContainer percieveAtomTypesAndConfigureAtoms saturate getDummyDescriptorValue setMaxGasteigerIters setMaxResoStruc getAtomCount setCharge getAtom assignGasteigerPiPartialCharges iterator bonds hasNext next abs getCharge getBegin getCharge getEnd cacheDescriptorValue getDummyDescriptorValue setCharge getBegin setAtomTypeName getBegin setHybridization getBegin setValency getBegin setFormalNeighbourCount getBegin setCharge getEnd setAtomTypeName getEnd setHybridization getEnd setValency getEnd setFormalNeighbourCount getEnd setMaxBondOrder getBegin setBondOrderSum getBegin setMaxBondOrder getEnd setBondOrderSum getEnd getCachedDescriptorValue getSpecification getParameterNames getParameters getCachedDescriptorValue
focal_method.modifiers: @Override public
focal_method.parameters: (IBond bond, IAtomContainer ac)
focal_method.return: DescriptorValue
focal_method.signature: DescriptorValue calculate(IBond bond, IAtomContainer ac)