IMSIsotopeDistribution#
- class pyopenms.IMSIsotopeDistribution#
Bases:
objectRepresents a distribution of isotopes restricted to the first K elements
Represents a distribution of isotopes of chemical elements as a list of peaks each as a pair of mass and abundance. ‘IsotopeDistribution’ unlike ‘IsotopeSpecies’ has one abundance per a nominal mass. Here is an example in the format (mass; abundance %) for molecule H2O (values are taken randomly):
- IsotopeDistribution
(18.00221; 99.03 %) (19.00334; 0.8 %) (20.00476; 0.17 %)
- IsotopeSpecies
(18.00197; 98.012 %) (18.00989; 1.018 %) (19.00312; 0.683 %) (19.00531; 0.117 %) (20.00413; 0.134 %) (20.00831; 0.036 %)
To the sake of faster computations distribution is restricted to the first K elements, where K can be set by adjusting size ‘SIZE’ of distribution. Note: For the elements most abundant in living beings (CHNOPS) this restriction is negligible, since abundances decrease dramatically in isotopes order and are usually of no interest starting from +10 isotope.
‘IsotopeDistribution’ implements folding with other distribution using an algorithm described in details in paper: Boecker et al. “Decomposing metabolic isotope patterns” WABI 2006. doi: 10.1007/11851561_2
Folding with itself is done using Russian Multiplication Scheme
- __init__(nominal_mass: int = 0) None#
- __init__(arg: float, /) None
- __init__(arg0: collections.abc.Sequence[pyopenms.IMSIsotopeDistribution_Peak], arg1: int, /) None
- __init__(arg: pyopenms.IMSIsotopeDistribution, /) None
Methods
__init__([nominal_mass])empty()Returns true if the distribution has no peaks, false - otherwise
getAbundance(i)Gets an abundance of isotope 'i'
getMass(i)Gets a mass of isotope 'i'
Normalizes distribution, i.e. scaling abundances to be summed up to 1 with an error.
setNominalMass(nominalMass)size()Attributes
- ABUNDANCES_SUM_ERROR = 0.0#
- SIZE = 0#
- empty() bool#
Returns true if the distribution has no peaks, false - otherwise
- getAbundance(i: int) float#
- getAbundances() list[float]#
Gets an abundance of isotope ‘i’
- getAverageMass() float#
- getMass(i: int) float#
- getMasses() list[float]#
Gets a mass of isotope ‘i’
- getNominalMass() int#
- normalize() None#
Normalizes distribution, i.e. scaling abundances to be summed up to 1 with an error
- setNominalMass(nominalMass: int) None#
- size() int#