EmpiricalFormula#
- class pyopenms.EmpiricalFormula#
Bases:
object
Cython implementation of _EmpiricalFormula
Original C++ documentation is available here
- __init__()#
Overload:
- __init__(self) None
Representation of an empirical formula
Overload:
- __init__(self, in_0: EmpiricalFormula) None
Overload:
- __init__(self, in_0: bytes | str | String) None
EmpiricalFormula Constructor from string
Overload:
- __init__(self, number: int, element: Element, charge: int) None
EmpiricalFormula Constructor with element pointer and number
Methods
Overload:
contains
(self, ef)Returns true if all elements from ef ( empirical formula ) are LESS abundant (negative allowed) than the corresponding elements of this EmpiricalFormula
estimateFromWeightAndComp
(self, ...)Fills this EmpiricalFormula with an approximate elemental composition for a given average weight and approximate elemental stoichiometry
estimateFromWeightAndCompAndS
(self, ...)Fills this EmpiricalFormula with an approximate elemental composition for a given average weight, exact number of sulfurs, and approximate elemental stoichiometry
getAverageWeight
(self)Returns the average weight of the formula (includes proton charges)
getCharge
(self)Returns the total charge
getConditionalFragmentIsotopeDist
(self, ...)getElementalComposition
(self)Get elemental composition as a hash {'Symbol' -> NrAtoms}
Overload:
getMonoWeight
(self)Returns the mono isotopic weight of the formula (includes proton charges)
getNumberOfAtoms
(self)Returns the total number of atoms
hasElement
(self, element)Returns true if the formula contains the element
isCharged
(self)Returns true if charge is not equal to zero
isEmpty
(self)Returns true if the formula does not contain a element
setCharge
(self, charge)Sets the charge
toString
(self)Returns the formula as a string (charges are not included)
- calculateTheoreticalIsotopesNumber(self) float #
- contains(self, ef: EmpiricalFormula) bool #
Returns true if all elements from ef ( empirical formula ) are LESS abundant (negative allowed) than the corresponding elements of this EmpiricalFormula
- estimateFromWeightAndComp(self, 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(self, 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(self) float #
Returns the average weight of the formula (includes proton charges)
- getCharge(self) int #
Returns the total charge
- getConditionalFragmentIsotopeDist(self, precursor: EmpiricalFormula, precursor_isotopes: Set[int], method: CoarseIsotopePatternGenerator) IsotopeDistribution #
- getElementalComposition(self) Dict[bytes, int] #
Get elemental composition as a hash {‘Symbol’ -> NrAtoms}
- getIsotopeDistribution()#
Overload:
- getIsotopeDistribution(self, in_0: CoarseIsotopePatternGenerator) IsotopeDistribution
Computes the isotope distribution of an empirical formula using the CoarseIsotopePatternGenerator or the FineIsotopePatternGenerator method
Overload:
- getIsotopeDistribution(self, in_0: FineIsotopePatternGenerator) IsotopeDistribution
- getMonoWeight(self) float #
Returns the mono isotopic weight of the formula (includes proton charges)
- getNumberOfAtoms(self) int #
Returns the total number of atoms
- isCharged(self) bool #
Returns true if charge is not equal to zero
- isEmpty(self) bool #
Returns true if the formula does not contain a element
- setCharge(self, charge: int) None #
Sets the charge