3131 "amber14,None" : ['amber14-all.xml' ],
3232 "charmm36,None" : ['charmm36.xml' ],
3333 "amoeba,None" : ['amoeba2018.xml' ],
34- "amber19,None" : ['amber19-all.xml' ]
34+ "amber19,None" : ['amber19-all.xml' ],
35+ "amber19,implicit" : ['amber19-all.xml' , 'implicit/gbn2.xml' ],
36+ "amber14,implicit" : ['amber14-all.xml' , 'implicit/gbn2.xml' ],
37+ "charmm36,implicit" : ['charmm36.xml' , 'implicit/gbn2.xml' ],
38+ "amoeba,implicit" : ['amoeba2018.xml' , 'amoeba2009_gk.xml' ],
3539}
3640
3741
3842def make_forcefield (ff , solvent = None ):
3943 if ff + "," + str (solvent ) not in ff_lookup .keys ():
44+ err = "Solvent " + str (solvent )+ " not in list of available solvents."
4045 validff = set ([item [0 ] for item in list (
4146 map (methodcaller ("split" , "," ), ff_lookup .keys ()))])
4247 validsolvent = set ([item [1 ] for item in list (
4348 map (methodcaller ("split" , "," ), ff_lookup .keys ()))])
44- err = "Please pick a valid force field and solvent.\n "
49+ err + = "Please pick a valid force field and solvent.\n "
4550 err += "Valid force fields are " + str (validff )+ "\n "
4651 err += "Valid solvents are " + str (validsolvent )+ "\n "
4752 raise ValueError (err )
@@ -64,8 +69,8 @@ def check_platforms():
6469
6570def test_sim (pdb ):
6671 run (pdb , minimised_structure_out = pdb , md_steps = None ,
67- integrator = "LangevinMiddleIntegrator" , solvent = None ,
68- pressure = None , test_sim_steps = 50 )
72+ integrator = "LangevinMiddleIntegrator" ,
73+ pressure = None , test_sim_steps = 250 )
6974
7075
7176def run (pdb ,
@@ -84,7 +89,7 @@ def run(pdb,
8489 test_run = True ,
8590 fix_backbone = False ,
8691 constraints = "Default" , # Default, None, HBonds
87- solvent = "tip4pew " ,
92+ solvent = "implicit " ,
8893 strip_solvent = False ,
8994 ionic_strength = 0.1 * molar ,
9095 pressure = 1 * bar ,
@@ -133,7 +138,8 @@ def run(pdb,
133138 None, HBonds. By default, HBonds will be constrained if the backbone
134139 is not fixed. A string.
135140 solvent - solvent to use. Possible values: None (no solvent), tip3p,
136- tip4pew, spce. A string.
141+ tip4pew, spce, implicit (gbn model, equivalent to AMBER igb=8). A
142+ string.
137143 write_solvent: whether to write solvent atoms to the minimised
138144 structure file. Solvent will always be written to the trajectory. A
139145 bool.
@@ -195,7 +201,7 @@ def run(pdb,
195201 "running a solvated simulation instead." )
196202
197203 if not solvent :
198- print ("WARNING: No solvent" )
204+ print ("WARNING: No solvent. Minimised structures may be wrong!!! " )
199205
200206 # read in mmcif or pdb
201207 if ".cif" in pdb or ".mmcif" in pdb :
@@ -209,7 +215,7 @@ def run(pdb,
209215
210216 forcefield = make_forcefield (forcefield , solvent )
211217
212- if solvent :
218+ if solvent and solvent != "implicit" :
213219 print ("Solvating system..." )
214220 modeller .addSolvent (forcefield , model = solvent ,
215221 ionicStrength = ionic_strength ,
@@ -231,7 +237,7 @@ def run(pdb,
231237
232238 # setup non bonded method - if none is chosen, select based on box
233239 if non_bonded_method == "Default" :
234- if solvent is None :
240+ if solvent == None or solvent == "implicit" :
235241 non_bonded_method = CutoffNonPeriodic
236242 else :
237243 non_bonded_method = PME
@@ -282,6 +288,9 @@ def run(pdb,
282288 raise ValueError ("Integrator must be one of: "
283289 "VariableLangevinIntegrator,"
284290 " LangevinMiddleIntegrator" )
291+
292+ # TODO: create metadynamics object here
293+
285294 simulation = Simulation (modeller .topology , system , integrator )
286295 simulation .context .setPositions (modeller .positions )
287296
@@ -336,6 +345,8 @@ def run(pdb,
336345 " minimisation and test run were both skipped." )
337346
338347 if md_steps and traj_out :
348+ # todo: if metadynamics, add rmsd reporter here
349+
339350 if ".dcd" in traj_out .lower ():
340351 simulation .reporters .append (DCDReporter (traj_out , step ))
341352 elif ".xtc" in traj_out .lower ():
@@ -350,6 +361,9 @@ def run(pdb,
350361 step , step = True ,
351362 potentialEnergy = True ,
352363 temperature = True ))
364+
365+ # TODO: if metadynamics, do meta.step here
366+
353367 print ("Running production MD..." )
354368 simulation .step (md_steps )
355369 simulation .saveCheckpoint (checkpoint_output )
@@ -394,7 +408,7 @@ def entry_point():
394408 help = "Fix the backbone" , action = "store_true" )
395409 parser .add_argument ("-c" , "--constraints" , help = "Constraints to apply. Possible values: None, HBonds. Constraining HBonds can make simulations run faster, at the cost of some accuracy. You can't constrain HBonds if you're also fixing the backbone, for obvious reasons." , default = "Default" )
396410 parser .add_argument (
397- "-solv" , "--solvent" , help = "Solvent to use. Possible values: tip3p, tip4pew, spce. If no solvent is specified, none will be used." , default = None )
411+ "-solv" , "--solvent" , help = "Solvent to use. Possible values: tip3p, tip4pew, spce, implicit (GBn model, equivalent to AMBER igb=8) . If no solvent is specified, implicit will be used." , default = "implicit" )
398412 parser .add_argument ("-ns" , "--strip_solvent" ,
399413 help = "Don't write solvent molecules to the minimised output file" , action = "store_true" )
400414 parser .add_argument ("-ion" , "--ionic_strength" ,
0 commit comments