Skip to content

About

CDK jobs

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

squonk2-cdk

CDK jobs repository contains Java code running molecular property predictions using the Chemistry Development Kit. These are made available as a "tool", typically represented as a Java class. Those tools become available as:

  • a command line application
  • a command line application running in a Docker container
  • a Squonk2 job that runs using the Docker container

For more details on Squonk2 jobs look at our main virtual-screening repo that contains more documentation and examples.

We anticipate a wider range of functions being incoporated as additional tools in the futures. Suggestions and contributions are welcome.

One purpose of this repo is as a prototype for creating Squonk2 jobs using Java (most current ones are Python based).

This repo illustrates:

Building

You need JDK 21 and Docker. Gradle itself comes from the wrapper, so ./gradlew is all you need; it does not download a JDK for you, and the build declares a Java 21 toolchain, so a JDK 21 has to be on the machine (or on org.gradle.java.installations.paths).

$ ./gradlew test

Running

To run a tool through gradle:

$ ./gradlew run --args="--all -i ../data/dhfr_3d.sdf -o foo.sdf"

> Task :app:run
2022-04-06T09:05:19+00:00 # INFO -EVENT- squonk.jobs.cdk.DescriptorsExec --all -i ../data/dhfr_3d.sdf -o foo.sdf
2022-04-06T09:05:19+00:00 # INFO -EVENT- Calculating 10 descriptors
2022-04-06T09:05:22+00:00 # INFO -EVENT- Processed 756 molecules, 0 errors.
2022-04-06T09:05:22+00:00 # INFO -COST- 7560.0 1

BUILD SUCCESSFUL in 3s

This runs the default class which reads a SDF, calculates all properties and writes out a new SDF with those calculations as additional properties. See the build.gradle application task for more details. Note that this is effectively executed from the app directory, hence the path to the test SDF.

Build the docker container image:

$ docker build -f Dockerfile . -t informaticsmatters/squonk2-cdk:latest

The Dockerfile is a two-stage build: it runs ./gradlew installDist in a JDK image and copies the result onto a JRE, so it needs nothing installed locally beyond Docker. The image used to be generated by the bmuschko docker-java-application Gradle plugin; it is a plain Dockerfile now, which is what CI builds.

Running the docker container:

$ docker run -it -v $PWD:$PWD -w $PWD -u 1000:1000 informaticsmatters/squonk2-cdk:latest java squonk.jobs.cdk.DescriptorsExec --all -i data/dhfr_3d.sdf -o foo.sdf
2022-04-06T09:14:40+00:00 # INFO -EVENT- squonk.jobs.cdk.DescriptorsExec --all -i data/dhfr_3d.sdf -o foo.sdf
2022-04-06T09:14:40+00:00 # INFO -EVENT- Calculating 10 descriptors
2022-04-06T09:14:44+00:00 # INFO -EVENT- Processed 756 molecules, 0 errors.
2022-04-06T09:14:44+00:00 # INFO -COST- 7560.0 1

Running the Job tests:

jote runs the tests declared in the Job Definition against a locally built image. The manifest is not at jote's default path, so name it:

$ docker build -f Dockerfile . -t informaticsmatters/squonk2-cdk:ci
$ jote -m manifest-cdk.yaml --image-tag ci

--image-tag overrides the tag in the Job Definition, so a new image can be tested without editing the YAML.

About

CDK jobs

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages