IMSAlphabet#

class pyopenms.IMSAlphabet#

Bases: object

Cython implementation of _IMSAlphabet

Original C++ documentation is available here

Holds an indexed list of bio-chemical elements.

Presents an indexed list of bio-chemical elements of type (or derived from type) ‘Element’. Due to indexed structure ‘Alphabet’ can be used similar to std::vector, for example to add a new element to ‘Alphabet’ function push_back(element_type) can be used. Elements or their properties (such as element’s mass) can be accessed by index in a constant time. On the other hand accessing elements by their names takes linear time. Due to this and also the fact that ‘Alphabet’ is ‘heavy-weighted’ (consisting of ‘Element’ -s or their derivatives where the depth of derivation as well is undefined resulting in possibly ‘heavy’ access operations) it is recommended not use ‘Alphabet’ directly in operations where fast access to ‘Element’ ‘s properties is required. Instead consider to use ‘light-weighted’ equivalents, such as ‘Weights’

Parameters:
  • map – MSExperiment to receive the identifications

  • fmap – FeatureMap with PeptideIdentifications for the MSExperiment

  • clear_ids – Reset peptide and protein identifications of each scan before annotating

  • map_ms1 – Attach Ids to MS1 spectra using RT mapping only (without precursor, without m/z)

__init__()#

Overload:

__init__(self) None

Overload:

__init__(self, in_0: IMSAlphabet) None

Overload:

__init__(self, elements: List[IMSElement]) None

Methods

__init__

Overload:

clear(self)

Clears the alphabet data

erase(self, name)

Removes the element with 'name' from the alphabet

getAverageMasses(self)

Gets average masses of elements

getElement

Overload:

getMass

Overload:

getMasses(self, isotope_index)

Gets masses of elements isotopes given by 'isotope_index'

getName(self, index)

Gets the symbol of the element with an 'index' in alphabet

hasName(self, name)

Returns true if there is an element with symbol 'name' in the alphabet, false - otherwise

load(self, fname)

Loads the alphabet data from the file 'fname' using the default parser.

push_back

Overload:

setElement(self, name, mass, forced)

Overwrites an element in the alphabet with the 'name' with a new element constructed from the given 'name' and 'mass'

size(self)

sortByNames(self)

Sorts the alphabet by names

sortByValues(self)

Sorts the alphabet by mass values

clear(self) None#

Clears the alphabet data

erase(self, name: bytes) bool#

Removes the element with ‘name’ from the alphabet

getAverageMasses(self) List[float]#

Gets average masses of elements

getElement()#

Overload:

getElement(self, name: bytes) IMSElement

Gets the element with ‘index’ and returns element with the given index in alphabet

Overload:

getElement(self, index: int) IMSElement

Gets the element with ‘index’

getMass()#

Overload:

getMass(self, name: bytes) float

Gets mono isotopic mass of the element with the symbol ‘name’

Overload:

getMass(self, index: int) float

Gets mass of the element with an ‘index’ in alphabet

getMasses(self, isotope_index: int) List[float]#

Gets masses of elements isotopes given by ‘isotope_index’

getName(self, index: int) bytes#

Gets the symbol of the element with an ‘index’ in alphabet

hasName(self, name: bytes) bool#

Returns true if there is an element with symbol ‘name’ in the alphabet, false - otherwise

load(self, fname: String) None#

Loads the alphabet data from the file ‘fname’ using the default parser. If there is no file ‘fname’, throws an ‘IOException’

push_back()#

Overload:

push_back(self, name: bytes, value: float) None

Adds a new element with ‘name’ and mass ‘value’

Overload:

push_back(self, element: IMSElement) None

Adds a new ‘element’ to the alphabet

setElement(self, name: bytes, mass: float, forced: bool) None#

Overwrites an element in the alphabet with the ‘name’ with a new element constructed from the given ‘name’ and ‘mass’

size(self) int#
sortByNames(self) None#

Sorts the alphabet by names

sortByValues(self) None#

Sorts the alphabet by mass values