test_class.declarator: builder = SilentChemObjectBuilder.getInstance()
test_class.modifier: private final static
test_class.original_string: private final static IChemObjectBuilder builder = SilentChemObjectBuilder.getInstance();
test_class.type: IChemObjectBuilder
test_class.var_name: builder
test_class.declarator: lpcheck = new LonePairElectronChecker()
test_class.original_string: LonePairElectronChecker                 lpcheck = new LonePairElectronChecker();
test_class.type: LonePairElectronChecker
test_class.var_name: lpcheck
test_class.file: descriptor/qsaratomic/src/test/java/org/openscience/cdk/qsar/descriptors/atomic/PartialTChargePEOEDescriptorTest.java
test_class.identifier: PartialTChargePEOEDescriptorTest
test_class.superclass: extends AtomicDescriptorTest
test_case.body: @Test
      @Category(SlowTest.class)
      public void testPartialTChargeDescriptor_FormicAcid() throws ClassNotFoundException, CDKException,
              java.lang.Exception {
          double[] testResult = {0.2672, -0.3877, -0.2365, 0.1367, 0.2203};/*
                                                                            * from
                                                                            * Petra
                                                                            * online
                                                                            * :
                                                                            * http
                                                                            * :
                                                                            * //www2
                                                                            * .
                                                                            * chemie
                                                                            * .
                                                                            * uni-
                                                                            * erlangen
                                                                            * .de/
                                                                            * services
                                                                            * /
                                                                            * petra
                                                                            * /
                                                                            * smiles
                                                                            * .
                                                                            * phtml
                                                                            */
          IAtomicDescriptor descriptor = new PartialTChargePEOEDescriptor();
  
          IAtomContainer molecule = builder.newInstance(IAtomContainer.class);
          molecule.addAtom(builder.newInstance(IAtom.class, "C"));
          molecule.addAtom(builder.newInstance(IAtom.class, "O"));
          molecule.addBond(0, 1, IBond.Order.DOUBLE);
          molecule.addAtom(builder.newInstance(IAtom.class, "O"));
          molecule.addBond(0, 2, IBond.Order.SINGLE);
  
          AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);
          addExplicitHydrogens(molecule);
          lpcheck.saturate(molecule);
  
          for (int i = 0; i < molecule.getAtomCount(); i++) {
              double result = ((DoubleResult) descriptor.calculate(molecule.getAtom(i), molecule).getValue())
                      .doubleValue();
  
              Assert.assertEquals(testResult[i], result, 0.05);
          }
      }
test_case.class_method_signature: PartialTChargePEOEDescriptorTest.testPartialTChargeDescriptor_FormicAcid()
test_case.full_signature: @Test @Category(SlowTest.class) public void testPartialTChargeDescriptor_FormicAcid()
test_case.identifier: testPartialTChargeDescriptor_FormicAcid
test_case.invocations: newInstance addAtom newInstance addAtom newInstance addBond addAtom newInstance addBond percieveAtomTypesAndConfigureAtoms addExplicitHydrogens saturate getAtomCount doubleValue getValue calculate getAtom assertEquals
test_case.modifiers: @Test @Category(SlowTest.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPartialTChargeDescriptor_FormicAcid()
focal_class.declarator: NAMES         = {"pepeT"}
focal_class.modifier: private static final
focal_class.original_string: private static final String[]          NAMES         = {"pepeT"};
focal_class.type: String[]
focal_class.var_name: NAMES
focal_class.declarator: peoe          = null
focal_class.modifier: private
focal_class.original_string: private GasteigerMarsiliPartialCharges peoe          = null;
focal_class.type: GasteigerMarsiliPartialCharges
focal_class.var_name: peoe
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.file: descriptor/qsaratomic/src/main/java/org/openscience/cdk/qsar/descriptors/atomic/PartialTChargePEOEDescriptor.java
focal_class.identifier: PartialTChargePEOEDescriptor
focal_class.class_method_signature: PartialTChargePEOEDescriptor.PartialTChargePEOEDescriptor()
focal_class.full_signature: public  PartialTChargePEOEDescriptor()
focal_class.identifier: PartialTChargePEOEDescriptor
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  PartialTChargePEOEDescriptor()
focal_class.class_method_signature: PartialTChargePEOEDescriptor.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: PartialTChargePEOEDescriptor.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: PartialTChargePEOEDescriptor.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: PartialTChargePEOEDescriptor.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: PartialTChargePEOEDescriptor.calculate(IAtom atom, IAtomContainer ac)
focal_class.full_signature: @Override public DescriptorValue calculate(IAtom atom, IAtomContainer ac)
focal_class.identifier: calculate
focal_class.modifiers: @Override public
focal_class.parameters: (IAtom atom, IAtomContainer ac)
focal_class.return: DescriptorValue
focal_class.signature: DescriptorValue calculate(IAtom atom, IAtomContainer ac)
focal_class.class_method_signature: PartialTChargePEOEDescriptor.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: PartialTChargePEOEDescriptor.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 AbstractAtomicDescriptor
focal_method.body: @Override
      public DescriptorValue calculate(IAtom atom, IAtomContainer ac) {
          // FIXME: for now I'll cache a few modified atomic properties, and restore them at the end of this method
          Double originalCharge = atom.getCharge();
          String originalAtomtypeName = atom.getAtomTypeName();
          Integer originalNeighborCount = atom.getFormalNeighbourCount();
          Integer originalValency = atom.getValency();
          IAtomType.Hybridization originalHybridization = atom.getHybridization();
          Double originalBondOrderSum = atom.getBondOrderSum();
          Order originalMaxBondOrder = atom.getMaxBondOrder();
          if (!isCachedAtomContainer(ac)) {
              try {
                  AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(ac);
              } catch (CDKException e) {
                  new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(
                          Double.NaN), NAMES, e);
              }
  
              if (lpeChecker) {
                  LonePairElectronChecker lpcheck = new LonePairElectronChecker();
                  try {
                      lpcheck.saturate(ac);
                  } catch (CDKException e) {
                      new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(
                              Double.NaN), NAMES, e);
                  }
              }
  
              if (maxIterations != -1) pepe.setMaxGasteigerIters(maxIterations);
              if (maxResonStruc != -1) pepe.setMaxResoStruc(maxResonStruc);
  
              try {
                  peoe.assignGasteigerMarsiliSigmaPartialCharges(ac, true);
                  List<Double> peoeAtom = new ArrayList<Double>();
                  for (Iterator<IAtom> it = ac.atoms().iterator(); it.hasNext();)
                      peoeAtom.add(it.next().getCharge());
  
                  for (Iterator<IAtom> it = ac.atoms().iterator(); it.hasNext();)
                      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)
                              + ac.getAtom(i).getCharge()));
  
              } catch (Exception e) {
                  new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(
                          Double.NaN), NAMES, e);
              }
          }
          // restore original props
          atom.setCharge(originalCharge);
          atom.setAtomTypeName(originalAtomtypeName);
          atom.setFormalNeighbourCount(originalNeighborCount);
          atom.setValency(originalValency);
          atom.setHybridization(originalHybridization);
          atom.setMaxBondOrder(originalMaxBondOrder);
          atom.setBondOrderSum(originalBondOrderSum);
  
          return getCachedDescriptorValue(atom) != null ? new DescriptorValue(getSpecification(), getParameterNames(),
                  getParameters(), getCachedDescriptorValue(atom), NAMES) : null;
      }
focal_method.class_method_signature: PartialTChargePEOEDescriptor.calculate(IAtom atom, IAtomContainer ac)
focal_method.full_signature: @Override public DescriptorValue calculate(IAtom atom, IAtomContainer ac)
focal_method.identifier: calculate
focal_method.invocations: getCharge getAtomTypeName getFormalNeighbourCount getValency getHybridization getBondOrderSum getMaxBondOrder isCachedAtomContainer percieveAtomTypesAndConfigureAtoms getSpecification getParameterNames getParameters saturate getSpecification getParameterNames getParameters setMaxGasteigerIters setMaxResoStruc assignGasteigerMarsiliSigmaPartialCharges iterator atoms hasNext add getCharge next iterator atoms hasNext setCharge next assignGasteigerPiPartialCharges getAtomCount cacheDescriptorValue getAtom get getCharge getAtom getSpecification getParameterNames getParameters setCharge setAtomTypeName setFormalNeighbourCount setValency setHybridization setMaxBondOrder setBondOrderSum getCachedDescriptorValue getSpecification getParameterNames getParameters getCachedDescriptorValue
focal_method.modifiers: @Override public
focal_method.parameters: (IAtom atom, IAtomContainer ac)
focal_method.return: DescriptorValue
focal_method.signature: DescriptorValue calculate(IAtom atom, IAtomContainer ac)