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 Python versions 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.4.tar.gz (12.4 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.4-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: openpredict-0.0.4.tar.gz
  • Upload date:
  • Size: 12.4 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.4.tar.gz
Algorithm Hash digest
SHA256 558552c8db912e2921d147bf3ffb0f06e4d8e28e242b8c9737006c51834299b0
MD5 dcc966452fdc3f6a847afa507ad1ae2a
BLAKE2b-256 984fcbbe799a43bb77c83b08baf342eea35f00fa7b763e84a865d87a6ccf9b0f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: openpredict-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 12.3 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c3c76711910833bfdd42975ab318ea760d31f79e70b30195c7effc0b086f470c
MD5 5fa76d2c403e8229031d657d758cdb0a
BLAKE2b-256 57bf55c089817f1b46c0c06345b29d3318f1f8ee2b9b5b724ec22b51aff79891

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