Skip to main content

Python interface to the ariadne multi-omic knowledge graph

Project description

ariadnePy: a Python interface to the ariadne database network

issues pulls tests

ariadnePy brings the biological database integration and graph-theory tools of the R package ariadne to Python users. It downloads biological resources (Gene Ontology, KEGG, UniProt, BugSigDB, ChocoPhlAn, and more) from Zenodo and assembles them into a single igraph Graph that can be queried, filtered, and visualised directly in Python.


Installation

pip install ariadnepy

RDS-backed resources (e.g. MSigDB) are supported out of the box — pyreadr is installed as a core dependency.

To also use the AnnData integration helpers (add_modules, get_modules, process_gene_families):

pip install "ariadnepy[anndata]"

For development:

git clone https://github.com/Minotau-R/ariadnePy
cd ariadnePy
pip install -e ".[dev]"

Quick start

import ariadnepy

# Build the knowledge graph using default resource versions
# (downloads GML files from Zenodo on first run; cached locally afterwards)
graph = ariadnepy.ariadne()

print(graph)
# IGRAPH U--- <N vertices> <M edges> --

# List all available resource versions
df = ariadnepy.list_resource_versions()
print(df.head())

# Select specific versions
graph = ariadnepy.ariadne(versions={"GO": "2026-01-23", "KEGG": "latest"})

# Explore a few candidate paths between two resources
ariadnepy.search_path(graph, "ko ~ ec", k=3)

# Weave a linkmap along a chosen path
linkmap = ariadnepy.weave_path(graph, "taxname ~ bugsig", init=["s__Bacteroides_fragilis"])

# weave_path / weave_complex also accept an existing pathway DataFrame
# (e.g. from draw_path(), or the bundled pathMeta example) instead of the
# full graph, skipping path search entirely and re-running just those steps:
pathmeta = ariadnepy.load_pathmeta()
chebi2gmm = ariadnepy.weave_path(pathmeta, init=[15377, 30616, 4167])

# Visualise a path on the graph
fig = ariadnepy.plot_path(graph, "ko ~ ec", k=1)
fig.savefig("path.png")

Supported resources

Resource Description
GO Gene Ontology
KEGG KEGG Pathways & Modules
UniProt UniProt protein database
OTT Open Tree of Life Taxonomy
Rhea Rhea biochemical reactions
WoL Web of Life phylogenetic tree
TIGRFAMs TIGRFAM protein families
GM Gut Metabolic Modules
BugSigDB Bug Signatures Database
ChocoPhlAn MetaPhlAn gene families
MSigDB Molecular Signatures Database

Run ariadnepy.list_resource_versions() for the exact versions available at any time.


Project structure

ariadnePy/
├── src/
│   └── ariadnepy/
│       ├── __init__.py        # public API
│       ├── core/               # ariadne() graph builder, GML download/cache, resource versions
│       ├── graph/               # weave_path, weave_complex, draw_path, search_path, link_names
│       ├── io/                  # SPARQL (UniProt/Rhea) and Open Tree of Life query backends
│       ├── plot/                 # plot_path, add_resource
│       ├── resources/             # resource file caching/parsing, bundled example datasets
│       ├── anndata/                # AnnData integration (add_modules, get_modules, process_gene_families)
│       └── exceptions.py
├── tests/                          # mirrors the src/ package layout
├── pyproject.toml
└── README.md

Running tests

pytest

License

Artistic License 2.0, matching the ariadne R package.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ariadnepy-0.2.0.tar.gz (52.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ariadnepy-0.2.0-py3-none-any.whl (49.2 kB view details)

Uploaded Python 3

File details

Details for the file ariadnepy-0.2.0.tar.gz.

File metadata

  • Download URL: ariadnepy-0.2.0.tar.gz
  • Upload date:
  • Size: 52.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.3

File hashes

Hashes for ariadnepy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fc9da3ab47fc5a3c2ac0b57d7d243c943e8ad8ea98fb09b5fe24e90964409f7a
MD5 fb7e82d265e71a4d17c6f05228a84de8
BLAKE2b-256 3552234ffe30e60d84467623c14bdd1a6f8a939a2bd106e5ba1d1add1ae45230

See more details on using hashes here.

File details

Details for the file ariadnepy-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ariadnepy-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 49.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.3

File hashes

Hashes for ariadnepy-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7b8b048668badf707b7c247bb370c63bc7d0a6b446d68613b6a768ac4af1921
MD5 a337fad1fa0dc229580d26f9d57c69e1
BLAKE2b-256 50cfda85d2fa9e642ba15d56f7e76ab65a4c86385370bf434fde6d78ab666685

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page