Open-source code for processing chromatography and mass spectrometry data in the MATLAB programming environment |
Select the Download ZIP
button on this page or visit the MATLAB File Exchange to download a copy of the current release.
Import Data |
| ||||||||||
Baseline Correction | |||||||||||
Curve Fitting | |||||||||||
Visualize |
Current release stable on the following systems:
- MATLAB 2013b+
Visit the wiki for a full list of methods and options.
Add the @Chromatography
folder to your MATLAB path and run the following code in the MATLAB command window:
obj = Chromatography();
Find out which version is currently installed using the command below:
obj.version
ans =
'0.1.51'
Import raw data files into the MATLAB workspace:
% Import Agilent '.D' files
data = obj.import('.D');
% Append data with Thermo '.RAW' files
data = obj.import('.RAW', 'append', data);
Calculate baselines for the total ion chromatograms (TIC) in all samples:
data = obj.baseline(data,...
'samples', 'all',...
'ions', 'tic',...
'smoothness', 1E7,...
'asymmetry', 5E-6);
Apply a smoothing filter to the total ion chromatograms (TIC) in all samples:
% Small amount of smoothing
data = obj.smooth(data,...
'samples', 'all',...
'ions', 'tic',...
'smoothness', 10,...
'asymmetry', 0.5);
% Heavy amount of smoothing
data = obj.smooth(data,...
'samples', 'all',...
'ions', 'tic',...
'smoothness', 1000,...
'asymmetry', 0.5);
Reset data to its original state with the command:
data = obj.reset(data);
Plot all total ion chromatograms (TIC) in a stacked layout:
fig = obj.visualize(data,...
'samples', 'all',...
'ions', 'tic',...
'layout', 'stacked',...
'scale', 'normalized',...
'xlim', [5,45],...
'colormap', 'jet',...
'legend', 'on');
Plot the total ion chromatogram (TIC) for a single sample and save as a JPG (400 DPI):
fig = obj.visualize(data,...
'samples', 4,...
'ions', 'tic',...
'xlim', [2,50],...
'color', 'black',...
'legend', 'on',...
'export', {'MyFileName', '-djpeg', '-r400'});
Plot selected extracted ion chromatograms (XIC) for selected samples and save as a PNG (150 DPI):
fig = obj.visualize(data,...
'samples', [1:2,6,9:10],...
'ions', [10:50,55,59,100:200],...
'layout', 'stacked',...
'scale', 'full',...
'xlim', [10,30],...
'colormap', 'winter',...
'legend', 'on',...
'export', {'MyFileName', '-dpng', '-r150'});