Class ElementalAnalysisFactory

java.lang.Object
chemaxon.calculations.elemental.ElementalAnalysisFactory

@PublicApi public class ElementalAnalysisFactory extends Object
Provides static factory methods for creating ElementalAnalysis instances from various input types.
  • Method Details

    • createAnalysis

      public static ElementalAnalysis createAnalysis(Molecule molecule)
      Creates elemental analysis for the specified molecule.
      Parameters:
      molecule - the input structure
      Returns:
      an ElementalAnalysis instance
    • createAnalysis

      public static ElementalAnalysis createAnalysis(Molecule molecule, boolean ignorePseudoLabels)
      Creates elemental analysis for the specified molecule with the given options.
      Parameters:
      molecule - the input structure
      ignorePseudoLabels - indicates if pseudo atoms are ignored
      Returns:
      an ElementalAnalysis instance
    • createAnalysis

      public static ElementalAnalysis createAnalysis(Molecule molecule, Set<Integer> filteredAtomIndices, boolean ignorePseudoLabels)
      Creates an elemental analysis from the specified molecule with the given options.
      Parameters:
      molecule - the input structure
      filteredAtomIndices - the set of atom indices to include in the analysis (if empty, all atoms are included)
      ignorePseudoLabels - indicates if pseudo atoms are ignored
      Returns:
      an ElementalAnalysis instance
    • createAnalysis

      public static ElementalAnalysis createAnalysis(String formula)
      Constructs an elemental analysis from molecular formula.

      Multiple fragments with fractional stoichiometric coefficients are supported:

      CH3O.0.5Na.1.5H2O, NaCl.1.5H2O, AlCl3.1.5H2O
      If the molecular formula contains any unspecified symbol (e.g. R, Pol) the analysis do not take into consideration these symbols. The analysis returns the same result for formulas either with or without these symbols.
      Parameters:
      formula - molecular formula, e.g. C3H8NO2, Al2(CO3)3.2H2O
      Returns:
      an ElementalAnalysis instance
      Throws:
      chemaxon.calculations.elemental.internal.formula.InvalidFormulaException - if the parser cannot parse the formula string