Skip to content

Instantly share code, notes, and snippets.

@leelasd
Created October 15, 2017 04:06
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/278e88a3f1ac626b1faf252f8c2e374f to your computer and use it in GitHub Desktop.
Save leelasd/278e88a3f1ac626b1faf252f8c2e374f to your computer and use it in GitHub Desktop.
Serialize Parmed System
structure = parmed.openmm.topsystem.load_topology( pdbfile.topology, system, pdbfile.positions)
structure.save('system.prmtop', overwrite=True)
structure.save('system.crd', format='rst7', overwrite=True)
parm = parmed.load_file('system.prmtop', 'system.crd')
ambersys = parm.createSystem(nonbondedMethod= app.NoCutoff, constraints = None, implicitSolvent = None)
from simtk.openmm import XmlSerializer
serialized_system_amber = XmlSerializer.serialize(ambersys)
outfile = open('amber_system.xml','w')
outfile.write(serialized_system_amber)
outfile.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment