Skip to content

Commit

Permalink
Minor patch
Browse files Browse the repository at this point in the history
  • Loading branch information
JLittlef committed Feb 15, 2024
1 parent 6fce30b commit 97f5783
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
22 changes: 14 additions & 8 deletions bin/openmm-runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
3 changes: 2 additions & 1 deletion bin/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 97f5783

Please sign in to comment.