Skip to main content

Get metadata and ontological information about all biomedical entities.

Project description

Biolookup Service logo

Biolookup

Tests Cookiecutter template from @cthoyt PyPI PyPI - Python Version PyPI - License Documentation Status DOI Code style: black

Get metadata and ontological information about biomedical entities.

🔍 Querying the Biolookup Service

The Biolookup Service has an endpoint /api/lookup/<curie> for retrieving metadata and ontological information about a biomedical entity via its compact identifier (CURIE).

import requests

res = requests.get("http://localhost:5000/api/lookup/doid:14330").json()
assert res["name"] == "Parkinson's disease"
assert res["identifier"] == "14330"
assert res["prefix"] == "doid"
assert res["definition"] is not None  # not shown for brevity

The INDRA Lab hosts an instance of the Biolookup Service at http://biolookup.io, so you can alternatively use http://biolookup.io/api/lookup/doid:14330.

The same can be accomplished using the biolookup package:

import biolookup

res = biolookup.lookup("doid:14330")
assert res["name"] == "Parkinson's disease"
# ... same as before

If you've configured the BIOLOOKUP_SQLALCHEMY_URI environment variable (or any other valid way with pystow to point directly at the database for an instance of the Biolookup Service, it will make a direct connection to the database instead of using the web-based API.

🕸️ Running the Lookup App

You can run the lookup app in local mode with:

$ biolookup web --lazy

This means that the in-memory data from pyobo are used. If you have a large external database, you can run in remote mode with the --sql flag:

$ biolookup web --sql --uri postgresql+psycopg2://postgres:biolookup@localhost:5434/biolookup

If --uri is not given for the web subcommand, it uses pystow.get_config("biolookup", "sqlalchemy_uri)to look up from BIOLOOKUP_SQLALCHEMY_URI or in ~/.config/biolookup.ini. If none is given, it defaults to a SQLite database in ~/.data/biolookup/biolookup.db.

🗂️ Load the Database

$ biolookup load --uri postgresql+psycopg2://postgres:biolookup@localhost:5434/biolookup

If --uri is not given for the load subcommand, it uses pystow.get_config("biolookup", "sqlalchemy_uri)to look up from BIOLOOKUP_SQLALCHEMY_URI or in ~/.config/biolookup.ini. If none is given, it creates a defaults a SQLite database at ~/.data/biolookup/biolookup.db.

🚀 Installation

The most recent release can be installed from PyPI with:

$ pip install biolookup

The most recent code and data can be installed directly from GitHub with:

$ pip install git+https://github.com/biopragmatics/biolookup.git

To install in development mode, use the following:

$ git clone git+https://github.com/biopragmatics/biolookup.git
$ cd biolookup
$ pip install -e .

👐 Contributing

Contributions, whether filing an issue, making a pull request, or forking, are appreciated. See CONTRIBUTING.rst for more information on getting involved.

👀 Attribution

⚖️ License

The code in this package is licensed under the MIT License.

🎁 Support

The Biolookup Service was developed by the INDRA Lab, a part of the Laboratory of Systems Pharmacology and the Harvard Program in Therapeutic Science (HiTS) at Harvard Medical School.

💰 Funding

This project has been supported by the following grants:

Funding Body Program Grant
DARPA Automating Scientific Knowledge Extraction (ASKE) HR00111990009

🍪 Cookiecutter

This package was created with @audreyfeldroy's cookiecutter package using @cthoyt's cookiecutter-snekpack template.

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

biolookup-0.1.0.tar.gz (117.8 kB view details)

Uploaded Source

Built Distribution

biolookup-0.1.0-py3-none-any.whl (122.6 kB view details)

Uploaded Python 3

File details

Details for the file biolookup-0.1.0.tar.gz.

File metadata

  • Download URL: biolookup-0.1.0.tar.gz
  • Upload date:
  • Size: 117.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.5

File hashes

Hashes for biolookup-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f59157de8891673767c340902d6a8b1643bc43d0ffc65f379ac94fc1d28a3325
MD5 ffe08d2599565f6ea8f19a9514d9aaf3
BLAKE2b-256 aecbf8d3b565aa3077703fdacda1b9377aece5fcb1e9f515f070ad3497e704cc

See more details on using hashes here.

File details

Details for the file biolookup-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: biolookup-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 122.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.5

File hashes

Hashes for biolookup-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8e9a8e3be6784564638b74c2b8ab1057167833da2809f115adaeee1b789d612
MD5 aa3840f786c32e89e51102308991bf3f
BLAKE2b-256 93d801cc1753f5dc1840e6dbac38a5b34dbf2b973245d47819a99f65726dced7

See more details on using hashes here.

Supported by

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