Logo
Libraries and SDKs,  Molecular Biology

MDAnalysis

Date Published

MDAnalysis is an open-source Python toolkit for analysing molecular dynamics (MD) simulations and other particle-based trajectory data. Designed and maintained by a community of scientists, it provides a high-level, numpy-friendly API that makes atomic coordinates and topology information available as arrays and convenient container objects. The project is fiscally sponsored by NumFOCUS and is distributed under an LGPL license; users are encouraged to cite core MDAnalysis papers and individual algorithm sources when publishing results. At the heart of MDAnalysis are two complementary concepts: the Universe and AtomGroups. A Universe bundles a topology (atoms, residues, bonds) with one or more trajectory files; AtomGroups and their higher-level analogues (ResidueGroup, Segment) let you define and operate on subsets of the system. A central design goal is memory efficiency: MDAnalysis typically reads only one frame at a time from a trajectory reader, letting you analyse trajectories of arbitrary length without loading all frames into memory. The library exposes coordinates and per-frame data as numpy arrays, and many common operations return results that are easy to convert into pandas DataFrames for downstream plotting or statistical analysis. MDAnalysis supports a wide range of topology and trajectory formats used by major engines (GROMACS, AMBER, NAMD, CHARMM, DL_POLY, HOOMD, LAMMPS and more) and can write single-frame and multi-frame outputs (PDB, GRO, XTC, DCD, etc.). Its flexible selection language supports boolean operators, ranges, wildcards, distance-based queries (static vs dynamic selections) and fancy indexing, enabling concise expressions like selecting backbone atoms, residues in a region, or all atoms within a cutoff of a ligand. The topology layer provides access to bonded terms (bonds, angles, dihedrals) and to topology attributes such as element, mass and residue names; these can be adjusted manually or extended with custom labels when working with coarse-grained or unconventional systems. The package includes a broad collection of analysis modules (MDAnalysis.analysis) and building blocks for custom workflows: RMSD and alignment tools, RMSF, pairwise and atom-wise distances, contact and native‑contact analyses, principal component analysis, clustering and dimensionality reduction, solvent and mass density calculations, hydrogen-bond analysis, and many more. Many analyses follow a consistent interface (initialise with a Universe or AtomGroup, run over a frame range, and inspect stored results), and several analyses now expose a parallelisation API to distribute work across cores or nodes (dask integration is available as an optional extra). Some specialised capabilities have been migrated into separate MDAKit packages; MDAnalysis is extensible so you can add custom Readers, Parsers or analysis classes and have them picked up automatically. Typical use cases include computing backbone RMSD over a production run, measuring radius of gyration and end-to-end distances, mapping solvent density around proteins, quantifying contact networks and native contact fractions, characterising membrane properties and lipid order, or building pipelines to extract observables for machine-learning models. MDAnalysis is widely used both for batch analyses and interactive exploration in Jupyter notebooks; it pairs naturally with numpy, pandas and plotting libraries, and integrates with visualization tools such as nglview and other community plugins. The project maintains extensive tutorials and example notebooks (including RMSD/alignment, contact analysis, PCA and trajectory streaming), a user guide with installation instructions and developer documentation, and an active community on GitHub Discussions and issue trackers, plus training workshops and a user-group meeting. For reproducible workflows, MDAnalysis supports pinned releases/tags, editable developer installs, optional dependency groups (for extra formats, parallel backends, or documentation), and a test-suite to validate installations.