agentsclimarketplace

Qc sample filtering multi step criteria

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/qc-sample-filtering-multi-step-criteria

Use when after feature extraction from XCMS, MS-Dial, or similar tools (producing a feature intensity matrix with samples in rows and compounds in columns), and after sample type annotation (blank, curve, qc, unknown).From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill qc-sample-filtering-multi-step-criteria

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.9 KB, ~1.4k tokens by cl100k_base, as published. Nobody here has run it

QC-Sample Filtering with Multi-Step Criteria

Summary

A four-step sequential filtering workflow that removes non-reproducible and contaminated features from untargeted metabolomics feature intensity matrices using QC sample statistics: CV%, detection frequency, blank contribution ratio, and dilution series consistency. Applied within GetFeatistics to harmonize feature tables before downstream statistical analysis.

When to use

After feature extraction from XCMS, MS-Dial, or similar tools (producing a feature intensity matrix with samples in rows and compounds in columns), and after sample type annotation (blank, curve, qc, unknown). Use this skill when QC samples are present and reproducibility and contaminant removal are priorities—particularly in untargeted metabolomics where feature quality varies widely and blanks are available for contamination assessment.

When NOT to use

  • Input is already a curated, manually validated feature table with known reproducibility.
  • QC samples are absent or too few (< 3) to reliably estimate CV% or blank contribution.
  • Blank samples are not available and contamination assessment cannot be performed.
  • Feature intensity data are not in matrix form (samples × compounds) or contain non-numeric values.

Inputs

  • Feature intensity matrix (samples × compounds, numeric)
  • Sample type legend with classifications (blank, curve, qc, unknown)
  • Step cutoff parameters (step1_cutoff: CV% threshold; step2_cutoff: min QC % presence; step3_cutoff: max blank/QC ratio; step4_cutoff: QC_half % range)

Outputs

  • QC-filtered feature intensity matrix (subset of columns, same sample rows)
  • List of retained feature IDs passing all four steps
  • Filtering summary (counts and percentages removed per step)

How to apply

Load the feature intensity matrix (df_example_feat_intensities) and sample legend (df_example_qc_sampletype) into R. Execute QCs_process sequentially: Step 1 removes features with CV% above step1_cutoff in QC samples (default filtering for reproducibility); Step 2 excludes features absent in at least step2_cutoff % of QC samples (minimum detection frequency); Step 3 filters features whose blank contribution ratio (mean blank intensity / mean QC intensity) exceeds step3_cutoff (contamination control); Step 4 removes features whose mean intensity in QC_half (dilution series) samples falls outside the range specified by step4_cutoff % relative to mean QC intensity (dilution linearity check). Process each QC group separately if multiple QC cohorts exist, then merge confirmed features across groups. Output the resulting QC-filtered feature table ready for normalization and statistical analysis.

Related tools

  • GetFeatistics (R package implementing QCs_process function with four-step filtering pipeline) — https://github.com/FrigerioGianfranco/GetFeatistics
  • XCMS (Open source feature extraction tool whose output (feature table) serves as input to this filtering skill)
  • MS-Dial (Open source feature extraction tool whose output (feature table) serves as input to this filtering skill)
  • R (Runtime environment (≥ 4.3.1) for executing GetFeatistics functions)

Examples

library(GetFeatistics); result <- QCs_process(df_example_feat_intensities, df_example_qc_sampletype, step1_cutoff=30, step2_cutoff=80, step3_cutoff=0.3, step4_cutoff=c(20,180), separate_QC=TRUE)

Evaluation signals

  • Step 1: Verify that all retained features have CV% ≤ step1_cutoff when computed across QC samples.
  • Step 2: Confirm that retained features are present (non-NA) in ≥ step2_cutoff % of QC samples.
  • Step 3: Check that mean(blank) / mean(QC) ≤ step3_cutoff for all retained features.
  • Step 4: Validate that mean(QC_half) falls within [step4_cutoff[1]% × mean(QC), step4_cutoff[2]% × mean(QC)] for retained features.
  • Overall: Feature count reduction should be monotonic and traceable per step; merged output should have no duplicate feature IDs and same row dimension as input.

Limitations

  • Filtering is sensitive to cutoff parameter choice; no automated optimization is provided—practitioners must validate cutoffs against domain knowledge.
  • Requires sufficient QC replication (≥ 3 recommended) to reliably estimate CV% and statistics; sparse QC designs may be unreliable.
  • Step 4 (QC_half dilution check) assumes a dilution series is present in the QC group; if absent or non-linear, step 4 may filter valid features.
  • Separate QC group processing can fragment feature retention if QC cohorts have differing reproducibility profiles; merging may lose features present in only one QC group.
  • Missing values (NA) in feature intensity matrix are not explicitly handled by the filtering steps; imputation or removal strategy should be applied before QCs_process.

Evidence

  • [intro] step1_cutoff filtering to remove features with CV% above threshold in QC samples: "features with a relative standard deviation (CV%) greater than the value defined in the step1_cutoff will be filtered out"
  • [intro] step2_cutoff to exclude features not present in minimum percentage of QC samples: "features not present in at least a percentage of QC samples as defined in step2_cutoff will be filtered out"
  • [intro] step3_cutoff to remove features with blank contribution ratio above cutoff: "features with a blank contribution, i.e.: the ratio between mean of blank and mean of QC, greater than the value defined in the step3_cutoff will be filtered out"
  • [intro] step4_cutoff to remove features with QC_half mean outside specified percentage range: "features whose mean in "QC_half" samples are not between the percentage range of two values defined in step4_cutoff compared to the mean of QCs will be filtered out"
  • [other] Four sequential steps remove non-reproducible and contaminated features: "The QCs_process function filters features through four sequential steps: step1 removes features with CV% above cutoff, step2 removes features absent in minimum QC percentage, step3 removes features"
  • [intro] Input data structure and sample legend format: "The first should contain the intensities of peak area. Samples in rows, analysed compounds in columns"
  • [intro] Sample type classification legend requirements: "the second column should contain the following: "blank", "curve", "qc", or "unknown""
  • [readme] GetFeatistics as integrated feature elaboration and QC processing framework: "Getting streamlined elaboration of targeted and non-targeted metabolomics data, including elaboration of feature tables, separate QC processing, advanced statistics such as multiple regression linear"

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.