IMSAlphabet

class pyopenms.IMSAlphabet

Bases: object

Cython implementation of _IMSAlphabet

Documentation is available at http://www.openms.de/current_doxygen/html/classOpenMS::ims::IMSAlphabet_1_1IMSAlphabet.html

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’ —– :param map: MSExperiment to receive the identifications :param fmap: FeatureMap with PeptideIdentifications for the MSExperiment :param clear_ids: Reset peptide and protein identifications of each scan before annotating :param map_ms1: Attach Ids to MS1 spectra using RT mapping only (without precursor, without m/z)

__init__()
  • Cython signature: void IMSAlphabet()

  • Cython signature: void IMSAlphabet(IMSAlphabet &)

  • Cython signature: void IMSAlphabet(libcpp_vector[IMSElement] & elements)

Methods

__init__

  • Cython signature: void IMSAlphabet()

clear

Cython signature: void clear() Clears the alphabet data

erase

Cython signature: bool erase(libcpp_string & name) Removes the element with 'name' from the alphabet

getAverageMasses

Cython signature: libcpp_vector[double] getAverageMasses() Gets average masses of elements

getElement

  • Cython signature: IMSElement getElement(libcpp_string & name)

getMass

  • Cython signature: double getMass(libcpp_string & name)

getMasses

Cython signature: libcpp_vector[double] getMasses(int isotope_index) Gets masses of elements isotopes given by 'isotope_index'

getName

Cython signature: libcpp_string getName(int index) Gets the symbol of the element with an 'index' in alphabet

hasName

Cython signature: bool hasName(libcpp_string & name) Returns true if there is an element with symbol 'name' in the alphabet, false - otherwise

load

Cython signature: void load(String & fname) Loads the alphabet data from the file 'fname' using the default parser.

push_back

  • Cython signature: void push_back(libcpp_string & name, double value)

setElement

Cython signature: void setElement(libcpp_string & name, double mass, bool forced) Overwrites an element in the alphabet with the 'name' with a new element constructed from the given 'name' and 'mass'

size

Cython signature: int size()

sortByNames

Cython signature: void sortByNames() Sorts the alphabet by names

sortByValues

Cython signature: void sortByValues() Sorts the alphabet by mass values

clear()

Cython signature: void clear() Clears the alphabet data

erase()

Cython signature: bool erase(libcpp_string & name) Removes the element with ‘name’ from the alphabet

getAverageMasses()

Cython signature: libcpp_vector[double] getAverageMasses() Gets average masses of elements

getElement()
  • Cython signature: IMSElement getElement(libcpp_string & name) Gets the element with ‘index’ and returns element with the given index in alphabet

  • Cython signature: IMSElement getElement(int index) Gets the element with ‘index’

getMass()
  • Cython signature: double getMass(libcpp_string & name) Gets mono isotopic mass of the element with the symbol ‘name’

  • Cython signature: double getMass(int index) Gets mass of the element with an ‘index’ in alphabet

getMasses()

Cython signature: libcpp_vector[double] getMasses(int isotope_index) Gets masses of elements isotopes given by ‘isotope_index’

getName()

Cython signature: libcpp_string getName(int index) Gets the symbol of the element with an ‘index’ in alphabet

hasName()

Cython signature: bool hasName(libcpp_string & name) Returns true if there is an element with symbol ‘name’ in the alphabet, false - otherwise

load()

Cython signature: void load(String & fname) Loads the alphabet data from the file ‘fname’ using the default parser. If there is no file ‘fname’, throws an ‘IOException’

push_back()
  • Cython signature: void push_back(libcpp_string & name, double value) Adds a new element with ‘name’ and mass ‘value’

  • Cython signature: void push_back(IMSElement & element) Adds a new ‘element’ to the alphabet

setElement()

Cython signature: void setElement(libcpp_string & name, double mass, bool forced) Overwrites an element in the alphabet with the ‘name’ with a new element constructed from the given ‘name’ and ‘mass’

size()

Cython signature: int size()

sortByNames()

Cython signature: void sortByNames() Sorts the alphabet by names

sortByValues()

Cython signature: void sortByValues() Sorts the alphabet by mass values