chem: collection of mostly python code for molecular visualization, QM/MM, FEP, etc. Very long-term goal is something like enzyme design. Intended for interactive use from standard python prompt.

Major features:

  • 3D visualization of molecular geometry, orbitals, ESP, etc.
  • fast OpenGL volume and isosurface rendering
  • oriented toward analysis and debugging of calculations rather than presentation
  • QM/MM driver supporting electrostatic embedding with various charge shifting schemes
  • DLC/HDLC/Redundant internal coordinates
  • transition state search (Dimer method, Lanczos method), reaction path optimization (NEB)
  • read/write .pdb, TINKER, GAMESS and NWChem files
  • model creation and setup: build polypeptides, add hydrogens and bonds, mutate residues, solvate

How to use this code:

  1. If an example in projects/ or test/ looks promising, try using that as a starting point … all the examples are outdated or work-in-progress currently. Open an issue describing what you’re interested in doing and I’ll help with getting started.
  • for example, see the “Preparation” section in projects/; then from the folder containing 1MCT-trimI.pdb, at a Python prompt, run execfile('<path to this repo>/projects/')
  • add import pdb; pdb.set_trace() to step line by line
  • see “Examples” in test/ for standalone visualization examples
  1. Cut and paste what you need: code is kept as self-contained as possible
  • opt/ delocalized internal coordinates (DLC) and hybrid DLC; useful for geometry opt. w/ constraints
  • opt/ gradient-only BFGS and L-BFGS optimizers (i.e., no line search)
  • opt/ nudged elastic band (reaction path optimization)
  • opt/ Dimer and Lanczos methods (transition state search)
  • qmmm/ RESP/CHELPG charge fitting (only harmonic restraints currently)
  • slow but simple MM energy and gradient for AMBER-type force field (and Hessian for Coulomb and LJ)
  • simple FEP, BAR free energy calculations
  • model/ build polypeptides, add hydrogens and bonds, mutate residues


  • Python 3 w/ scipy and numpy (should mostly still work with Python 2.7)
  • OpenMM – molecular mechanics calculations
  • PySCF – quantum chemistry calculations

See misc/ for setup on Debian/Ubuntu


Credit to chemlab (3D camera, some shaders) and speck (some shaders), among others.

Any published results obtained using this software should be accompanied by all code needed to replicate.

Screenshot: 1MCT.pdb shown with backbone ribbon, MM atoms as lines, QM atoms as sticks, and components of QM/MM force on each atom as yellow, cyan, magenta cylinders.



View Github