Skip to content

Commit 7f673a3

Browse files
authored
Merge pull request #52 from ndonyapour/glob_order_genconformers
fix glob order for gen_conformers
2 parents 07248d2 + 7409361 commit 7f673a3

File tree

9 files changed

+273
-39
lines changed

9 files changed

+273
-39
lines changed

.github/workflows/docker_build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
rename_residues_mol, combine_structure,
2727
remove_terminal_residue_name_prefixes, molgan,
2828
pdbbind_refined, onionnet-sfct, smina, pdbfixer,
29-
fix_pdb_atom_column, extract_protein] # No username for pdbind_refined
29+
fix_pdb_atom_column, extract_protein, generate_conformers] # No username for pdbind_refined
3030
# skip data/ and cwl_adapters/file_format_conversions/biosimspace/
3131
runs-on: [ubuntu-latest]
3232

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
#!/usr/bin/env cwl-runner
2+
cwlVersion: v1.0
3+
4+
class: CommandLineTool
5+
6+
label: Download the PDBbind refined database
7+
8+
doc: |-
9+
Download the PDBbind refined database
10+
11+
baseCommand: ['python3', '/generate_conformers.py']
12+
13+
hints:
14+
DockerRequirement:
15+
dockerPull: ndonyapour/generate_conformers
16+
17+
requirements:
18+
InlineJavascriptRequirement: {}
19+
20+
inputs:
21+
input_excel_path:
22+
label: Path to the input xlsx file
23+
type: File
24+
format:
25+
- edam:format_3620
26+
inputBinding:
27+
prefix: --input_excel_path
28+
29+
query:
30+
label: query str to search the dataset
31+
doc: |-
32+
query str to search the dataset
33+
Type: string
34+
File type: input
35+
Accepted formats: txt
36+
type: string
37+
format:
38+
- edam:format_2330
39+
inputBinding:
40+
prefix: --query
41+
42+
output_txt_path:
43+
label: Path to the text dataset file
44+
doc: |-
45+
Path to the text dataset file
46+
Type: string
47+
File type: output
48+
Accepted formats: txt
49+
type: string
50+
format:
51+
- edam:format_2330
52+
inputBinding:
53+
prefix: --output_txt_path
54+
default: system.log
55+
56+
output_sdf_path:
57+
label: Path to the input file
58+
doc: |-
59+
Path to the input file
60+
Type: string
61+
File type: input
62+
Accepted formats: sdf
63+
type: string
64+
format:
65+
- edam:format_3814 # sdf
66+
67+
min_row:
68+
label: The row min index
69+
doc: |-
70+
The row min inex
71+
Type: int
72+
type: int?
73+
format:
74+
- edam:format_2330
75+
inputBinding:
76+
prefix: --min_row
77+
78+
max_row:
79+
label: The row max index
80+
doc: |-
81+
The row max inex
82+
Type: int
83+
type: int?
84+
format:
85+
- edam:format_2330
86+
inputBinding:
87+
prefix: --max_row
88+
89+
smiles_column:
90+
label: The name of the smiles column
91+
doc: |-
92+
The name of the smiles column
93+
Type: string
94+
File type: output
95+
Accepted formats: txt
96+
type: string
97+
format:
98+
- edam:format_2330
99+
inputBinding:
100+
prefix: --smiles_column
101+
102+
binding_data_column:
103+
label: The name of the binding data column
104+
doc: |-
105+
The name of the binding data column
106+
Type: string
107+
File type: output
108+
Accepted formats: txt
109+
type: string
110+
format:
111+
- edam:format_2330
112+
inputBinding:
113+
prefix: --binding_data_column
114+
115+
convert_Kd_dG:
116+
label: If this is set to true, dG will be calculated
117+
doc: If this is set to true, dG will be calculated
118+
type: boolean
119+
format:
120+
- edam:format_2330
121+
inputBinding:
122+
prefix: --convert_Kd_dG
123+
default: False
124+
125+
experimental_dGs:
126+
label: Experimental Free Energies of Binding
127+
doc: |-
128+
Experimental Free Energies of Binding
129+
type: string?
130+
format:
131+
- edam:format_2330
132+
133+
outputs:
134+
output_txt_path:
135+
label: Path to the txt file
136+
doc: |-
137+
Path to the txt file
138+
type: File
139+
outputBinding:
140+
glob: $(inputs.output_txt_path)
141+
format: edam:format_2330
142+
143+
output_sdf_path:
144+
label: Path to the input file
145+
doc: |-
146+
Path to the input file
147+
Type: string
148+
File type: input
149+
Accepted formats: sdf
150+
type: File[]
151+
outputBinding:
152+
# NOTE: Do NOT just use glob: ./*.sdf !!! This will return an array sorted by filenames.
153+
# We want the order of output_sdf_paths to match the order of experimental_dGs, etc
154+
# Because we need to compare experimental ΔGs with predicted values.
155+
glob: $(inputs.output_txt_path)
156+
loadContents: true
157+
outputEval: |
158+
${
159+
var lines = self[0].contents.split("\n");
160+
var sdfs = [];
161+
for (var idx = 0; idx < lines.length; idx++) {
162+
var words = lines[idx].split(" ");
163+
var sdffile = {"class": "File", "path": "ligand_" + idx + ".sdf"};
164+
sdfs.push(sdffile);
165+
}
166+
167+
return sdfs;
168+
}
169+
format: edam:format_3814
170+
171+
experimental_dGs:
172+
label: Experimental Free Energies of Binding
173+
doc: |-
174+
Experimental Free Energies of Binding
175+
type: float[]
176+
outputBinding:
177+
# NOTE: Do NOT just use $(inputs.output_txt_path) !!! This will return an array sorted by filenames.
178+
# We want the order of output_sdf_paths to match the order of experimental_dGs, etc
179+
# Because we need to compare experimental ΔGs with predicted values.
180+
glob: $(inputs.output_txt_path)
181+
loadContents: true
182+
outputEval: |
183+
${
184+
var lines = self[0].contents.split("\n");
185+
var experimental_dGs = [];
186+
for (var i = 0; i < lines.length; i++) {
187+
var words = lines[i].split(" ");
188+
if (words.length > 2) {
189+
var experimental_dG = parseFloat(words[2]);
190+
experimental_dGs.push(experimental_dG);
191+
}
192+
}
193+
194+
if (experimental_dGs.length == 0) {
195+
throw new Error("Error! Experimental dGs are empty!");
196+
} else {
197+
return experimental_dGs;
198+
}
199+
}
200+
201+
$namespaces:
202+
edam: https://edamontology.org/
203+
204+
$schemas:
205+
- https://raw.githubusercontent.com/edamontology/edamontology/master/EDAM_dev.owl

