spike.plugins.MS package — spike 0.99.23 documentation

# spike.plugins.MS package

## Submodules

## spike.plugins.MS.FTMS_calib module

A utility for calibration of MS experiments

based on a list of experimentally measured m/z and theoretical ones The method will reduce the difference between lists.

adds ppm() ppm_error() and display_icalib() methods to the FTMSAxis object

  and imzmeas and mzref attributes

Adds the following methods(): to FTICR datasets

> set_calib(mzmeas, mzref, axis=1) calib(axis=1, method=’l1’, verbose=False) display_calib(axis=1, compare=False)

to FTICR axes

  display_icalib(xref, mzref, symbol=’bo’) ppm_error(xref, mzref) ppm(xref, mzref) display_icalib(xref, mzref, symbol=’bo’)

and the following attributes:

  RefAxis: a backup FTICRAxis, used to store the previous calibration

to FTICR axes

  mzref : list of m/z of reference values imzmeas : list of pea indices of reference peaks (to be match with mzref)

`spike.plugins.MS.FTMS_calib.` `calib`(npk, axis=1, method='l1', verbose=False)

  the current FTMS experiment is recalibrated optimaly along its axis ‘axis’ (usefull only in 2D) using parameters provided with set_calib() uses the current (2 or 3 parameters) calibration

  method is either ‘l1’ (robust) or ‘l2’ (classic)

  The current calibration is copied to a new unused axis called RefAxis

`spike.plugins.MS.FTMS_calib.` `calib_loadref`(npkd, fname, recalibrate=False, axis=1)

  Reads in a *.ref Bruker file holding a set of calibrating values for MS with the following format:

  > # comments

  > # TuneMixPos m/z charge C5H12O2N 118.086255 +1 C6H19O6N3P3 322.048121 +1 …

  and associate the reference list to the experiment, preparing for recalibration

  if recalibrate is True, values will be recomputed, with values interpreted as formula or peptides (A letter code)

`spike.plugins.MS.FTMS_calib.` `computes_index`(meas, axis)

  locates in index measured values

`spike.plugins.MS.FTMS_calib.` `display_calib`(npkd, axis=1, compare=False)

  generates a plot of the current calibration if compare is True, will try to draw the previous calibration curve along with the current one

`spike.plugins.MS.FTMS_calib.` `distcalib`(param, xref, mzref, axis)

  computes the residual to minimize when calibrating basically a wrapper around axis.ppm_error

`spike.plugins.MS.FTMS_calib.` `icalib`(npk, xind, ref, axis=1, method='l1', verbose=False)

  given a list of location in index ‘xind’ and of theoretical values ‘ref’ the current FTMS experiment is recalibrated optimatly along its axis ‘axis’ (usefull only in 2D) uses the current (2 or 3 parameters) calibration

  method is either ‘l1’ (robust) or ‘l2’ (classic)

  The current calibration is copied to a new unused axis called RefAxis

`spike.plugins.MS.FTMS_calib.` `l1calib`(param, xref, mzref, axis)

  computes the sum of residual to minimize when calibrating basically a wrapper around axis.ppm

`spike.plugins.MS.FTMS_calib.` `mzcalib`(xind, ref, axis, method='l1')

  fit axis parameters so that points located at xind be closest to ref values fits on two parameters if the 3rd (ML3 ie axis.calibC) is zero method = l2 uses levenberg-marqtart on l2 norm : classical method method = l1 uses powell on l1 norm : robust method

`spike.plugins.MS.FTMS_calib.` `ppm`(axis, xref, mzref)

  computes the mean error in ppm from a array of positions (xref) and the theoretical m/z (mzref) uses l1 norm ! xref : array of point coordinates of the reference points mzref: array of reference m/z

`spike.plugins.MS.FTMS_calib.` `ppm_error`(axis, xref, mzref)

  computes the error from a array of positions (xref) and the theoretical m/z (mzref) returns an array with errors in ppm xref : array of point coordinates of the reference points mzref: array of reference m/z

`spike.plugins.MS.FTMS_calib.` `read_ref`(fname)

  Reads in a *.ref Bruker file holding a set of calibrating values for MS returns a referencing dictionary {‘FORMULA’:(value,charge), … }

`spike.plugins.MS.FTMS_calib.` `recalibrate`(calib)

  a referencing dictionary {‘FORMULA’:value, … }

`spike.plugins.MS.FTMS_calib.` `set_calib`(npkd, mzmeas, mzref, axis=1)

  preset parameters for mass calibration mzref : list of reference m/z of calibrants mzmeas : list of measured m/z of calibrants

  axis is the axis to be calibrated, defaut is 1

## spike.plugins.MS.PhaseMS module

Phase correction for MS

includes 2nd order correction

`spike.plugins.MS.PhaseMS.` `movepivot`(p0, p1, p2, pvbef, pvaft)

  computes a new set of parameters whil moving pivot from pvbef to pvaft

`spike.plugins.MS.PhaseMS.` `phase`(self, ph0, ph1, ph2=0.0, pivot=0.0, axis=0)

  apply a phase correction along given axis PH0 is in degrees PH1 PH2 corrections are in nb of turns over the whole spectral width,

  > warning, this is different from usual NMR phases

  pivot is the center of the 1st & 2nd order term goes 0.0 … 1.0

    default value is 0 (left/slow frequency side) warning, this is different from usual NMR phases

  for a N complex spectrum, correction on ith point is

    ph = ph0 + ph1*(i/N - pv) + ph2*(i/N - pv)^2

## spike.plugins.MS.diagonal_2DMS module

computes diagonal of 2D-MS spectra

Created by DELSUC Marc-André on 2020-12-10.

`spike.plugins.MS.diagonal_2DMS.` `diagonal`(self)

  allows to extract the diagonal of a 2D FTMS spectrum

## Module contents