agentsclimarketplace

Imaging parameter metadata annotation

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/imaging-parameter-metadata-annotation

Use when after mzML-to-imzML conversion has produced barebones imzML files with pixel alignment but no experimental metadata.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill imaging-parameter-metadata-annotation

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

8.1 KB, ~1.5k tokens by cl100k_base, as published. Nobody here has run it

imaging-parameter-metadata-annotation

Summary

Annotate imzML mass spectrometry imaging files with experimental acquisition parameters (scan speed, step size, lock mass, MS mode) and imaging coordinates to enable proper spatial-spectral alignment and mass recalibration. This skill ensures that imzML files produced by format conversion retain critical metadata linking pixel positions to instrument settings and known reference masses.

When to use

Apply this skill after mzML-to-imzML conversion has produced barebones imzML files with pixel alignment but no experimental metadata. Use it when you have: (1) mzML source files with embedded acquisition metadata, (2) known imaging parameters (X scan speed in µm/s, Y step size in µm, lock mass m/z value), and (3) a requirement to enable mass recalibration and proper interpretation of ion images by downstream software (e.g., Cardinal MSI, METASPACE, M2aia). This is essential before sharing or analyzing imzML files with external readers.

When NOT to use

  • Input is already a fully annotated imzML file from a native vendor format importer; re-annotation may overwrite correct metadata.
  • Experimental parameters (scan speed, step size, lock mass) are unknown or unavailable; metadata annotation requires these inputs.
  • The imzML files are in raw vendor format; use msconvert and mzML-to-imzML conversion before applying this skill.

Inputs

  • mzML files (from prior msconvert conversion of raw vendor files)
  • barebones imzML files (pixel-aligned, pre-metadata)
  • raw vendor mass spectrometry data path
  • experimental parameters: X scan speed (µm/s), Y step size (µm), lock mass (m/z), MS data mode (centroid or profile)

Outputs

  • annotated imzML files with embedded experimental metadata
  • imzML files organized by scan filter
  • imzML files with imaging coordinates and mass recalibration reference

How to apply

Load the raw vendor mass spectrometry data path and mzML-derived imzML files into imzML Writer. Extract or specify the experimental parameters: X scan speed (µm/s), Y step size (µm), lock mass (m/z of internal standard, typically used as a reference point to correct mass measurement errors), and MS acquisition metadata (centroid vs. profile mode, scan filters). Call iw_utils.imzML_metadata_process(model_files=mzML_path, x_speed=x_scan_speed, y_step=y_step_size, path=raw_data_path) to write these parameters into the imzML XML header and associate them with the barebones pixel grid. Verify that the annotated imzML files are organized by scan filter as specified in the source mzML files and placed in the output directory. The lock mass value serves as a reference point to enable downstream mass recalibration, and the imaging coordinates (X, Y) must match the pixel dimensions written during the mzML-to-imzML conversion step.

Related tools

Examples

from imzml_writer import iw_utils; iw_utils.imzML_metadata_process(model_files='./mzML_files/sample.mzML', x_speed=50.0, y_step=100.0, path='./raw_data/', lock_mass=391.28425)

Evaluation signals

  • Annotated imzML files are valid XML and pass imzML schema validation (check against imzML specification 1.1 or 1.2)
  • Lock mass parameter is present in the imzML file and matches the specified m/z value; verify by parsing the XML and confirming mass calibration element
  • Imaging coordinates (X, Y pixel positions) align with X scan speed and Y step size; verify by calculating expected spatial extent and comparing to ion image dimensions
  • imzML files are readable by at least one known downstream reader (e.g., Cardinal MSI, METASPACE, M2aia); successful import confirms metadata is syntactically correct
  • Mass recalibration using lock mass produces expected mass accuracy improvement (typically within instrument specification, e.g., ±5 ppm for Orbitrap)

Limitations

  • Lock mass annotation requires a known internal standard or reference ion; if lock mass is incorrectly specified, mass recalibration will introduce systematic error.
  • Imaging parameters (X scan speed, Y step size) must be manually entered or extracted from raw file headers; no automated detection is documented, risking parameter mismatch if user provides incorrect values.
  • imzML metadata annotation does not validate spatial or mass accuracy against raw data; errors in pixel alignment or mass calibration are not flagged during annotation.
  • Pixel dimensions must be written as integers for compatibility with some readers (e.g., SCiLS Lab); floating-point pixel dimensions may cause read failures in certain software.

Evidence

  • [methods] Call iw_utils.imzML_metadata_process(model_files=mzML_path, x_speed=x_scan_speed, y_step=y_step_size, path=raw_data_path) to annotate imzML files with experimental parameters (lock mass for mass recalibration, imaging coordinates, and MS acquisition metadata).: "iw_utils.imzML_metadata_process(model_files=mzML_path, x_speed=x_scan_speed, y_step=y_step_size, path=raw_data_path) to annotate imzML files with experimental parameters (lock mass for mass"
  • [methods] Lock mass: m/z of a known ion (typically m/z of an internal standard). This serves as a reference point to correct any mass measurement errors: "Lock mass: m/z of a known ion (typically m/z of an internal standard). This serves as a reference point to correct any mass measurement errors"
  • [methods] Type in the experimental parameters (i.e., X scan speed, Y step, Lock mass) and choose the MS data mode of interest (i.e., Centroid or Profile): "Type in the experimental parameters (i.e., X scan speed, Y step, Lock mass) and choose the MS data mode of interest (i.e., Centroid or Profile)"
  • [methods] imzML files generated with imzML_Writer are compatible with multiple imzML file readers both commercially and as open-source software: "imzML files generated with imzML_Writer are compatible with multiple imzML file readers both commercially and as open-source software"
  • [readme] Pixel dimensions must be written as an integer to be read properly: "Pixel dimensions must be written as an integer to be read properly"

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.