agentsclimarketplace

Cdf file format parsing

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/cdf-file-format-parsing

Use when when you have multiple CDF files from mass spectrometry imaging experiments (e.g., root tissue MALDI-MS data) that need to be ingested into Matlab for linear imaging analysis. Trigger: presence of .From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill cdf-file-format-parsing

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 15 stars15 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

6.5 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

cdf-file-format-parsing

License: restricted — no clear open-source license detected for the underlying tool; verify licensing before commercial use or redistribution. <!-- asb-license-banner -->

Summary

Batch parsing of NetCDF/CDF imaging files to extract and structure mass spectrometry spectral data (m/z values, intensity arrays, spatial coordinates) into Matlab workspace arrays for downstream DIMPLE pipeline analysis.

When to use

When you have multiple CDF files from mass spectrometry imaging experiments (e.g., root tissue MALDI-MS data) that need to be ingested into Matlab for linear imaging analysis. Trigger: presence of .cdf file directories and a requirement to aggregate spectral intensity, m/z calibration, and spatial metadata into a unified workspace structure.

When NOT to use

  • CDF files are already loaded into Matlab workspace or pre-converted to .mat format (use directly instead)
  • Input data are in non-CDF formats (mzML, mzXML, HDF5); use format-specific parsers
  • Only single CDF file needs parsing; use native ncread() or netCDF libraries directly

Inputs

  • Cell array of CDF file paths (e.g., {'B73-root11/.cdf', 'OG1/.cdf'})
  • Directory tree of .cdf files from mass spectrometry imaging experiments
  • Matlab workspace or script environment

Outputs

  • Matlab workspace struct/cell array containing aggregated spectral data, m/z calibration vectors, and spatial metadata
  • Pre-processed imaging arrays ready for DIMPLE linear analysis pipeline

How to apply

The batchcdfread function iterates through a cell array or file list of CDF file paths, using Matlab's native NetCDF/CDF I/O functions to read each file. For each CDF file, extract the spectral intensity arrays, m/z values (mass-to-charge calibration), and spatial coordinates (x, y position or linear position along the root axis). Organize these heterogeneous arrays into a structured cell or struct array with consistent field names (spectra, mz, spatial_metadata). Aggregate all batch results into a single workspace structure compatible with downstream DIMPLE analysis steps, ensuring all files are parsed with matching m/z binning and spatial reference frames.

Related tools

  • Matlab (netCDF/CDF I/O functions) (Reads and parses CDF file format; extracts spectral intensity, m/z values, and spatial coordinates)
  • DIMPLE-code (Downstream pipeline that consumes batchcdfread output for mass spectrometry imaging analysis along a linear axis) — github.com/dickinsonlab/DIMPLE-code

Examples

batchcdfread({'B73-root11/*.cdf', 'OG1/*.cdf'}, output_workspace)

Evaluation signals

  • Workspace struct contains expected fields (spectra, mz, spatial_metadata) with consistent dimensions across all batch files
  • m/z values are monotonically increasing and match instrumental calibration (no NaN or Inf values)
  • Spectral intensity arrays match the dimensions of spatial coordinates (e.g., if 100 x/y positions, intensity matrix is 100 × mz_bins)
  • All input CDF files are represented in output struct (no missing files or corrupted reads)
  • Output workspace is compatible with downstream DIMPLE pipeline functions (no type mismatches or missing required fields)

Limitations

  • Function assumes all CDF files share compatible m/z binning and instrument calibration; heterogeneous calibrations across files may require alignment preprocessing
  • Spatial coordinates must be extractable from CDF metadata; files lacking valid x, y, or linear position information will fail or require manual annotation
  • No built-in handling of corrupted or incomplete CDF files; error handling and validation must be implemented upstream
  • Batch processing performance scales with file count and spectral resolution; very large datasets may require memory management or chunked I/O

Evidence

  • [other] The batchcdfread function was developed by Yifan Meng in Dr. Richard N. Zare's lab at Stanford University to enable batch processing of CDF files into Matlab workspaces for use in the DIMPLE pipeline.: "The batchcdfread function was developed by Yifan Meng in Dr. Richard N. Zare's lab at Stanford University to enable batch processing of CDF files into Matlab workspaces for use in the DIMPLE pipeline."
  • [other] 1. Parse input CDF file paths provided as a cell array or file list. 2. Iterate through each CDF file and read the spectral data using Matlab's netCDF/CDF I/O functions. 3. Extract spectral intensity arrays, m/z values, and spatial coordinates (x, y, or linear position) from each CDF file. 4. Organize extracted data into a structured array or cell array with fields for spectra, m/z values, and spatial metadata. 5. Return the aggregated workspace structure containing all batch spectra in a format compatible with downstream DIMPLE pipeline analysis.: "Iterate through each CDF file and read the spectral data using Matlab's netCDF/CDF I/O functions. Extract spectral intensity arrays, m/z values, and spatial coordinates (x, y, or linear position)"
  • [readme] cdf files and available Matlab workspaces are provided for the roots that were analyzed in Sama et al. 2025.: "cdf files and available Matlab workspaces are provided for the roots that were analyzed in Sama et al. 2025."
  • [readme] Computational pipeline for analyzing mass spectrometry imaging data along a linear axis.: "Computational pipeline for analyzing mass spectrometry imaging data along a linear axis."

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.