-
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. Moreover, data are stored in additional binary files, allowing working efficiently even with very large files.
The [Finnee class] (https://github.com/glerny/Finnee2016/wiki/Finnee(class)) is the entry object for Finnee2016 and contains all recorded information about a single [X-HRMS] (https://github.com/glerny/Finnee2016/wiki/Definition-of-terms) run. A new Finnee object should be 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 five properties associated with this variable.

- mzMLDump is a structure that contains information initially presents in the mzML file
- Path2Fin is the location and name of the Finnee directory
- FileID is the generic name
- options is the [Options4Finnee object] (https://github.com/glerny/Finnee2016/wiki/Options4Finnee(class)) that summarises the options related to the Finnee object
- Datasets is an array of object [Dataset] (https://github.com/glerny/Finnee2016/wiki/Dataset(class)). For more information about the different properties and methods associated with this object you can check the detailed description of [Finnee] (https://github.com/glerny/Finnee2016/wiki/Finnee(class))
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
- Format defined how the dataset is made; it can either be ‘MS profile’, ‘MS centroid’, or ‘Ion profile.'
- Created from
- XLabel, Xunit and PrecInX are information about the X axis
- TimeAxe contains the value for the time axis
- YLabel, Yunit and PrecInY are information about the Y axis
- Zlabel, Xunit are information about the Z axis
- BPP, TIP, TIS, FIS, BIS are trace objects that contain the [base peak profile] (https://github.com/glerny/Finnee2016/wiki/Definition-of-terms), the [total ion profile] (https://github.com/glerny/Finnee2016/wiki/Definition-of-terms), the [total ion spectrum] (https://github.com/glerny/Finnee2016/wiki/Definition-of-terms), the [frequence ion spectrum] (https://github.com/glerny/Finnee2016/wiki/Definition-of-terms) and the [base ion spectrum] (https://github.com/glerny/Finnee2016/wiki/Definition-of-terms) respectively.
- ListOfScans is an array of trace that contains the experimental data. If the format is ‘MS profile’; ListOfScans will contain all the [profile spectra] (https://github.com/glerny/Finnee2016/wiki/definition_of_terms) recorded by the instrument along the time. If the format is ‘MS centroid’; ListOfScans will contain all the [centroid spectra] (https://github.com/glerny/Finnee2016/wiki/definition_of_terms) calculated from the previous profile spectra. If the format is ‘ion profile’; listOfScans will contain [extracted ion profiles] (https://github.com/glerny/Finnee2016/wiki/definition_of_terms) or [pure ion profiles] (https://github.com/glerny/Finnee2016/wiki/definition_of_terms).
For more information about the different properties and methods associated with this object you can check the detailed description of [Dataset] (https://github.com/glerny/Finnee2016/wiki/Dataset(class))
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
- Format (‘MS profile’, ‘MS centroid’, or ‘Ion profile’)
- XLabel, Xunit and PrecInX are information about the X axis
- YLabel, Yunit and PrecInY are information about the Y axis
- Path2Dat is the address of the binary file where the data are stored
- Index is the 3x1 array that allows finding the data in the binary file
- Precision is the encoding precision
For more information about the different properties and methods associated with this object you can check the detailed description of [Trace] (https://github.com/glerny/Finnee2016/wiki/Trace(class))
Different options can be used when creating a Finnee object; those can be input either using [Options4Finnee] (https://github.com/glerny/Finnee2016/wiki/Trace(class)) or using the Finnee function. Available options are:
- 'tLim', should be followed by a 2x1 array allow; set the time interval of interest
- 'mzMlim', should be followed by a 2x1 array; set the m/z interval of interest
- '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('tLim', [2 10], '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 : [Profile and spectrum] (https://github.com/glerny/Finnee2016/wiki/Profile-and-spectrum)
Previous : mzML files
Related to: