bulkrna-batch-correcti…
Load when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation. Skip…
Load when running univariate two-group testing (t-test / Wilcoxon / ANOVA / Kruskal-Wallis)
$ npx -y skills add tiangzlab/omicsclaw --skill metabolomics-statistics --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/metabolomics-statisticsContext preview
The summary Claude sees to decide when to auto-load this skill.
Load when running univariate two-group testing (t-test / Wilcoxon / ANOVA / Kruskal-Wallis)
name: metabolomics-statistics description: Load when running univariate two-group testing (t-test / Wilcoxon / ANOVA / Kruskal-Wallis) on a feature × sample metabolomics CSV with `--group1-prefix` / `--group2-prefix` column matching, BH-FDR adjusted. Skip when working with raw spectra (use metabolomics-xcms-preprocessing); two-group DE with default `ctrl` / `treat` prefixes (use metabolomics-de). trigger: metabolomics statistics, multivariate, PCA, clustering tags: - metabolomics - statistics - ttest - wilcoxon - anova - kruskal - bh-fdr
Test two explicit sample groups using Welch, ranksums, ANOVA or Kruskal. Use metabolomics-de for the ctrl/treat contrast and PCA CLI.
import pandas as pd
from skills._sdk.notebook import load_skill, read_input, write_output
library = load_skill("metabolomics-statistics")
data = read_input('features.csv', reader=lambda path: pd.read_csv(path, index_col=0))
result = library.test_groups(data, group1_prefix='ctrl', group2_prefix='treat')
write_output(result, 'tables/result.csv')[examples/example_step.py](examples/example_step.py) runs a seeded synthetic example through the step runner and writes a table and Figure. Computations return new DataFrames, leave the input unchanged and expose diagnostics through `run_info(result)`. Plotting functions write no files.
<!-- api:begin generated from _api.py; regenerate with run.py api <skill dir> --write -->
Return two-group test statistics and BH-adjusted p values.
:param data: Numeric feature-by-sample DataFrame with feature IDs as its index. :param method: CLI default ttest; wilcoxon (ranksums), anova or kruskal also work. :param alpha: CLI default .05; diagnostic significance threshold. :param group1_prefix: CLI default None; prefix selecting the reference samples. :param group2_prefix: CLI default None; prefix selecting the comparison samples. :param group1_cols: Explicit reference columns; supply together with group2_cols. :param group2_cols: Explicit comparison columns; overrides prefix selection. :returns: A new DataFrame with grouping and significance diagnostics. :raises ValueError: A group is empty, overlaps another or is only partly specified.
Read diagnostics attached to a returned table.
:param data: DataFrame returned by this library. :param keep: Default True; use False in the CLI to remove diagnostics. :returns: An independent dictionary describing the run. :raises ValueError: The table carries no run_info.
Plot group2/group1 log2 fold change against BH-adjusted significance.
:param data: Results from test_groups. :returns: A matplotlib Figure. :raises KeyError: log2fc or fdr is absent.
<!-- api:end -->
The wilcoxon label calls scipy.stats.ranksums, not paired Wilcoxon or Mann-Whitney U. ANOVA and Kruskal accept exactly two groups here. BH FDR covers every returned feature.
CSV input; `tables/statistics.csv`, `report.md` and `result.json`. The CLI also writes `tables/significant.csv`. The CLI writes `reproducibility/commands.sh`. The function library returns objects; the CLI and step own file writes.
python skills/metabolomics/metabolomics-statistics/metabolomics_statistics.py --demo --output /tmp/metabolomics_statistics
`numpy`, `pandas`, `scipy`, `matplotlib`
Conversational & memory-enabled AI research partner for multi-omics analysis. CLI + Desktop App (installers in Releases). From biological idea to full research paper.
Load when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation. Skip…
Load when discovering bulk gene co-expression modules and hub genes with R WGCNA. Skip direct expression contrasts (use…
Load when comparing gene expression between two conditions in bulk RNA-seq count data. Skip
Load when estimating cell-type proportions in bulk RNA-seq samples from a single-cell or
Load when running pathway / GO term enrichment on a bulk RNA-seq DE result list. Skip when
Load when converting Ensembl, Entrez or symbol IDs in a bulk RNA count matrix using an explicit mapping or a small human demo…