File: simulateCharmm.py

package info (click to toggle)
openmm 8.1.2%2Bdfsg-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 119,192 kB
  • sloc: xml: 377,325; cpp: 226,673; ansic: 42,767; python: 32,634; lisp: 2,441; sh: 440; makefile: 254; f90: 233; csh: 19
file content (33 lines) | stat: -rw-r--r-- 1,172 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from openmm.app import *
from openmm import *
from openmm.unit import *
from sys import stdout

# Read the PSF
psf = CharmmPsfFile('ala_ala_ala.psf')

# Get the coordinates from the PDB
pdb = PDBFile('ala_ala_ala.pdb')

# Load the parameter set.
params = CharmmParameterSet('charmm22.rtf', 'charmm22.par')

# NOTICE:
# -------
# The CHARMM 22 parameter set is out-of-date and NOT recommended for general
# use. It is included here as an illustrative example, but for production
# simulations you should download the latest versions of the force fields at
# http://mackerell.umaryland.edu/CHARMM_ff_params.html

# Instantiate the system
system = psf.createSystem(params, nonbondedMethod=NoCutoff, constraints=HBonds)
integrator = LangevinMiddleIntegrator(300*kelvin, 1/picosecond, 0.004*picoseconds)
simulation = Simulation(psf.topology, system, integrator)
simulation.context.setPositions(pdb.getPositions())
simulation.minimizeEnergy()
simulation.reporters.append(PDBReporter('ch_output.pdb', 1000))
simulation.reporters.append(
        StateDataReporter(stdout, 1000, step=True, potentialEnergy=True,
                          temperature=True)
)
simulation.step(10000)