From 879cdb4ca28b7356c6f02a0cd3ef7bdc5d7bbe47 Mon Sep 17 00:00:00 2001 From: popenc Date: Wed, 7 Aug 2024 11:10:52 -0400 Subject: [PATCH] biotransformer package updates --- .dockerignore | 5 +++++ .gitmodules | 3 --- Dockerfile | 12 +++++++++++- bt_cli.py | 14 ++++++++++++-- docker-compose.yml | 2 +- 5 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 .dockerignore delete mode 100644 .gitmodules diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..704385c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +env/ +__pycache__/ +.idea/ +ExtractedJar/ +.github/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 51f4aa6..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "biotransformer3.0jar"] - path = biotransformer3.0jar - url = https://bitbucket.org/wishartlab/biotransformer3.0jar diff --git a/Dockerfile b/Dockerfile index ef96bcc..4c2cb5c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,17 @@ RUN apt-get update -y && \ COPY . /src/ WORKDIR /src -RUN chown -R $APP_USER:$APP_USER /src /tmp +# RUN rm -rf \ +# /usr/local/lib/python3.11/site-packages/pip-23.1.2.dist-info \ +# /root/.cache/pip \ +# /usr/local/lib/python3.11/site-packages/pip \ +# /usr/local/pip3.11 \ +# /usr/local/pip3 \ +# /usr/local/pip + +RUN mkdir -p /var/www + +RUN chown -R $APP_USER:$APP_USER /src /tmp /var/www RUN chmod 755 /src/start_flask.sh diff --git a/bt_cli.py b/bt_cli.py index bef8f76..6548f03 100644 --- a/bt_cli.py +++ b/bt_cli.py @@ -62,13 +62,23 @@ def execute_bt3(self, smiles, pred_type, gen_limit, predictions_filename): """ Executes biotransformer jar file for predictions. """ + + logging.warning("Using the following jar: {}".format(BT_JAR_NAME)) + + # subprocess.run(["java", "-jar", BT_JAR_NAME, + # "--task", "pred", + # "--btType", pred_type, + # "--ismiles", smiles, + # "--csvoutput", predictions_filename, + # "--nsteps", str(gen_limit), + # "-useDB", "false" + # ], cwd=BT_JAR_PATH) subprocess.run(["java", "-jar", BT_JAR_NAME, "--task", "pred", "--btType", pred_type, "--ismiles", smiles, "--csvoutput", predictions_filename, - "--nsteps", str(gen_limit), - "-useDB", "false" + "--nsteps", str(gen_limit) ], cwd=BT_JAR_PATH) def build_endpoint_args(self): diff --git a/docker-compose.yml b/docker-compose.yml index 3e3f2ef..40394a0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,4 +16,4 @@ services: # - ./:/src environment: - BT_JAR_PATH=/src/biotransformer3.0jar - - BT_JAR_NAME=BioTransformer3.0_20230525.jar + - BT_JAR_NAME=biotransformer.jar # name of .jar in biotransformer3.0jar/