Skip to content

Extracting profile or spectrum

Guillaume Erny edited this page Apr 3, 2017 · 13 revisions

In x-HRMS analysis, extracted ion profiles EIP is one of the most interesting tools. Filtrating the dataset around a defined m/z interval allows extracting a profile that is specific to one ionic species (molecular ions, adducts...) of a separated compounds. The principle is simple and can easily be done using the Traces objects. For example

TimeAxe  =  myFinnee.Datasets{1}.TimeAxe.Data;       % Get the time axe from dataset 1
EIP(:,1) = TimeAxe;                                  % Time in first column
mzLim = [242 243];                                   % set values of interest
for ii = 1:length(TimeAxe)                          
    MS = myFinnee.Datasets{1}.ListOfScans{ii}.Data;  % Load MS spectra for each ii
    d2k = MS(:,1) >= mzLim(1) & MS(:,1) <= mzLim(2); % Find data between mzmin and mzmax
    EIP(ii, 2) = sum(MS(d2k, 2));
end

plot(EIP(:,1), EIP(:,2))                             % plot resulting data

Example EIP

The small script allows obtaining EIP between any m/z interval as set in the mzLim variable

Using the getProfile and getSpectra Dataset class methods

One of the main interest of OOP is to include within a class a structured data architecture and specific method to interact with those data. Two methods have been programmed in the Dataset object, the getProfile and getSpectra methods.

getSpectra

The getSpectra method allows obtaining either a spectrum a particular time or the average spectrum between a time interval. For example with the previous EIP with a peak maximum at 8.537 min and peak base at ~8.703 min and ~8.788 min the average spectrum cab be obtained using

spra1 = myFinnee.Datasets{1}.getSpectra(8.537);         % Spectrum at 8.537 min
spra2 = myFinnee.Datasets{1}.getSpectra([8.403 8.788]); % averaged spectrum between 8.403 and 8.788

spra1 and spra2 are Trace objects with all associated properties and methods. For example,

spra2.plot

averaged Spectrum
can be used to plot the spectrum or

MS = spra2.Data;

to copy the data to the variable MS. The averaged spectrum is particularly attractive when using a centroid spectrum mode. While with profile mode, the spectrum is a continuous profile, with centroid mode Finnee2016 do not bucket the data allowing to keep the accurate masses of each spectrum. Those can be easily measured zooming around the peak of interest

averaged spectrum in centroid mode

thus allowing to defined an extremely narrow m/z range for EIP in centroid mode.

getProfile

getProfile is similar to getSpectra and allows to obtain a profile at a single m/z value or between a m/z interval. It is evident that in the case of a centroid mode dataset a single value does not present a lot of interest.

prf1 = prf1 = myFinnee.Datasets{1}.getProfile([243.0577 243.0612])
prf1.plot

EIP, dataset in ctrMode

Important notes (18/01/2017)

At this time, it is not possible to save individual traces obtained using getProfile or getSpectra. The reason is that Finnee2016 uses a temporary file to store the data. This can be modified if there is a demand for it.


Up            : Profile and spectrum
Next         : Working with the GUI
Previous  : Working with Trace


Related to:

Clone this wiki locally