bio-metabolomics-statistical-analysis
Statistical analysis for metabolomics data. Covers preprocessing (log2 transformation, normalization), limma moderated testing with empirical Bayes, Welch's t-tests with BH correction, fold change estimation, and multivariate methods (PCA, PLS-DA, OPLS-DA). Use when identifying differentially abundant metabolites or building classification models.
npx skills add BioTender-max/awesome-bio-agent-skills --skill statistical-analysis --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
The skill directs an agent to perform statistical analysis on metabolomics data, including preprocessing (log2 transformation, normalization), differential testing with limma moderated statistics, Welch's t-tests with BH correction, fold-change estimation on log2-transformed, normalized data, and multivariate approaches (PCA, PLS-DA, OPLS-DA) for identifying differentially abundant metabolites or building classification models.
How it works
- Applies a processing pipeline: zero/missing handling, log2 transformation, normalization, then statistical testing.
- For limma: constructs a design matrix from sample info, fits linear models, uses contrasts, applies empirical Bayes moderation with trend and robust options, and outputs BH-adjusted results with columns including logFC, AveExpr, t, P.Value, adj.P.Val, B. Includes guidance to add batch as a covariate in the design matrix when needed.
- For Python-based analysis: performs per-feature Welch's t-tests on log2-transformed data, then applies BH correction using multipletests with method='fdr_bh'; fold changes are computed as the difference of group means in log2 space.
- Fold change calculation emphasizes using log2-transformed, unscaled data, with notes on geometric means (difference of log means) versus arithmetic means, and provides guidance on reporting FC and applying shrinkage via ashr in R.
- Provides examples for normalization methods, including PQN normalization, and cautions about when normalization may hurt due to global shifts.
- Includes steps for creating volcano plots, PCA, and initial steps for supervised methods like PLS-DA with cross-validation and VIP scoring (in the truncated portion).
When to use it
Use when identifying differentially abundant metabolites or when building classification models from metabolomics data, particularly when you need a structured pipeline combining preprocessing, differential testing, and multivariate analyses.
What it can touch
- Tools: limma (R) for moderated testing; Python components rely on numpy, pandas, scipy.stats.ttest_ind, and statsmodels.stats.multitest.tesults for BH correction. The skill references file-based inputs like 'feature_table.tsv' and 'sample_info.tsv' and outputs results in data frames with columns such as log2fc and padj.
- Scripts present in the skill folder include executable components that implement these patterns.
Caveats
- Emphasizes that PQN normalization assumes most features are not differentially abundant; if global metabolic shifts occur (>50% of features), normalization may be inappropriate.
- Warns against imputing BPMV zeros (true absences) with half-minimum, recommending two-part tests instead.
- Notes that MetaboAnalyst uses different defaults (Student's t-test and arithmetic mean FC); users should override to align with this workflow.
- Highlights that post-hoc FC filtering can inflate FDR and recommends using treat() + topTreat() for minimum-effect testing.
- Contains explicit guidance about not pre-removing batch effects with removeBatchEffect(); instead, include batch as a covariate in the design.
## Version Compatibility Reference examples tested with: limma 3.58+, ashr 2.2+, scipy 1.12+, statsmodels 0.14+, numpy 1.26+, pandas 2.1+, mixOmics 6.28+, ggplot2 3.5+ Before using code patterns, verify installed versions match. If versions differ: - Python: `pip show <package>` then `help(module.function)` to check signatures - R: `packageVersion('<pkg>')` then `?function_name` to verify parameters If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying. # Metabolomics Statistical Analysis ## Processing Pipeline Standard pipeline: zero/missing handling -> log2 transformation -> normalization -> statistical testing. Fold change and statistical tests operate on log2-transformed, normalized but unscaled data. Pareto or auto-scaling distorts fold change magnitudes -- apply only for multivariate methods (PCA, PLS-DA). ### Zero and Missing Value Handling Metabolomics zeros fall into two categories requiring different treatment: | Type | Meaning | Detection | Action | |------|---------|-----------|--------| | TPMV (technical) | Below detection limit | Random missingness within detected f
- Version Compatibility
- Processing Pipeline
- Zero and Missing Value Handling
- Normalization
- Method Selection
- limma Workflow (R)
- Welch's t-test Workflow (Python)
- Fold Change Calculation
- Fold Change Reporting
- Fold Change Shrinkage (ashr)
- Minimum Fold Change Testing
- Common Pitfalls
- Volcano Plot
- PCA
What does the bio-metabolomics-statistical-analysis skill do?
Statistical analysis for metabolomics data. Covers preprocessing (log2 transformation, normalization), limma moderated testing with empirical Bayes, Welch's t-tests with BH correction, fold change estimation, and multivariate methods (PCA, PLS-DA, OPLS-DA). Use when identifying differentially abundant metabolites or building classification models.
How do I install it?
Run `npx skills add BioTender-max/awesome-bio-agent-skills --skill statistical-analysis --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From BioTender-max/awesome-bio-agent-skills, a repository with 135 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
