Home

MDTraj

MDTraj is an open-source Python library designed for the analysis of molecular dynamics trajectory data. It provides tools to read, manipulate, and analyze trajectory files produced by common MD packages, and it emphasizes efficient, geometry-focused computation on large datasets. MDTraj is suitable for researchers working with protein, nucleic acid, and small-molecule simulations, and it supports interoperability with multiple simulation ecosystems.

The library centers on a Trajectory object, which pairs a topology description with a time series of

Core analytical capabilities include computation of distances, angles, and dihedrals, as well as global measures such

MDTraj emphasizes performance through a C++ core with Python bindings and relies on NumPy for data handling.

coordinates.
The
topology
encodes
atoms,
residues,
chains,
and
bonds,
enabling
meaningful
geometric
measurements.
MDTraj
supports
reading
and
writing
a
wide
range
of
trajectory
formats,
including
DCD,
XTC,
TRR,
NetCDF,
PDB,
GRO,
and
others,
and
it
provides
a
simple
API
for
selecting
atom
groups
and
aligning
trajectories
to
reference
structures.
as
root-mean-square
deviation
(RMSD)
and
root-mean-square
fluctuation
(RMSF).
The
library
also
offers
tools
for
selecting
subsets
of
atoms,
computing
pairwise
contacts,
and
performing
more
specialized
analyses
such
as
hydrogen
bonds
and
native
contact
maps.
These
capabilities
enable
researchers
to
quantify
structural
changes,
compare
conformations,
and
extract
meaningful
statistics
from
simulation
data.
Typical
workflows
involve
loading
trajectories,
aligning
to
a
reference,
calculating
metrics
of
interest,
and
exporting
results
for
further
analysis
or
visualization.
The
project
serves
as
a
lightweight,
versatile
tool
for
trajectory
analysis
within
the
broader
MD
simulation
ecosystem,
and
it
is
maintained
with
documentation
and
a
community
of
users.