FastMDAnalysis is a software for fast and automated analysis of molecular dynamics (MD) trajectories. It provides a unified Python API as well as a command‐line interface (CLI) for performing a variety of MD analyses. This package is designed to simplify your workflow by allowing you to load a trajectory once (with options for frame and atom selection) and then run multiple analyses without repeating input file details.
- rmsd: Calculate Root-Mean-Square Deviation relative to a reference frame.
- rmsf: Compute per-atom Root-Mean-Square Fluctuation.
- rg: Determine the Radius of Gyration for each frame.
- hbonds: Detect and count hydrogen bonds using the Baker-Hubbard algorithm.
- cluster: Perform clustering (DBSCAN and/or KMeans) on trajectory frames.
- ss: Compute Secondary Structure (SS) assignments using DSSP with a discrete heatmap.
- sasa: Compute Solvent Accessible Surface Area (SASA) in multiple ways:
- Total SASA vs. frame.
- Per-residue SASA vs. frame (heatmap).
- Average per-residue SASA (bar plot).
- dimred: Perform dimensionality reduction (PCA, MDS, t-SNE) to project high-dimensional data into 2D.
Navigate to the root directory of the package (the directory containing setup.py
).
For a standard installation, run:
pip install .
For development (editable) mode, run:
pip install -e .
Instantiate a FastMDAnalysis object with your trajectory and topology file paths. Optionally, specify frame selection and atom selection. Frame selection is provided as a tuple (start, stop, stride). Negative indices (e.g., -1 for the last frame) are supported. If no options are provided, the entire trajectory and all atoms are used by default.
- RMSD Analysis:
from FastMDAnalysis import FastMDAnalysis
fastmda = FastMDAnalysis("traj.dcd", "top.pdb")
# Run RMSD analysis
rmsd_analysis = fastmda.rmsd()
# Optionally retrieve rmsd data
print("RMSD Data:", rmsd_analysis.data)
# Optionally customize rmsd plot
rmsd_analysis.plot()
After installation, you can run FastMDAnalysis from the command line using the fastmda command. Global options allow you to specify the trajectory, topology, frame selection, and atom selection.
- RMSD Analysis:
fastmda rmsd -traj traj.dcd -top top.pdb
FastMDAnalysis is licensed under the MIT License. See the LICENSE file for more details.
FastMDAnalysis leverages MDTraj for trajectory analysis. It also relies on popular Python libraries such as NumPy, scikit-learn, and Matplotlib for data processing and visualization. Special thanks to the community for their continuous support and contributions.