Interface ElementalAnalysis


@PublicApi public interface ElementalAnalysis
Calculates molecular formula, mass, MS mass and composition.

API usage example:

     // build the analysis
     ElementalAnalysis elemanal = ...

     double exactMass = elemanal.exactMass();
     double mass = elemanal.mass();
     BigDecimal massPrecision = elemanal.massPrecision();
     BigDecimal atomCount1 = elemanal.atomCount(8); // oxygen atom count
     BigDecimal atomCount3 = elemanal.atomCount(8, 16); // oxygen isotope count with massno=16
     String formula = elemanal.formula();
     String composition = elemanal.composition(2); // precision=2

     // now use the results...
      }
 
Since:
Marvin 16.4.18
  • Method Summary

    Modifier and Type
    Method
    Description
    Calculates the number of atoms in the molecule.
    atomCount(int z)
    Calculates the number of atoms of a given element in the molecule (including its isotopes).
    atomCount(int z, int m)
    Calculates the number of atoms of a given element in the molecule.
    Map<com.chemaxon.calculations.elemanal.formula.FormulaAtom,BigDecimal>
    Gets the elemental analysis, the relative percent composition of a pure chemical substance by element (w/w%).
    Calculates the weight of the MS molecule ion using the mass of the most frequent natural isotope for element atoms.
    Calculates the formal (total) charge of the molecule.
    Calculates the molecular formula which is a string listing all atom types and their occurrence in the molecule.
    default String
    Calculates the molecular formula which is a string listing all atom types and their occurrence in the molecule.
    Calculates the molecular formula which is a string listing all atom types and their occurrence in the molecule.
    Calculates the isotopic distributions for the molecule.
    Calculates the molecular weight of the molecule.
    Mass of the molecule calculated using the isotope mass of the most abundant constituent element isotope of each element rounded to the nearest integer value and multiplied by the number of atoms of each element.
    Calculates the sum of the radicals of all atoms of the molecule.
  • Method Details

    • atomCount

      BigDecimal atomCount()
      Calculates the number of atoms in the molecule.
      Returns:
      number of atoms
    • atomCount

      BigDecimal atomCount(int z)
      Calculates the number of atoms of a given element in the molecule (including its isotopes).
      Parameters:
      z - atomic number of the atom (protons)
      Returns:
      number of the specified atoms
    • atomCount

      BigDecimal atomCount(int z, int m)
      Calculates the number of atoms of a given element in the molecule.
      Parameters:
      z - atomic number of the atom (protons)
      m - mass number of the atom (protons + neutrons)
      Returns:
      number of the specified atoms
    • mass

      BigDecimal mass()
      Calculates the molecular weight of the molecule.

      The result is rounded according to the decimals of the lowest precision atomic mass value.

      Returns:
      molecular weight of the molecule
    • exactMass

      BigDecimal exactMass()
      Calculates the weight of the MS molecule ion using the mass of the most frequent natural isotope for element atoms.
      Returns:
      weight of the molecule ion
    • nominalMass

      BigDecimal nominalMass()
      Mass of the molecule calculated using the isotope mass of the most abundant constituent element isotope of each element rounded to the nearest integer value and multiplied by the number of atoms of each element.
      Returns:
      nominal mass of the molecule
    • formula

      String formula()
      Calculates the molecular formula which is a string listing all atom types and their occurrence in the molecule.

      Note: Isotopes and charged elements are separated.

      Returns:
      formula representation of elements
    • formula

      String formula(Set<FormulaGenerationRule> rules)
      Calculates the molecular formula which is a string listing all atom types and their occurrence in the molecule.
      Returns:
      formula representation of elements
      See Also:
    • formula

      default String formula(FormulaGenerationRule... rules)
      Calculates the molecular formula which is a string listing all atom types and their occurrence in the molecule.
      Returns:
      formula representation of elements
      See Also:
    • formalCharge

      BigDecimal formalCharge()
      Calculates the formal (total) charge of the molecule.
      Returns:
      the formal charge of the molecule
    • sumOfRadicals

      BigDecimal sumOfRadicals()
      Calculates the sum of the radicals of all atoms of the molecule.
      Returns:
      the sum of the radicals of all atoms
    • isotopeDistribution

      Map<BigDecimal,BigDecimal> isotopeDistribution()
      Calculates the isotopic distributions for the molecule.

      Takes charge into account. The maximum of distribution is normalized to 1.

      Returns:
      the map of masses and distributions.
      Throws:
      ArithmeticException - if the molecule contains non-integer fragment multipliers, e.g. 2Na.1.5H2O
    • composition

      Map<com.chemaxon.calculations.elemanal.formula.FormulaAtom,BigDecimal> composition()
      Gets the elemental analysis, the relative percent composition of a pure chemical substance by element (w/w%).
      Returns:
      molecular composition