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.file: tool/formula/src/test/java/org/openscience/cdk/formula/IsotopePatternGeneratorTest.java
test_class.identifier: IsotopePatternGeneratorTest
test_class.superclass: extends CDKTestCase
test_case.body: @Test
      public void testCalculateIsotopesOrthinine() {
          // RESULTS ACCORDING PAGE: http://www2.sisweb.com/mstools/isotope.htm
          double[] massResults = {133.097720, 134.094750, 134.101079, 134.103990, 135.101959, 135.104430};
          double[] abundResults = {1.00, .006, .054, 0.002, 0.004, 0.001};
  
          IMolecularFormula molFor = new MolecularFormula();
          molFor.addIsotope(builder.newInstance(IIsotope.class, "C"), 5);
          molFor.addIsotope(builder.newInstance(IIsotope.class, "H"), 13);
          molFor.addIsotope(builder.newInstance(IIsotope.class, "N"), 2);
          molFor.addIsotope(builder.newInstance(IIsotope.class, "O"), 2);
  
          IsotopePatternGenerator isotopeGe = new IsotopePatternGenerator(0.0010);
          IsotopePattern isoPattern = isotopeGe.getIsotopes(molFor);
  
          Assert.assertEquals(6, isoPattern.getNumberOfIsotopes());
  
          Assert.assertEquals(massResults[0], isoPattern.getIsotope(0).getMass(), 0.01);
          Assert.assertEquals(massResults[1], isoPattern.getIsotope(1).getMass(), 0.01);
          Assert.assertEquals(massResults[2], isoPattern.getIsotope(2).getMass(), 0.01);
          Assert.assertEquals(massResults[3], isoPattern.getIsotope(3).getMass(), 0.01);
          Assert.assertEquals(massResults[4], isoPattern.getIsotope(4).getMass(), 0.01);
          Assert.assertEquals(massResults[5], isoPattern.getIsotope(5).getMass(), 0.01);
  
          Assert.assertEquals(abundResults[0], isoPattern.getIsotope(0).getIntensity(), 0.01);
          Assert.assertEquals(abundResults[1], isoPattern.getIsotope(1).getIntensity(), 0.01);
          Assert.assertEquals(abundResults[2], isoPattern.getIsotope(2).getIntensity(), 0.01);
          Assert.assertEquals(abundResults[3], isoPattern.getIsotope(3).getIntensity(), 0.01);
          Assert.assertEquals(abundResults[4], isoPattern.getIsotope(4).getIntensity(), 0.01);
          Assert.assertEquals(abundResults[5], isoPattern.getIsotope(5).getIntensity(), 0.01);
  
      }
