Metadata-Version: 2.4
Name: orangemetabo
Version: 0.2.1
Summary: MetaboAnalyst-style univariate statistics for GC-MS / GC-IMS feature tables in Orange3
Author: Philipp Weller
Author-email: philipp.weller@googlemail.com
Project-URL: Source, https://github.com/philippweller/WellerLab/tree/main/orange-metabo-addon
Project-URL: Bug Tracker, https://github.com/philippweller/WellerLab/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering
Description-Content-Type: text/markdown
Requires-Dist: Orange3>=3.40.0
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: matplotlib
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: project-url
Dynamic: requires-dist
Dynamic: summary

# orangemetabo — MetaboAnalyst-Style Statistics for Orange3

Add-on for **Orange3** that reproduces the **MetaboAnalyst** univariate
workflow for GC-MS / GC-IMS **feature tables** (Compound Discoverer exports),
as used in the coffee-fermentation study (AK Weller).

## Pipeline

```
Feature Table CSV ──> Preprocess ──> [Filter] ──> Univariate Stats ──> Heatmap
 (2-header, ;)       (Sum-Norm,       (QC)         (ANOVA / Welch /     (Top-N,
                       log2, Imputation,             Kruskal + BH-FDR     Ward cluster,
                       Autoscale/Pareto)             + log2FC + means)     PNG/SVG export)
                                                                           └─> Volcano
                                                                              (log2FC vs -log10 FDR)
```

## Widgets (category *Metabo Weller*)

| Widget | Function |
|--------|----------|
| Metabo Feature Table | Load Compound Discoverer 2-header semicolon CSV; sample×feature Table with `group`/`sample` metas; pseudo-replicate (<3 replicates) hint |
| Metabo Preprocess | Optional imputation (min / k-NN) → sum-normalisation → log2 → autoscale (z) / Pareto |
| Metabo Feature Filter | Drop features by missing fraction, zero variance, constant, or below-detection threshold |
| Metabo Univariate Stats | One-way ANOVA, Welch two-sample t-test, or Kruskal-Wallis per feature + Benjamini-Hochberg FDR + log2FC + group means |
| Metabo Volcano | Volcano plot (log2FC vs. −log10 FDR) for a chosen two-group contrast from the results; FDR/|log2FC| thresholds, direction colours, top-N labels, PNG/SVG export; **click a point to select a feature** (shift-click to add) and see its per-group distribution as a box plot (needs the Data input); emits the significant features and the selected features' sample values |
| Metabo Heatmap | Top-N features by p, Ward/Euclidean row clustering, group bar, PNG/SVG export |

## Correctness

`orangemetabo/metabo_core.py` is the headless, Qt-free analytics core.
The default pipeline (sum-normalise → log2 → autoscale → one-way ANOVA →
BH-FDR) **reproduces the validated ground truth**
`analysis_CV/cv_anova_alle_97_features.csv` exactly: **97/97 features** on
F, p, and FDR (max abs diff < 5e-5). Reproduce with `_test_core.py`
(core) and `_test_e2e.py` (all six widgets, offscreen) — both run against the
Dropbox ground truth and print 97/97. The volcano contrast is checked to equal
the Welch log2FC and the ground-truth `log2FC_ANF_vs_WILD` column.

## Installation

```bash
cd orange-metabo-addon
/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/Current/bin/python3 -m pip install -e .
```
Or from the monorepo: `python ../orange-install.py metabo`.
