-
Notifications
You must be signed in to change notification settings - Fork 18
Home
James Dillon edited this page Feb 11, 2018
·
22 revisions
Chromatography Toolbox (v0.1.51
) provides command line data processing methods for chromatography and mass spectrometry data in MATLAB.
Initialize the Chromatography
class to use any of the following methods: import
, centroid
, baseline
, smooth
, integrate
, visualize
.
obj = Chromatography
Import raw data into the MATLAB workspace with the import
function. Supported file formats include: Agilent (.D
), Thermo (.RAW
), and netCDF (.CDF
).
data = obj.import(filetype, 'OptionName', optionvalue)
% Import Agilent '.D' files
data = obj.import('.D');
% Import NetCDF '.CDF' files and append data to an existing data structure
data = obj.import('.CDF', 'append', data);
% Import Thermo '.RAW' files without status updates in the command window
data = obj.import('.RAW', 'progress', 'off');
Perform baseline correction with the baseline
function.
data = obj.baseline(data, 'OptionName', optionvalue)
% Get baselines for all total ion chromatograms (TIC), for all samples
data = obj.baseline(data,...
'samples', 'all',...
'ions', 'tic',...
'smoothness', 1E7,...
'asymmetry', 1E-5);
% Get baselines for all extracted ion chromatograms (XIC), for samples #2 and #5
data = obj.baseline(data,...
'samples', [2,5],...
'ions', 'all',...
'smoothness', 1E6,...
'asymmetry', 5E-6);
% Get baselines for selected extracted ion chromatograms (XIC), for all samples
data = obj.baseline(data,...
'samples', 'all',...
'ions', [1:10, 23, 27, 80:150]);
Smooth raw data with the smooth
function.
data = obj.smooth(data, 'OptionName', optionvalue)
% Smooth all total ion chromatogram (TIC), for all samples
data = obj.smooth(data,...
'samples', 'all',...
'ions', 'tic',...
'smoothness', 1000,...
'asymmetry', 0.5);
% Smooth all extracted ion chromatograms (XIC), for samples #1-3 and #6
data = obj.smooth(data,...
'samples', [1:3,6],...
'ions', 'all',...
'smoothness', 10,...
'asymmetry', 0.5);
% Smooth selected extracted ion chromatograms (XIC), for samples #2, #4, and #6
data = obj.smooth(data,...
'samples', [2,4,6],...
'ions', [1:100, 150:250, 300, 400],...
'smoothness', 500,...
'asymmetry', 0.5);
Find peaks and determine peak area using the integrate
function.
data = obj.integrate(data, 'OptionName', optionvalue)
% Find and integrate the largest peak between 19.5 and 21.5 minutes in the total ion chromatogram (TIC), for all samples
data = obj.integrate(data,...
'samples', 'all',...
'ions', 'tic',...
'center', 20.5,
'width', 1.0);
% Find and integrate the largest peak between 0 and 30 minutes in the total ion chromatogram (TIC), for samples #2-4 and #6
data = obj.integrate(data,...
'samples', [2:4,6],...
'ions', 'tic',...
'center', 15.0,
'width', 15.0);
% Find and integrate any peaks at 19.36 minutes for all extracted ion chromatograms (XIC), for all samples
data = obj.integrate(data,...
'samples', 'all',...
'ions', 'all',...
'center', 19.36,
'width', 0.01);
% Re-run the previous example, but reset/clear all existing peak data first
data = obj.integrate(data,...
'samples', 'all',...
'ions', 'all',...
'center', 19.36,
'width', 0.01,...
'results', 'reset');
% Find and integrate peaks at 19.50 minutes and replace the results from the previous example
data = obj.integrate(data,...
'samples', 'all',...
'ions', 'all',...
'center', 19.50,
'width', 0.01,...
'results', 'replace');
Plot data and export high quality figures using the visualize
function.
fig = obj.visualize(data, 'OptionName', optionvalue)
% Plot the total ion chromatograms (TIC) for all samples in a stacked layout using separate scales and show legend
fig = obj.visualize(data,...
'samples', 'all',...
'ions', 'tic',...
'layout', 'stacked',...
'scale', 'normalized',...
'legend', 'on');
% Re-run the previous example, change the color to 'black' and save figure to a .PNG file with a DPI of 300
fig = obj.visualize(data,...
'samples', 'all',...
'ions', 'tic',...
'layout', 'stacked',...
'scale', 'normalized',...
'legend', 'on',...
'color', 'black',...
'export', {'MyFileName', '-dpng', '-r300'});
% Plot selected XIC for all samples and overlay all chromatograms on the same scale between 10-30 minutes
fig = obj.visualize(data,...
'samples', 'all',...
'ions', [2,50],...
'layout', 'overlaid',...
'scale', 'full',...
'legend', 'on',...
'colormap', 'jet',...
'xlim', [10,30]);
% Plot a single XIC for samples #1-2, and #5-6 in a stacked layout with separate scales and save figure to .JPG file
fig = obj.visualize(data,...
'samples', [1:2,5:6],...
'ions', 34,...
'layout', 'stacked',...
'scale', 'normalized',...
'legend', 'on',...
'colormap', 'hsv',...
'xlim', [15,45],...
'export', {'MyFileName2', '-djpeg', '-r400'});