MDAnalysis
An object-oriented toolkit to analyze molecular dynamics trajectories.
What it is and what it does
MDAnalysis is a Python library for reading, manipulating, and analyzing molecular dynamics simulation trajectories. It abstracts away the complexity of different trajectory file formats—supporting GROMACS, Amber, NAMD, CHARMM, DL_POLY, HOOMD, LAMMPS, and others—and provides a unified interface to select atoms, extract structural data as NumPy arrays, and iterate through frames. The library is written by and for computational scientists and includes a growing collection of analysis algorithms for tasks like RMSD calculations, structural alignment, and distance analysis.
The package is mature (first released in 2012), actively maintained, and fiscally sponsored by NumFOCUS. It has a large dependency footprint (11 runtime packages including numpy, scipy, and matplotlib) and is designed for interactive exploration and scripting of simulation data. Prebuilt wheels cover recent Python versions and major platforms, making installation straightforward for most users.
Use it for:
- Load and iterate through molecular dynamics trajectories from GROMACS, Amber, or NAMD simulations to extract atomic positions and velocities.
- Select subsets of atoms (e.g., 'name OH' or 'protein and backbone') and compute structural properties like center of mass or distances.
- Perform RMSD calculations and structural alignment to compare protein conformations across trajectory frames.
- Extract time-series data (positions, forces, velocities) as NumPy arrays for downstream statistical or machine-learning analysis.
- Analyze drug–protein interactions or material properties by computing contact distances and structural metrics over simulation time.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
MDAnalysis reads and analyzes molecular dynamics simulation trajectories from many popular simulation packages, providing atom selection, structural analysis, and trajectory iteration through a Python API.
Yes. MDAnalysis is a mature, actively maintained library with broad support for simulation formats and a large user base in computational chemistry and biophysics. Install friction is moderate but manageable; the LGPLv3+ license is permissive for most use cases. No known security vulnerabilities. Install it if you work with molecular dynamics simulations and need a standard, well-documented toolkit for trajectory analysis.
Install
mdanalysis on PyPI
pip
pip install mdanalysisuv
uv add mdanalysispoetry
poetry add mdanalysisInstalling MDAnalysis
Before you install
Medium install friction: 11 runtime dependencies including numpy, scipy, matplotlib, and joblib. Prebuilt wheels available for Python 3.11–3.14 on macOS, Windows, and Linux. Actively maintained with recent commits; last release 301 days old but repository shows ongoing development.
License in practice
Licensed under LGPLv3+ with some components under LGPLv2.1+. Permissive for linking into non-free software; you may use and modify it freely, but derivative works must remain under LGPL. No restriction on closed-source applications that link to it.
Quickstart
pip install mdanalysis
import MDAnalysis as mda
u = mda.Universe('topol.tpr', 'traj.trr')
ag = u.select_atoms('name OH')
for ts in u.trajectory:
print(ag.center_of_mass())
Verify before relying
- Performance characteristics and scalability limits for large trajectory files or systems
- Specific analysis algorithms included in MDAnalysis.analysis module beyond what the description excerpt covers
- Memory requirements and optimal hardware for typical use cases
Package facts
| License | ========================================================================== Licensing of the MDAnalysis library ========================================================================== The MDAnalyis… (full text in the JSON record) (copyleft) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 11 — numpy, GridDataFormats, mmtf-python, joblib, scipy, matplotlib, tqdm, threadpoolctl, packaging, filelock, mda-xdrlib |
| Maintenance | actively maintained — 301 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 256,728/month — #8,459 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mdanalysis-2.10.0-cp311-cp311-macosx_10_9_x86_64.whl; mdanalysis-2.10.0-cp311-cp311-macosx_11_0_arm64.whl; mdanalysis-2.10.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; mdanalysis-2.10.0-cp311-cp311-win_amd64.whl; mdanalysis-2.10.0-cp312-cp312-macosx_10_13_x86_64.whl; mdanalysis-2.10.0-cp312-cp312-macosx_11_0_arm64.whl; mdanalysis-2.10.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; mdanalysis-2.10.0-cp312-cp312-win_amd64.whl; mdanalysis-2.10.0-cp313-cp313-macosx_10_13_x86_64.whl; mdanalysis-2.10.0-cp313-cp313-macosx_11_0_arm64.whl; mdanalysis-2.10.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; mdanalysis-2.10.0-cp313-cp313-win_amd64.whl; mdanalysis-2.10.0-cp314-cp314-macosx_10_13_x86_64.whl; mdanalysis-2.10.0-cp314-cp314-macosx_11_0_arm64.whl; mdanalysis-2.10.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; mdanalysis-2.10.0-cp314-cp314-win_amd64.whl
Keywords: python, science, chemistry, biophysics, molecular-dynamics, computational-chemistry, molecular-simulation, analysis, trajectory-analysis
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
mdtrajMDTraj reads, writes, and analyzes molecular…
copyleft · top 15,000 on PyPI
alchemlybalchemlyb parses molecular dynamics simulation…
permissive · top 15,000 on PyPI
biotrajReads and writes molecular dynamics trajectory…
copyleft · top 5,000 on PyPI
OpenMMOpenMM is a Python wrapper for a C++ molecular…
permissive · top 15,000 on PyPI
dpdatadpdata converts and manipulates atomistic…
copyleft · top 15,000 on PyPI
aseASE provides Python tools for setting up,…
copyleft · top 5,000 on PyPI
openseespyOpenSeesPy is a Python interpreter for…
unclear · top 15,000 on PyPI
pdb2pqrPDB2PQR prepares protein structures from PDB…
permissive · top 15,000 on PyPI
pymbarpymbar implements the multistate Bennett…
permissive · top 15,000 on PyPI
fairchem-coreProvides pretrained machine learning models for…
permissive · top 15,000 on PyPI