test_case.class_method_signature: IsotopePatternGeneratorTest.testCalculateIsotopesOrthinine()
test_case.full_signature: @Test public void testCalculateIsotopesOrthinine()
test_case.identifier: testCalculateIsotopesOrthinine
test_case.invocations: addIsotope newInstance addIsotope newInstance addIsotope newInstance addIsotope newInstance getIsotopes assertEquals getNumberOfIsotopes assertEquals getMass getIsotope assertEquals getMass getIsotope assertEquals getMass getIsotope assertEquals getMass getIsotope assertEquals getMass getIsotope assertEquals getMass getIsotope assertEquals getIntensity getIsotope assertEquals getIntensity getIsotope assertEquals getIntensity getIsotope assertEquals getIntensity getIsotope assertEquals getIntensity getIsotope assertEquals getIntensity getIsotope
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCalculateIsotopesOrthinine()
focal_class.declarator: builder        = null
focal_class.modifier: private
focal_class.original_string: private IChemObjectBuilder builder        = null;
focal_class.type: IChemObjectBuilder
focal_class.var_name: builder
focal_class.declarator: isoFactory
focal_class.modifier: private
focal_class.original_string: private IsotopeFactory     isoFactory;
focal_class.type: IsotopeFactory
focal_class.var_name: isoFactory
focal_class.declarator: logger         = LoggingToolFactory.createLoggingTool(IsotopePatternGenerator.class)
focal_class.modifier: private
focal_class.original_string: private ILoggingTool       logger         = LoggingToolFactory.createLoggingTool(IsotopePatternGenerator.class);
focal_class.type: ILoggingTool
focal_class.var_name: logger
focal_class.declarator: minIntensity = 0.00001
focal_class.modifier: private
focal_class.original_string: private double  minIntensity = 0.00001;
focal_class.type: double
focal_class.var_name: minIntensity
focal_class.declarator: minAbundance = 1E-10
focal_class.modifier: private
focal_class.original_string: private double  minAbundance = 1E-10;
focal_class.type: double
focal_class.var_name: minAbundance
focal_class.declarator: resolution   = 0.00005f
focal_class.modifier: private
focal_class.original_string: private double  resolution   = 0.00005f;
focal_class.type: double
focal_class.var_name: resolution
focal_class.declarator: storeFormula = false
focal_class.modifier: private
focal_class.original_string: private boolean storeFormula = false;
focal_class.type: boolean
focal_class.var_name: storeFormula
focal_class.file: tool/formula/src/main/java/org/openscience/cdk/formula/IsotopePatternGenerator.java
focal_class.identifier: IsotopePatternGenerator
focal_class.class_method_signature: IsotopePatternGenerator.IsotopePatternGenerator()
focal_class.full_signature: public  IsotopePatternGenerator()
focal_class.identifier: IsotopePatternGenerator
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  IsotopePatternGenerator()
focal_class.class_method_signature: IsotopePatternGenerator.IsotopePatternGenerator(double minIntensity)
focal_class.full_signature: public  IsotopePatternGenerator(double minIntensity)
focal_class.identifier: IsotopePatternGenerator
focal_class.modifiers: public
focal_class.parameters: (double minIntensity)
focal_class.signature:  IsotopePatternGenerator(double minIntensity)
focal_class.class_method_signature: IsotopePatternGenerator.setMinIntensity(double minIntensity)
focal_class.full_signature: public IsotopePatternGenerator setMinIntensity(double minIntensity)
focal_class.identifier: setMinIntensity
focal_class.modifiers: public
focal_class.parameters: (double minIntensity)
focal_class.return: IsotopePatternGenerator
focal_class.signature: IsotopePatternGenerator setMinIntensity(double minIntensity)
focal_class.class_method_signature: IsotopePatternGenerator.setMinResolution(double resolution)
focal_class.full_signature: public IsotopePatternGenerator setMinResolution(double resolution)
focal_class.identifier: setMinResolution
focal_class.modifiers: public
focal_class.parameters: (double resolution)
focal_class.return: IsotopePatternGenerator
focal_class.signature: IsotopePatternGenerator setMinResolution(double resolution)
focal_class.class_method_signature: IsotopePatternGenerator.setStoreFormulas(boolean storeFormula)
focal_class.full_signature: public IsotopePatternGenerator setStoreFormulas(boolean storeFormula)
focal_class.identifier: setStoreFormulas
focal_class.modifiers: public
focal_class.parameters: (boolean storeFormula)
focal_class.return: IsotopePatternGenerator
focal_class.signature: IsotopePatternGenerator setStoreFormulas(boolean storeFormula)
focal_class.class_method_signature: IsotopePatternGenerator.getIsotopes(IMolecularFormula molFor)
focal_class.full_signature: public IsotopePattern getIsotopes(IMolecularFormula molFor)
focal_class.identifier: getIsotopes
focal_class.modifiers: public
focal_class.parameters: (IMolecularFormula molFor)
focal_class.return: IsotopePattern
focal_class.signature: IsotopePattern getIsotopes(IMolecularFormula molFor)
focal_class.class_method_signature: IsotopePatternGenerator.asFormula(IIsotope isotope)
focal_class.full_signature: private IMolecularFormula asFormula(IIsotope isotope)
focal_class.identifier: asFormula
focal_class.modifiers: private
focal_class.parameters: (IIsotope isotope)
focal_class.return: IMolecularFormula
focal_class.signature: IMolecularFormula asFormula(IIsotope isotope)
focal_class.class_method_signature: IsotopePatternGenerator.union(IMolecularFormula a, IMolecularFormula b)
focal_class.full_signature: private IMolecularFormula union(IMolecularFormula a, IMolecularFormula b)
focal_class.identifier: union
focal_class.modifiers: private
focal_class.parameters: (IMolecularFormula a, IMolecularFormula b)
focal_class.return: IMolecularFormula
focal_class.signature: IMolecularFormula union(IMolecularFormula a, IMolecularFormula b)
focal_class.class_method_signature: IsotopePatternGenerator.findExisting(List<IsotopeContainer> containers,
                                                   double mass, double treshhold)
focal_class.full_signature: private static IsotopeContainer findExisting(List<IsotopeContainer> containers,
                                                   double mass, double treshhold)
