mzcdf2peaks does not accepts given data created by mzcdfread in Matlab r2020a

70 views Asked by At

So I have the following code and error:

>> data = mzcdfread('sample1.cdf');

Reading filename: sample1.cdf  
Number of dimensions: 11   Unlimited Dimension:  8
Number of variables:  12   Number of attributes: 10

Exploring global netCDF attributes:
     acd_ec_version -> 1.0
     dataset_completeness -> C1
     aia_template_revision -> 1.0
     netcdf_revision -> 3.4
     languages -> English
     injection_date_time_stamp -> 20120404170129+-0500
     separation_experiment_type -> Liquid Chromatography
     source_file_reference -> L:\chromatogram\web\sample 1.xy
     detector_unit -> AU
     retention_unit -> seconds
 
Exploring netCDF dimensions:
                          Name  Length  Dim_ID 
                _2_byte_string       2     1
                _4_byte_string       4     2
                _8_byte_string       8     3
               _16_byte_string      16     4
               _32_byte_string      32     5
               _64_byte_string      64     6
              _128_byte_string     128     7
              _255_byte_string     255     8
                  acd_ec_count       0     9
                  error_number       1    10
                  point_number   17999    11

Reading netCDF variables:
                          Name    Type  Dim_ID  NumAtt
                     error_log      2   6 10       0
        detector_maximum_value      5              0
        detector_minimum_value      5              0
        actual_run_time_length      5              0
      actual_sampling_interval      5              0
             actual_delay_time      5              0
               ordinate_values      5     11       1
         uniform_sampling_flag -> Y
           peak_retention_time      5              0
                     peak_name      2              0
                   peak_amount      5              0
                     peak_area      5              0
                   peak_height      5              0
>> mzcdf2peaks(data)
Error using mzcdf2peaks (line 27)
Input structure MZCDFSTRUCT must be created by MZCDFREAD. 

It's a simple .cdf file. I want the final output to be:

Final result

but as you see mzcdf2peaks function does not work for me and causes this error:

Error using mzcdf2peaks (line 27)
Input structure MZCDFSTRUCT must be created by MZCDFREAD.

I'm following this example where they use the following commands:

mzcdf_struct = mzcdfread('results.cdf');
[peaks,time] = mzcdf2peaks(mzcdf_struct)
figure
hold on

for i = 1:numel(peaks)
    t = repmat(time(i),size(peaks{i},1),1);
    plot3(t,peaks{i}(:,1),peaks{i}(:,2),'color',colors(i,:))
end

view(70,60)
xlabel('Time')
ylabel(mzcdf_struct.mass_axis_label)
zlabel(mzcdf_struct.intensity_axis_label)

When I open sample1.cdf file in Unichrom it works.

working

You can access the cdf file here: https://files.fm/u/j7yjb23c

So my question is how to get Matlab mzcdf2peaks function working on this dataset? Is there any other way to achieve the desired output?

0

There are 0 answers