From 93953cec30011ab08526a8976a608b035c644b1a Mon Sep 17 00:00:00 2001 From: Valerij Talagayev <82884038+talagayev@users.noreply.github.com> Date: Fri, 9 Aug 2024 13:48:06 +0200 Subject: [PATCH] Create setup_options.py Added File and Class to move default configuration settings from openmmdl setup --- openmmdl/openmmdl_setup/setup_options.py | 68 ++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 openmmdl/openmmdl_setup/setup_options.py diff --git a/openmmdl/openmmdl_setup/setup_options.py b/openmmdl/openmmdl_setup/setup_options.py new file mode 100644 index 00000000..a2fd10d5 --- /dev/null +++ b/openmmdl/openmmdl_setup/setup_options.py @@ -0,0 +1,68 @@ + + +class SimulationOptionsConfigurator: + def __init__(self, session): + self.session = session + + def configure_default_options(self): + """Select default options based on the file format and force field.""" + implicitWater = False + self.session["restart_checkpoint"] = False + self.session["mdtraj_output"] = "mdtraj_pdb_dcd" + self.session["mdtraj_removal"] = "False" + self.session["mda_output"] = "mda_pdb_dcd" + self.session["mda_selection"] = "mda_prot_lig_all" + self.session["openmmdl_analysis"] = "No" + self.session["analysis_selection"] = "analysis_all" + self.session["binding_mode"] = "40" + self.session["min_transition"] = "1" + self.session["rmsd_diff"] = "No" + self.session["pml_generation"] = "True" + self.session["stable_water"] = "Yes" + self.session["wc_distance"] = "1.0" + + if self.session["fileType"] == "pdb" and self.session["waterModel"] == "implicit": + implicitWater = True + + self.session["ensemble"] = "nvt" if implicitWater else "npt" + self.session["platform"] = "CUDA" + self.session["precision"] = "mixed" + self.session["cutoff"] = "2.0" if implicitWater else "1.0" + self.session["ewaldTol"] = "0.0005" + self.session["constraintTol"] = "0.000001" + self.session["hmr"] = True + self.session["hmrMass"] = "1.5" + self.session["dt"] = "0.002" + self.session["sim_length"] = "30" + self.session["equilibration"] = "equilibration" + self.session["temperature"] = "300" + self.session["friction"] = "1.0" + self.session["pressure"] = "1.0" + self.session["barostatInterval"] = "25" + self.session["nonbondedMethod"] = "CutoffNonPeriodic" if implicitWater else "PME" + self.session["writeDCD"] = True + self.session["dcdFilename"] = "trajectory.dcd" + self.session["dcdFrames"] = "1000" + self.session["pdbInterval_ns"] = "10" + self.session["writeData"] = True + self.session["dataFilename"] = "log.txt" + self.session["dataInterval"] = "1000" + self.session["dataFields"] = [ + "step", + "speed", + "progress", + "potentialEnergy", + "temperature", + ] + self.session["writeCheckpoint"] = True + self.session["checkpointFilename"] = "checkpoint.chk" + self.session["checkpointInterval_ns"] = "0.02" + self.session["writeSimulationXml"] = False + self.session["systemXmlFilename"] = "system.xml" + self.session["integratorXmlFilename"] = "integrator.xml" + self.session["writeFinalState"] = False + self.session["finalStateFileType"] = "stateXML" + self.session["finalStateFilename"] = "final_state.xml" + self.session["constraints"] = "hbonds" + self.session["rmsd"] = "True" + self.session["md_postprocessing"] = "True"