test_class.file: descriptor/qsaratomic/src/test/java/org/openscience/cdk/qsar/descriptors/atomic/ProtonTotalPartialChargeDescriptorTest.java
test_class.identifier: ProtonTotalPartialChargeDescriptorTest
test_class.superclass: extends AtomicDescriptorTest
test_case.body: @Test
      public void testNaNs() throws java.lang.Exception {
          IAtomicDescriptor descriptor = new ProtonTotalPartialChargeDescriptor();
          SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
          IAtomContainer mol = sp.parseSmiles("C(F)(F)");
          addExplicitHydrogens(mol);
          DoubleArrayResult retval = (DoubleArrayResult) descriptor.calculate(mol.getAtom(0), mol).getValue();
          Assert.assertEquals(5, retval.length());
          Assert.assertTrue(Double.isNaN(retval.get(3)));
          Assert.assertTrue(Double.isNaN(retval.get(4)));
      }
test_case.class_method_signature: ProtonTotalPartialChargeDescriptorTest.testNaNs()
test_case.full_signature: @Test public void testNaNs()
test_case.identifier: testNaNs
test_case.invocations: getInstance parseSmiles addExplicitHydrogens getValue calculate getAtom assertEquals length assertTrue isNaN get assertTrue isNaN get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testNaNs()
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: neighboors
focal_class.modifier: private
focal_class.original_string: private List<IAtom>                    neighboors;
focal_class.type: List<IAtom>
focal_class.var_name: neighboors
focal_class.declarator: MAX_PROTON_COUNT = 5
focal_class.modifier: private final
focal_class.original_string: private final int                      MAX_PROTON_COUNT = 5;
focal_class.type: int
focal_class.var_name: MAX_PROTON_COUNT
focal_class.file: descriptor/qsaratomic/src/main/java/org/openscience/cdk/qsar/descriptors/atomic/ProtonTotalPartialChargeDescriptor.java
focal_class.identifier: ProtonTotalPartialChargeDescriptor
focal_class.interfaces: implements IAtomicDescriptor
focal_class.class_method_signature: ProtonTotalPartialChargeDescriptor.ProtonTotalPartialChargeDescriptor()
focal_class.full_signature: public  ProtonTotalPartialChargeDescriptor()
focal_class.identifier: ProtonTotalPartialChargeDescriptor
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  ProtonTotalPartialChargeDescriptor()
focal_class.class_method_signature: ProtonTotalPartialChargeDescriptor.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: ProtonTotalPartialChargeDescriptor.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: ProtonTotalPartialChargeDescriptor.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: ProtonTotalPartialChargeDescriptor.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: ProtonTotalPartialChargeDescriptor.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: ProtonTotalPartialChargeDescriptor.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: ProtonTotalPartialChargeDescriptor.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: ProtonTotalPartialChargeDescriptor.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) {
          neighboors = ac.getConnectedAtomsList(atom);
  
          IAtomContainer clone;
          try {
              clone = (IAtomContainer) ac.clone();
          } catch (CloneNotSupportedException e) {
              return getDummyDescriptorValue(e);
          }
  
          try {
              peoe = new GasteigerMarsiliPartialCharges();
              peoe.setMaxGasteigerIters(6);
              //	HydrogenAdder hAdder = new HydrogenAdder();
              //	hAdder.addExplicitHydrogensToSatisfyValency(mol);
              peoe.assignGasteigerMarsiliSigmaPartialCharges(clone, true);
          } catch (Exception exception) {
              return getDummyDescriptorValue(exception);
          }
  
          IAtom localAtom = clone.getAtom(ac.indexOf(atom));
          neighboors = clone.getConnectedAtomsList(localAtom);
  
          // we assume that an atom has a mxa number of protons = MAX_PROTON_COUNT
          // if it has less, we pad with NaN
          DoubleArrayResult protonPartialCharge = new DoubleArrayResult(MAX_PROTON_COUNT);
          assert (neighboors.size() < MAX_PROTON_COUNT);
  
          protonPartialCharge.add(localAtom.getCharge());
          int hydrogenNeighbors = 0;
          for (IAtom neighboor : neighboors) {
              if (neighboor.getSymbol().equals("H")) {
                  hydrogenNeighbors++;
                  protonPartialCharge.add(neighboor.getCharge());
              }
          }
          int remainder = MAX_PROTON_COUNT - (hydrogenNeighbors + 1);
          for (int i = 0; i < remainder; i++)
              protonPartialCharge.add(Double.NaN);
  
          return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), protonPartialCharge,
                  getDescriptorNames());
      }
focal_method.class_method_signature: ProtonTotalPartialChargeDescriptor.calculate(IAtom atom, IAtomContainer ac)
focal_method.full_signature: @Override public DescriptorValue calculate(IAtom atom, IAtomContainer ac)
focal_method.identifier: calculate
focal_method.invocations: getConnectedAtomsList clone getDummyDescriptorValue setMaxGasteigerIters assignGasteigerMarsiliSigmaPartialCharges getDummyDescriptorValue getAtom indexOf getConnectedAtomsList size add getCharge equals getSymbol add getCharge add getSpecification getParameterNames getParameters getDescriptorNames
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)