forked from wolberlab/OpenMMDL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigurePdbFile.html
More file actions
374 lines (322 loc) · 16.4 KB
/
configurePdbFile.html
File metadata and controls
374 lines (322 loc) · 16.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
{% extends "layout.html" %}
{% macro fileinput(id, accept="") %}
<div class="input-group om-filedrop" data-file-input="{{ id }}">
<label class="btn btn-default btn-file input-group-addon">
<span title="Select File"style=" font-weight: 700;">Browse... </span>
<input type="file" name="{{ id }}" id="{{ id }}" style="display: none" {% if accept %}accept="{{ accept }}"{% endif %} onchange="if (omValidateFileInput(this)) optionChanged()"/>
</label>
<span id="{{ id }}_label" class="form-control om-filedrop-label"></span>
</div>
{% endmacro %}
{% block title %}Select Input Files{% endblock %}
{% block body %}
</style>
Select the pdb input file and options for how to model it.
<p/>
<form method="post" enctype="multipart/form-data" action="{{ url_for('configureFiles') }}" class="form-horizontal">
<div class="form-group">
<label for="filename" class="control-label col-md-2">PDB File</label>
<div class="col-md-10">{{ fileinput('file', accept='.pdb') }}</div>
</div>
<div class="form-group">
<label for="forcefield" class="control-label col-md-2">Force Field</label>
<div class="col-md-10"><select name="forcefield" id="forcefield" class="form-control" title="CHARMM force field does not support ligands. Select Amber force fields for ligand-protein MD simulations" onchange="optionChanged()">
<option value="AMBER19" selected>AMBER19</option>
<option value="AMBER14">AMBER14</option>
<option value="AMBER99SB">AMBER99SB</option>
<option value="AMBER99SB-ILDN">AMBER99SB-ILDN</option>
<option value="AMBER03">AMBER03</option>
<option value="AMBER10">AMBER10</option>
<option value="CHARMM36">CHARMM36</option>
<option value="CHARMM2024">CHARMM36 2024</option>
</select></div>
</div>
<div id="waterModelRow" class="form-group">
<label for="waterModel" class="control-label col-md-2">Water Model</label>
<div class="col-md-10"><select name="waterModel" id="waterModel" class="form-control" title="TIP3P, TIP3P-FB and SPC/E are the most tested water models in OpenMMDL "></select></div>
</div>
<p>
Optional : Add ligand SDF file to the MD simulation (Default: No ligand)
</p>
<div class="form-group">
<label for="filename" class="control-label col-md-2">Ligand File</label>
<div class="col-md-10" title="The supported formats are SDF, MOL and MOL2"> {{ fileinput('sdfFile', accept='.sdf,.mol,.mol2') }}</div>
</div>
<div class="form-group">
<label for="smallMoleculeForceField" class="control-label col-md-2">Small Molecule Force Field</label>
<div class="col-md-10"><select name="smallMoleculeForceField" id="smallMoleculeForceField" class="form-control" title="Select the preferred small molecule force field" onchange="optionChanged()">
<option value="gaff" selected>GAFF</option>
<option value="smirnoff">SMIRNOFF</option>
</select></div>
</div>
<div id="gaffVersionRow" class="form-group" hidden>
<label for="gaffVersion" class="control-label col-md-2">GAFF Version</label>
<div class="col-md-10">
<select name="gaffVersion" id="gaffVersion" class="form-control" onchange="optionChanged()"></select>
</div>
</div>
<div id="smirnoffConstraintRow" class="form-group" hidden>
<label for="openffConstraint" class="control-label col-md-2">SMIRNOFF Mode</label>
<div class="col-md-10">
<select name="openffConstraint" id="openffConstraint" class="form-control" onchange="optionChanged()">
<option value="constrained" selected>Constrained</option>
<option value="unconstrained">Unconstrained</option>
</select>
</div>
</div>
<div id="smirnoffVersionRow" class="form-group" hidden>
<label for="openffVersion" class="control-label col-md-2">SMIRNOFF Version</label>
<div class="col-md-10">
<select name="openffVersion" id="openffVersion" class="form-control" onchange="optionChanged()"></select>
</div>
</div>
<div class="form-group">
<label for="ligandMinimization" class="control-label col-md-2">Ligand Minimization</label>
<div class="col-md-10"><select name="ligandMinimization" id="ligandMinimization" class="form-control" title="Minimize ligand with MMFF94 rdkit without protein" onchange="optionChanged()">
<option value="False" selected>No</option>
<option value="True">Yes</option>
</select></div>
</div>
<div class="form-group">
<label for="ligandSanitization" class="control-label col-md-2">
<span style=" font-weight: 700" title="Depending on the ligand the Sanitization can be required for OpenMM or may lead to errors in case of specific ligand substructures (example: Thiopene)"">Ligand Sanitization</span>
</label>
<div class="col-md-10"><select name="ligandSanitization" id="ligandSanitization" class="form-control" title="Sanitize ligand with rdkit" onchange="optionChanged()">
<option value="False" selected>No</option>
<option value="True">Yes</option>
</select></div>
</div>
<br/>
<button type="button" class="btn btn-default btn-back-red"
onclick="window.location.href='{{ url_for('showSelectFileType') }}'">Back</button>
<input type="submit" value="Continue" id="continue" class="btn" disabled="true"/>
</form>
<script>
var newAmberWaterModels = [
["TIP3P", "TIP3P", true],
["TIP3P-FB", "TIP3P-FB", false],
["SPC/E", "SPC/E", false],
["TIP4P-Ew", "TIP4P-Ew", false],
["TIP4P-FB", "TIP4P-FB", false],
["OPC3", "OPC3", false],
["OPC", "OPC", false],
]
var charmmWaterModels = [
["CHARMM default", "CHARMM default", true],
["TIP3P-PME-B", "TIP3P-PME-B", false],
["TIP3P-PME-F", "TIP3P-PME-F", false],
["SPC/E", "SPC/E", false],
["TIP4P-Ew", "TIP4P-Ew", false],
["TIP4P-2005", "TIP4P-2005", false],
["TIP5P", "TIP5P", false],
["TIP5P-Ew", "TIP5P-Ew", false],
]
var gaffVersions = [
["gaff-2.2.20", "GAFF 2.2.20", true],
["gaff-2.11", "GAFF 2.11", false],
["gaff-2.1", "GAFF 2.1", false],
["gaff-1.81", "GAFF 1.81", false],
["gaff-1.8", "GAFF 1.8", false],
["gaff-1.4", "GAFF 1.4", false],
]
var openffVersionsDefault = [
["openff_no_water-3.0.0-alpha0.offxml", "OpenFF 3.0 no water (ALPHA version – may be unstable)", false],
["openff-2.2.1.offxml", "OpenFF 2.2.1", true],
["openff-2.2.0.offxml", "OpenFF 2.2.0", false],
["openff-2.1.1.offxml", "OpenFF 2.1.1", false],
["openff-2.1.0.offxml", "OpenFF 2.1.0", false],
["openff-2.0.0.offxml", "OpenFF 2.0.0", false],
["openff-1.3.1.offxml", "OpenFF 1.3.1", false],
["openff-1.3.0.offxml", "OpenFF 1.3.0", false],
["openff-1.2.1.offxml", "OpenFF 1.2.1", false],
["openff-1.2.0.offxml", "OpenFF 1.2.0", false],
["openff-1.1.1.offxml", "OpenFF 1.1.1", false],
["openff-1.1.0.offxml", "OpenFF 1.1.0", false],
["openff-1.0.1.offxml", "OpenFF 1.0.1", false],
["openff-1.0.0.offxml", "OpenFF 1.0.0", false],
]
var openffVersionsUnconstrained = [
["openff_no_water_unconstrained-3.0.0-alpha0.offxml", "OpenFF 3.0 no water unconstrained (ALPHA version – may be unstable)", false],
["openff_unconstrained-2.2.1.offxml", "OpenFF 2.2.1 unconstrained", true],
["openff_unconstrained-2.2.0.offxml", "OpenFF 2.2.0 unconstrained", false],
["openff_unconstrained-2.1.1.offxml", "OpenFF 2.1.1 unconstrained", false],
["openff_unconstrained-2.1.0.offxml", "OpenFF 2.1.0 unconstrained", false],
["openff_unconstrained-2.0.0.offxml", "OpenFF 2.0.0 unconstrained", false],
["openff_unconstrained-1.3.1.offxml", "OpenFF 1.3.1 unconstrained", false],
["openff_unconstrained-1.3.0.offxml", "OpenFF 1.3.0 unconstrained", false],
["openff_unconstrained-1.2.1.offxml", "OpenFF 1.2.1 unconstrained", false],
["openff_unconstrained-1.2.0.offxml", "OpenFF 1.2.0 unconstrained", false],
["openff_unconstrained-1.1.1.offxml", "OpenFF 1.1.1 unconstrained", false],
["openff_unconstrained-1.1.0.offxml", "OpenFF 1.1.0 unconstrained", false],
["openff_unconstrained-1.0.1.offxml", "OpenFF 1.0.1 unconstrained", false],
["openff_unconstrained-1.0.0.offxml", "OpenFF 1.0.0 unconstrained", false],
]
var oldAmberWaterModels = [
["TIP3P", "TIP3P", true],
["TIP3P-FB", "TIP3P-FB", false],
["SPC/E", "SPC/E", false],
["TIP4P-Ew", "TIP4P-Ew", false],
["TIP5P", "TIP5P", false],
["OPC3", "OPC3", false],
["OPC", "OPC", false],
]
var amoebaWaterModels = [
["Explicit", "Explicit", true],
["Implicit", "Implicit", false]
]
function optionChanged() {
// Update UI elements.
// -------------------------
// Forcefield / Water model
// -------------------------
forcefield = document.getElementById("forcefield").value;
waterSelect = document.getElementById("waterModel");
// If you inject waterModel from the server, use it once; otherwise keep current selection
currentWater = waterSelect.value;
if (typeof waterModel !== "undefined" && waterModel) {
currentWater = waterModel;
}
if (forcefield == 'CHARMMPOLAR2019')
document.getElementById("waterModelRow").hidden = true;
else {
document.getElementById("waterModelRow").hidden = false;
if (forcefield == "AMBER14")
models = newAmberWaterModels;
else if (forcefield == "AMBER19")
models = newAmberWaterModels;
else if (forcefield == "CHARMM36")
models = charmmWaterModels;
else if (forcefield == "CHARMM2024")
models = charmmWaterModels;
else if (forcefield == "AMOEBA2018")
models = amoebaWaterModels;
else
models = oldAmberWaterModels;
while (waterSelect.length > 0)
waterSelect.remove(0);
for (i = 0; i < models.length; i++) {
option = document.createElement("option");
option.value = models[i][0];
option.text = models[i][1];
waterSelect.add(option);
}
for (i = 0; i < models.length; i++)
if (models[i][2])
waterSelect.selectedIndex = i;
for (i = 0; i < models.length; i++)
if (currentWater == models[i][0])
waterSelect.selectedIndex = i;
}
// clear injected waterModel so user changes persist
if (typeof waterModel !== "undefined" && waterModel) {
waterModel = "";
}
// -------------------------------------
// Small molecule FF + versions handling
// -------------------------------------
smffSelect = document.getElementById("smallMoleculeForceField");
// If you inject smallMoleculeForceField from the server, apply once
if (smffSelect && typeof smallMoleculeForceField !== "undefined" && smallMoleculeForceField) {
smffSelect.value = smallMoleculeForceField;
smallMoleculeForceField = "";
}
// If nothing is selected (empty), force the HTML default
if (smffSelect && !smffSelect.value)
smffSelect.value = "gaff";
if (smffSelect) {
smff = smffSelect.value;
gaffVersionRow = document.getElementById("gaffVersionRow");
smirnoffConstraintRow = document.getElementById("smirnoffConstraintRow");
smirnoffVersionRow = document.getElementById("smirnoffVersionRow");
gaffVersionSelect = document.getElementById("gaffVersion");
openffConstraintSelect = document.getElementById("openffConstraint");
openffVersionSelect = document.getElementById("openffVersion");
if (smff == "gaff") {
if (gaffVersionRow) gaffVersionRow.hidden = false;
if (smirnoffConstraintRow) smirnoffConstraintRow.hidden = true;
if (smirnoffVersionRow) smirnoffVersionRow.hidden = true;
if (gaffVersionSelect) {
// Use injected smallMoleculeForceFieldVersion once if present; otherwise preserve current selection
currentGaff = gaffVersionSelect.value;
if (typeof smallMoleculeForceFieldVersion !== "undefined" && smallMoleculeForceFieldVersion)
currentGaff = smallMoleculeForceFieldVersion;
models = gaffVersions;
while (gaffVersionSelect.length > 0)
gaffVersionSelect.remove(0);
for (i = 0; i < models.length; i++) {
option = document.createElement("option");
option.value = models[i][0];
option.text = models[i][1];
gaffVersionSelect.add(option);
}
for (i = 0; i < models.length; i++)
if (models[i][2])
gaffVersionSelect.selectedIndex = i;
for (i = 0; i < models.length; i++)
if (currentGaff == models[i][0])
gaffVersionSelect.selectedIndex = i;
}
// clear injected version so user changes persist
if (typeof smallMoleculeForceFieldVersion !== "undefined" && smallMoleculeForceFieldVersion) {
smallMoleculeForceFieldVersion = "";
}
} else if (smff == "smirnoff") {
if (gaffVersionRow) gaffVersionRow.hidden = true;
if (smirnoffConstraintRow) smirnoffConstraintRow.hidden = false;
if (smirnoffVersionRow) smirnoffVersionRow.hidden = false;
// If we have an injected OpenFF version, set constrained/unconstrained automatically once
if (openffConstraintSelect && typeof smallMoleculeForceFieldVersion !== "undefined" && smallMoleculeForceFieldVersion) {
if (smallMoleculeForceFieldVersion.indexOf("unconstrained") != -1)
openffConstraintSelect.value = "unconstrained";
else
openffConstraintSelect.value = "constrained";
}
mode = "constrained";
if (openffConstraintSelect)
mode = openffConstraintSelect.value;
if (mode == "unconstrained")
models = openffVersionsUnconstrained;
else
models = openffVersionsDefault;
if (openffVersionSelect) {
// Use injected smallMoleculeForceFieldVersion once if present; otherwise preserve current selection
currentOpenff = openffVersionSelect.value;
if (typeof smallMoleculeForceFieldVersion !== "undefined" && smallMoleculeForceFieldVersion)
currentOpenff = smallMoleculeForceFieldVersion;
while (openffVersionSelect.length > 0)
openffVersionSelect.remove(0);
for (i = 0; i < models.length; i++) {
option = document.createElement("option");
option.value = models[i][0];
option.text = models[i][1];
openffVersionSelect.add(option);
}
for (i = 0; i < models.length; i++)
if (models[i][2])
openffVersionSelect.selectedIndex = i;
for (i = 0; i < models.length; i++)
if (currentOpenff == models[i][0])
openffVersionSelect.selectedIndex = i;
}
// clear injected version so user changes persist
if (typeof smallMoleculeForceFieldVersion !== "undefined" && smallMoleculeForceFieldVersion) {
smallMoleculeForceFieldVersion = "";
}
} else {
if (gaffVersionRow) gaffVersionRow.hidden = true;
if (smirnoffConstraintRow) smirnoffConstraintRow.hidden = true;
if (smirnoffVersionRow) smirnoffVersionRow.hidden = true;
}
}
// -------------------------
// File labels + submit state
// -------------------------
files = document.getElementById("file").files;
sdfFile = document.getElementById("sdfFile").files;
document.getElementById("file_label").textContent = (files.length == 0 ? "" : files[0].name);
document.getElementById("sdfFile_label").textContent = (sdfFile.length == 0 ? "" : sdfFile[0].name);
document.getElementById('continue').disabled = !document.getElementById("file").value;
}
optionChanged();
</script>
{% endblock %}