focal_class.identifier: findExisting
focal_class.modifiers: private static
focal_class.parameters: (List<IsotopeContainer> containers,
                                                   double mass, double treshhold)
focal_class.return: IsotopeContainer
focal_class.signature: IsotopeContainer findExisting(List<IsotopeContainer> containers,
                                                   double mass, double treshhold)
focal_class.class_method_signature: IsotopePatternGenerator.addDistinctFormula(IsotopeContainer container, IMolecularFormula mf)
focal_class.full_signature: private void addDistinctFormula(IsotopeContainer container, IMolecularFormula mf)
focal_class.identifier: addDistinctFormula
focal_class.modifiers: private
focal_class.parameters: (IsotopeContainer container, IMolecularFormula mf)
focal_class.return: void
focal_class.signature: void addDistinctFormula(IsotopeContainer container, IMolecularFormula mf)
focal_class.class_method_signature: IsotopePatternGenerator.calculateAbundanceAndMass(IsotopePattern current, List<IsotopeContainer> additional)
focal_class.full_signature: private IsotopePattern calculateAbundanceAndMass(IsotopePattern current, List<IsotopeContainer> additional)
focal_class.identifier: calculateAbundanceAndMass
focal_class.modifiers: private
focal_class.parameters: (IsotopePattern current, List<IsotopeContainer> additional)
focal_class.return: IsotopePattern
focal_class.signature: IsotopePattern calculateAbundanceAndMass(IsotopePattern current, List<IsotopeContainer> additional)
focal_class.class_method_signature: IsotopePatternGenerator.cleanAbundance(IsotopePattern isopattern, double minIntensity)
focal_class.full_signature: private IsotopePattern cleanAbundance(IsotopePattern isopattern, double minIntensity)
focal_class.identifier: cleanAbundance
focal_class.modifiers: private
focal_class.parameters: (IsotopePattern isopattern, double minIntensity)
focal_class.return: IsotopePattern
focal_class.signature: IsotopePattern cleanAbundance(IsotopePattern isopattern, double minIntensity)
focal_method.body: public IsotopePattern getIsotopes(IMolecularFormula molFor) {
  
          if (builder == null) {
              try {
                  isoFactory = Isotopes.getInstance();
                  builder = molFor.getBuilder();
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
          String mf = MolecularFormulaManipulator.getString(molFor, true);
  
          IMolecularFormula molecularFormula = MolecularFormulaManipulator.getMajorIsotopeMolecularFormula(mf, builder);
  
          IsotopePattern abundance_Mass = null;
  
          for (IIsotope isos : molecularFormula.isotopes()) {
              String elementSymbol = isos.getSymbol();
              int atomCount = molecularFormula.getIsotopeCount(isos);
  
              // Generate possible isotope containers for the current atom's
              // these will then me 'multiplied' with the existing patten
              List<IsotopeContainer> additional = new ArrayList<>();
              for (IIsotope isotope : isoFactory.getIsotopes(elementSymbol)) {
                  double mass      = isotope.getExactMass();
                  double abundance = isotope.getNaturalAbundance();
                  if (abundance <= 0.000000001)
                      continue;
                  IsotopeContainer container = new IsotopeContainer(mass, abundance);
                  if (storeFormula)
                      container.setFormula(asFormula(isotope));
                  additional.add(container);
              }
  
              for (int i = 0; i < atomCount; i++)
                  abundance_Mass = calculateAbundanceAndMass(abundance_Mass, additional);
          }
  
          IsotopePattern isoP = IsotopePatternManipulator.sortAndNormalizedByIntensity(abundance_Mass);
          isoP = cleanAbundance(isoP, minIntensity);
          IsotopePattern isoPattern = IsotopePatternManipulator.sortByMass(isoP);
          return isoPattern;
  
      }
focal_method.class_method_signature: IsotopePatternGenerator.getIsotopes(IMolecularFormula molFor)
focal_method.full_signature: public IsotopePattern getIsotopes(IMolecularFormula molFor)
focal_method.identifier: getIsotopes
focal_method.invocations: getInstance getBuilder printStackTrace getString getMajorIsotopeMolecularFormula isotopes getSymbol getIsotopeCount getIsotopes getExactMass getNaturalAbundance setFormula asFormula add calculateAbundanceAndMass sortAndNormalizedByIntensity cleanAbundance sortByMass
focal_method.modifiers: public
focal_method.parameters: (IMolecularFormula molFor)
focal_method.return: IsotopePattern
focal_method.signature: IsotopePattern getIsotopes(IMolecularFormula molFor)