agentsclimarketplace

Composite mass track construction

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/composite-mass-track-construction

Use when when processing a multi-sample LC-MS metabolomics project after mass-track extraction and retention-time calibration have been applied to all individual samples, and you need to detect peaks across the entire cohort.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill composite-mass-track-construction

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

10.0 KB, ~1.7k tokens by cl100k_base, as published. Nobody here has run it

composite-mass-track-construction

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

Summary

Construct a single composite mass track by element-wise summation of intensity values across aligned mass tracks from all samples at each m/z value, enabling efficient single-pass peak detection instead of per-sample detection. This reduces computational cost from O(N) to O(1) peak-detection algorithm invocations while preserving signal fidelity across the cohort.

When to use

When processing a multi-sample LC-MS metabolomics project after mass-track extraction and retention-time calibration have been applied to all individual samples, and you need to detect peaks across the entire cohort. This approach is especially valuable when N > 10 samples, as it avoids redundant peak-detection invocations and enables detection of low-abundance features visible only when signal is pooled across samples.

When NOT to use

  • When input samples have drastically different ionization efficiency or sample loads (pooling may obscure sample-specific rare peaks or introduce bias toward dominant samples).
  • When retentiontime miscalibration across samples is severe (misaligned scans will blur the composite track and lower peak definition).
  • When peak detection must preserve sample-level spatial information or variance (composite pooling loses per-sample intensity and signal heterogeneity).

Inputs

  • aligned mass tracks from all samples (one mass track per m/z per sample)
  • retention-time calibration dictionaries (rt_cal_dict) mapping sample scan numbers to reference coordinates
  • reference sample scan-number range (defines synchronized coordinate system)
  • min_peak_height threshold (default tunable, used for dynamic prominence calculation)
  • min_timepoints for peak width control (default 25 scans)

Outputs

  • composite mass track (intensity array of full retention-time length, summed across all N samples)
  • detected peaks on composite track with metrics: m/z, retention time, intensity, prominence, gaussian fit goodness (goodness_fitting), chromatographic selectivity (cSelectivity), signal-to-noise ratio (SNR)
  • audit report on composite track (max intensity value, rescaling applied, detrending applied, baseline and noise estimates)

How to apply

After extracting aligned mass tracks from each sample and obtaining retention-time calibration dictionaries (rt_cal_dict), synchronize scan-number indices across all samples by applying rt_cal_dict to map each sample's scan numbers to a reference sample coordinate system. For each unique m/z value in the aligned mass grid, sum the intensity arrays element-wise across all samples to produce a single composite mass track of full retention-time length. Audit the composite track using peaks.audit_mass_track (check intensity ceiling at 1E8, apply rescaling if needed, detect low-intensity tracks with median < 1e3, detrend if median > 10× min_peak_height and >50% of points exceed threshold, compute baseline and noise from bottom-signal quartiles, apply moving-average smoothing when noise > 1% of max intensity and max intensity < 10× min_peak_height). Subtract the baseline and noise filter to isolate positive regions, splitting the track into segments. Then apply scipy.signal.find_peaks to each segment once, using dynamic prominence (max of 1/3 min_peak_height, noise level, and 5% of segment max intensity) and min_timepoints (default 25 scans) for window control, rather than calling find_peaks N times on individual samples.

Related tools

Evaluation signals

  • Verify that scipy.signal.find_peaks is invoked exactly once per composite track (or once per segment within a composite track), not N times, by instrumenting or logging the call stack.
  • Confirm that the composite track intensity array has length equal to the full reference retention-time span (number of scans in reference sample) and contains element-wise sums of all aligned input tracks.
  • Check that detected peaks include all four required metrics: goodness_fitting (gaussian fit), cSelectivity (chromatographic selectivity), SNR > 2 (signal-to-noise ratio), and min_peak_height threshold met.
  • Validate that reported peak retention times fall within the range of scans present in all or nearly all input samples (indicating genuine pooled signal, not noise from misaligned outliers).
  • Audit log should show that audit_mass_track executed once per composite track with reported baseline, noise, and detrending decisions.

Limitations

  • Composite pooling assumes that retention time is sufficiently synchronized across samples via rt_cal_dict; large inter-sample drift will blur peaks and reduce sensitivity.
  • Pooling assumes similar sample loading and ionization efficiency across the cohort; highly unbalanced samples may dominate the composite signal and obscure low-abundance metabolites in weaker samples.
  • The single composite peak list does not preserve per-sample signal heterogeneity; downstream abundance tables must be extracted by mapping detected peaks back to individual sample mass tracks via mass-to-feature association, which requires the original sample-level data.
  • Very low-abundance metabolites visible in only 1–2 samples may be diluted below detection threshold in the composite track if other samples have zero signal; per-sample detection may recover these features, trading computational cost for sensitivity.
  • Baseline and noise estimation are computed once from the composite pooled signal; samples with anomalous noise or drift may skew these estimates and lead to suboptimal thresholds for the composite detection step.

Evidence

  • [other] Asari implements peak detection using scipy.signal.find_peaks on a composite map constructed from summed mass tracks across all samples, reducing the number of peak-detection algorithm calls from N (one per sample) to one (composite), thereby improving scalability and computational efficiency.: "Asari implements peak detection using scipy.signal.find_peaks on a composite map constructed from summed mass tracks across all samples, reducing the number of peak-detection algorithm calls from N"
  • [other] Sum intensity values element-wise across all samples for each unique m/z value in the mass grid, producing composite mass tracks as full-length intensity arrays.: "Sum intensity values element-wise across all samples for each unique m/z value in the mass grid, producing composite mass tracks as full-length intensity arrays."
  • [other] Synchronize scan-number indices across samples by applying rt_cal_dict to map each sample's scan numbers to reference sample coordinates.: "Synchronize scan-number indices across samples by applying rt_cal_dict to map each sample's scan numbers to reference sample coordinates."
  • [other] Audit each composite mass track (peaks.audit_mass_track): check max intensity ceiling (1E8), apply rescaling if needed, detect low-intensity tracks (median < 1e3), perform detrend if median > 10× min_peak_height and >50% of points exceed threshold, compute baseline and noise from bottom-signal quartiles, apply smoothing (moving average) when noise > 1% of max intensity and max intensity < 10× min_peak_height.: "Audit each composite mass track (peaks.audit_mass_track): check max intensity ceiling (1E8), apply rescaling if needed, detect low-intensity tracks (median < 1e3), perform detrend if median > 10×"
  • [readme] Peak detection on a composite map instead of repeated on individual samples: "Peak detection on a composite map instead of repeated on individual samples"

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.