|
2 | 2 |
|
3 | 3 | <img src="https://user-images.githubusercontent.com/112839/227489878-d253c381-75fd-4e92-b851-2b36df0fc5ed.png" width=100> |
4 | 4 |
|
5 | | -STATUS: BETA |
| 5 | +Pandasaurus supports simple queries over ontology annotations in dataframes, powered by Ubergraph SPARQL queries. It keeps dependencies light while still offering CURIE validation, enrichment utilities, and graph exports for downstream tooling. |
6 | 6 |
|
7 | | -A python library supporting simple queries over ontology annotations in dataframes, using UberGraph queries. |
| 7 | +## Features |
8 | 8 |
|
9 | | -The aim for now is to keep this as a very simple independent Python lib avoiding any complex dependencies. |
| 9 | +- Validate and update seed CURIEs, catching obsoleted terms with replacement suggestions. |
| 10 | +- Enrich seed lists via simple, minimal, full, contextual, and ancestor-based strategies. |
| 11 | +- Build tabular outputs (`pandas.DataFrame`) and transitive-reduced graphs (`rdflib.Graph`) for visualization. |
| 12 | +- Batched SPARQL queries and deterministic tests with built-in mocking examples. |
10 | 13 |
|
11 | | -With the basic library in place, the first planned use for this is as a base for a library that provides simple enrichement and querability to AnnData Cell X Gene matrices following the [CZ single cell curation standard](https://github.com/chanzuckerberg/single-cell-curation/blob/main/schema/3.0.0/schema.md). |
| 14 | +## Installation |
| 15 | + |
| 16 | +```bash |
| 17 | +pip install pandasaurus |
| 18 | +``` |
| 19 | + |
| 20 | +or with Poetry: |
| 21 | + |
| 22 | +```bash |
| 23 | +poetry add pandasaurus |
| 24 | +``` |
| 25 | + |
| 26 | +Requires Python 3.9–3.11. |
| 27 | + |
| 28 | +## Quick Example |
| 29 | + |
| 30 | +```python |
| 31 | +from pandasaurus.curie_validator import CurieValidator |
| 32 | +from pandasaurus.query import Query |
| 33 | + |
| 34 | +seeds = ["CL:0000084", "CL:0000787", "CL:0000636"] |
| 35 | + |
| 36 | +terms = CurieValidator.construct_term_list(seeds) |
| 37 | +CurieValidator.get_validation_report(terms) # raises if invalid or obsoleted |
| 38 | + |
| 39 | +query = Query(seeds, force_fail=True) |
| 40 | +df = query.simple_enrichment() |
| 41 | +print(df.head()) |
| 42 | +``` |
| 43 | + |
| 44 | +See the [Quick Start guide](docs/quickstart.rst) for a step-by-step workflow. |
| 45 | + |
| 46 | +## Documentation |
| 47 | + |
| 48 | +Full documentation (quick start, recipes, developer guide, and API reference) lives under `docs/` and is published from the `gh-pages` branch: |
| 49 | + |
| 50 | +- [Hosted documentation](https://incatools.github.io/PandaSaurus/) |
| 51 | +- [Quick Start (source)](docs/quickstart.rst) |
| 52 | +- [Guides (source)](docs/guides/index.rst) |
| 53 | +- [API reference (source)](docs/pandasaurus/index.rst) |
| 54 | + |
| 55 | +To build docs locally: |
| 56 | + |
| 57 | +```bash |
| 58 | +poetry install -E docs |
| 59 | +poetry run sphinx-build -b html docs docs/_build/html |
| 60 | +``` |
| 61 | + |
| 62 | +## Contributing |
| 63 | + |
| 64 | +Pull requests are welcome! See `docs/guides/contributing.rst` for details on environment setup, testing, linting, and the release workflow. Pandasaurus aims to remain a small, focused library; please open an issue before introducing large new features. |
| 65 | + |
| 66 | +## Background |
| 67 | + |
| 68 | +The first planned use case is to provide enrichment/query tooling for AnnData Cell x Gene matrices following the [CZ single cell curation standard](https://github.com/chanzuckerberg/single-cell-curation/blob/main/schema/3.0.0/schema.md). |
0 commit comments