algorithm-interface-abstraction
Summary
Design a unified interface that wraps multiple interchangeable peak-picking algorithms (Centwave, FeatureFinderMetabo, ADAP) and routes raw LC-MS data to the selected algorithm via configuration-driven dispatch, standardizing outputs to a common feature table format. This abstraction isolates algorithm-specific details and allows users to swap peak-picking methods without rewriting downstream processing logic.
When to use
You have multiple independent peak-picking algorithms available and need to allow end-users to select among them for the same analytical task (peak detection in untargeted LC-MS data) without coupling the rest of your pipeline to each algorithm's API. Typical trigger: a configuration file specifying algorithm choice ('Centwave' vs 'FeatureFinderMetabo' vs 'ADAP') and raw mzML or netCDF input data.
When NOT to use
- Input data is already a feature table or alignment matrix (data has already been peak-picked); use this skill only at the raw data → peak table boundary.
- All downstream code is tightly coupled to a single algorithm's output schema and cannot tolerate differences in column names or precision; refactoring to accept a standardized format is a prerequisite.
- The analysis requires simultaneous use of multiple peak-picking algorithms on the same data and explicit comparison of their results (consider running each separately and comparing outputs post-hoc instead).
Inputs
- Configuration specification (text or JSON) naming the peak-picking algorithm (Centwave, FeatureFinderMetabo, or ADAP)
- Centroided raw LC-MS data in mzML or netCDF format
- Algorithm-specific parameters (e.g., ppm tolerance, peak width range)
Outputs
- Standardized feature matrix (rows=features/ions, columns=m/z, retention time, intensity)
- Algorithm metadata (algorithm name, version, parameters applied)
- Feature quality indicators (e.g., signal-to-noise ratio, peak shape metrics)
How to apply
Implement a routing layer that accepts a configuration key naming the target peak-picking algorithm and centroided LC-MS data (mzML or netCDF format). Route the data to the corresponding algorithm-specific wrapper module based on the configuration value. Execute the selected algorithm with user-supplied parameters. Standardize the algorithm's output (which may differ in column names, units, or structure) into a common internal format—typically a feature matrix with columns for m/z, retention time, and intensity. Return both the standardized feature table and algorithm metadata (e.g., algorithm name, version, parameters used) so downstream stages (alignment, grouping, gap-filling) operate uniformly. This decouples downstream code from algorithm-specific output schemas and allows parameter swapping via configuration without code changes.
Related tools
- Centwave (One of three selectable peak-picking algorithms; detects peaks using continuous wavelet transform)
- FeatureFinderMetabo (One of three selectable peak-picking algorithms; feature detection optimized for metabolomics)
- ADAP (One of three selectable peak-picking algorithms; adaptive peak detection)
- SLAW (Reference implementation of algorithm-interface abstraction for untargeted LC-MS processing) — https://github.com/zamboni-lab/SLAW
Examples
docker run --rm -v /path/to/input:/input -v /path/to/output:/output zambonilab/slaw:latest
Evaluation signals
- Verify that selecting different algorithm names in the configuration file routes data to the correct wrapper and executes the intended algorithm (e.g., check log output or algorithm metadata in output).
- Confirm that output from each algorithm, despite differences in native format, produces a standardized feature matrix with identical column names and types (m/z, retention time, intensity).
- Validate that downstream stages (alignment, grouping, gap-filling) accept the standardized output from any algorithm without modification, confirming decoupling.
- Check that feature counts and m/z/RT ranges are consistent with the selected algorithm's known sensitivity and specificity on positive control samples.
- Ensure algorithm metadata is correctly captured and propagated through the output for reproducibility and audit trails.
Limitations
- SLAW wrapping is specific to three peak-picking algorithms (Centwave, FeatureFinderMetabo, ADAP); adding new algorithms requires implementing a new wrapper module.
- Output standardization assumes all wrapped algorithms report at least m/z, retention time, and intensity; algorithms lacking one of these metrics cannot be integrated without lossy transformation.
- Parameter optimization (automated tuning for alignment and gap-filling) is decoupled from algorithm selection; users must manually manage parameter ranges for each algorithm choice.
- DIA-MS and profile-mode (non-centroided) data are not supported; all input must be centroided DDA mzML or netCDF.
- Polarity detection is performed once at initialization; mixed-polarity datasets require pre-splitting and separate SLAW runs.
Evidence
- [other] SLAW wraps three independent peak picking algorithms—Centwave, FeatureFinderMetabo, and ADAP—enabling configurable selection among them for the peak-picking stage of untargeted LC-MS processing.: "SLAW wraps three independent peak picking algorithms—Centwave, FeatureFinderMetabo, and ADAP—enabling configurable selection among them for the peak-picking stage"
- [other] Route the data to the corresponding algorithm wrapper module based on the configuration key.: "Route the data to the corresponding algorithm wrapper module based on the configuration key."
- [other] Standardize the output peak table to a common internal format (e.g., feature matrix with m/z, retention time, intensity columns).: "Standardize the output peak table to a common internal format (e.g., feature matrix with m/z, retention time, intensity columns)."
- [readme] Wrapping of three main peak picking algorithms: Centwave, FeatureFinderMetabo, ADAP: "Wrapping of three main peak picking algorithms: Centwave, FeatureFinderMetabo, ADAP"
- [readme] Raw MS data in mzML format. Files can include MS1 and DDA-MS2 scans. All data must be centroided and of unique polarity.: "Raw MS data in mzML format. Files can include MS1 and DDA-MS2 scans. All data must be centroided and of unique polarity."
1---2name: algorithm-interface-abstraction3description: Use when you have multiple independent peak-picking algorithms available and need to allow end-users to select among them for the same analytical task (peak detection in untargeted LC-MS data) without coupling the rest of your pipeline to each algorithm's API.4license: CC-BY-4.05---67# algorithm-interface-abstraction89## Summary1011Design a unified interface that wraps multiple interchangeable peak-picking algorithms (Centwave, FeatureFinderMetabo, ADAP) and routes raw LC-MS data to the selected algorithm via configuration-driven dispatch, standardizing outputs to a common feature table format. This abstraction isolates algorithm-specific details and allows users to swap peak-picking methods without rewriting downstream processing logic.1213## When to use1415You have multiple independent peak-picking algorithms available and need to allow end-users to select among them for the same analytical task (peak detection in untargeted LC-MS data) without coupling the rest of your pipeline to each algorithm's API. Typical trigger: a configuration file specifying algorithm choice ('Centwave' vs 'FeatureFinderMetabo' vs 'ADAP') and raw mzML or netCDF input data.1617## When NOT to use1819- Input data is already a feature table or alignment matrix (data has already been peak-picked); use this skill only at the raw data → peak table boundary.20- All downstream code is tightly coupled to a single algorithm's output schema and cannot tolerate differences in column names or precision; refactoring to accept a standardized format is a prerequisite.21- The analysis requires simultaneous use of multiple peak-picking algorithms on the same data and explicit comparison of their results (consider running each separately and comparing outputs post-hoc instead).2223## Inputs2425- Configuration specification (text or JSON) naming the peak-picking algorithm (Centwave, FeatureFinderMetabo, or ADAP)26- Centroided raw LC-MS data in mzML or netCDF format27- Algorithm-specific parameters (e.g., ppm tolerance, peak width range)2829## Outputs3031- Standardized feature matrix (rows=features/ions, columns=m/z, retention time, intensity)32- Algorithm metadata (algorithm name, version, parameters applied)33- Feature quality indicators (e.g., signal-to-noise ratio, peak shape metrics)3435## How to apply3637Implement a routing layer that accepts a configuration key naming the target peak-picking algorithm and centroided LC-MS data (mzML or netCDF format). Route the data to the corresponding algorithm-specific wrapper module based on the configuration value. Execute the selected algorithm with user-supplied parameters. Standardize the algorithm's output (which may differ in column names, units, or structure) into a common internal format—typically a feature matrix with columns for m/z, retention time, and intensity. Return both the standardized feature table and algorithm metadata (e.g., algorithm name, version, parameters used) so downstream stages (alignment, grouping, gap-filling) operate uniformly. This decouples downstream code from algorithm-specific output schemas and allows parameter swapping via configuration without code changes.3839## Related tools4041- **Centwave** (One of three selectable peak-picking algorithms; detects peaks using continuous wavelet transform)42- **FeatureFinderMetabo** (One of three selectable peak-picking algorithms; feature detection optimized for metabolomics)43- **ADAP** (One of three selectable peak-picking algorithms; adaptive peak detection)44- **SLAW** (Reference implementation of algorithm-interface abstraction for untargeted LC-MS processing) — https://github.com/zamboni-lab/SLAW4546## Examples4748```49docker run --rm -v /path/to/input:/input -v /path/to/output:/output zambonilab/slaw:latest50```5152## Evaluation signals5354- Verify that selecting different algorithm names in the configuration file routes data to the correct wrapper and executes the intended algorithm (e.g., check log output or algorithm metadata in output).55- Confirm that output from each algorithm, despite differences in native format, produces a standardized feature matrix with identical column names and types (m/z, retention time, intensity).56- Validate that downstream stages (alignment, grouping, gap-filling) accept the standardized output from any algorithm without modification, confirming decoupling.57- Check that feature counts and m/z/RT ranges are consistent with the selected algorithm's known sensitivity and specificity on positive control samples.58- Ensure algorithm metadata is correctly captured and propagated through the output for reproducibility and audit trails.5960## Limitations6162- SLAW wrapping is specific to three peak-picking algorithms (Centwave, FeatureFinderMetabo, ADAP); adding new algorithms requires implementing a new wrapper module.63- Output standardization assumes all wrapped algorithms report at least m/z, retention time, and intensity; algorithms lacking one of these metrics cannot be integrated without lossy transformation.64- Parameter optimization (automated tuning for alignment and gap-filling) is decoupled from algorithm selection; users must manually manage parameter ranges for each algorithm choice.65- DIA-MS and profile-mode (non-centroided) data are not supported; all input must be centroided DDA mzML or netCDF.66- Polarity detection is performed once at initialization; mixed-polarity datasets require pre-splitting and separate SLAW runs.6768## Evidence6970- [other] SLAW wraps three independent peak picking algorithms—Centwave, FeatureFinderMetabo, and ADAP—enabling configurable selection among them for the peak-picking stage of untargeted LC-MS processing.: "SLAW wraps three independent peak picking algorithms—Centwave, FeatureFinderMetabo, and ADAP—enabling configurable selection among them for the peak-picking stage"71- [other] Route the data to the corresponding algorithm wrapper module based on the configuration key.: "Route the data to the corresponding algorithm wrapper module based on the configuration key."72- [other] Standardize the output peak table to a common internal format (e.g., feature matrix with m/z, retention time, intensity columns).: "Standardize the output peak table to a common internal format (e.g., feature matrix with m/z, retention time, intensity columns)."73- [readme] Wrapping of three main peak picking algorithms: Centwave, FeatureFinderMetabo, ADAP: "Wrapping of three main peak picking algorithms: Centwave, FeatureFinderMetabo, ADAP"74- [readme] Raw MS data in mzML format. Files can include MS1 and DDA-MS2 scans. All data must be centroided and of unique polarity.: "Raw MS data in mzML format. Files can include MS1 and DDA-MS2 scans. All data must be centroided and of unique polarity."