docker/dockerBuild.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ sudo docker build --no-cache --pull -f Dockerfile_autodock_vina -t jakefennick/a
2323
sudo docker build --no-cache --pull -f Dockerfile_autodock_vina_filter -t jakefennick/autodock_vina_filter .
2424
sudo docker build --no-cache --pull -f Dockerfile_bash_scripts -t jakefennick/bash_scripts .
2525
sudo docker build --no-cache --pull -f Dockerfile_calculate_net_charge -t jakefennick/calculate_net_charge .
26-
sudo docker build --no-cache --pull -f Dockerfile_generate_conformers -t jakefennick/generate_conformers .
2726
sudo docker build --no-cache --pull -f Dockerfile_mol2_to_pdbqt -t jakefennick/mol2_to_pdbqt .
2827
sudo docker build --no-cache --pull -f Dockerfile_nmr4md -t jakefennick/nmr4md .
2928
sudo docker build --no-cache --pull -f Dockerfile_openbabel -t jakefennick/openbabel .
@@ -35,7 +34,8 @@ sudo docker build --no-cache --pull -f Dockerfile_onionnet-sfct -t cyangnyu/onio
3534
sudo docker build --no-cache --pull -f Dockerfile_smina -t cyangnyu/smina .
3635
sudo docker build --no-cache --pull -f Dockerfile_pdb_fixer -t ndonyapour/pdbfixer .
3736
sudo docker build --no-cache --pull -f Dockerfile_extract_protein -t ndonyapour/extract_protein .
38-
sudo docker build --no-cache --pull -f Dockerfile_extract_protein -t ndonyapour/fix_pdb_atom_column .
37+
sudo docker build --no-cache --pull -f Dockerfile_fix_pdb_atom_column -t ndonyapour/fix_pdb_atom_column .
38+
sudo docker build --no-cache --pull -f Dockerfile_generate_conformers -t ndonyapour/generate_conformers .
3939

