Read data from SPC file
SPCStruct = tgspcread(File)
tgspcread(..., 'ZRange', ZRangeValue, ...)
tgspcread(..., 'ScanIndices', ScanIndicesValue, ...)
tgspcread(..., 'Verbose', VerboseValue, ...)
SPCStruct = tgspcread(File) reads a Galactic SPC file from Thermo Scientific®, and returns the data in a MATLAB® structure.
tgspcread(..., 'PropertyName', PropertyValue, ...) calls tgspcread with optional properties that use property name/property value pairs. You can specify one or more properties in any order. Enclose each PropertyName in single quotation marks. Each PropertyName is case insensitive. These property name/property value pairs are as follows:
tgspcread(..., 'ZRange', ZRangeValue, ...) specifies a range of z data values in the SPC file from which to extract scans.
tgspcread(..., 'ScanIndices', ScanIndicesValue, ...) specifies a scan, multiple scans, or range of scans in the SPC file to read.
tgspcread(..., 'Verbose', VerboseValue, ...) controls the display of the progress of the reading of the SPC file. Choices are true or false (default).
String specifying a file name or path and file name of an SPC file that conforms to the Thermo Scientific Universal Data Format Specification. If you specify only a file name, that file must be on the MATLAB search path or in the current folder.
Two-element numeric array [Start End] that specifies the range of z data values in File to read. Start and End must be positive scalars, and Start must be less than End. Default is to extract all scans.
Positive integer, vector of integers, or a two-element numeric array [Start_Ind: End_Ind] that specifies a scan, multiple scans, or a range of scans in File to read. Start_Ind and End_Ind are each positive integers indicating a scan index. Start_Ind must be less than End_Ind. Default is to read all scans.
Controls the display of the progress of the reading of File. Choices are true or false (default).
Structure containing information from an SPC file. The structure contains the following fields.
The SPC file, results.spc, used in the following example is not provided with the Bioinformatics Toolbox™ software. You can download sample files from:
Read an SPC file:
% Read the contents of an SPC file into a MATLAB structure out = tgspcread('results.spc')
File contains 1 scans out = Header: [1x1 struct] X: [12031x1 single] Y: [12031x1 double] Z: 0
Plot an SPC file:
% Plot the first scan in the SPC file: plot(out.X,out.Y(:,1));