• simple import of native dataset.

  • simple FID

  • FFT with zerofilling

  • urQRd

You have first to execute the first two cells, then you can execute independently any of the example cells.
We begin first with simple import then we show how to make more elaborated commands involving data processing algorithms such as urQRd.

In [1]:
%matplotlib inline
In [2]:
cd ../.. 
/Users/chiron/bitbuck
In [3]:
from spike.File.Apex import Import_1D
import numpy as np                  # pour faire des calculs
import matplotlib.pyplot as plt     # pour afficher les données brutes
from spike.FTICR import FTICRData
    ========================
          SPIKE
    ========================
    Version     : 0.6.4
    Date        : 12-03-2015
    ========================
Importing plugin << bcorr >>
Importing plugin << fastclean >>
Importing plugin << Peaks >>
Importing plugin << rem_ridge >>
Importing plugin << sg >>
Importing plugin << test >>
Importing plugin << urQRd >>

Simple import from Apex format

In [4]:
f = Import_1D("DATA_test/angio_ms_000005.d")
f.report()
['DATA_test/angio_ms_000005.d/Apex2_LC_autoexclusion_test2.m/apexAcquisition.method'] 1
Out[4]:
'Dim 1\nAxis F1 : FT-ICR axis at 1000.000000 kHz,  524288 real points,  from mz = 1500.000   to m/z =  144.365  R max (M=400) = 189221'
In [5]:
f = Import_1D("DATA_test/angio_ms_000005.d")
f.display(label = "FID")
['DATA_test/angio_ms_000005.d/Apex2_LC_autoexclusion_test2.m/apexAcquisition.method'] 1
Out[5]:
Dim 1
Axis F1 : FT-ICR axis at 1000.000000 kHz,  524288 real points,  from mz = 1500.000   to m/z =  144.365  R max (M=400) = 189221
In [6]:
f = Import_1D("DATA_test/angio_ms_000005.d")
f.chsize(len(f.buffer)/2)
ff = f.copy()
ff.buffer = ff.buffer[:len(f.buffer)/2]/2
f.display(label = "FID")
f.display(label = "FID cut", new_fig = False)
['DATA_test/angio_ms_000005.d/Apex2_LC_autoexclusion_test2.m/apexAcquisition.method'] 1
Out[6]:
Dim 1
Axis F1 : FT-ICR axis at 1000.000000 kHz,  262144 real points,  from mz = 1500.000   to m/z =  144.365  R max (M=400) = 94611

Classical FFT with apodisation and zerofilling.

In [7]:
f = Import_1D("DATA_test/angio_ms_000005.d")
f.report()
f.units = 'm/z'
f.apod_sin(maxi = 0.5).chsize(f.buffer.size*2).rfft().modulus().display(label = "zerofill x2", show = True)
['DATA_test/angio_ms_000005.d/Apex2_LC_autoexclusion_test2.m/apexAcquisition.method'] 1
Out[7]:
Dim 1
Axis F1 : FT-ICR axis at 1000.000000 kHz,  524288 real points,  from mz = 1500.000   to m/z =  144.365  R max (M=400) = 189221

Here instead of writing a single long command with pipelines, the command is cut in many chunks. This can be used for performing intermediate operations not present in NPKv2.

In [8]:
f = Import_1D("DATA_test/angio_ms_000005.d")
f.units = 'm/z'
f.apod_sin(maxi = 0.5)
f.chsize(f.buffer.size*2).rfft()
f.modulus().display(label = "zerofill x2", show = True)
['DATA_test/angio_ms_000005.d/Apex2_LC_autoexclusion_test2.m/apexAcquisition.method'] 1
Out[8]:
Dim 1
Axis F1 : FT-ICR axis at 1000.000000 kHz,  524288 real points,  from mz = 1500.000   to m/z =  144.365  R max (M=400) = 189221

Example of how to use urQRd for denoising a spectrum. As a rule of thumb, the rank must be few times the number of expected frequencies.

In [9]:
f = Import_1D("DATA_test/angio_ms_000005.d")
f.units = 'm/z'
rank = 30
f.urqrd(k = rank).rfft().modulus().display(label = "urQRd, rank = {}".format(rank), show = True)
['DATA_test/angio_ms_000005.d/Apex2_LC_autoexclusion_test2.m/apexAcquisition.method'] 1
Out[9]:
Dim 1
Axis F1 : FT-ICR axis at 1000.000000 kHz,  262144 real points,  from mz = 1500.000   to m/z =  144.365  R max (M=400) = 94611
In [ ]: