Skip to content

Commit b0a9f4c

Browse files
committed
simple rdock job
1 parent c44bc4f commit b0a9f4c

File tree

3 files changed

+190
-1
lines changed

3 files changed

+190
-1
lines changed

Dockerfile-rdock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ RUN yum -y update &&\
1010
RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org im-data-manager-job-utilities==1.2.0
1111

1212
COPY prepare_rdock.py rdock_*.sh /code/
13-
COPY scripts/split-sdf.sh /usr/local/bin/
13+
COPY scripts/*.sh /usr/local/bin/
1414
RUN chmod 755 /code/prepare_rdock.py
1515

1616
USER rdock

data-manager/im-virtual-screening.yaml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,129 @@ jobs:
345345
type: string
346346
default: docking
347347

348+
rdock:
349+
name: Docking using rdock
350+
description: >-
351+
Dock ligands using rdock
352+
version: '1.0.0'
353+
category: virtual screening
354+
keywords:
355+
- docking
356+
- rdock
357+
- 3d
358+
image:
359+
name: informaticsmatters/vs-rdock
360+
tag: 'latest'
361+
project-directory: /data
362+
working-directory: /data
363+
fix-permissions: true
364+
command: >-
365+
rdock.sh
366+
-r '{{ receptor }}'
367+
{% if prmFile is defined %}-p '{{ prmFile }}'{% endif %}
368+
-a '{{ cavityFile }}'
369+
-m '{{ mode }}'
370+
-n {{ count }}
371+
-c '{{ candidates }}'
372+
-o '{{ outputFile }}'
373+
374+
variables:
375+
inputs:
376+
type: object
377+
required:
378+
- candidates
379+
- receptor
380+
- prmFile
381+
- cavityFile
382+
properties:
383+
candidates:
384+
title: Input SD-file
385+
mime-types:
386+
- chemical/x-mdl-sdfile
387+
type: file
388+
receptor:
389+
title: Receptor (.mol2 file)
390+
mime-types:
391+
- chemical/x-mol2
392+
type: file
393+
prmFile:
394+
title: Docking configuration (.prm file)
395+
mime-types:
396+
- squonk/x-rdock-prm
397+
type: file
398+
cavityFile:
399+
title: Cavity file (.as file)
400+
mime-types:
401+
- squonk/x-rdock-as
402+
type: file
403+
outputs:
404+
type: object
405+
properties:
406+
outputFile:
407+
title: Output file
408+
mime-types:
409+
- chemical/x-pdb
410+
creates: '{{ outputFile }}.sd'
411+
type: file
412+
options:
413+
type: object
414+
required:
415+
- outputFile
416+
properties:
417+
count:
418+
title: Number of dockings
419+
type: number
420+
default: 25
421+
mode:
422+
title: Docking mode
423+
type: string
424+
enum:
425+
- dock
426+
- minimise
427+
- score
428+
outputFile:
429+
title: Base filename for output (do not include the extension)
430+
type: string
431+
pattern: "^[A-Za-z0-9_/\\.\\-]+$"
432+
tests:
433+
simple-execution-with-prm:
434+
inputs:
435+
candidates: data/candidates-10.sdf
436+
receptor: data/dhfr-receptor-ph7.mol2
437+
prmFile: data/docking.prm
438+
cavityFile: data/docking.as
439+
options:
440+
outputFile: results
441+
count: 1
442+
mode: dock
443+
checks:
444+
exitCode: 0
445+
outputs:
446+
- name: results.sdf
447+
checks:
448+
- exists: true
449+
- name: results.log
450+
checks:
451+
- exists: true
452+
simple-execution-without-prm:
453+
inputs:
454+
candidates: data/candidates-10.sdf
455+
receptor: data/dhfr-receptor-ph7.mol2
456+
cavityFile: data/docking.as
457+
options:
458+
outputFile: results
459+
count: 1
460+
mode: dock
461+
checks:
462+
exitCode: 0
463+
outputs:
464+
- name: results.sdf
465+
checks:
466+
- exists: true
467+
- name: results.log
468+
checks:
469+
- exists: true
470+
348471
ultrafast-shape-recognition:
349472
name: USR shape similarity
350473
description: >-

scripts/rdock.sh

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/bin/bash
2+
3+
while getopts ":r:p:a:n:c:m:o:" opt; do
4+
case $opt in
5+
r)
6+
RECEPTOR=$OPTARG
7+
echo "setting RECEPTOR to $RECEPTOR"
8+
;;
9+
p)
10+
PRM=$OPTARG
11+
echo "setting PRM to $PRM"
12+
;;
13+
n)
14+
COUNT=$OPTARG
15+
echo "setting COUNT to $COUNT"
16+
;;
17+
a)
18+
AS=$OPTARG
19+
echo "setting AS to $AS"
20+
;;
21+
c)
22+
MOLS=$OPTARG
23+
echo "setting MOLS to $MOLS"
24+
;;
25+
m)
26+
MODE=$OPTARG
27+
echo "setting MODE to $MODE"
28+
;;
29+
o)
30+
OUTFILE=$OPTARG
31+
echo "setting OUTFILE to $OUTFILE"
32+
;;
33+
\?)
34+
echo "Invalid option: -$OPTARG" >&2
35+
exit 1
36+
;;
37+
esac
38+
done
39+
40+
if [ -z ${AS+x} ]; then
41+
echo "active site file (.as) not specified"
42+
exit 1
43+
elif
44+
[[ "$AS" == 'docking.as' ]]; then
45+
echo "Using supplier docking.as file";
46+
else
47+
echo "Using supplied .as file $AS";
48+
cp $AS docking.as
49+
fi
50+
51+
if [ -z ${PRM+x} ]; then
52+
echo "generating .prm file"
53+
echo -e "RBT_PARAMETER_FILE_V1.00\\nTITLE rDockdocking\\nRECEPTOR_FILE @@RECEPTOR_FILE@@\\nRECEPTOR_FLEX 3.0\\n" > docking.prm
54+
elif [[ "$PRM" == 'docking.prm' ]]; then
55+
echo "Using supplier docking.prm file"
56+
else
57+
echo "Using supplied .prm file $PRM"
58+
cp $PRM docking.prm
59+
fi
60+
61+
sed -i "s/@@RECEPTOR_FILE@@/$RECEPTOR/" docking.prm
62+
63+
64+
echo "running rdock"
65+
rbdock -r 'docking.prm' -p $MODE.prm -n 1 -i $MOLS -o $OUTFILE > $OUTFILE.log
66+
mv $OUTFILE.sd $OUTFILE.sdf

0 commit comments

Comments
 (0)