Skip to content

Commit d53c49e

Browse files
committed
updates to nextflow workflows
1 parent 26ebc6d commit d53c49e

File tree

7 files changed

+45
-75
lines changed

7 files changed

+45
-75
lines changed

Dockerfile-smog

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ RUN wget https://sourceforge.net/projects/opengrowth/files/SMoG2016.tar.gz/downl
1212
g++ -O3 -Wall -std=c++11 -Wno-uninitialized -I/usr/include/openbabel-2.0 -lm -c /usr/local/SMoG2016/SMoG2016.cpp -o /usr/local/SMoG2016/SMoG2016.o &&\
1313
g++ /usr/local/SMoG2016/SMoG2016.o -o /usr/local/SMoG2016/SMoG2016.exe -rdynamic /usr/lib/libopenbabel.so -Wl,-rpath,/usr/lib
1414

15-
RUN useradd -u 1001 -g 0 -m smog
16-
USER 1001
15+
ARG USERID=1001
16+
17+
RUN useradd -u $USERID -g 0 -m smog
18+
USER $USERID
19+
1720

1821
WORKDIR /home/smog

src/nextflow/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ When Squonk executes your pipeline it does the following:
138138
* copies your `*.nsd.conf` file to the file `nextflow.conf` in this directory
139139
* creates a simple `execute` bash script that will executes the pipeline with the options provided by the user and as specified
140140
in the service descriptor
141-
* Runs a container using the `informaticsmatters/nextflow` Docker image, mounting in the working directory and running the
141+
* Runs a container using the `informaticsmatters/nextflow-docker` Docker image, mounting in the working directory and running the
142142
`execute` script
143143
* After execution grabs the expected output files and as the results of execution
144144
* deletes the temporary working directory (unless working in debug mode)

