主要内容

mzcdfread

从NETCDF文件中读取质谱数据

Syntax

mzCDFStruct= mzcdfread(文件)
mzCDFStruct= mzcdfread(文件, ...'时间范围',TimeRangeValue,……)
mzCDFStruct= mzcdfread(文件,……”ScanIndices',ScanindicesValue,……)
mzCDFStruct= mzcdfread(文件,...'冗长',VerboseValue,……)

Input Arguments

文件

Character vector or string containing a file name, or a path and file name, of a netCDF file that contains mass spectrometry data and conforms to the ANDI/MS or the ASTM E2077-00 (2005) standard specification or earlier specifications.

If you specify only a file name, that file must be on the MATLAB®search path or in the current folder.

TimeRangeValue

两元素数字阵列[Start End]that specifies the time range in文件for which to read spectra. Default is to read spectra from all times[0 Inf]

Tip

时间单元在NETCDF全局属性中指示。有关NetCDF文件中时间范围的摘要信息,请使用mzcdfinfofunction.

Note

If you specify aTimeRangeValue, you cannot specify aScanindicesValue

ScanindicesValue

Positive integer, vector of integers, or a two-element numeric array[start_ind end_ind]指定扫描,多次扫描或一系列扫描文件读书。Start_IndEnd_Indare each positive integers indicating a scan index number.Start_Indmust be less thanEnd_Ind。默认是阅读所有扫描。

Tip

有关NetCDF文件中扫描索引的信息,请检查NumberOfScansfield in the structure returned by themzcdfinfofunction.

Note

If you specify aScanindicesValue, you cannot specifyTimeRangeValue

VerboseValue

Controls the display of the progress of the reading of文件。Choices are真的(default) orfalse

Output Arguments

mzCDFStruct

MATLAB结构包含来自NetCDF文件的质谱信息。它的字段对应于NetCDF文件中的变量和全局属性。如果NETCDF变量包含本地属性,则创建了一个附加字段,该字段的名称是附加的变量名称_属性。The number and names of the fields will vary, depending on the mass spectrometer software, but typically there aremass_valuesintense_valuesfields.

Description

mzCDFStruct= mzcdfread(文件)读取NetCDF文件,文件, and then creates a MATLAB structure,mzCDFStruct

文件is a character vector or string containing a file name, or a path and file name, of a netCDF file that contains mass spectrometry data. The file must conform to the ANDI/MS or the ASTM E2077-00 (2005) standard specification or earlier specifications.

mzCDFStructcontains fields that correspond to the variables and global attributes in a netCDF file. If a netCDF variable contains local attributes, an additional field is created, with the name of the field being the variable name appended with_属性。The number and names of the fields will vary, depending on the mass spectrometer software, but typically there aremass_valuesintense_valuesfields.

Tip

LC/MS数据分析需要操作系统的大量内存。

mzCDFStruct= mzcdfread(文件,……”PropertyName',PropertyValue,……)callsmzcdfreadwith optional properties that use property name/property value pairs. You can specify one or more properties in any order. EachPropertyNamemust be enclosed in single quotation marks and is case insensitive. These property name/property value pairs are as follows:

mzCDFStruct= mzcdfread(文件, ...'时间范围',TimeRangeValue,……)specifies the range of time in文件读书。TimeRangeValue是两个元素数字阵列[Start End]。Default is to read spectra from all times[0 Inf]

Tip

时间单元在NETCDF全局属性中指示。有关NetCDF文件中时间范围的摘要信息,请使用mzcdfinfofunction.

Note

If you specify aTimeRangeValue, you cannot specifyScanindicesValue

mzCDFStruct= mzcdfread(文件,……”ScanIndices',ScanindicesValue,……)指定扫描,多次扫描或扫描范围文件读书。ScanindicesValueis a positive integer, vector of integers, or a two-element numeric array[start_ind end_ind]Start_IndEnd_Indare each positive integers indicating a scan index number.Start_Indmust be less thanEnd_Ind。默认是阅读所有扫描。

Tip

有关NetCDF文件中扫描索引的信息,请检查NumberOfScansfield in the structure returned by themzcdfinfofunction.

Note

If you specify aScanindicesValue, you cannot specify aTimeRangeValue

mzCDFStruct= mzcdfread(文件,...'冗长',VerboseValue,……)controls the progress display when reading文件。Choices are真的(default) orfalse

Examples

在下面的示例中,文件results.cdf未提供。

  1. 将NETCDF文件读取到MATLAB软件中作为结构。

    out = mzcdfread('results.cdf');
  2. View the second scan in the netCDF file by creating separate variables containing the intensity and m/z values, and then plotting these values. Add a title andx- 和y-axis labels using fields in the output structure.

    idx1 = out.scan_index(2)+1; idx2 = out.scan_index(3); y = out.intensity_values(idx1:idx2); z = out.mass_values(idx1:idx2); stem(z,y,'marker','none') title(sprintf('Time: %f',out.scan_acquisition_time(2))) xlabel(out.mass_axis_units) ylabel(out.intensity_axis_units)

Introduced in R2008b