EmpiricalFormula#

class pyopenms.EmpiricalFormula#

Bases: object

Representation of an empirical formula

__init__() → None#
__init__(arg: pyopenms.EmpiricalFormula, /) → None
__init__(arg: str, /) → None

Methods

__init__()

addChargeAdduct([count, adduct])

Makes ionization explicit: adds count copies of adduct (default: a hydrogen atom) to the formula and resets the charge to zero

calculateTheoreticalIsotopesNumber()

contains(ef)

Returns true if all elements from ef ( empirical formula ) are LESS abundant (negative allowed) than the corresponding elements of this EmpiricalFormula

estimateFromWeightAndComp(average_weight, C, ...)

Fills this EmpiricalFormula with an approximate elemental composition for a given average weight and approximate elemental stoichiometry

estimateFromWeightAndCompAndS(...)

Fills this EmpiricalFormula with an approximate elemental composition for a given average weight, exact number of sulfurs, and approximate elemental stoichiometry

getAverageWeight()

Returns the average weight of the formula (includes proton charges)

getCharge()

Returns the total charge

getConditionalFragmentIsotopeDist(precursor, ...)

Returns the conditional fragment isotope distribution

getElementalComposition()

Overloaded function.

getIsotopeDistribution(method)

Overloaded function.

getLightestIsotopeWeight()

Returns the sum of the lightest isotope weight of all elements in the formula (includes proton charges)

getMonoWeight()

Returns the mono isotopic weight of the formula (includes proton charges)

getNumberOf(element)

Returns the number of atoms of the given element (can be negative)

getNumberOfAtoms()

Returns the total number of atoms

hasElement(element)

Returns true if the formula contains the element

isCharged()

Returns true if charge is not equal to zero

isEmpty()

Returns true if the formula does not contain a element

setCharge(charge)

Sets the charge

toString()

Returns the formula as a string (charges are not included)

addChargeAdduct(count: int = 1, adduct: str = 'H') → pyopenms.EmpiricalFormula#

Makes ionization explicit: adds count copies of adduct (default: a hydrogen atom) to the formula and resets the charge to zero

calculateTheoreticalIsotopesNumber() → float#
contains(ef: pyopenms.EmpiricalFormula) → bool#

Returns true if all elements from ef ( empirical formula ) are LESS abundant (negative allowed) than the corresponding elements of this EmpiricalFormula

estimateFromWeightAndComp(average_weight: float, C: float, H: float, N: float, O: float, S: float, P: float) → bool#

Fills this EmpiricalFormula with an approximate elemental composition for a given average weight and approximate elemental stoichiometry

estimateFromWeightAndCompAndS(average_weight: float, S: int, C: float, H: float, N: float, O: float, P: float) → bool#

Fills this EmpiricalFormula with an approximate elemental composition for a given average weight, exact number of sulfurs, and approximate elemental stoichiometry

getAverageWeight() → float#

Returns the average weight of the formula (includes proton charges)

getCharge() → int#

Returns the total charge

getConditionalFragmentIsotopeDist(precursor: pyopenms.EmpiricalFormula, precursor_isotopes: collections.abc.Set[int], method: pyopenms.CoarseIsotopePatternGenerator) → pyopenms.IsotopeDistribution#

Returns the conditional fragment isotope distribution

getElementalComposition() → dict[str, int]#
getElementalComposition() → dict[str, int]

Overloaded function.

  1. getElementalComposition() -> dict[str, int]

Get elemental composition as a hash {‘Symbol’ -> NrAtoms}

  1. getElementalComposition() -> dict[str, int]

Get elemental composition as a dict {‘Symbol’: NrAtoms}

getIsotopeDistribution(method: pyopenms.CoarseIsotopePatternGenerator) → pyopenms.IsotopeDistribution#
getIsotopeDistribution(method: pyopenms.FineIsotopePatternGenerator) → pyopenms.IsotopeDistribution

Overloaded function.

  1. getIsotopeDistribution(method: pyopenms.CoarseIsotopePatternGenerator) -> pyopenms.IsotopeDistribution

Returns isotope distribution using CoarseIsotopePatternGenerator

  1. getIsotopeDistribution(method: pyopenms.FineIsotopePatternGenerator) -> pyopenms.IsotopeDistribution

Returns isotope distribution using FineIsotopePatternGenerator

getLightestIsotopeWeight() → float#

Returns the sum of the lightest isotope weight of all elements in the formula (includes proton charges)

getMonoWeight() → float#

Returns the mono isotopic weight of the formula (includes proton charges)

getNumberOf(element: pyopenms.Element) → int#

Returns the number of atoms of the given element (can be negative)

getNumberOfAtoms() → int#

Returns the total number of atoms

hasElement(element: pyopenms.Element) → bool#

Returns true if the formula contains the element

isCharged() → bool#

Returns true if charge is not equal to zero

isEmpty() → bool#

Returns true if the formula does not contain a element

setCharge(charge: int) → None#

Sets the charge

toString() → str#

Returns the formula as a string (charges are not included)