src/nextflow/docking/plip.nsd.nf

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,38 +48,23 @@ process pli_scoring {
4848
process joiner {
4949

5050
beforeScript 'chmod g+w .'
51-
publishDir baseDir, pattern: "{output.data.gz,output.metadata}"
52-
53-
input:
54-
file parts from scored_parts.collect()
55-
56-
output:
57-
file 'output_metrics.txt' into joiner_metrics
58-
file 'output.data.gz'
59-
60-
"""
61-
cat scored_part*.sdf | python -m pipelines_utils_rdkit.filter -if sdf -of json -o output --meta --thin
62-
"""
63-
}
64-
65-
process metrics_meta {
66-
67-
beforeScript 'chmod g+w .'
68-
publishDir baseDir
51+
publishDir baseDir, mode: 'link'
6952

7053
input:
54+
file parts from scored_parts.collect()
7155
file 'splitter_metrics.txt' from splitter_metrics
72-
file 'joiner_metrics.txt' from joiner_metrics
7356

7457
output:
58+
file 'output.data.gz'
7559
file 'output_metrics.txt'
7660
file 'output.metadata'
7761

7862
"""
63+
cat scored_part*.sdf | python -m pipelines_utils_rdkit.filter -if sdf -of json -o output --meta --thin
64+
mv output_metrics.txt joiner_metrics.txt
7965
grep '__InputCount__' splitter_metrics.txt | sed s/__InputCount__/PLI/ > output_metrics.txt
8066
grep '__InputCount__' splitter_metrics.txt >> output_metrics.txt
8167
grep '__OutputCount__' joiner_metrics.txt >> output_metrics.txt
8268
echo '{"type":"org.squonk.types.BasicObject","valueClassMappings":{"pliff_cscore":"java.lang.Float","pliff_iscore":"java.lang.Float","pliff_tscore":"java.lang.Float","pliff_gscore":"java.lang.Float","pliff_score":"java.lang.Float","pliff_nb_score":"java.lang.Float"}}' > output.metadata
8369
"""
8470
}
85-

src/nextflow/docking/rdock.nsd.nf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ receptorzip = file(params.receptor)
2727
process unzip_config {
2828

2929
beforeScript 'chmod g+w .'
30-
container 'informaticsmatters/rdkit_pipelines'
30+
container 'informaticsmatters/rdkit_pipelines:latest'
3131

3232
input:
3333
file receptorzip
@@ -48,7 +48,7 @@ process unzip_config {
4848
process splitter {
4949

5050
beforeScript 'chmod g+w .'
51-
container 'informaticsmatters/rdkit_pipelines'
51+
container 'informaticsmatters/rdkit_pipelines:latest'
5252

5353
input:
5454
file ligands
@@ -89,7 +89,7 @@ process rdock {
8989
*/
9090
process results {
9191

92-
container 'informaticsmatters/rdock'
92+
container 'informaticsmatters/rdock-mini'
9393
// change permissions - see above
9494
beforeScript 'chmod g+w .'
9595

@@ -108,9 +108,9 @@ process results {
108108
process metrics {
109109

110110
beforeScript 'chmod g+w .'
111-
container 'informaticsmatters/rdkit_pipelines'
111+
container 'informaticsmatters/rdkit_pipelines:latest'
112112

113-
publishDir baseDir
113+
publishDir baseDir, mode: 'link'
114114

115115
input:
116116
file 'results.sdf' from results

src/nextflow/docking/smog.nsd.nf

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -48,39 +48,23 @@ process smog_scoring {
4848
process joiner {
4949

5050
beforeScript 'chmod g+w .'
51-
publishDir baseDir, pattern: "{output.data.gz,output.metadata}"
51+
publishDir baseDir, mode: 'link'
5252

5353
input:
54-
file parts from scored_parts.collect()
54+
file parts from scored_parts.collect()
55+
file 'splitter_metrics.txt' from splitter_metrics
5556

5657
output:
57-
file 'output_metrics.txt' into joiner_metrics
58+
file 'output_metrics.txt'
5859
file 'output.data.gz'
60+
file 'output.metadata'
5961

6062
"""
6163
cat scored_part*.sdf | python -m pipelines_utils_rdkit.filter -if sdf -of json -o output --meta --thin
62-
"""
63-
}
64-
65-
process metrics_meta {
66-
67-
beforeScript 'chmod g+w .'
68-
publishDir baseDir
69-
70-
71-
input:
72-
file 'splitter_metrics.txt' from splitter_metrics
73-
file 'joiner_metrics.txt' from joiner_metrics
74-
75-
output:
76-
file 'output_metrics.txt'
77-
file 'output.metadata'
78-
79-
"""
80-
grep '__InputCount__' splitter_metrics.txt | sed s/__InputCount__/PLI/ > output_metrics.txt
64+
mv output_metrics.txt joiner_metrics.txt
65+
grep '__InputCount__' splitter_metrics.txt | sed s/__InputCount__/SMOG/ > output_metrics.txt
8166
grep '__InputCount__' splitter_metrics.txt >> output_metrics.txt
8267
grep '__OutputCount__' joiner_metrics.txt >> output_metrics.txt
83-
echo '{"type":"org.squonk.types.BasicObject","valueClassMappings":{"pliff_cscore":"java.lang.Float","pliff_iscore":"java.lang.Float","pliff_tscore":"java.lang.Float","pliff_gscore":"java.lang.Float","pliff_score":"java.lang.Float","pliff_nb_score":"java.lang.Float"}}' > output.metadata
84-
"""
68+
echo '{"type":"org.squonk.types.BasicObject","valueClassMappings":{"SMoG2016_SCORE":"java.lang.Float","EmbedRMS":"java.lang.Float"}}' > output.metadata
69+
"""
8570
}
86-

src/python/pipelines/dmpk/pk_tmax_cmax_sim.dsd.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"cmax",
1111
"tmax",
1212
"simulation",
13+
"prediction",
1314
"docker"
1415
],
1516
"resourceUrl": null,

test-nextflow.sh

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,38 +24,35 @@ nextflow run src/nextflow/docking/rdock.nf -c src/nextflow/docking/rdock.config
2424

2525
echo 'Running SMoG2016 in squonk mode'
2626
sudo rm -rf tmp/*
27-
cp src/nextflow/docking/smog.nsd.nf tmp/nextflow.nf
28-
cp src/nextflow/docking/smog.nsd.config tmp/nextflow.config
29-
gzip -c data/smog/DCP2_1.pdb > tmp/protein.pdb.gz
30-
cp data/smog/confs.data.gz tmp/ligands.data.gz
31-
cp data/smog/confs.metadata tmp/ligands.metadata
3227
cd tmp
33-
docker run -it --rm -v $PWD:$PWD:z -w $PWD -v /var/run/docker.sock:/var/run/docker.sock informaticsmatters/nextflow sh -c 'nextflow run nextflow.nf -c nextflow.config --score 100.0 -with-docker'
28+
ln ../src/nextflow/docking/smog.nsd.nf nextflow.nf
29+
ln ../src/nextflow/docking/smog.nsd.config nextflow.config
30+
gzip -c ../data/smog/DCP2_1.pdb > protein.pdb.gz
31+
ln ../data/smog/confs.data.gz ligands.data.gz
32+
ln ../data/smog/confs.metadata ligands.metadata
33+
docker run -it --rm -v $PWD:$PWD:z -w $PWD -v /var/run/docker.sock:/var/run/docker.sock informaticsmatters/nextflow-docker:0.30.2 sh -c 'nextflow run nextflow.nf -c nextflow.config --score 100.0 -with-docker'
3434
cd ..
35-
sudo rm -rf tmp/*
36-
3735

3836
echo 'Running PLI in squonk mode'
3937
sudo rm -rf tmp/*
40-
cp src/nextflow/docking/plip.nsd.nf tmp/nextflow.nf
41-
cp src/nextflow/docking/plip.nsd.config tmp/nextflow.config
42-
gzip -c data/smog/DCP2_1.pdb > tmp/protein.pdb.gz
43-
cp data/smog/confs.data.gz tmp/ligands.data.gz
44-
cp data/smog/confs.metadata tmp/ligands.metadata
4538
cd tmp
46-
docker run -it --rm -v $PWD:$PWD:z -w $PWD -v /var/run/docker.sock:/var/run/docker.sock informaticsmatters/nextflow sh -c 'nextflow run nextflow.nf -c nextflow.config --score 100.0 -with-docker'
39+
ln ../src/nextflow/docking/plip.nsd.nf nextflow.nf
40+
ln ../src/nextflow/docking/plip.nsd.config nextflow.config
41+
gzip -c ../data/smog/DCP2_1.pdb > protein.pdb.gz
42+
ln ../data/smog/confs.data.gz ligands.data.gz
43+
ln ../data/smog/confs.metadata ligands.metadata
44+
docker run -it --rm -v $PWD:$PWD:z -w $PWD -v /var/run/docker.sock:/var/run/docker.sock informaticsmatters/nextflow-docker:0.30.2 sh -c 'nextflow run nextflow.nf -c nextflow.config --score 100.0 -with-docker'
4745
cd ..
48-
sudo rm -rf tmp/*
49-
5046

5147
echo 'Running rDock in squonk mode'
5248
sudo rm -rf tmp/*
53-
cp src/nextflow/docking/rdock.nsd.nf tmp/nextflow.nf
54-
cp src/nextflow/docking/rdock.nsd.config tmp/nextflow.config
55-
cp data/hivpr.config.zip tmp/config.zip
56-
cp data/dhfr_3d.data.gz tmp/ligands.data.gz
57-
cp data/dhfr_3d.metadata tmp/ligands.metadata
5849
cd tmp
59-
docker run -it --rm -v $PWD:$PWD:z -w $PWD -v /var/run/docker.sock:/var/run/docker.sock informaticsmatters/nextflow sh -c 'nextflow run nextflow.nf -c nextflow.config --num_dockings 1 --limit 40 --chunk 5 -with-docker'
50+
ln ../src/nextflow/docking/rdock.nsd.nf nextflow.nf
51+
ln ../src/nextflow/docking/rdock.nsd.config nextflow.config
52+
ln ../data/hivpr.config.zip config.zip
53+
ln ../data/dhfr_3d.data.gz ligands.data.gz
54+
ln ../data/dhfr_3d.metadata ligands.metadata
55+
docker run -it --rm -v $PWD:$PWD:z -w $PWD -v /var/run/docker.sock:/var/run/docker.sock informaticsmatters/nextflow-docker:0.30.2 sh -c 'nextflow run nextflow.nf -c nextflow.config --num_dockings 1 --limit 40 --chunk 5 -with-docker'
6056
cd ..
57+
6158
sudo rm -rf tmp/*

0 commit comments

Comments
 (0)