agentsclimarketplace

Dysregulation score computation

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/dysregulation-score-computation

Use when you have per-sample metabolite abundance data (e.g., from LC-MS or GC-MS) and a metabolite-to-pathway assignment table, and need to generate a sample-by-pathway dysregulation matrix for downstream classification, prognosis prediction, or pathway-level phenotype association.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill dysregulation-score-computation

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

8.2 KB, ~1.4k tokens by cl100k_base, as published. Nobody here has run it

dysregulation-score-computation

Summary

Compute pathway dysregulation scores (PDS) for individual samples by projecting per-sample metabolite abundances onto principal curves fitted in metabolite-pathway space, then quantifying each sample's deviation from the normal centroid. This enables personalized, pathway-level quantification of metabolic dysregulation across cohorts.

When to use

Apply this skill when you have per-sample metabolite abundance data (e.g., from LC-MS or GC-MS) and a metabolite-to-pathway assignment table, and need to generate a sample-by-pathway dysregulation matrix for downstream classification, prognosis prediction, or pathway-level phenotype association. Use when pathway-level summaries of individual sample dysregulation are required rather than simple fold-change or univariate metabolite tests.

When NOT to use

  • Input metabolite abundances are already aggregated at the pathway level or normalized to principal components; PDS computation requires raw or log-transformed per-metabolite abundances.
  • Metabolite-to-pathway mapping is unavailable or unmapped metabolites comprise >50% of the data, as dysregulation scores require sufficient pathway-level metabolite coverage.
  • Sample cohort has no well-defined control/normal group to serve as the curve origin centroid for dysregulation distance calculation.

Inputs

  • Per-sample metabolite abundance matrix (samples × metabolites; numeric, e.g., from plasma_breast_cancer.csv)
  • Metabolite-pathway association table (metabolite IDs mapped to KEGG/HMDB pathway assignments)
  • Sample metadata including phenotype labels and/or control/case assignments for centroid reference

Outputs

  • Pathway Dysregulation Score (PDS) matrix (samples × pathways; numeric; values ≥ 0 represent distance from normal centroid)
  • Principal curve objects per pathway (used for pathway visualization and metabolite-pathway regression downstream)

How to apply

First, load metabolite abundance data and metabolite-pathway assignments (e.g., KEGG or HMDB identifiers) into R. For each pathway, extract the subset of metabolites assigned to that pathway and construct a per-sample metabolite abundance submatrix. Use Lilikoi v2.0's principal-curve fitting algorithm to project samples into the high-dimensional principal component space of each pathway's metabolite subspace. Fit a smooth principal curve through the samples to capture the manifold of metabolite co-variation. Compute dysregulation scores as the Euclidean distance from each sample's projected point on the principal curve to the centroid of control (normal) samples at the curve's origin. Organize all computed scores into a matrix with samples as rows and pathways as columns to produce the PDSmatrix. This approach captures multivariate dysregulation patterns within each pathway rather than treating metabolites independently.

Related tools

  • Lilikoi v2.0 (Implements principal-curve projection, PDS computation via lilikoi.PDSfun(), and pathway visualization; provides the primary algorithmic backend for dysregulation score calculation.) — https://github.com/lanagarmire/lilikoi2
  • R (Programming environment for loading data, managing metabolite-pathway tables, and executing Lilikoi v2.0 functions.)
  • lilikoi.MetaTOpathway() (Converts metabolite names to HMDB IDs and constructs the metabolite-pathway association table prior to PDS computation.) — https://github.com/lanagarmire/lilikoi2

Examples

# Transform metabolites to pathway and compute PDSmatrix
convertResults=lilikoi.MetaTOpathway('name')
Metabolite_pathway_table = convertResults$table
PDSmatrix=lilikoi.PDSfun(Metabolite_pathway_table)

Evaluation signals

  • PDSmatrix dimensions match input (rows = number of samples, columns = number of unique pathways); all values are non-negative numeric.
  • Control samples have consistently lower dysregulation scores (closer to origin) than case/disease samples in the same pathway, indicating the principal curve centroid is correctly anchored at normal phenotype.
  • No NaN or infinite values in PDSmatrix; missing pathways or metabolites are handled with explicit imputation or exclusion documented in the workflow.
  • Dysregulation scores show pathway-level variance correlated with phenotype in downstream machine learning or association tests; pathway selection by dysregulation (e.g., gain ratio threshold > 0.50) identifies pathways relevant to the phenotype.
  • Reproducibility: the same input data and normal cohort definition yield identical PDSmatrix when re-run with identical principal-curve fitting parameters (e.g., smoothing bandwidth, number of components).

Limitations

  • PDS computation assumes metabolites within each pathway co-vary in a manner captured by principal curves; pathways with highly sparse or uncorrelated metabolite profiles may yield unstable principal curve fits.
  • The choice of control/normal samples for centroid reference critically affects all dysregulation scores; misclassified or contaminated control samples will bias the entire matrix.
  • Principal curve fitting in high-dimensional metabolite space becomes computationally and statistically challenging when pathways contain very few metabolites (< 3–5) or very many (> 100+), potentially requiring pathway-specific parameter tuning.
  • The Euclidean distance metric in PDS assumes isotropic variance; metabolites with heterogeneous measurement error or dynamic ranges may require data normalization (e.g., z-score or quantile normalization) before PDS computation.
  • No systematic guidance provided in the README or article for choosing smoothing hyperparameters or handling pathways with insufficient sample size relative to metabolite dimensionality.

Evidence

  • [other] Principal-curve projection and dysregulation distance computation: "Project the per-sample metabolite abundances onto a principal curve fitted to the metabolite-pathway space using Lilikoi v2.0's principal-curve projection method. Compute dysregulation scores as the"
  • [other] Centroid reference and sample-level quantification: "quantifies each sample's dysregulation as the distance from its projected point on the curve to the centroid of normal samples at the curve's origin"
  • [other] Workflow input and output structure: "Load the metabolite-pathway association table and per-sample metabolite abundance data into R. For each pathway, extract the subset of metabolites assigned to that pathway. Organize scores into a"
  • [readme] Lilikoi v2.0 supports pathway analysis components: "Lilikoi v2 supports data preprocessing, exploratory analysis, pathway visualization and metabolite-pathway regression"
  • [readme] Example R invocation of PDSfun: "PDSmatrix=lilikoi.PDSfun(Metabolite_pathway_table)"

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.