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
port = 8808
debug = False
openpredict_api.start_api(port, 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 of you just want to run the API without installing the package, or to 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.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8edbfffa03e29cd85d4cb024a432dde0e5272c221350fa8401b20105bfa81335 |
|
MD5 | 3a75dbb37d0e9fbe3e715a8bc59536aa |
|
BLAKE2b-256 | 54115a50764868274551d45c05a1174991d9ba21ceefdcd5939de30b5d28f507 |