test_class.file: descriptor/qsarmolecular/src/test/java/org/openscience/cdk/qsar/descriptors/molecular/ZagrebIndexDescriptorTest.java
test_class.identifier: ZagrebIndexDescriptorTest
test_class.superclass: extends MolecularDescriptorTest
test_case.body: @Test
      public void test2Dvs3D() throws Exception {
          SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
          IAtomContainer mol = sp.parseSmiles("O1C2C34C(C(C1O)CCCc1cc(cc(c1)C(F)(F)F)C(F)(F)F)CCC(C3CCC(O2)(OO4)C)C");
  
          addExplicitHydrogens(mol);
          AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol);
          Aromaticity.cdkLegacy().apply(mol);
  
          double value2D = ((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue();
  
          String filename = "data/mdl/cpsa-uncharged.sdf";
          InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
          ISimpleChemObjectReader reader = new MDLV2000Reader(ins);
          ChemFile content = (ChemFile) reader.read((ChemObject) new ChemFile());
          List cList = ChemFileManipulator.getAllAtomContainers(content);
          mol = (IAtomContainer) cList.get(0);
          AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol);
          Aromaticity.cdkLegacy().apply(mol);
  
          double value3D = ((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue();
  
          Assert.assertEquals(value2D, value3D, 0.001);
  
      }
test_case.class_method_signature: ZagrebIndexDescriptorTest.test2Dvs3D()
test_case.full_signature: @Test public void test2Dvs3D()
test_case.identifier: test2Dvs3D
test_case.invocations: getInstance parseSmiles addExplicitHydrogens percieveAtomTypesAndConfigureAtoms apply cdkLegacy doubleValue getValue calculate getResourceAsStream getClassLoader getClass read getAllAtomContainers get percieveAtomTypesAndConfigureAtoms apply cdkLegacy doubleValue getValue calculate assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test2Dvs3D()
focal_class.declarator: NAMES = {"Zagreb"}
focal_class.modifier: private static final
focal_class.original_string: private static final String[] NAMES = {"Zagreb"};
focal_class.type: String[]
focal_class.var_name: NAMES
focal_class.file: descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/ZagrebIndexDescriptor.java
focal_class.identifier: ZagrebIndexDescriptor
focal_class.interfaces: implements IMolecularDescriptor
focal_class.class_method_signature: ZagrebIndexDescriptor.ZagrebIndexDescriptor()
focal_class.full_signature: public  ZagrebIndexDescriptor()
focal_class.identifier: ZagrebIndexDescriptor
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  ZagrebIndexDescriptor()
focal_class.class_method_signature: ZagrebIndexDescriptor.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: ZagrebIndexDescriptor.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: ZagrebIndexDescriptor.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: ZagrebIndexDescriptor.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: ZagrebIndexDescriptor.calculate(IAtomContainer atomContainer)
focal_class.full_signature: @Override public DescriptorValue calculate(IAtomContainer atomContainer)
focal_class.identifier: calculate
focal_class.modifiers: @Override public
focal_class.parameters: (IAtomContainer atomContainer)
focal_class.return: DescriptorValue
focal_class.signature: DescriptorValue calculate(IAtomContainer atomContainer)
focal_class.class_method_signature: ZagrebIndexDescriptor.getDescriptorResultType()
focal_class.full_signature: @Override public IDescriptorResult getDescriptorResultType()
focal_class.identifier: getDescriptorResultType
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: IDescriptorResult
focal_class.signature: IDescriptorResult getDescriptorResultType()
focal_class.class_method_signature: ZagrebIndexDescriptor.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: ZagrebIndexDescriptor.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 AbstractMolecularDescriptor
focal_method.body: @Override
      public DescriptorValue calculate(IAtomContainer atomContainer) {
          double zagreb = 0;
          for (IAtom atom : atomContainer.atoms()) {
              if (atom.getAtomicNumber() == IElement.H) continue;
              int atomDegree = 0;
              List<IAtom> neighbours = atomContainer.getConnectedAtomsList(atom);
              for (IAtom neighbour : neighbours) {
                  if (neighbour.getAtomicNumber() != IElement.H) {
                      atomDegree += 1;
                  }
              }
              zagreb += (atomDegree * atomDegree);
          }
          return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(zagreb),
                  getDescriptorNames());
      }
focal_method.class_method_signature: ZagrebIndexDescriptor.calculate(IAtomContainer atomContainer)
focal_method.full_signature: @Override public DescriptorValue calculate(IAtomContainer atomContainer)
focal_method.identifier: calculate
focal_method.invocations: atoms getAtomicNumber getConnectedAtomsList getAtomicNumber getSpecification getParameterNames getParameters getDescriptorNames
focal_method.modifiers: @Override public
focal_method.parameters: (IAtomContainer atomContainer)
focal_method.return: DescriptorValue
focal_method.signature: DescriptorValue calculate(IAtomContainer atomContainer)