Metadata-Version: 2.5
Name: geomend
Version: 0.0.2
Summary: Combine GEO metadata tables, review suggested variable mappings, and export data with source and review history
Project-URL: Documentation, https://prestonraab.github.io/geomend/
Project-URL: Repository, https://github.com/prestonraab/geomend
Project-URL: Issues, https://github.com/prestonraab/geomend/issues
License: MIT License
        
        Copyright (c) 2026 Preston Raab
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: GEO,bioinformatics,data curation,metadata harmonization,ontology mapping,schema matching
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.13
Requires-Dist: bagit<2,>=1.9
Requires-Dist: filelock<4,>=3.16
Requires-Dist: pydantic<3,>=2.12
Requires-Dist: pyyaml<7,>=6.0
Provides-Extra: cohort
Requires-Dist: diskcache<6,>=5.6; extra == 'cohort'
Requires-Dist: duckdb<2,>=1.5; extra == 'cohort'
Requires-Dist: fastapi<1,>=0.115; extra == 'cohort'
Requires-Dist: frictionless<6,>=5.18; extra == 'cohort'
Requires-Dist: httpx<1,>=0.28; extra == 'cohort'
Requires-Dist: huey<3,>=2.5; extra == 'cohort'
Requires-Dist: joblib<2,>=1.4; extra == 'cohort'
Requires-Dist: linkml-map==0.5.4; extra == 'cohort'
Requires-Dist: numpy<3,>=2.1; extra == 'cohort'
Requires-Dist: packaging<27,>=24; extra == 'cohort'
Requires-Dist: pint<1,>=0.24; extra == 'cohort'
Requires-Dist: pooch<2,>=1.9; extra == 'cohort'
Requires-Dist: rapidfuzz<4,>=3.10; extra == 'cohort'
Requires-Dist: scikit-learn<2,>=1.5; extra == 'cohort'
Requires-Dist: scipy<2,>=1.14; extra == 'cohort'
Requires-Dist: sse-starlette<4,>=3.5; extra == 'cohort'
Requires-Dist: uvicorn<1,>=0.34; extra == 'cohort'
Provides-Extra: geo-verify
Requires-Dist: geoparse<3,>=2.0; extra == 'geo-verify'
Requires-Dist: pandas<3,>=2.2; extra == 'geo-verify'
Provides-Extra: learned
Requires-Dist: huggingface-hub<1,>=0.28; extra == 'learned'
Requires-Dist: torch<3,>=2.6; extra == 'learned'
Requires-Dist: transformers<5,>=4.48; extra == 'learned'
Provides-Extra: ontology
Requires-Dist: bioregistry<1,>=0.14; extra == 'ontology'
Requires-Dist: oaklib<1,>=0.6; extra == 'ontology'
Requires-Dist: pooch<2,>=1.9; extra == 'ontology'
Requires-Dist: sssom<1,>=0.4; extra == 'ontology'
Provides-Extra: reconcile
Requires-Dist: biopython<2,>=1.85; extra == 'reconcile'
Requires-Dist: frictionless<6,>=5.18; extra == 'reconcile'
Requires-Dist: httpx<1,>=0.28; extra == 'reconcile'
Requires-Dist: joblib<2,>=1.4; extra == 'reconcile'
Requires-Dist: numpy<3,>=2.1; extra == 'reconcile'
Requires-Dist: packaging<27,>=24; extra == 'reconcile'
Requires-Dist: pint<1,>=0.24; extra == 'reconcile'
Requires-Dist: pooch<2,>=1.9; extra == 'reconcile'
Requires-Dist: rapidfuzz<4,>=3.10; extra == 'reconcile'
Requires-Dist: scikit-learn<2,>=1.5; extra == 'reconcile'
Requires-Dist: scipy<2,>=1.14; extra == 'reconcile'
Provides-Extra: server
Requires-Dist: fastapi<1,>=0.115; extra == 'server'
Requires-Dist: sse-starlette<4,>=3.5; extra == 'server'
Requires-Dist: uvicorn<1,>=0.34; extra == 'server'
Provides-Extra: transform
Requires-Dist: linkml-map==0.5.4; extra == 'transform'
Description-Content-Type: text/markdown

# GEOmend

GEOmend downloads and combines metadata from GEO studies into a table for
analysis. It profiles source fields, suggests how to align them across studies,
and exports the results. You can inspect and correct those suggestions through
the command line, Python SDK, or API.

GEOmend accepts GEO accessions, family-SOFT files, and CSV/TSV metadata. The
cohort workflow produces an initial table without requiring a registry or
review decisions. Its field groupings and transformations are provisional and
may need correction. GEOmend preserves source data, revision history, evidence,
and previous exports. For output that requires reviewed mappings, use the
separate reviewed reconciliation workflow.

## Install

