Skip to content

Instantly share code, notes, and snippets.

@leelasd
Created October 16, 2017 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leelasd/185f9bc3ea80e062ca4aa3dcc7468310 to your computer and use it in GitHub Desktop.
Save leelasd/185f9bc3ea80e062ca4aa3dcc7468310 to your computer and use it in GitHub Desktop.
Simulation of Benzene in TIP4P waterbox with OpenMM
from __future__ import print_function
from simtk.openmm import app
import simtk.openmm as mm
from simtk import unit
from sys import stdout
# load in input PDB file and force field XML files
pdb = app.PDBFile('BNZ_7D0AA7.pdb')
forcefield = app.ForceField('BNZ_7D0AA7.xml', 'tip4pew.xml')
# use app.Modeller to add hydrogens, extra particles, and solvent
modeller = app.Modeller(pdb.topology, pdb.positions)
modeller.addSolvent(forcefield, model='tip4pew', padding=1.0*unit.nanometers)
app.PDBFile.writeFile(modeller.topology, modeller.positions, open('1o9s_modeller_tip4pew.pdb', 'w'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment