test_class.file: descriptor/qsarmolecular/src/test/java/org/openscience/cdk/qsar/descriptors/molecular/FragmentComplexityDescriptorTest.java
test_class.identifier: FragmentComplexityDescriptorTest
test_class.superclass: extends MolecularDescriptorTest
test_case.body: @Test
      public void test1FragmentComplexityDescriptor() throws Exception {
          IMolecularDescriptor descriptor = new FragmentComplexityDescriptor();
          String filename = "data/mdl/murckoTest1.mol";
          //System.out.println("\nFragmentComplexityTest: " + filename);
          InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
          MurckoFragmenter gf = new MurckoFragmenter();
          double Complexity = 0;
          MDLV2000Reader reader = new MDLV2000Reader(ins, Mode.STRICT);
          IAtomContainer mol = reader.read(new AtomContainer());
          gf.generateFragments(mol);
          IAtomContainer[] setOfFragments = gf.getFrameworksAsContainers();
          for (int i = 0; i < setOfFragments.length; i++) {
              addExplicitHydrogens(setOfFragments[i]);
              Complexity = ((DoubleResult) descriptor.calculate(setOfFragments[i]).getValue()).doubleValue();
              //System.out.println("Complexity:"+Complexity);
          }
          Assert.assertEquals(659.00, Complexity, 0.01);
      }
test_case.class_method_signature: FragmentComplexityDescriptorTest.test1FragmentComplexityDescriptor()
test_case.full_signature: @Test public void test1FragmentComplexityDescriptor()
test_case.identifier: test1FragmentComplexityDescriptor
test_case.invocations: getResourceAsStream getClassLoader getClass read generateFragments getFrameworksAsContainers addExplicitHydrogens doubleValue getValue calculate assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test1FragmentComplexityDescriptor()
focal_class.declarator: NAMES = {"fragC"}
focal_class.modifier: private static final
focal_class.original_string: private static final String[] NAMES = {"fragC"};
focal_class.type: String[]
focal_class.var_name: NAMES
focal_class.file: descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/FragmentComplexityDescriptor.java
focal_class.identifier: FragmentComplexityDescriptor
focal_class.interfaces: implements IMolecularDescriptor
focal_class.class_method_signature: FragmentComplexityDescriptor.FragmentComplexityDescriptor()
focal_class.full_signature: public  FragmentComplexityDescriptor()
focal_class.identifier: FragmentComplexityDescriptor
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  FragmentComplexityDescriptor()
focal_class.class_method_signature: FragmentComplexityDescriptor.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: FragmentComplexityDescriptor.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: FragmentComplexityDescriptor.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: FragmentComplexityDescriptor.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: FragmentComplexityDescriptor.calculate(IAtomContainer container)
focal_class.full_signature: @Override public DescriptorValue calculate(IAtomContainer container)
focal_class.identifier: calculate
focal_class.modifiers: @Override public
focal_class.parameters: (IAtomContainer container)
focal_class.return: DescriptorValue
focal_class.signature: DescriptorValue calculate(IAtomContainer container)
focal_class.class_method_signature: FragmentComplexityDescriptor.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: FragmentComplexityDescriptor.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: FragmentComplexityDescriptor.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 container) {
          //System.out.println("FragmentComplexityDescriptor");
          int a = 0;
          double h = 0;
          for (int i = 0; i < container.getAtomCount(); i++) {
              if (container.getAtom(i).getAtomicNumber() != IElement.H) {
                  a++;
              }
              if (container.getAtom(i).getAtomicNumber() != IElement.H && container.getAtom(i).getAtomicNumber() != IElement.C) {
                  h++;
              }
          }
          int b = container.getBondCount() + AtomContainerManipulator.getImplicitHydrogenCount(container);
          double c = Math.abs(b * b - a * a + a) + (h / 100);
          return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(c),
                  getDescriptorNames());
      }
focal_method.class_method_signature: FragmentComplexityDescriptor.calculate(IAtomContainer container)
focal_method.full_signature: @Override public DescriptorValue calculate(IAtomContainer container)
focal_method.identifier: calculate
focal_method.invocations: getAtomCount getAtomicNumber getAtom getAtomicNumber getAtom getAtomicNumber getAtom getBondCount getImplicitHydrogenCount abs getSpecification getParameterNames getParameters getDescriptorNames
focal_method.modifiers: @Override public
focal_method.parameters: (IAtomContainer container)
focal_method.return: DescriptorValue
focal_method.signature: DescriptorValue calculate(IAtomContainer container)