- PDB → prepare → solvate + ions → minimize → NVT → NPT → production MD
- Supports both Systemic (multiple systems) and One-Shot (PDB) Simulations
- Automated post‑MD analysis via
FastMDAnalysis(with auto-generated slide deck) - Runs on CPU, NVIDIA GPUs, and HPC clusters with built-in CUDA support
- Simple CLI for quick runs + Python API for custom workflows
git clone https://github.com/aai-research-lab/FastMDSimulation.gitcd FastMDSimulationWe recommend installing FastMDSimulation using mamba.
If you don't have
mamba, see Mamba Installation section below.
mamba env create -f environment.yml || conda env create -f environment.ymlconda activate fastmdsimulationpip install ../scripts/install_cuda.shfastmds -hfastmds simulate -hpython - <<'PY'
import openmm as mm
platforms = [mm.Platform.getPlatform(i).getName() for i in range(mm.Platform.getNumPlatforms())]
print('Available platforms:', platforms)
if 'CUDA' in platforms:
print('CUDA platform available for GPU acceleration')
else:
print('CPU-only installation - simulations will run on CPU')
PYCPU-Only Systems: Everything works without CUDA installation.
Local NVIDIA GPU: The installer will auto-detect and install CUDA support.
HPC Systems: Skip the CUDA installer and use your system's CUDA modules:
module load cuda/11.8 # Use your system's CUDA versionconda activate fastmdsimulationIf you don't have mamba, we recommend installing Miniforge. Please see option A or option B below.
After installing Miniforge, initialize your shell
source "$HOME/miniforge3/etc/profile.d/conda.sh"
conda init "$(basename "$SHELL")"
exec $SHELL -lmamba --versionIf mamba isn’t present after installing Miniforge, add it with:
conda install -n base -c conda-forge mambacurl -L -o "$HOME/Miniforge3-MacOSX-arm64.sh" \
"https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh"
bash "$HOME/Miniforge3-MacOSX-arm64.sh" -b -p "$HOME/miniforge3"curl -L -o "$HOME/Miniforge3-MacOSX-x86_64.sh" \
"https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh"
bash "$HOME/Miniforge3-MacOSX-x86_64.sh" -b -p "$HOME/miniforge3"curl -L -o "$HOME/Miniforge3-Linux-x86_64.sh" \
"https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh"
bash "$HOME/Miniforge3-Linux-x86_64.sh" -b -p "$HOME/miniforge3"curl -L -o "$HOME/Miniforge3-Linux-aarch64.sh" \
"https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-aarch64.sh"
bash "$HOME/Miniforge3-Linux-aarch64.sh" -b -p "$HOME/miniforge3"$inst = "$env:USERPROFILE\Downloads\Miniforge3-Windows-x86_64.exe"
Invoke-WebRequest -Uri "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe" -OutFile $inst
Start-Process -Wait $inst
& "$env:USERPROFILE\miniforge3\condabin\conda.bat" init powershell
# Close and reopen PowerShell, then
mamba --version || true
conda --versionGrab the installer for your OS from the Miniforge releases page and run it.
For simulating one or multiple systems.
All systems and simulation parameters are specified in a
.ymlfile.
fastmds simulate -system waterbox2nm.ymlFor simulations from a single raw PDB.
fastmds simulate -system trpcage.pdb[Optionally] provide .yml simulation parameter overrides.
fastmds simulate -system trpcage.pdb --config config_trpcage.ymlYou can always add an explicit output directory with
-o <dir>and analysis flags like--analyze,--atoms,--frames,--slides.
Analysis flags (only when --analyze is present):
--slides(default True; set--slides Falseto disable slides)--frames(e.g.,"0,-1,10"subsample every 10 frames; FastMDAnalysis format)--atoms(e.g.,protein,"protein and name CA")
Analysis output is streamed line‑by‑line and prefixed with [fastmda] in the log.
Supply raw PDB structures or parameterized systems in a .yml file.
systems:
- id: MyProt
pdb: path/to/protein.pdb # raw PDB → PDBFixer (strict) → *_fixed.pdb → solvate+ions → run
# OR if you already vetted a fixed file:
# fixed_pdb: path/to/protein_fixed.pdb # skips PDBFixer- PDB inputs are strictly fixed with PDBFixer (missing atoms/residues, hydrogens). Failures abort.
- After fixing, the system is solvated (TIP3P), ions are added (NaCl by default), and CHARMM36 is used unless overridden.
- pH for hydrogen addition can be set via
defaults.phor per-systemph(default 7.0).
systems:
- id: MyAmber
type: amber
prmtop: path/to/system.prmtop
inpcrd: path/to/system.inpcrd # or rst7:
# rst7: path/to/system.rst7systems:
- id: MyGro
type: gromacs
top: path/to/topol.top
gro: path/to/conf.gro
# optional
itp: [path/to/ffcustom.itp, path/to/ligand.itp]
include_dirs: [path/to/includes] # these are passed to GromacsTopFilesystems:
- id: MyCharmm
type: charmm
psf: path/to/system.psf
# coordinates (choose one)
crd: path/to/system.crd
# or
# pdb: path/to/system.pdb
# parameters (choose 'params' list OR any of prm/rtf/str)
params: [toppar/par_all36m_prot.prm]
# or
# prm: [file.prm, another.prm]
# rtf: [file.rtf]
# str: [file.str]Simulation parameters are specified in a .yml file.
project: TrpCage
defaults:
temperature_K: 300
timestep_fs: 2.0
report_interval: 100
checkpoint_interval: 500
stages:
- { name: minimize, steps: 0 }
- { name: nvt, steps: 5000, ensemble: NVT }
- { name: npt, steps: 5000, ensemble: NPT }
- { name: production, steps: 10000, ensemble: NPT }
systems:
- id: trpcage
pdb: trpcage.pdbEverything shown below is optional. Omitted fields fall back to sensible defaults.
project: TrpCage
defaults:
engine: openmm
# Platform + properties
platform: auto # auto → CUDA → OpenCL → CPU
platform_properties:
CudaPrecision: single # or double; device‑dependent
CudaDeviceIndex: "0" # choose GPU id when using CUDA
# Thermostat & integrator
integrator:
name: langevin_middle # langevin | brownian | verlet | variable_langevin | variable_verlet | langevin_middle
timestep_fs: 2.0
friction_ps: 1.0 # used by langevin/brownian/langevin_middle
temperature_K: 300
error_tolerance: 0.001 # used by variable_*
# Barostat (used for NPT stages)
pressure_atm: 1.0
# Reporting
report_interval: 1000
checkpoint_interval: 10000
# Preparation & FF (PDB route only)
forcefield: ["charmm36.xml", "charmm36/water.xml"]
box_padding_nm: 1.0
ionic_strength_molar: 0.15
neutralize: true
ions: NaCl # "NaCl" | "KCl" | {positiveIon: "K+", negativeIon: "Cl-"}
ph: 7.0 # pH used by PDBFixer
# Energy minimization
minimize_tolerance_kjmol_per_nm: 10.0
minimize_max_iterations: 0
# Constraint handling (default for createSystem unless overridden there)
constraints: HBonds # HBonds | AllBonds | HAngles | none
# Pass‑through to ForceField.createSystem(...) across all routes
create_system:
nonbondedMethod: PME # NoCutoff | CutoffNonPeriodic | CutoffPeriodic | PME | Ewald
nonbondedCutoff_nm: 1.0
useSwitchingFunction: true # Only meaningful for Cutoff* methods
# switchDistance_nm: 0.9 # Only valid when useSwitchingFunction is true AND a Cutoff* method is used
ewaldErrorTolerance: 0.0005
constraints: HBonds # overrides defaults.constraints if provided
rigidWater: true
hydrogenMass_amu: 3.0 # HMR; enables 3–4 fs with LangevinMiddle
longRangeDispersionCorrection: true # maps to useDispersionCorrection
removeCMMotion: false # adds a CMMotionRemover force when true
# Console logging style (file logs are always plain ISO)
log_style: pretty # pretty | plain
stages:
- { name: minimize, steps: 25000 } # increase if you want a deeper minimization
- { name: nvt, steps: 250000, ensemble: NVT } # 500 ps @ 2 fs
- { name: npt, steps: 500000, ensemble: NPT } # 1 ns
- { name: production, steps: 1000000, ensemble: NPT } # 2 ns
systems:
- id: trpcage1
pdb: trpcage.pdb # raw PDB → PDBFixer → _build/trpcage1_fixed.pdb
# fixed_pdb: already_fixed.pdb # use this to skip PDBFixer
- id: trpcage2
pdb: trpcage.pdb
sweep:
temperature_K: [300, 310, 320] # for each system perform simulations at multiple temperaturesTip: When you enable
useSwitchingFunction, only setswitchDistance_nmif you also choose aCutoff*nonbonded method. PassingswitchingDistancewith PME/Ewald raises an OpenMM error.
Simulate a 2nm water box:
from fastmdsimulation import FastMDSimulation
fastmds = FastMDSimulation("waterbox2nm.yml")
fastmds.simulate()Simulate Trp-cage miniprotein with post-MD analysis + auto-generated slide deck:
from fastmdsimulation import FastMDSimulation
fastmds = FastMDSimulation(
system="trpcage.pdb",
config="config_trpcage.yml" # optional overrides when using a PDB
)
fastmds.simulate(
analyze=True, # optional
atoms="protein", # optional
slides=True # optional (default True)
)- If
systemends with.yml/.yaml, Systemic Simulation executed;configis ignored. - If
systemis a.pdb, PDBFixer runs (strict), then a temporaryjob.auto.ymlis generated and executed.
Print stages, approximate ps, output dirs, and the exact fastmda analyze commands (when --analyze is present):
# YAML
fastmds simulate -system job.yml --analyze --dry-run
# PDB
fastmds simulate -system protein.pdb --config config.yml --analyze --dry-runYou can add
-o <output-dir>,--atoms,--frames, or--slidesto both commands as needed.
After running any simulation, you'll get:
<output>/<project>/
fastmds.log # project log (plain text; records versions & CLI)
inputs/ # auto-populated provenance bundle
job.yml
<system-id>/ # per-system inputs (engine-ready + originals when applicable)
protein.pdb | *_fixed.pdb | prmtop | inpcrd | top | gro | psf | prm/rtf/str | ...
<run_id>/ # e.g., TrpCage_T300
minimize/
state.log | state.chk | stage.json | topology.pdb
nvt/
traj.dcd | state.log | state.chk | stage.json | topology.pdb
npt/
traj.dcd | state.log | state.chk | stage.json | topology.pdb
production/
traj.dcd | state.log | state.chk | stage.json | topology.pdb
done.ok
meta.json # start/end time, job.yml SHA256, CLI argv, versions
-
No CUDA in
Platformslist- Local workstations: Run
./scripts/install_cuda.shafter creating the environment to auto-detect and install CUDA support. - HPC/Cluster systems: Use your system's CUDA modules (e.g.,
module load cuda/11.8) instead of the CUDA installer script. - CPU-only systems: Simulations will run on CPU - no action needed.
- Local workstations: Run
-
Mixed CUDA runtimes
Avoid mixing module CUDA and condacudatoolkitin the same job. Pick one strategy:- HPC: Use
module load cuda/X.X+ base environment (no cudatoolkit) - Local: Use
./scripts/install_cuda.shto install cudatoolkit in conda environment
- HPC: Use
-
CUDA installation script fails
If./scripts/install_cuda.shencounters issues, you can manually install:# Check available CUDA versions conda search -c conda-forge cudatoolkit # Install specific version (adjust as needed) conda install -c conda-forge cudatoolkit=11.8
-
PDBFixer failed
The fixer is strict by design. Inspect the error infastmds.log, repair upstream, or provide a vettedfixed_pdb:path. -
Different log look
FastMDSimulationuses a compact, icon‑and‑color console style (orplainif you setdefaults.log_style: plainorFASTMDS_LOG_STYLE=plain). Project logs (fastmds.log) are always plain ISO timestamps. -
Environment creation fails
Ifmambafails, it will automatically fall back to conda. For persistent issues:# Remove existing environment and retry conda env remove -n fastmdsimulation mamba env create -f environment.yml -
Package not found after installation
Ensure you've activated the environment:conda activate fastmdsimulationand installFastMDSimulation:pip install . -
Analysis fails
Ensurefastmdanalysis>=1.0.0is installed. Check fastmds.log for specific error messages.
Contributions are welcome. Please submit a Pull Request.
Development Installation
If you want to contribute or modify the code:
# Clone the repository
git clone https://github.com/aai-research-lab/FastMDSimulation.git
cd FastMDSimulation
# Create and activate conda environment
mamba env create -f environment.yml
conda activate fastmdsimulation
# Install in development mode
pip install -e .
# Verify installation
fastmds -h
fastmds simulate -h
# Run tests (when available)
python -m pytest tests/ -vIf you use FastMDSimulation in your work, please cite:
Aina, A. (2025) "FastMDSimulation: Software for Automated Molecular Dynamics Simulation". Zenodo. https://doi.org/10.5281/zenodo.17664277
@software{fastmdsimulation,
author = {Adekunle Aina},
title = {FastMDSimulation: Software for Automated Molecular Dynamics Analysis},
year = {2025},
publisher = {Zenodo},
doi = {10.5281/zenodo.17664277},
url = {https://doi.org/10.5281/zenodo.17664277},
version = {v0.1.0}
}FastMDSimulation is licensed under the MIT license.
FastMDSimulation builds upon excellent open-source libraries to provide its automated molecular dynamics capabilities and to improve workflow efficiency, usability, and reproducibility in MD simulations. We gratefully acknowledge:
OpenMMfor the high-performance molecular dynamics engineopenmmforcefieldsfor providing CHARMM36 and other force fieldsPDBFixerfor structure preparation and repairFastMDAnalysisfor automated analysis of MD trajectoriesNumPy/SciPyfor efficient numerical computations
FastMDSimulation also leverages the broader scientific Python ecosystem for visualization, configuration management, and user experience:
PyYAMLfor flexible configuration managementRichfor enhanced console output and loggingMatplotlib(via FastMDAnalysis) for publication-quality figures
While building upon these robust tools, FastMDSimulation simplifies MD setup and execution for students, professionals, and researchers, especially those new to molecular dynamics. We thank the scientific Python community for their contributions to the ecosystem that make projects like this possible.
