-
Notifications
You must be signed in to change notification settings - Fork 2
Converting an mzML file to a Matlab object
The built-in Matlab function xmlread allows to load XML documents (such as mzML files). However, this function is problematic with large files. Finnee2016 uses various objects to organise the information. Data are stored in additional binary files, allowing working efficiently even with very large files.
The Finnee class is the entry object for Finnee2016 and contains all recorded information about a single X-HRMS run. A new Finnee object is created for each run by entering the following line in the command window
myFinnee = Finnee;
If entered without any option (as it is on top), you will be asked to:
- Select the mzML file
- Select a folder of destination
- Enter a generic name
The creation of the Finnee object can take few minutes (use Ctrl-c if you want to abort). All information are stored in a new folder whose name is the one given in 3, with a ´.fin´extension. This folder contains the Matlab file ‘myFinnee.mat’ and one or more large files with a random name. Those are the binary data files. The variable myFinnee should also be in your workspace with as value ‘1x1Finnee’. In Matlab, you can easily interact with the variables. For example, right-clicking on myFinnee allows you to rename it. If you double left-click on this variable, you should see the properties associated with this variable.

- FileID is the generic name selected in 3
- DateOfCreation is the date when the Finnee object has been created
- FileIn id the original mzML file
- Datasets is an array of objects Dataset. For more information about the different properties and methods associated with this object, you can check the detailed description of Finnee in the Matlab environment by typing > help finnee.
Dataset objects contain the collection of traces (trace can be MS spectrum, chromatogram, electropherogram or any 2D data representation) that were recorded during a single experiment. At the creation of the Finnee object only the original dataset exists, however, additional datasets can be created, for example after filtering, baseline correction or centroidisation. As with Finnee, double left-click on the dataset allows listing all associated properties with a given dataset.

- Title
- Log allows to keep a record of all transformation that were done. Here, PRF indicates that this a profile type dataset.
- DateOfCreation
- Format defined how the dataset is made; it can either be ‘MS profile’ or ‘MS centroid’
- BPP, TIP, TIS, FIS, BIS are trace objects that contain the base peak profile, the total ion profile, the total ion spectrum, the frequence ion spectrum and the base ion spectrum respectively.
- ListOfScans is an array of trace that contains the experimental data. If the format is ‘profile’; ListOfScans will contain all the profile spectra recorded by the instrument. If the format is ‘centroid’; ListOfScans will contain all the centroid spectra calculated from the previous profile spectra. For more information about the different properties and methods associated with this object you can check the detailed description of Dataset in Matlab
The Trace object will contain all information about a two-dimensional data series. This can either be a profile (chromatogram, electropherogram…) or an MS spectra. The properties associated with the Trace object are

- Title
- FigureTitle, usually related to the dataset
- TraceType: 'PRF' profile MS scan; 'CTR' centroid MS scab; 'SEP' separation profile; 'OTH' other.
- AxisX information about the X axis (axis object) (time axis for SEP, m/z axis for CTR or PRF)
- AxisY information about the Y axis (usually intensity)
- Data a 2xn array with, in first column the X data and in second column the Y data
A Finnee object can be initialised using different options; those are:
- 'rounding', To be explained
- 'spikes', followed by an integer n (n = 0, 1, 2 or 3). Remove spikes from each MS scans where a spike is an "MS peak" that contain n or less non-zeros points. By default peaks with 2 or fewer points will be removed from each scan. ('spikes', 0) is used to don't remove spikes.
- 'fileIn', followed by the full path to the mzML file
- 'folderOut', path to the output folder
- 'fileID', name of the folder (without the .fin extension)
- 'overwrite', delete 'folderout'/'fileID'.fin if it exists
myFinnee = finnee('fileID', 'myExperiment', 'overwrite') myFinnee = finnee('spikes', 1, 'overwrite')
Finnee objects are saved automatically at creation or when a new dataset is added. However, it is possible to add or delete traces, delete datasets or edit some properties. To save your modification, use
myFinnee.save
To load a Finnee object, you can either use
load('(the full path)\myFinnee.mat')
or you can load the .fin folder using browse for folder, and double click on myFinnee.mat

Up : Where to start?
Next : Trace, Dataset and Finnee objects
Previous: mzML files