|
|
| t2dexample.m |

%% Accessing Mass spectrometry data using the Proteome Commons IO Library
% There are many formats for mass spectrometry data. The Proteome Commons
% Project http://www.proteomecommons.org provides a library of functions
% for reading many of the widely used formats. In this example we will read
% a ABI T2D file.
%% Add the Proteome Commons IO Library to MATLAB
% Download the Proteome Commons IO jar files from
% http://www.proteomecommons.org/current/531
%
% The documentation says that all the T2D support is in the main libraries
% but I had to also download the IO-T2D extension.
% http://www.proteomecommons.org/archive/1118700527203/index.html
%
javaaddpath('d:\ProteomeCommons\t2d\ProteomeCommons.org-IO-T2D.jar')
javaaddpath('d:\ProteomeCommons\ProteomeCommons.org-IO.jar')
import org.proteomecommons.io.t2d.*
import org.proteomecommons.io.*
%% Open the file and get the peak list
%
t2dFile = org.proteomecommons.io.t2d.T2DPeakListReader('D01_LINEAR_1.t2d');
peakList = t2dFile.getPeakList
%%
% Use the methods command to show what methods are available for this
% object.
methods(peakList)
%% Extract the peaks
% This creates an array of peaks.
peaks = peakList.getPeaks;
%%
% You can access the individual peak information
methods(peaks(1))
peaks(1).getCharge
peaks(1).getIntensity
peaks(1).getMassOverCharge
%% Copy the data into a MATLAB array
% Loop over all the data
numPeaks = numel(peaks);
MZ = zeros(numPeaks,1);
I = zeros(numPeaks,1);
for count = 1:numel(peaks)
MZ(count) = peaks(count).getMassOverCharge;
I(count) = peaks(count).getIntensity;
end
%% Plot the results
%
plot(MZ,I)
|
|
Contact us at files@mathworks.com