@@ -134,23 +134,29 @@ def save_geometry(self, fmt='xyz'):
134
134
isicle .io .save (geomfile , self .geom )
135
135
self .geom .path = geomfile
136
136
137
- def _configure_xtb (self , forcefield = 'gfn2' , optlevel = 'normal' , charge = None , solvation = None ):
137
+ def _configure_xtb (self , forcefield = 'gfn2' , optlevel = 'normal' , charge = 0 , solvation = None ,
138
+ ignore_topology = False , cycles = None , dryrun = False ):
138
139
"""
139
140
Set command line for xtb simulations.
140
141
141
142
Parameters
142
143
----------
143
144
forcefield : str
144
- GFN forcefield for the optimization
145
- Default: gff
146
- Supported forcefields: gfn2, gfn1, gff
145
+ GFN forcefield for the optimization.
146
+ Supported : gfn2, gfn1, gff
147
147
optlevel : str
148
- Optimization convergence level
149
- Default : normal
148
+ Optimization convergence level.
150
149
Supported : crude, sloppy, loose, lax, normal, tight, vtight extreme
151
150
charge : int
152
151
Charge of molecular system.
153
- Default : 0 (Neutral charge)
152
+ solvation : str
153
+ Specify solvent for simulation.
154
+ ignore_topolgy : bool
155
+ Turn off only the initial topology check prior to the conformational search.
156
+ cycles : int
157
+ Maximum number of optimization cycles.
158
+ dryrun : bool
159
+ Signal whether to perform a dry run.
154
160
155
161
"""
156
162
@@ -166,55 +172,69 @@ def _configure_xtb(self, forcefield='gfn2', optlevel='normal', charge=None, solv
166
172
# Add forcefield
167
173
s += '--' + forcefield + ' '
168
174
169
- # Add optional charge
175
+ # Add charge
170
176
if charge is not None :
171
- s += '--chrg ' + charge + ' '
177
+ s += '--chrg ' + str (charge ) + ' '
178
+
179
+ # Add dryrun option
180
+ if dryrun :
181
+ s += '--dryrun '
172
182
173
183
# Add optional implicit solvation
174
184
if solvation is not None :
175
185
s += '--alpb ' + solvation + ' '
176
186
187
+ if ignore_topology :
188
+ s += '--noreftopo '
189
+
190
+ if cycles :
191
+ s += '--cycles ' + str (cycles ) + ' '
192
+
177
193
# Add output
178
194
s += '&>' + ' '
179
195
180
196
s += '{}.{}' .format (self .basename , "out" )
181
197
return s
182
198
183
- def _configure_crest (self , ewin = 6 , optlevel = 'Normal' , forcefield = 'gfn2' ,
199
+ def _configure_crest (self , forcefield = 'gfn2' , optlevel = 'Normal' , ewin = 6 ,
184
200
protonate = False , deprotonate = False , tautomerize = False ,
185
- ion = None , charge = None , dryrun = False , processes = 1 ,
186
- solvation = None , ignore_topology = False ):
201
+ ion = None , charge = None , solvation = None , ignore_topology = False ,
202
+ cycles = None , dryrun = False , processes = 1 ):
187
203
"""
188
204
Set command line for crest simulations.
189
205
190
206
Parameters
191
207
----------
192
- ewin : int
193
- Energy window (kcal/mol) for conformer, (de)protomer, or tautomer search.
194
- Default : 6
208
+ forcefield : str
209
+ GFN forcefield for the optimization
210
+ Supported : gfn2, gfn1, gff
195
211
optlevel : str
196
212
Optimization convergence level
197
- Default : normal
198
213
Supported : crude, sloppy, loose, lax, normal, tight, vtight extreme
199
- forcefield : str
200
- GFN forcefield for the optimization
201
- Default: gff
202
- Supported forcefields: gfn2, gfn1, gff
214
+ ewin : int
215
+ Energy window (kcal/mol) for conformer, (de)protomer, or tautomer search.
203
216
protonate : bool
204
217
Signal to initiate protomer search. Suggested ewin = 30.
205
- Default : False
206
218
deprotonate : bool
207
219
Signal to initiate deprotonated conformers. Suggesting ewin = 30.
208
- Default : False
209
- tautomer : bool
220
+ tautomerize : bool
210
221
Signal to initiate tautomer search.
211
- Default : False
212
222
ion : str
213
223
Keyword to couple with protonate to ionize molecule with an ion other than a proton.
214
224
See :obj:`~isicle.adduct.parse_ion` for list of ion options.
215
225
charge : int
216
226
Charge of molecular system.
217
- Default : 0 (Neutral charge)
227
+ solvation : str
228
+ Specify solvent for simulation.
229
+ ignore_topolgy : bool
230
+ Turn off only the initial topology check prior to the conformational search.
231
+ cycles : int
232
+ Maximum number of optimization cycles.
233
+ dryrun : bool
234
+ Signal whether to perform a dry run.
235
+ processes : int
236
+ Number of parallel processes.
237
+
218
238
"""
219
239
220
240
# Start base command
@@ -237,8 +257,9 @@ def _configure_crest(self, ewin=6, optlevel='Normal', forcefield='gfn2',
237
257
if ion is not None :
238
258
s += '-swel ' + ion + ' '
239
259
260
+ # Add charge
240
261
if charge is not None :
241
- s += '-chrg ' + str (charge ) + ' '
262
+ s += '-- chrg ' + str (charge ) + ' '
242
263
243
264
# Add dryrun option
244
265
if dryrun :
@@ -263,6 +284,9 @@ def _configure_crest(self, ewin=6, optlevel='Normal', forcefield='gfn2',
263
284
if ignore_topology :
264
285
s += '--noreftopo '
265
286
287
+ if cycles :
288
+ s += '--cycles ' + str (cycles ) + ' '
289
+
266
290
# Add output
267
291
s += '&>' + ' '
268
292
@@ -272,34 +296,39 @@ def _configure_crest(self, ewin=6, optlevel='Normal', forcefield='gfn2',
272
296
273
297
return s
274
298
275
- def configure (self , task = 'optimize' , forcefield = 'gfn2' , charge = None ,
276
- ewin = 6 , ion = None , optlevel = 'Normal' , dryrun = False , processes = 1 ,
277
- solvation = None , ignore_topology = False ):
299
+ def configure (self , task = 'optimize' , forcefield = 'gfn2' , optlevel = 'Normal' ,
300
+ ewin = 6 , charge = None , ion = None , solvation = None ,
301
+ ignore_topology = False , cycles = None , dryrun = False , processes = 1 ):
278
302
"""
279
303
Generate command line
280
304
281
305
Parameters
282
306
----------
283
- tasks : str
307
+ task : str
284
308
Set task to "optimize", "conformer", "protonate", "deprotonate", or "tautomerize".
285
- Default : "optimize"
286
309
forcefield : str
287
310
GFN forcefield for the optimization
288
- Default: gff
289
- Supported forcefields: gfn2, gfn1, gff
290
- ewin : int
291
- Energy window (kcal/mol) for conformer(set to 6), (de)protomer(set to 30), or tautomer(set to 30) search.
292
- Default : 6
293
- ion : str
294
- Ion for protomer calculation.
311
+ Supported : gfn2, gfn1, gff
295
312
optlevel : str or list of str
296
313
Set optimization level. Supply globally or per task.
314
+ ewin : int
315
+ Energy window (kcal/mol) for conformer(set to 6), (de)protomer(set to 30), or tautomer(set to 30) search
316
+ charge : int
317
+ Charge of molecular system.
297
318
ion : str
298
319
Keyword to couple with protonate to ionize molecule with an ion other than a proton.
299
320
See :obj:`~isicle.adduct.parse_ion` for list of ion options.
300
- charge : int
301
- Charge of molecular system.
302
- Default : 0 (Neutral charge)
321
+ solvation : str
322
+ Specify solvent for simulation.
323
+ ignore_topolgy : bool
324
+ Turn off only the initial topology check prior to the conformational search.
325
+ cycles : int
326
+ Maximum number of optimization cycles.
327
+ dryrun : bool
328
+ Signal whether to perform a dry run.
329
+ processes : int
330
+ Number of parallel processes.
331
+
303
332
"""
304
333
305
334
if type (task ) == list :
@@ -311,7 +340,12 @@ def configure(self, task='optimize', forcefield='gfn2', charge=None,
311
340
312
341
if task == 'optimize' :
313
342
config = self ._configure_xtb (optlevel = optlevel ,
314
- forcefield = forcefield )
343
+ forcefield = forcefield ,
344
+ charge = charge ,
345
+ dryrun = dryrun ,
346
+ solvation = solvation ,
347
+ ignore_topology = ignore_topology ,
348
+ cycles = cycles )
315
349
316
350
else :
317
351
if task == 'conformer' :
@@ -338,7 +372,8 @@ def configure(self, task='optimize', forcefield='gfn2', charge=None,
338
372
dryrun = dryrun ,
339
373
processes = processes ,
340
374
solvation = solvation ,
341
- ignore_topology = ignore_topology )
375
+ ignore_topology = ignore_topology ,
376
+ cycles = cycles )
342
377
else :
343
378
raise Error (
344
379
'Task not assigned properly, please choose optimize, conformer, protonate, deprotonate, or tautomerize' )
@@ -369,7 +404,6 @@ def finish(self):
369
404
self .temp_dir , self .basename + '.out' ))
370
405
371
406
result = parser .parse ()
372
-
373
407
self .__dict__ .update (result )
374
408
375
409
for i in self .geom :
@@ -385,9 +419,9 @@ def finish(self):
385
419
else :
386
420
self .geom = self .geom [0 ]
387
421
388
- def run (self , geom , task = 'optimize' , forcefield = 'gfn2' , charge = None ,
389
- ewin = 6 , ion = None , optlevel = 'Normal' , dryrun = False , processes = 1 ,
390
- solvation = None , ignore_topology = False ):
422
+ def run (self , geom , task = 'optimize' , forcefield = 'gfn2' , optlevel = 'Normal' ,
423
+ ewin = 6 , charge = None , ion = None , solvation = None , ignore_topology = False ,
424
+ cycles = None , dryrun = False , processes = 1 ):
391
425
"""
392
426
Optimize geometry via density functional theory using supplied functional
393
427
and basis set.
@@ -396,21 +430,29 @@ def run(self, geom, task='optimize', forcefield='gfn2', charge=None,
396
430
----------
397
431
geom : :obj:`~isicle.geometry.Geometry`
398
432
Molecule representation.
399
- tasks : str
433
+ task : str
400
434
Set task to "optimize", "conformer", "protonate", "deprotonate", or "tautomerize".
401
435
forcefield : str
402
436
GFN forcefield for the optimization, including "gfn2", "gfn1", "gff".
403
- ewin : int
404
- Energy window (kcal/mol) for conformer(set to 6), (de)protomer(set to 30), or tautomer(set to 30) search.
405
- ion : str
406
- Ion for protomer calculation.
407
437
optlevel : str or list of str
408
438
Set optimization level. Supply globally or per task.
439
+ ewin : int
440
+ Energy window (kcal/mol) for conformer(set to 6), (de)protomer(set to 30), or tautomer(set to 30) search.
441
+ charge : int
442
+ Charge of molecular system.
409
443
ion : str
410
444
Keyword to couple with protonate to ionize molecule with an ion other than a proton.
411
445
See :obj:`~isicle.adduct.parse_ion` for list of ion options.
412
- charge : int
413
- Charge of molecular system. Defaults to 0 (neutral).
446
+ solvation : str
447
+ Specify solvent for simulation.
448
+ ignore_topolgy : bool
449
+ Turn off only the initial topology check prior to the conformational search.
450
+ cycles : int
451
+ Maximum number of optimization cycles.
452
+ dryrun : bool
453
+ Signal whether to perform a dry run.
454
+ processes : int
455
+ Number of parallel processes.
414
456
415
457
Returns
416
458
-------
@@ -428,7 +470,7 @@ def run(self, geom, task='optimize', forcefield='gfn2', charge=None,
428
470
# Configure
429
471
self .configure (task = task , forcefield = forcefield , charge = charge ,
430
472
ewin = ewin , ion = ion , optlevel = optlevel , dryrun = dryrun , processes = processes ,
431
- solvation = solvation , ignore_topology = ignore_topology )
473
+ solvation = solvation , ignore_topology = ignore_topology , cycles = cycles )
432
474
433
475
# Run QM simulation
434
476
self .submit ()
0 commit comments