Read, write and analyze MD trajectories with only a few lines of Python code.
MDTraj is a python library that allows users to manipulate molecular dynamics (MD) trajectories and perform a variety of analyses, including fast RMSD, solvent accessible surface area, hydrogen bonding, etc. A highlight of MDTraj is the wide variety of molecular dynamics trajectory file formats which are supported, including RCSB pdb, GROMACS xtc and trr, CHARMM / NAMD dcd, AMBER binpos, AMBER NetCDF, AMBER mdcrd, TINKER arc and MDTraj HDF5.
MDTraj is based on numpy and is both easy to use and fast. Core routines like RMSD are written in C with explicit SSE vectorization and multicore parallelization. The RMSD code, in particular, is based on the Theobald QCP method and is 4x the speed of the original Theobald code and over 3x as fast as Theobald code modified to use GotoBLAS.
The library also ships with a flexible command-line application for converting trajectories between formats. When you install MDTraj, the script will be installed under the name mdconvert.
The best way to report a bug or request a new feature is to make an issue on github. Don’t hesitate to fork the repository, make some changes, and submit a pull request!
MDTraj is licensed under the Lesser GNU General Public License (LGPL v2.1+).