agentsclimarketplace

Retention time extraction from raw spectra

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v1/skills/retention-time-extraction-from-raw-spectra

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 retention-time-extraction-from-raw-spectra

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 when you have Thermo Orbitrap .raw files containing known reference peptides (e.

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

retention-time-extraction-from-raw-spectra

Summary

Extract and validate retention time measurements from Thermo Fisher Scientific Orbitrap raw files by reading chromatographic data, fitting intensity traces to identify apex retention times, and evaluating linearity through regression modeling. This skill bridges proprietary binary .raw file formats to quantitative RT calibration and quality control in bottom-up proteomics.

When to use

When you have Thermo Orbitrap .raw files containing known reference peptides (e.g., iRT standards) and need to (1) verify instrument retention time stability and linearity, (2) extract precise RT values at peak apex for calibration curves, or (3) validate LC-MS method performance by comparing observed vs. expected RT behavior. Typical trigger: QC workflows requiring reproducibility metrics, or iRT-based retention time alignment across runs.

When NOT to use

  • Non-Thermo instruments (e.g., Bruker, AB Sciex, Waters Synapt): rawrr wraps RawFileReader, which reads only Thermo .raw files; alternative tools (ProteoWizard, ThermoRawFileParser) or formats (mzML, mzXML) are required.
  • Raw files from instruments without iRT or stable reference standards: the skill depends on annotated reference peptides with known RT scores; uncharacterized samples cannot be evaluated.
  • Already-processed RT data (e.g., peak lists, mzML with centroids): this skill requires direct access to binary scan metadata and intensity traces; use this skill upstream of feature detection, not downstream.

Inputs

  • Thermo Fisher Scientific .raw file (binary Orbitrap format)
  • Reference peptide metadata (m/z values, iRT scores, or other known RT scale)
  • Mass tolerance window (ppm) for XIC extraction
  • Scan filter specification (e.g., 'ms' for MS1-level data)

Outputs

  • Extracted ion chromatogram (rawrrChromatogram object with intensity vs. time)
  • Retention time at apex for each reference peptide (rtFittedAPEX)
  • Linear regression model object (lm class) with coefficients and R-squared
  • R-squared value quantifying RT linearity (unitless, 0–1 scale)
  • Fitted RT values and residuals for quality assessment

How to apply

Load the binary .raw file using rawrr::readFileHeader() to confirm instrument metadata and scan parameters. Extract extracted ion chromatograms (XIC) for known reference peptide precursor m/z values using rawrr::readChromatogram() with type='xic', filter='ms' (for MS1-level scans), and a mass tolerance window (e.g. 10 ppm). For each XIC, fit a curve to the intensity trace to locate the retention time at maximum intensity (rtFittedAPEX). Construct a linear regression model lm(rtFittedAPEX ~ iRTscore) using annotated iRT reference scores, then report and interpret the R-squared value; R² > 0.99 indicates highly linear RT behavior suitable for downstream RT calibration. Document the fitted model coefficients and residuals as quality metrics.

Related tools

  • rawrr (R package providing direct read access to Thermo .raw file binary data; supplies readFileHeader(), readChromatogram(), and readSpectrum() functions for metadata and intensity trace extraction) — https://github.com/fgcz/rawrr
  • RawFileReader (.NET assembly (C#) wrapping proprietary Thermo Scientific APIs; underlying dependency invoked by rawrr via system calls to extract chromatographic and spectral data) — https://github.com/thermofisherlsms/RawFileReader
  • MsBackendRawFileReader (Optional Bioconductor backend enabling rawrr integration with Spectra package for standardized accessor functions and on-disk data handling) — https://github.com/cpanse/MsBackendRawFileReader

Examples

C <- rawrr::readChromatogram(rawfile = '20181113_010_autoQC01.raw', mass = c(463.2671, 437.2808, 437.2655), tol = 10, type = 'xic', filter = 'ms'); fit <- lm(rtFittedAPEX ~ iRTscore, data = data.frame(rtFittedAPEX = c(...), iRTscore = c(-24.92, -14.15, 19.79))); summary(fit)$r.squared

Evaluation signals

  • R-squared value for lm(rtFittedAPEX ~ iRTscore) ≥ 0.99 indicates highly linear RT behavior; lower values (e.g., R² < 0.98) suggest instrumental drift or data quality issues requiring investigation.
  • Residuals from the fitted regression model should be approximately normally distributed with mean near zero and constant variance; large or systematic deviations indicate non-linear RT behavior or outlier reference peptides.
  • For each iRT peptide, rtFittedAPEX should fall within ±0.2 min of the expected retention time predicted by the regression model; deviations > 0.5 min suggest chromatographic problems or m/z calibration drift.
  • XIC peak shape should be symmetric and unimodal; asymmetric or multi-modal intensity traces indicate co-eluting species or baseline issues that compromise apex-fitting accuracy.
  • Comparison across multiple runs or time points: R² values should remain stable (variation < 0.001); systematic decline in R² over time signals instrument maintenance need or column degradation.

Limitations

  • Windows decimal symbol configuration: on Windows systems, the decimal symbol must be set to '.' (full stop) for proper data extraction; regional locale settings using ',' (comma) will cause parsing failures.
  • Chromatogram resolution and fitting algorithm sensitivity: apex fitting depends on adequate intensity sampling density and curve-fitting quality; low-resolution or noisy XIC traces may yield unreliable rtFittedAPEX values, especially for co-eluting peptides.
  • RawFileReader .NET dependency: rawrr invokes compiled C# methods via system calls, requiring Mono (.NET runtime) on Linux/macOS; Windows users may encounter additional complexity managing ThermoFisher.CommonCore DLL versions.
  • Reference peptide annotation requirement: accurate iRT scores or other RT standards are mandatory; mislabeled or contaminated reference materials will corrupt the regression model and produce misleading R² values.
  • Scope limited to Thermo Orbitrap instruments: readFileHeader() confirms Q Exactive HF and related Orbitrap platforms; no support for other vendors (Bruker, Waters, AB Sciex) without external conversion to mzML or mzXML.

Evidence

  • [methods] Extract and validate retention times from Orbitrap .raw files: "Extract precursor m/z values and retention times for known iRT peptide standards using rawrr::readChromatogram() with mass tolerance 10 ppm and XIC filter."
  • [results] Fit intensity traces to apex for RT extraction: "we extract the RTs at the maximum of the fitted intensity traces stored in the rawrrChromatogram object and fit a linear model"
  • [results] R-squared as linearity metric: "The corresponding R-squared indicates that the RTs behave highly linear"
  • [intro] rawrr wraps RawFileReader for .raw file access: "rawrr wraps the functionality of the RawFileReader .NET assembly"
  • [discussion] Windows decimal symbol configuration requirement: "On Windows, the decimal symbol has to be configured as a '.'!"
  • [methods] iRT peptide standard reference: "The file is part of the MassIVE dataset [MSV000086542]"

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.