agentsclimarketplace

Composite mass track summation across samples

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/composite-mass-track-summation-across-samples

Use when after mass tracks have been aligned across samples into a MassGrid structure (m/z-aligned, same mass-to-charge ratio) and retention time calibration dictionaries have been computed for each sample.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill composite-mass-track-summation-across-samples

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

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

Reconstruct the composite map by summing aligned mass track intensities

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

Summary

Aggregate intensity vectors from retention-time-aligned mass tracks across all samples into a composite map by element-wise summation at each scan position. This unified composite representation replaces independent peak detection on each sample, enabling statistics-guided peak detection on aggregated signal.

When to use

After mass tracks have been aligned across samples into a MassGrid structure (m/z-aligned, same mass-to-charge ratio) and retention time calibration dictionaries have been computed for each sample. Apply this skill when you need to pool signal from multiple samples for improved peak detection sensitivity and reproducibility, rather than detecting peaks independently on each sample.

When NOT to use

  • Input is already a feature table or set of detected peaks (composite map construction precedes peak detection, not follows it).
  • Mass tracks have not yet been aligned across samples into a MassGrid structure (perform mass alignment first).
  • Retention time calibration has not been computed for all samples (rt_cal_dict must be available before intensity summation).

Inputs

  • MassGrid: m/z-aligned mass tracks across samples
  • rt_cal_dict: sample-specific retention time calibration dictionaries
  • intensity vectors (np.array): full RT-length intensity arrays per sample per mass track
  • parent_masstrack_id links for traceability

Outputs

  • CompositeMap: collection of composite mass tracks indexed by m/z
  • composite intensity vectors: element-wise sum of aligned, RT-calibrated intensities
  • composite mass track objects: (consensus m/z, summed intensity vector, parent_masstrack_id)

How to apply

Load the MassGrid (m/z-aligned mass tracks from all samples) and sample-specific retention time calibration dictionaries (rt_cal_dict) from prior alignment steps. For each mass track in the MassGrid, retrieve the corresponding intensity vectors (as np.array, full RT length) from all samples. Apply retention time calibration to each sample's mass track by remapping scan indices using the sample-specific rt_cal_dict to align all intensities to reference sample scan space, ensuring uniform length. Sum the intensity values element-wise across all samples at each scan position to create a single composite intensity vector. Construct composite mass track objects containing the consensus m/z value and summed intensity vector, and store them in the CompositeMap.composite_tracks data structure indexed by m/z for downstream peak detection.

Related tools

  • numpy (Element-wise array summation and intensity vector manipulation)
  • asari.CompositeMap.construct_mass_grid (Constructs the MassGrid from aligned mass tracks prior to composite map building) — https://github.com/shuzhao-li/asari
  • asari.chromatograms.extract_massTracks_ (Extracts individual mass tracks from each sample before alignment and summation) — https://github.com/shuzhao-li/asari
  • asari.peaks.stats_detect_elution_peaks (Peak detection performed on the composite map output from this skill) — https://github.com/shuzhao-li/asari

Evaluation signals

  • All composite mass tracks have consistent m/z values matching the MassGrid index.
  • Composite intensity vectors have uniform length equal to the reference sample scan space after RT calibration.
  • Sum of composite intensities at each scan position equals the sum of corresponding aligned intensities from all samples.
  • parent_masstrack_id links are retained in composite mass track objects for traceability back to individual sample tracks.
  • Composite intensity values are non-negative and magnitude is increased by factor proportional to number of samples (assuming additive signal).

Limitations

  • Assumes retention time calibration has been correctly computed; errors in rt_cal_dict propagate to misaligned intensity summation.
  • Element-wise summation treats all samples equally; samples with extreme baseline or noise dominate composite signal.
  • Requires all samples to have mass tracks at the same m/z; missing mass tracks in some samples contribute zero intensity.
  • No per-sample weighting or robust aggregation (e.g., median, trimmed mean) is applied; outlier samples can inflate composite signal.

Evidence

  • [other] The asari workflow constructs a composite map by aligning mass tracks across samples into a MassGrid structure, which serves as the input for subsequent peak detection operations rather than performing peak detection independently on each sample.: "constructs a composite map by aligning mass tracks across samples into a MassGrid structure, which serves as the input for subsequent peak detection operations"
  • [other] For each mass track in the MassGrid, retrieve the corresponding aligned mass tracks from all samples and their intensity vectors (full RT length as np.array). Apply retention time calibration to each sample's mass track by remapping scan indices using the sample-specific rt_cal_dict to align all intensities to reference sample scan space. Sum the intensity values element-wise across all samples at each scan position to create a composite intensity vector of unified length.: "retrieve the corresponding aligned mass tracks from all samples and their intensity vectors (full RT length as np.array). Apply retention time calibration to each sample's mass track by remapping"
  • [intro] Peak detection on a composite map instead of repeated on individual samples: "Peak detection on a composite map instead of repeated on individual samples"
  • [other] Construct composite mass track objects containing the consensus m/z value and summed intensity vector, retaining the parent_masstrack_id link for downstream feature mapping. Store composite mass tracks in the CompositeMap.composite_tracks data structure indexed by m/z for access by peak detection.: "Construct composite mass track objects containing the consensus m/z value and summed intensity vector, retaining the parent_masstrack_id link for downstream feature mapping. Store composite mass"

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.