agentsclimarketplace

Drift retention time alignment

Skill HolobiomicsLab/asb-skill-collections/packs/metabolomics/gc-ms/skills/drift-retention-time-alignment

Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill drift-retention-time-alignment

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

  • 14 stars14 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 author says it does

Copied from the file, not written here

Use when you have GCIMS samples exhibiting misalignment across drift time (typically 5–16 ms range) and retention time (typically 0–1100 s range) caused by pressure/temperature fluctuations or chromatographic column degradation, and you need to normalize sample positions before downstream peak.

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.1 KB, as published. Nobody here has run it

drift-retention-time-alignment

Summary

Aligns Gas Chromatography–Ion Mobility Spectrometry (GCIMS) samples across both drift time and retention time dimensions to correct for instrument and column degradation-induced misalignments. This skill is essential for preprocessing GCIMS data before peak detection and clustering.

When to use

Apply this skill when you have GCIMS samples exhibiting misalignment across drift time (typically 5–16 ms range) and retention time (typically 0–1100 s range) caused by pressure/temperature fluctuations or chromatographic column degradation, and you need to normalize sample positions before downstream peak detection or comparative analysis.

When NOT to use

  • Data is already peak-detected or peak-clustered; alignment operates on raw or lightly preprocessed ion matrices, not peak tables.
  • Samples originate from different analytical methods or instruments with incompatible drift time / retention time scales.
  • Retention time or drift time range is not known or meaningful (e.g., single-point measurements or non-temporal data).

Inputs

  • GCIMSDataset object (loaded from raw GCIMS data files)
  • raw ion mobility spectrometry matrix with drift time and retention time dimensions
  • sample annotation metadata (optional but recommended)

Outputs

  • aligned GCIMSDataset object with corrected drift time and retention time coordinates
  • Total Ion Spectra (TIS) plot showing overlaid aligned samples
  • Reverse Ion Chromatogram (RIC) plot showing aligned chromatographic profiles

How to apply

First, filter the GCIMS dataset to the target retention time range (e.g., 0–1100 s) and drift time range (e.g., 5–16 ms) using filterRt() and filterDt(). Apply Savitzky-Golay smoothing independently in both the drift time and retention time dimensions to reduce noise and stabilize alignment features. Decimate the matrix by taking 1 every Nd points in drift time and 1 every Nr points in retention time to reduce computational cost and memory usage. Finally, perform sequential alignment: first align all samples in drift time, then align in retention time. Visual confirmation via Total Ion Spectra and Reverse Ion Chromatogram plots should show overlapped sample traces across both dimensions, indicating successful alignment.

Related tools

  • GCIMS (R package implementing the drift-time and retention-time alignment pipeline; provides filterRt(), filterDt(), Savitzky-Golay smoothing, decimation, and alignment functions) — https://github.com/sipss/GCIMS
  • R (statistical computing environment in which GCIMS runs)
  • ggplot2 (visualization of aligned Total Ion Spectra and Reverse Ion Chromatogram plots for quality assessment)
  • cowplot (multi-panel layout and arrangement of alignment diagnostic plots)

Examples

filterDt(filterRt(dataset, rt = c(0, 1100)), dt = c(5, 16)) %>% smoothSG() %>% decimate(Nd = 10, Nr = 10) %>% alignDt() %>% alignRt()

Evaluation signals

  • Total Ion Spectra plots show visually overlapped sample traces across the full drift time and retention time ranges with minimal dispersion or skew.
  • Reverse Ion Chromatogram plots display aligned chromatographic peaks at consistent retention time positions across all samples.
  • Peak alignment consistency: after alignment, replicate or related samples show matching drift time and retention time coordinates for corresponding features (quantified by cross-correlation or peak-matching algorithms).
  • Memory footprint reduction: decimated and aligned dataset occupies significantly less RAM than pre-decimation raw data, with no loss of interpretable structure.
  • Downstream peak detection (via peakDetection) produces consistent peak lists across aligned samples with minimal noise-driven false positives.

Limitations

  • Alignment assumes that misalignment is caused by systematic instrumental/environmental drift; if samples have genuine chemical or biological differences in retention or drift time, over-alignment may obscure those differences.
  • Choice of decimation factors (Nd, Nr) and Savitzky-Golay filter parameters (window length, polynomial order) requires manual tuning and optimization per dataset; no fully automated parameter selection is described.
  • Alignment is sequential (drift time first, then retention time); this ordering may not be optimal for all datasets and could introduce coupling artifacts if the two dimensions are strongly dependent.
  • No changelog or version history provided; reproducibility across GCIMS package versions is not documented.

Evidence

  • [intro] misalignment_causes: "Pressure and temperature fluctuations as well as degradation of the chromatographic column are some of the causes of misalignments in the data, both in retention and drift time."
  • [intro] alignment_procedure: "The alignment will happen first in drift time and afterwards in retention time."
  • [intro] filter_retention_time: "filterRt(dataset, rt = c(0, 1100)) # in s"
  • [intro] filter_drift_time: "filterDt(dataset, dt = c(5, 16)) # in ms"
  • [intro] smoothing_method: "You can remove noise from your sample using a Savitzky-Golay filter, applied both in drift time and in retention time."
  • [intro] decimation_rationale: "One way to speed up calculations and reduce the memory requirements is to decimate the matrix, by taking 1 every Nd points in drift time and 1 every Nr points in retention time."
  • [other] visual_validation: "the Total Ion Spectra and Reverse Ion Chromatogram plots show visual alignment of samples across both drift time and retention time dimensions."
  • [intro] delayed_evaluation_efficiency: "GCIMS uses delayed evaluations were possible, so dataset modifications can be executed in a more efficient way and without using too much RAM."
  • [readme] gcims_package_purpose: "GCIMS is an R package implementing a preprocessing pipeline for Gas Chromatography – Ion Mobility Spectrometry samples."

Keep looking

Skills are one crate of 328,083. 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.