--- id: mdtraj version: "1.11.1.post2" license: LGPLv2.1+ license_treatment: copyleft maintenance: active --- # mdtraj — MDTraj: A modern, open library for the analysis of molecular dynamics trajectories License: copyleft · Maintenance: active · Downloads: 221.1K/mo ## What it is and what it does MDTraj is a Python library for reading, writing, and analyzing molecular dynamics simulation trajectories. It abstracts over many trajectory file formats (xtc, trr, dcd, pdb, netcdf, gsd, and others) and provides a unified interface for structural analysis. The library emphasizes speed and vectorized operations, with optimized RMSD calculations and built-in functions for computing bonds, angles, dihedrals, hydrogen bonding networks, and secondary structure assignments. The package is designed for computational chemistry and biophysics researchers who need to post-process MD simulations. It depends on numpy, scipy, pyparsing, and packaging. The library is in maintenance mode—bug fixes and documentation improvements are welcome, but major new features are not actively planned. It requires Python 3.11 or later and is available as prebuilt wheels for current Python versions on macOS, Linux, and Windows. Use it for: - Load and convert molecular dynamics trajectories between different file formats (xtc, dcd, pdb, netcdf) for interoperability. - Calculate root-mean-square deviation (RMSD) between protein conformations to measure structural similarity over time. - Identify and analyze hydrogen bonding patterns and networks within a trajectory ensemble. - Assign secondary structure (alpha helix, beta sheet) to protein residues across trajectory frames. - Extract and analyze dihedral angles, bond lengths, and other geometric properties for validation or feature extraction. - Prepare trajectory data for downstream machine learning or statistical analysis pipelines. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. MDTraj reads, writes, and analyzes molecular dynamics trajectories in multiple formats, providing fast RMSD calculations and structural analysis functions like hydrogen bonding and secondary structure assignment. Yes, if you work with molecular dynamics simulations and need trajectory analysis. The library is stable, well-maintained for bug fixes, and provides a comprehensive API for common MD post-processing tasks. The LGPLv2.1+ copyleft license requires careful review if you plan to distribute derivative works or link it into proprietary software. No known security vulnerabilities. ## Install pip install mdtraj uv add mdtraj poetry add mdtraj ## Installing mdtraj Before you install: Medium install friction with prebuilt wheels for Python 3.11–3.14 across macOS, Linux, and Windows. Last release 37 days ago; repository active but in maintenance mode with no major feature development planned. License in practice: Licensed under LGPLv2.1+, a copyleft license. Derivative works and modifications must be distributed under compatible terms; proprietary use requires careful review of linking and distribution obligations. Quickstart: import mdtraj as md traj = md.load('trajectory.xtc', top='topology.pdb') rmsd = md.rmsd(traj, traj[0]) print(rmsd) Requires a molecular dynamics trajectory file and topology file in a supported format (e.g., xtc, pdb, dcd, netcdf). Verify before relying: - Whether the package's C extensions require compilation or system libraries on all supported platforms. - Current state of community support and response time given maintenance-mode status. - Performance characteristics of analysis functions beyond RMSD on large trajectories. ## Package facts - License: LGPLv2.1+ (copyleft) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 221.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags molecular dynamics trajectory analysis, MD trajectory file format conversion, RMSD calculations protein, hydrogen bonding analysis, secondary structure prediction MD, molecular dynamics post-processing, trajectory file reader writer, molecular-dynamics, computational-chemistry, trajectory-analysis [View on SkillFed](https://skillfed.io/packages/mdtraj) · [View on PyPI](https://pypi.org/project/mdtraj/)