Skip to content

Commit 056ceb5

Browse files
committed
fixing obabel_prepare_pdb service and docker images
1 parent 9b485e0 commit 056ceb5

File tree

5 files changed

+67
-50
lines changed

5 files changed

+67
-50
lines changed

Dockerfile-pli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ LABEL maintainer="Tim Dudgeon<[email protected]>"
33

44

55
USER root
6-
RUN apt-get install zlib1g-dev make gcc git -y
6+
RUN apt-get update -y && apt-get install zlib1g-dev make gcc git -y
77
RUN mkdir -p /usr/local/
88
WORKDIR /usr/local/
99
RUN git clone https://bitbucket.org/AstexUK/pli.git

Dockerfile-smog

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ LABEL maintainer="Tim Dudgeon<[email protected]>"
33

44

55
USER root
6-
RUN apt-get install libopenbabel-dev g++ -y
6+
7+
RUN echo 'deb http://deb.debian.org/debian experimental main' >> /etc/apt/sources.list
8+
9+
RUN apt-get update -y && apt-get install -t experimental libopenbabel-dev g++ -y
710

811
WORKDIR /usr/local
912
RUN wget https://sourceforge.net/projects/opengrowth/files/SMoG2016.tar.gz/download -O smog.tar.gz &&\

build.gradle

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,28 @@ task buildSmogImage(type: DockerBuildImage) {
8484
tag = "informaticsmatters/smog:latest"
8585
}
8686

