You are on page 1of 2

Anal. Chem., 1996, 68(20), 3602-3606, DOI:10.

1021/ac960435y

Terms & Conditions


Electronic Supporting Information files are available without a subscription to ACS Web Editions. The American Chemical
Society holds a copyright ownership interest in any copyrightable Supporting Information. Files available from the ACS
website may be downloaded for personal use only. Users are not otherwise permitted to reproduce, republish,
redistribute, or sell any Supporting Information from the ACS website, either in whole or in part, in either machine-
readable form or any other form without permission from the American Chemical Society. For permission to reproduce,
republish and redistribute this material, requesters must process their own requests via the RightsLink permission
system. Information about how to use the RightsLink permission system can be found at
http://pubs.acs.org/page/copyright/permissions.html

Copyright © 1996 American Chemical Society


(01996 American Chemical Society Analytical Chemistry V68 Page 3602 Windig Supplemental Page 1

function democoda(data,window,level);
%function democoda(data,window,level);
%demonstrates the CODA algorithm (Anal. Chem .......
%The input argument data is a matrix with the spectra in rows. Window is the
%smoothing window used. Window should be odd. Level is the lower limit for the
%MCQ level based selection of mass chromatograms. The program plots the TIC of
%the original data set (Fig. la of paper), the TIC of the mass chromatograms
%selected by CODA (Fig. 2c of paper), and a plot of all the mass
%chromatograms.

%INITIALIZE

[nrows,ncols]-size(data);
halfwindow-(window-l)/2;
datasmoothed-zeros(nrows-window+l,ncols);

%SMOOTH THE DATA

for i-1:window;
datasmoothed-datasmoothed+data(i:(nrows-window+i),:);
end;

%TRUNCTATE DATA SO THAT IT HAS SAME SIZE AS DATASMOOTHED

data([1:halfwindow nrows-halfwindow+l:nrows],:)-[];
nrows-nrows-window+1;

%SCALE DATA SO THAT COLUMNS (MASS CHROMATOGRAMS) HAVE UNIT LENGTH

lengthdata-sqrt(sum(data.*data));
datalengthscaled-data./lengthdata(ones(l,nrows),:);

%STANDARDIZE DATASMOOTHED

meandatasmoothed-mean(datasmoothed);
stddatasmoothed-std(datasmoothed);
datasmoothedstand-(datasmoothed-meandatasmoothed(ones(1,nrows),:))./...
stddatasmoothed(ones(1,nrows),:);

%CALCULATE MCQ INDEX

mcq-(l/sqrt(nrows-1))*sum(datalengthscaled.*datasmoothedstand);

%PLOT TIC, TIC of CODA and CODA selected mass chromatograms;

close;subplot(311);plot(sum(data'),'w');title('TIC');
subplot(312);plot(sum(data(:,(mcq>level))'),'w');title('TIC CODA');
subplot(313);plot((data(:,(mcq>level))));title('MC''s CODA');

You might also like