From 97f5783c38cfdf4ef86cc10540e471f5135bad37 Mon Sep 17 00:00:00 2001 From: Josh D Littlefair Date: Thu, 15 Feb 2024 12:50:59 +0000 Subject: [PATCH] Minor patch --- bin/openmm-runner.py | 22 ++++++++++++++-------- bin/plot.py | 3 ++- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/bin/openmm-runner.py b/bin/openmm-runner.py index 5da1f9c..a027c15 100755 --- a/bin/openmm-runner.py +++ b/bin/openmm-runner.py @@ -10,21 +10,27 @@ modeller = Modeller(pdb.topology, pdb.positions) modeller.deleteWater() residues=modeller.addHydrogens(forcefield) -modeller.addSolvent(forcefield, numAdded=sys.argv[4]) +solvmol=int(sys.argv[4]) +modeller.addSolvent(forcefield, numAdded=solvmol) system = forcefield.createSystem(modeller.topology, nonbondedMethod=PME, nonbondedCutoff=1.0*nanometer, constraints=HBonds) -integrator = LangevinMiddleIntegrator(sys.argv[2]*kelvin, 1/picosecond, 0.004*picoseconds) +temp=int(sys.argv[2]) +integrator = LangevinMiddleIntegrator(temp*kelvin, 1/picosecond, 0.004*picoseconds) simulation = Simulation(modeller.topology, system, integrator) simulation.context.setPositions(modeller.positions) print("Minimizing energy") simulation.minimizeEnergy() print("Running NVT") -simulation.reporters.append(PDBReporter(sys.argv[8], sys.argv[7])) -simulation.reporters.append(StateDataReporter(stdout, sys.argv[7], step=True, +reprate=int(sys.argv[7]) +simulation.reporters.append(PDBReporter(sys.argv[8], reprate)) +simulation.reporters.append(StateDataReporter(stdout, reprate, step=True, potentialEnergy=True, temperature=True, volume=True)) -simulation.reporters.append(StateDataReporter(sys.argv[9], sys.argv[7], step=True, +simulation.reporters.append(StateDataReporter(sys.argv[9], reprate, step=True, potentialEnergy=True, temperature=True, volume=True)) -simulation.step(sys.argv[5]) -system.addForce(MonteCarloBarostat(sys.argv[3]*bar, sys.argv[2]*kelvin)) +nvtsteps=int(sys.argv[5]) +pres=sys.argv[3] +simulation.step(nvtsteps) +system.addForce(MonteCarloBarostat(pres*bar, temp*kelvin)) simulation.context.reinitialize(preserveState=True) print("Running NPT") -simulation.step(sys.argv[6]) +nptsteps=int(sys.argv[6]) +simulation.step(nptsteps) diff --git a/bin/plot.py b/bin/plot.py index 8246335..9d3c8b1 100755 --- a/bin/plot.py +++ b/bin/plot.py @@ -8,7 +8,8 @@ potential_energy = data[:,1] temperature = data[:,2] volume = data[:,3] -clipped_step = (data[:,0] > sys.argv[2]) +skipsteps = int(sys.argv[2]) +clipped_step = (data[:,0] > skipsteps) clipped_data = data[clipped_step] clipped_pe = np.array(clipped_data[0:,1])