87-
task buildSdPosterDockerImage(type: DockerBuildImage) {
87+
task buildSdPosterImage(type: DockerBuildImage) {
8888
description 'Builds the pipelines SD-poster Docker image'
8989

9090
dockerFile = file('Dockerfile-sdposter')
9191
inputDir = file('.')
9292
tag = "squonk/rdkit-${pipeline}-sdposter:latest"
9393
}
9494

95+
task buildObabelImage(type: DockerBuildImage) {
96+
// TODO - remove this once the pipelines-obabel project becomes active
97+
description 'Builds the obabel Docker image'
98+
99+
dockerFile = file('Dockerfile-obabel')
100+
inputDir = file('.')
101+
tag = "informaticsmatters/pipelines-obabel:latest"
102+
}
103+
95104
task buildDockerImages() {
96105
dependsOn buildPliImage // that one depends on buildPipelinesImage
97106
dependsOn buildSmogImage // and so does this one
98-
dependsOn buildSdPosterDockerImage
107+
dependsOn buildSdPosterImage
108+
dependsOn buildObabelImage
99109

100110
group 'Docker'
101111
description 'Builds all the project Docker images'
Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
1-
{ "@class":"org.squonk.core.DockerServiceDescriptor",
1+
{ "@class": "org.squonk.core.DockerServiceDescriptor",
22
"serviceConfig": {
3-
"id": "pipelines.xchem.obabel.prepare.pdb.v1",
4-
"name": "OBabelPreparePDB",
5-
"description": "Prepare PDB file uisng Open Babel",
6-
"tags": [ "rdkit", "xchem", "docker", "openbabel", "obabel", "prepare", "pdb", "convert"],
7-
"resourceUrl": null,
8-
"icon": "icons/transform_molecule.png",
3+
"id": "pipelines.xchem.obabel.prepare.pdb.v1",
4+
"name": "OBabelPreparePDB",
5+
"description": "Prepare PDB file using Open Babel",
6+
"tags": [ "rdkit", "xchem", "docker", "openbabel", "obabel", "prepare", "pdb", "convert", "protein"],
7+
"resourceUrl": null,
8+
"icon": "icons/transform_molecule.png",
99

10-
"inputDescriptors": [
11-
{
12-
"primaryType": "org.squonk.types.PDBFile",
13-
"mediaType": "chemical/x-pdb",
14-
"name": "pdb"
15-
}
16-
],
17-
"outputDescriptors": [
18-
{
19-
"primaryType": "org.squonk.types.Mol2File",
20-
"mediaType": "chemical/x-mol2",
21-
"name": "mol2"
22-
}
23-
],
10+
"inputDescriptors": [
11+
{
12+
"primaryType": "org.squonk.types.PDBFile",
13+
"mediaType": "chemical/x-pdb",
14+
"name": "pdb"
15+
}
16+
],
17+
"outputDescriptors": [
18+
{
19+
"primaryType": "org.squonk.types.Mol2File",
20+
"mediaType": "chemical/x-mol2",
21+
"name": "mol2"
22+
}
23+
],
2424

25-
"optionDescriptors": [
26-
{
27-
"modes": [
28-
"User"
29-
],
30-
"editable": true,
31-
"@class": "org.squonk.options.OptionDescriptor",
32-
"typeDescriptor": {
33-
"type": "java.lang.Float",
34-
"@class": "org.squonk.options.SimpleTypeDescriptor"
35-
},
36-
"key": "arg.protonate",
37-
"label": "Protonate at pH",
38-
"description": "Optionally protonate side chains at this pH",
39-
"visible": true,
40-
"minValues": 0,
41-
"maxValues": 1
42-
}
43-
],
44-
"executorClassName": "org.squonk.execution.steps.impl.ThinDatasetDockerExecutorStep"
25+
"optionDescriptors": [
26+
{
27+
"modes": [
28+
"User"
29+
],
30+
"editable": true,
31+
"@class": "org.squonk.options.OptionDescriptor",
32+
"typeDescriptor": {
33+
"type": "java.lang.Float",
34+
"@class": "org.squonk.options.SimpleTypeDescriptor"
35+
},
36+
"key": "arg.protonate",
37+
"label": "Protonate at pH",
38+
"description": "Optionally protonate side chains at this pH",
39+
"visible": true,
40+
"minValues": 0,
41+
"maxValues": 1
42+
}
43+
],
44+
"executorClassName": "org.squonk.execution.steps.impl.ThinDatasetDockerExecutorStep"
4545
},
4646
"inputRoutes": [ {"route": "FILE"} ],
4747
"outputRoutes": [ {"route": "FILE"} ],
48-
"imageName": "informaticsmatters/rdkit_pipelines",
49-
"command": "python -m pipelines.docking.obabel_prepare_pdb -i ${PIN}pdb.pdb.gz -o ${POUT}mol2 -mol2${protonate ? ' -prot ' + protonate : ''} --meta"
48+
"imageName": "informaticsmatters/pipelines-obabel:latest",
49+
"command": "python -m pipelines.docking.obabel_prepare_pdb -i ${PIN}pdb.pdb.gz -o ${POUT}mol2 -mol2${binding.variables.containsKey('protonate') ? ' -prot ' + protonate : ''} --meta"
5050
}

src/python/pipelines/docking/obabel_prepare_pdb.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
# Copyright 2017 Informatics Matters Ltd.
3+
# Copyright 2018 Informatics Matters Ltd.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -21,15 +21,19 @@
2121

2222

2323
def execute(input, output, extension, format, ph, noGzip):
24+
25+
# TODO - convert this to use the Python API rather than an external process
26+
2427
filename = output + "." + extension
2528
base_args = ["obabel", "-ipdb", input, format, "-O", filename]
2629
if ph:
2730
base_args.append("-p")
28-
base_args.append("ph")
31+
base_args.append(str(ph))
32+
utils.log("Command: " + " ".join(base_args))
2933

3034
subprocess.check_call(base_args, stdout=sys.stderr, stderr=sys.stderr)
3135

32-
# NOTE the -z argument does not seem to work correctly with obabel (truncted files generated) so we
36+
# NOTE the -z argument does not seem to work correctly with obabel (truncated files generated) so we
3337
# fall back to good old gzip to handle the compression once the uncompressed file is created
3438
if not noGzip:
3539
subprocess.check_call(['gzip', filename], stdout=sys.stderr, stderr=sys.stderr)

0 commit comments

Comments
 (0)