Skip to content
Back to skills

Metabolomics Normalization

ASecurity

Load when normalising a feature × sample metabolomics CSV via median, quantile, total (sum),

  • 8 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 6, 2026
datapythongobashtesting

Works with

  • cli

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned September 6, 2026

npx -y skills add lilinji/GeneTind-Life-Skills --skill metabolomics-normalization --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Metabolomics Normalization?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Metabolomics Normalization
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lilinji-metabolomics-normalization/badge)](https://www.skillsdirectory.com/skills/lilinji-metabolomics-normalization)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
# AUTO-GENERATED header from skill.yaml — do not edit by hand.
# Edit skill.yaml, then run: python scripts/generate_skill_md.py <skill_dir>
name: metabolomics-normalization
description: Load when normalising a feature × sample metabolomics CSV via median, quantile, total (sum),
  PQN (probabilistic quotient), or log methods — emits a normalised wide-form table. Skip when also imputing
  (use metabolomics-quantification); raw spectra (use metabolomics-xcms-preprocessing).
version: 0.5.0
author: OmicsClaw
license: MIT
emoji: 📐
tags:
- metabolomics
- normalization
- pqn
- quantile
- median
- log
requires:
- numpy
- pandas
---

# metabolomics-normalization

## When to use

The user has a feature × sample metabolomics intensity table and
wants normalisation only (no imputation). Five methods:

- `median` (default) — divide each sample by its median.
- `quantile` — quantile normalisation across samples.
- `total` — divide by per-sample total (TIC).
- `pqn` — Probabilistic Quotient Normalisation (Dieterle 2006).
- `log` — log2(x+1) per-cell.

For combined imputation + normalisation use `metabolomics-quantification`.

## Inputs & Outputs

<!-- AUTO-GENERATED from skill.yaml (interface) — do not edit by hand. Regenerate: python scripts/generate_skill_md.py <skill_dir> -->

**Inputs**

- File types: `.csv`
- Accepts artifact `metabolomics.peak_table` (`csv`)

**Outputs**

- `tables/normalized.csv`
- `report.md`
- `result.json`
- Produces artifact `metabolomics.feature_matrix` as `tables/normalized.csv` (`csv`)

## Flow

1. Load CSV (`--input <features.csv>`) or generate a demo (`--demo`).
2. Dispatch on `--method`; reject unknown via `ValueError("Unknown method: {method}. Choose from {SUPPORTED_METHODS}")` at `metabolomics_normalization.py:151`.
3. Apply the chosen normalisation; write `tables/normalized.csv` (`metabolomics_normalization.py:258`) + `report.md` + `result.json`.

## Gotchas

- **`--method` choices are exact: `median` / `quantile` / `total` / `pqn` / `log`.** `metabolomics_normalization.py:36` defines `SUPPORTED_METHODS`. Aliases like `tic` (= `total`) are NOT accepted — pass `total` explicitly. (Note: sibling `metabolomics-quantification` accepts `tic` as a normalize choice; the two skills' vocabularies differ.)
- **`--input` REQUIRED unless `--demo`.** `metabolomics_normalization.py:248` raises `ValueError("--input required when not using --demo")`.
- **`pqn` requires non-zero reference values.** Probabilistic Quotient Normalisation divides by per-feature reference (median sample); features with all zeros yield NaN quotients. Pre-filter zero-prevalent features.
- **`log` is `log2(x+1)`.** Negative values raise / propagate NaN. Pre-clip upstream.
- **No imputation is performed.** NaN values pass through normalisation untouched (most methods skipna; `quantile` may NaN-propagate). Pre-impute with `metabolomics-quantification` if NaNs are problematic.
- **Method-specific behaviour with NaN may differ.** `median` / `total` use `np.nanmedian` / `np.nansum`; `quantile` may collapse rows with NaN; `pqn` expects all-numeric.

## Key CLI

```bash
# Demo (median normalize)
python omicsclaw.py run metabolomics-normalization --demo --output /tmp/norm_demo

# PQN
python omicsclaw.py run metabolomics-normalization \
  --input features.csv --output results/ --method pqn

# Total (TIC)
python omicsclaw.py run metabolomics-normalization \
  --input features.csv --output results/ --method total

# log2(x+1)
python omicsclaw.py run metabolomics-normalization \
  --input features.csv --output results/ --method log
```

## See also

- `references/parameters.md` — every CLI flag
- `references/methodology.md` — per-method semantics, when each wins
- `references/output_contract.md` — `tables/normalized.csv` schema
- Adjacent skills: `metabolomics-quantification` (parallel — combined impute + normalise), `metabolomics-xcms-preprocessing` (upstream), `metabolomics-peak-detection` (upstream), `metabolomics-statistics` (downstream — multi-group testing), `metabolomics-de` (downstream — two-group DE)

Files in this skill

  • SKILL.md4 KB
  • metabolomics_normalization.py9.2 KB
  • references/methodology.md811 B
  • references/output_contract.md631 B
  • references/parameters.md263 B
  • skill.yaml1.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in data →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.