An API to compute and serve predictions of biomedical concepts associations via OpenAPI, using the PREDICT method, for the NCATS Translator project
Project description
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
andLETSENCRYPT_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
Built Distribution
Hashes for openpredict-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3c76711910833bfdd42975ab318ea760d31f79e70b30195c7effc0b086f470c |
|
MD5 | 5fa76d2c403e8229031d657d758cdb0a |
|
BLAKE2b-256 | 57bf55c089817f1b46c0c06345b29d3318f1f8ee2b9b5b724ec22b51aff79891 |