GEOmend requires Python 3.13 or newer. Install the cohort workflow with
[`uv`](https://docs.astral.sh/uv/):

```bash
uv tool install 'geomend[cohort]'
geomend capabilities --json
geomend doctor --json
```

For the reviewed reconciliation workflow, install its profiling and ontology
dependencies:

```bash
uv tool install 'geomend[reconcile,ontology]'
```

You can also install GEOmend with `pip`:

```bash
python -m pip install 'geomend[cohort]'
```

## From study list to modeling table

Create a resumable cohort project from a list of accessions and export an
analysis-oriented table:

```bash
geomend cohort create --accessions-file accessions.txt --project my-cohort
geomend cohort export my-cohort --output metadata.tsv --profile analysis
```

The analysis export includes the sample metadata table, column annotations,
and extra metadata that does not belong in the modeling table. The primary
table keeps one row per study/sample, including samples with incomplete
metadata. Useful measurements and covariates stay in the table while
study-specific identifiers and unaligned study-level details move into
context. Acquisition can resume, completed inputs are reused, and exports
remain available as the project is refined.

To correct an initial suggestion, inspect its evidence and update it through
the CLI, SDK, or API. These interfaces apply the same review rules to people
and agents. See the
[cohort workflow guide](https://prestonraab.github.io/geomend/cohort/) for
recovery, refinements, local inputs, API, and SDK usage.

## Reconcile with review

Plan and run a review workspace for a local table:

```bash
geomend reconcile plan samples.tsv --output-dir plan
geomend reconcile run plan/reconcile.yaml --output-dir workspace --offline
geomend review show workspace/review.geomend.sqlite
```

Planning identifies fields and proposes candidate mappings. It does not accept
them. Reviewers can inspect evidence and record attributable decisions through
the CLI, SDK, or authenticated API. For example, assign two reviewers:

```bash
geomend review assign workspace/review.geomend.sqlite review-round \
  --reviewer reviewer-a --reviewer reviewer-b --query FIELD
```

Each reviewer receives a portable `.geomend-review.zip` packet. After review,
import the returned response and export reviewed data:

```bash
geomend review import workspace/review.geomend.sqlite \
  review-round/packets/reviewer-a.geomend-response.zip
geomend export data workspace/review.geomend.sqlite reviewed-output
```

Export includes only reviewed mappings by default. If none can
produce output values, the command stops and explains why. Use
`--allow-empty` when an empty export is intentional. Reviewers can accept a
mapping, choose `nomatch` when no target applies, or defer when more evidence
is needed.

For GEO accessions and family-SOFT inputs, use `geomend reconcile plan` with the
appropriate sources. For local CSV/TSV inputs, GEOmend creates a review-only
draft registry automatically. Supply `--registry TARGETS.json` to use curated
targets. Planning is offline; acquisition of uncached GEO accessions requires
network access.

## Optional features

Install extras for additional capabilities:

| Extra | Adds |
| --- | --- |
| `cohort` | Persistent cohort intake, export, review, transformations, and local API |
| `reconcile` | Profiling, lexical retrieval, and constrained optimization |
| `ontology` | OBO/OWL/RDF ontology ingestion |
| `transform` | LinkML-Map validation and execution |
| `server` | Authenticated loopback API |
| `geo-verify` | Optional GEOparse cross-checks |
| `learned` | Optional local dense-retrieval experiments |

For example, install both cohort and ontology features with
`uv tool install 'geomend[cohort,ontology]'`. Local LLM inference is optional;
it provides evidence and proposals, not automatic acceptance. Research
campaigns, training, and benchmarks live in the separate `geomend-research`
repository. See [the development boundary](docs/development-boundary.md).

## How GEOmend handles evidence and review

- GEOmend preserves source artifacts and records their hashes to detect changes.
- A source column, target variable, ontology concept, and observed answer are
  different entities; similar names do not prove equivalence.
- Candidate scores rank suggestions for review. They do not report calibrated
  confidence or approve mappings.
- Proposed transformations are reviewed separately from execution.
- New reviews are added to the history and refer to a fixed copy of the evidence.
- Exports record the sources, transformations, candidates, and reviews used to
  produce them.

GEOmend uses the upstream LinkML-Map `TransformationSpecification` as the
standard format for reviewed transformations. Validate a
specification with `geomend workspace transformation validate`.

## Documentation

- [Full documentation](https://prestonraab.github.io/geomend/)
- [Reviewer protocol](https://prestonraab.github.io/geomend/reviewer-protocol/)
- [Multiple reviewer workflow](https://prestonraab.github.io/geomend/workspace-review/)
- [CLI and JSON contracts](https://prestonraab.github.io/geomend/cli-contract/)
- [Ontology and provenance](https://prestonraab.github.io/geomend/ontology-provenance/)
- [Reconciliation outcomes](https://prestonraab.github.io/geomend/reconciliation-outcomes/)
- [Metadata representation vocabulary](https://prestonraab.github.io/geomend/metadata-representation-vocabulary/)
- [Artifact and curation contracts](https://prestonraab.github.io/geomend/curation-contracts/)
- [Repository and issue tracker](https://github.com/prestonraab/geomend)
