"openmmapi/vscode:/vscode.git/clone" did not exist on "d2a5d7e40990be7c8b9764aa0366da05443badc9"
simulatePdb.py 728 Bytes
Newer Older
Peter Eastman's avatar
Peter Eastman committed
1
2
3
from simtk.openmm.app import *
from simtk.openmm import *
from simtk.unit import *
4
from sys import stdout
Peter Eastman's avatar
Peter Eastman committed
5
6

pdb = PDBFile('input.pdb')
7
forcefield = ForceField('amber14-all.xml', 'amber14/tip3pfb.xml')
Peter Eastman's avatar
Peter Eastman committed
8
system = forcefield.createSystem(pdb.topology, nonbondedMethod=PME, nonbondedCutoff=1*nanometer, constraints=HBonds)
9
integrator = BAOABLangevinIntegrator(300*kelvin, 1/picosecond, 0.002*picoseconds)
Peter Eastman's avatar
Peter Eastman committed
10
11
12
13
simulation = Simulation(pdb.topology, system, integrator)
simulation.context.setPositions(pdb.positions)
simulation.minimizeEnergy()
simulation.reporters.append(PDBReporter('output.pdb', 1000))
14
simulation.reporters.append(StateDataReporter(stdout, 1000, step=True, potentialEnergy=True, temperature=True))
15
simulation.step(10000)