agentsclimarketplace

Coefficient of variation comparison

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/coefficient-of-variation-comparison

Use when after normalization of a metabolomic feature matrix but before statistical testing, when you have both QC (technical replicate) and non-QC (study) samples and need to remove features with unstable or poorly reproducible signal patterns.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill coefficient-of-variation-comparison

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

coefficient-of-variation-comparison

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

Summary

Filter metabolomic features by comparing coefficient of variation (CV) between sample and quality control (QC) groups, retaining only features where the CV ratio (non-QC/QC) exceeds a threshold. This approach removes low-variance features that fail to differentiate between study samples and analytical controls, improving data quality for downstream statistical testing.

When to use

After normalization of a metabolomic feature matrix but before statistical testing, when you have both QC (technical replicate) and non-QC (study) samples and need to remove features with unstable or poorly reproducible signal patterns. Use when QC samples are present in the dataset and you want to prioritize features with higher relative variability in the biological samples compared to technical replicates.

When NOT to use

  • When QC samples are absent or not adequately represented in the dataset — CV comparison requires both groups.
  • When features are expected to have low variability in biological samples (e.g., tightly regulated housekeeping metabolites) — filtering may remove real, stable signals.
  • When all samples are technical replicates or when no biological replication exists — CV comparison loses interpretability.

Inputs

  • Normalized feature abundance matrix (e.g., Urine_RP_NEG_norm.txt format)
  • Sample metadata identifying QC vs. non-QC sample group membership

Outputs

  • Filtered feature abundance matrix containing only CV-ratio-passing features
  • Summary statistics table: feature count before/after filtering, CV ratio distribution metrics (mean, median, quantiles)
  • CV ratio distribution visualization (histogram or density plot)

How to apply

First, stratify the normalized feature matrix by sample type (QC vs. non-QC) based on metadata. Calculate the coefficient of variation (standard deviation / mean × 100) separately for each feature within the QC sample group and within the non-QC sample group. Compute the CV ratio for each feature as (CV_non-QC / CV_QC). Apply a threshold filter (default: CV_ratio > 1.0) to retain only features where the ratio exceeds this cutoff. This ensures retained features show greater variability in the biological samples than in technical replicates, which is expected for true metabolomic signals. Generate summary statistics including the count of features before and after filtering, the distribution and median of retained CV ratios, and optional visualizations of the CV ratio distribution.

Related tools

  • margheRita (R package implementing CV_ratio() filtering function for metabolomic feature quality control) — https://github.com/emosca-cnr/margheRita
  • R (Statistical computing environment used to calculate CV, CV ratio, and apply threshold filtering)
  • notame (Alternative R package for non-targeted LC-MS metabolomics preprocessing; supports similar filtering workflows) — https://github.com/hanhineva-lab/notame

Examples

# Load normalized feature matrix and sample metadata; calculate CV per feature within QC and non-QC groups; compute CV_ratio and filter
CV_ratio_filtered <- CV_ratio(norm_matrix, metadata, cv_threshold = 1.0)

Evaluation signals

  • Feature count decreases from initial total to filtered total (e.g., 539 → 303 in the example); verify no records are lost due to calculation errors.
  • CV ratio distribution of retained features is centered ≥ 1.0 with median > threshold; features with CV_ratio ≤ threshold are completely absent.
  • Retained features exhibit higher variability in non-QC samples relative to QC samples by definition; spot-check a sample of retained vs. removed features to confirm expected pattern.
  • Summary statistics table is complete with no missing values for retained features; filtering is reproducible when re-applied to the same input.
  • No features remain in the output with CV_ratio < threshold; filtering logic is correctly enforced.

Limitations

  • The default threshold (CV_ratio > 1.0) is arbitrary; the appropriate threshold may depend on the metabolite class, instrument stability, and study design. Thresholds tuned to a specific dataset may not generalize.
  • CV calculation is sensitive to small mean values or zeroes, which may inflate ratios for low-abundance features; consider robust CV alternatives (e.g., using non-zero values only, median absolute deviation) if sparsity is high.
  • This filter does not account for biological significance or pathway relevance; features passing CV filtering may still be uninformative or confounded by batch effects.
  • If QC replicates are few (< 3–5), CV estimates for the QC group may be unstable, leading to unreliable CV ratios.

Evidence

  • [intro] filtering by coefficient of variation (samples vs QCs): "filtering by mass defects, filtering by coefficient of variation (samples vs QCs) and probabilistic quotient normalization"
  • [other] CV_ratio() function retains features with CV ratio exceeding default threshold of 1: "The CV_ratio() function retains only features with a CV ratio (non-QC samples / QC samples) exceeding the default threshold of 1"
  • [other] Feature retention results: 303 metabolites retained from 539 initial features: "producing a distribution with median 1.1032 and resulting in 303 metabolites retained out of 539 initial features"
  • [other] Workflow: calculate CV separately for QC and non-QC groups, compute ratio, apply threshold: "Calculate the coefficient of variation (CV) for each feature separately within the non-QC sample group and within the QC sample group. 3. Compute the CV ratio (CV_non-QC / CV_QC) for each feature. 4."
  • [readme] margheRita provides pre-processing functions with focus on metabolomic-specific methods: "a series of pre-processing functions (quality control, filtering and normalization) with a particular focus on methods specifically recommended for metabolomic profiles"

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.