4040
sudo docker build --no-cache --pull -f Dockerfile_pdbbind_refined -t pdbbind_refined_v2020 . # NOTE: no username
4141
cd ../..
@@ -45,4 +45,4 @@ sudo docker build --no-cache --pull -f Dockerfile_diffdock_cpu -t mrbrandonwalke
4545
sudo docker build --no-cache --pull -f Dockerfile_diffdock_gpu -t mrbrandonwalker/diffdock_gpu .
4646
sudo docker build --no-cache --pull -f Dockerfile_rmsd_pose_cluster -t mrbrandonwalker/rmsd_pose_cluster .
4747
sudo docker build --no-cache --pull -f Dockerfile_rank_diffdock_poses -t mrbrandonwalker/rank_diffdock_poses .
48-
cd ../..
48+
cd ../..

dockerPull.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ docker pull mrbrandonwalker/diffdock_gpu
2828
docker pull mrbrandonwalker/diffdock_cpu
2929
docker pull ndonyapour/pdbfixer
3030
docker pull ndonyapour/extract_protein
31-
docker pull ndonyapour/fix_pdb_atom_column
31+
docker pull ndonyapour/fix_pdb_atom_column
32+
docker pull ndonyapour/generate_conformers

examples/docking/download_smiles_ligand_db.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,22 @@ inputs:
1010
binding_data_column:
1111
type: string
1212
convert_Kd_dG:
13-
type: string
13+
type: boolean
1414
output_txt_path:
1515
type: string
1616

1717
outputs:
1818
output_txt_path:
1919
type: File
2020
format: edam:format_2330
21-
outputSource: download_smiles_ligand_db__step__2__python_script/output_txt_path
21+
outputSource: download_smiles_ligand_db__step__2__generate_conformers/output_txt_path
2222

2323
steps:
2424
- wget_xlsx:
2525
in:
2626
url: ~path
27-
- python_script:
27+
- generate_conformers:
2828
in:
29-
script: ../scripts/generate_conformers.py
30-
dockerPull: jakefennick/generate_conformers
3129
#input_excel_path: # inferred
3230
# query syntax: `column name` 'column value'
3331
query: ~query #"`Standard Type` == 'Kd' and `duplicate-type-classifier` == 'unique'"
@@ -47,7 +45,7 @@ wic:
4745
wic:
4846
graphviz:
4947
label: Download Excel File
50-
(2, python_script):
48+
(2, generate_conformers):
5149
wic:
5250
graphviz:
5351
label: Query Spreadsheet\nGenerate Conformers

examples/docking/vs_demo_2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ steps:
2424
max_row: 1 #25 # Use 1 for CI
2525
smiles_column: SMILES
2626
binding_data_column: Standard Value
27-
convert_Kd_dG: 'True'
27+
convert_Kd_dG: True
2828
output_txt_path: '&binding_data.txt'
2929

3030
- assign_partial_charges.yml:

examples/docking/vs_demo_3.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ steps:
2727
max_row: 1 #25 # Use 1 for CI
2828
smiles_column: SMILES
2929
binding_data_column: Standard Value
30-
convert_Kd_dG: 'True'
30+
convert_Kd_dG: True
3131
output_txt_path: '&binding_data.txt'
3232

3333
- ligand_modeling_docking.yml:

examples/scripts/Dockerfile_generate_conformers

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,4 @@ FROM condaforge/mambaforge
44
RUN mamba install -c conda-forge pandas rdkit openpyxl xorg-libxrender
55

66
ADD generate_conformers.py .
7-
ADD python_cwl_driver.py .
8-
ADD workflow_types.py .
9-
107
ADD Dockerfile_generate_conformers .

0 commit comments

Comments
 (0)