# Export one or multiple model evaluations to the browser

Install this package, compute the appropriate assay-specific evaluation, and export its saved result directory. Upload the resulting JSON into the evaluation-results workspace of the hosted demo. The export command uses Python's standard library; it does not recompute scores or require model checkpoints.

```bash
stdetail export-results --run outputs/hest --output outputs/hest-results.json
stdetail export-results --workflow her2 --run outputs/her2 --output outputs/ordering-results.json
stdetail export-results --run outputs/fourier_P1.tsv --unit P1 --run outputs/fourier_P2.tsv --unit P2 --output outputs/physical-results.json
stdetail export-results --workflow cell --run outputs/cell_scores --output outputs/cell-results.json
```

`--run` can be repeated. All runs must use the same workflow. Duplicate model/task/unit/metric identities are rejected, including accidentally importing a run twice. HEST accepts any number of named predictions from one upward. It does not require names `baseline` and `intervention`. For Fourier tables the original scorer does not record a specimen identifier; supply one `--unit` for each `--run`. Other workflows preserve saved unit identifiers.

The bundle retains metric definitions, missing scores, reasons and raw source tables. It never clips negative scores or values above one. Patient and specimen units remain distinct. It does not combine genes or cell support across separately scored models. Reference quantities (RNA or held-out baselines) are explicitly separate from prediction metrics.

This general scores-only bundle does not include expression maps. The existing paired HEST expression export remains unchanged:

```bash
stdetail export --manifest data/manifest.json --run outputs/hest --output outputs/paired-expression.json
```

## Generate small examples

```bash
python examples/export_results_example.py --output outputs/export-examples
```

This runs the original numerical implementations on generated inputs and writes `hest.json`, `her2.json`, `fourier.json` and `cell.json`. It includes an actual single-prediction HEST evaluation and a two-specimen Fourier merge. The short HER2/Fourier molecule-split lists are for software demonstration. The cell example runs graph-band components, not full transcript preprocessing or hotspot scoring. All files are labelled synthetic and contain no patient data.

On Windows, activate the Python/Conda environment before running numerical workflows so its compiled dependencies are available. An existing environment in which PyTorch and NumPy cannot load together must be repaired or replaced; the scores-only export command itself does not import them.

See `EVALUATION_BUNDLE_CONTRACT.md` for fields, metric IDs and support semantics.
