Skip to main content

An API to compute and serve predictions of biomedical concepts associations via OpenAPI, using the PREDICT method, for the NCATS Translator project

Project description

Version Run tests Publish package

Translator OpenPredict 🔮🐍 is an API to compute and serve predicted biomedical concepts associations, for the NCATS Translator project.

This service has been built from the fair-workflows/openpredict project.

Use the API 🌐

The Translator OpenPredict API Swagger UI is publicly available at openpredict.137.120.31.102.nip.io

You can find a Jupyter Notebook with examples to query the API on GitHub

Install the package 📦

You might want to use a virtual environment for Python 3.7

# Create the virtual environment
python3 -m venv .venv
# Activate it
source .venv/bin/activate

From PyPI

Install the latest release published on PyPI 🏷️

pip install openpredict

PyPI link : https://pypi.org/project/openpredict

From GitHub

You can also install from the latest version of the source code on GitHub:

pip install git+https://github.com/MaastrichtU-IDS/translator-openpredict

Run the API ⚙️

After installing the openpredict package (except for docker).

Run from the command line

Run in production with Tornado Web Server 🌪️

openpredict start-api

Access the Swagger UI at http://localhost:8808

Provide the port as arguments:

openpredict start-api --port 8808

Run in development with Flask 🧪. The API will reload automatically at each change 🔃

openpredict start-api --debug

Show help:

openpredict --help

Run from Python script

from openpredict import openpredict_api

debug = False
openpredict_api.start_api(8808, debug)

Access the Swagger UI at http://localhost:8808

Run by default in production, set debug = True to run in development mode.

Run with Docker

Running using Docker can be convenient if you just want to run the API without installing the packages locally, or run in production alongside other services.

Clone the repository:

git clone https://github.com/MaastrichtU-IDS/translator-openpredict.git
cd translator-openpredict

Start the openpredict-api container with docker-compose 🐳

docker-compose up

Access the Swagger UI at http://localhost:8808

We use nginx-proxy and docker-letsencrypt-nginx-proxy-companion as reverse proxy for HTTP and HTTPS in production. You can change the proxy URL and port via environment variables VIRTUAL_HOST, VIRTUAL_PORT and LETSENCRYPT_HOST in the docker-compose.yml file.

Stop the container:

docker-compose down

Compute the model 🤖

Run the pipeline to compute the model used by the OpenPredict API.

From a Python script

from openpredict.openpredict_omim_drugbank import get_drug_disease_classifier

get_drug_disease_classifier()

From the command line

openpredict compute-similarities

See also 👀

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

openpredict-0.0.3.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

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

openpredict-0.0.3-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file openpredict-0.0.3.tar.gz.

File metadata

  • Download URL: openpredict-0.0.3.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for openpredict-0.0.3.tar.gz
Algorithm Hash digest
SHA256 aebb5d020d998bc1f0e7403b4fa123d54b779eaeb58a7b6dfc37c124b765bb19
MD5 6e620b114d55c3dc2f8b37f8a5caf20a
BLAKE2b-256 2a557749054aac64a2b1aeed148f70ce86c68e642ff72b9fb924857672b0abd5

See more details on using hashes here.

File details

Details for the file openpredict-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: openpredict-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for openpredict-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4605b1b345d788f7129bcf6143c082912f6c506d47ccb0c287222891c7442ad0
MD5 d37112b57978de9981b972d01c328bd5
BLAKE2b-256 c17246274bceac4143e53407e8fa7f338a9f772c4b4864ded8106ea892facfc1

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