REINVENT is a molecular design tool for de novo design, scaffold hopping, R-group replacement, linker design, molecule optimization, and other small molecule design tasks. REINVENT uses a Reinforcement Learning (RL) algorithm to generate optimized molecules compliant with a user defined property profile defined as a multi-component score. Transfer Learning (TL) can be used to create or pre-train a model that generates molecules closer to a set of input molecules.
This repository provides a Python-based tool to access the inference functions of REINVENT4 via a REST API. Once the API is set up, use the OpenAD Toolkit to easily access the inference functions of REINVENT4.
More information on REINVENT4 can be found at:
- https://github.com/MolecularAI/REINVENT4
- https://link.springer.com/article/10.1186/s13321-024-00812-5
More information on the OpenAD Toolkit and OpenAD Service Utilities:
- https://accelerate.science/projects/openad
- https://github.com/acceleratedscience/open-ad-toolkit
- https://github.com/acceleratedscience/openad_service_utils
Note: All of these deployment options will allow you to access SMI-TED functions using the OpenAD Toolkit. You may want to first install the Toolkit in its own Python environment before proceeding with deploying the SMI-TED utility.
You will need a Python level of 3.11 & to follow these installation directions:
-
Create and activate a Python virtual environment, and install REINVENT4 per the "Installation" instructions at this site (ignore the requirement to use Python 3.10):
https://github.com/MolecularAI/REINVENT4 -
Install the OpenAD Service Utilities in the new virtual environment with the following command:
pip install git+https://github.com/acceleratedscience/openad_service_utils.git
-
Clone this repo into a new directory:
git clone https://github.com/acceleratedscience/openad_reinvent4
-
Change directory to
openad_reinvent4
. -
Start the server with the following command:
python app.py
-
Open a new terminal session.
-
In the new terminal session start the OpenAD Toolkit:
openad
-
At the OpenAD Toolkit command line execute the following command to create a new service for accessing the local server started in step 7:
catalog model service from remote 'http://127.0.0.1:8080/' as props
-
At the OpenAD Toolkit command line execute the following command to view the available commands:
props ?
Prerequisites: Make sure you have Docker and the Docker Buildx plugin installed on your system.
-
Clone this repo into a new directory:
git clone https://github.com/acceleratedscience/openad_smi_ted
-
To build the Docker image, change directory to
openad_smi_ted
then start the build with the following command:
docker build -t smi-ted-app .
-
After the build is complete, execute the following command to run the container and have the server available on port 8080:
docker run -p 8080:8080 smi-ted-app
-
Open a new terminal session and start the OpenAD Toolkit:
openad
-
At the OpenAD Toolkit command line execute the following command to create a new service for accessing the local server started in step 3:
catalog model service from remote 'http://0.0.0.0:8080/' as sm
-
At the OpenAD Toolkit command line execute the following command to view the available commands:
sm ?
Install Helm Chart
helm install smi-ted ./helm-chart
Start a new build
oc start-build smi-ted-build
Wait for the build to complete
LATEST_BUILD=$(oc get builds | grep 'smi-ted-build-' | awk '{print $1}' | sort -V | tail -n 1)
oc wait --for=condition=Complete build/$LATEST_BUILD --timeout=15m
Run request test (pod may take some time to initialize so curl request may fail. try again.)
curl "http://$(oc get route smi-ted-openad-model -o jsonpath='{.spec.host}')/health"
run on the command line `mkdir -p ~/.openad_models`
Note:
Initially downloading models may take some time, this will be prompted by your first request. To pre-load models you can run the following
mkdir -p ~/.openad_models/properties/molecules && aws s3 sync s3://ad-prod-biomed/molecules/smi_ted/ /tmp/.openad_models/properties/molecules/smi_ted --no-sign-request --exact-timestamps
it does require installing the AWS cli which can be found here..
https://docs.aws.amazon.com/cli/latest/userguide/getting-started-quickstart.html
then using Podman or Docker run the following in the same directory as the compose.yaml file:
(podman or docker) compose create
(podman or docker) compose start
the service will start on poert 8080
change this in the compose file if you wish it to run on another port.
In openad run the following command
catalog model service from remote 'http://127.0.0.1:8080/' as sm
-
The container used is https://quay.io/ibmdpdev/openad_smi_ted:latest
-
You can use the compose.yaml file rather than download the entire repository
https://github.com/acceleratedscience/openad_smi_ted/blob/main/compose.yaml
Support for skypilot on AWS is coming soon