A set of utilities and notebooks for running OpenMM simulations.
Project description
easyMD
A CLI tool for preparing and running molecular dynamics simulations, using OpenMM.
Description
Never run an MD simulation before? With EasyMD, it's as simple as:
easymd run my_protein.pdb
[!WARNING]
EasyMD is a Work In Progress, and is currently in pre-release form. Feel free to use and offer suggestions!
Table of Contents
Installation
EasyMD requires packages installed via the Conda package manager.
First, clone this repo:
git clone https://github.com/degrado-lab/easyMD.git
Inside the repo, create a new conda environment using the provided file:
conda env create -f environment.yml -y
Then, enter the environment:
conda activate easymd
Install EasyMD into the conda environment:
pip install .
[!NOTE]
Soon, this installation will be simplified with an official PyPi release of EasyMD.
Usage
Like all MD software, EasyMD requires a GPU to run efficiently. You should run EasyMD on a machine with a GPU, like a personal computer or the gpu development nodes on Wynton.
Running a basic protein simulation
For an unprocessed input structure (PDB or CIF), you can prepare and run a simulation using the easymd run command:
easymd run 1ohp.pdb --duration 100 # run for 100 ns
What's going on when we run this command?
First, EasyMD prepares the protein structure for simulation. This includes handling non-standard residues or molecules, adding hydrogens, and solvating the protein. Next, it runs an energy mimimization, followed by an initial equilibration & relaxation simulation (by default, 0.5ns of NVT, then 0.5ns of NPT). These initial simulations allow the system to settle into a realistic pose and energy level for the subsequent production simulation.
Finally, EasyMD will run the production simulation. The processed output structure will be saved as a PDB file, and the position data for the simulation is saved as a separate DCD file. These can be viewed in software like PyMol by loading first the PDB, then the DCD file.
To change the output file, relaxation simulation duration, and system preparation variables, view the full list of parameters using:
easymd run --help
Changing forcefields
OpenMM (the "engine" inside EasyMD) comes with many pre-packaged MD forcefields. To view them, run the command:
easymd get-forcefields
To run a simulation with a different forcefield, simply pass in the names of the forcefield XMLs to the --forcefield argument. You can also use forcefields downloaded to your computer, as long as they're in the OpenMM-compatible XML format.
easymd run 1ohp.cif --forcefield amber96.xml --forcefield tip3p.xml # Use Amber96, with tip3p water
Running a simulation with a ligand
Most protein forcefields are designed to recognize the typical protein amino acids, and some solvents. For any other molecule in your simulation (which I'll refer to as ligands), EasyMD will attempt to recognize it and generate forcefield parameters using the GAFF forcefield.
To do this, EasyMD needs a copy of each ligand as a separate file, with the correct bond orders and hydrogens. You can provide an SDF file of your ligand using the -l [ligand.SDF] flag (use an additional flag for each new ligand). The ligand in the SDF does not have to be in the same pose as in your PDB - this is used as a template for bond orders and hydrogen positions.
easymd run 1ohp.cif -l 6NT.sdf # manually adding ligand here
Alternatively, if your ligand is in the Protein DataBank's ligand repository, you can exclude the input SDF - EasyMD will use the ligand residue name to download an idealized SDF at runtime. If you'd like to utilize this feature, simply make sure your ligands have a residue name which matches their entry in the PDB (e.g. (6NT)[https://www.rcsb.org/ligand/6NT]).
easymd run 1ohp.cif # ligand will be downloaded from PDB
[!NOTE]
If you've parameterized your ligand yourself, you may provide that as a forcefield file using the--forcefieldflag. Additionally, more general ligand forcefield generators (SMIRNOFF and ESPALOMA) will be added soon.
Output Processing
After your simulation is run, the protein will likely be tumbling, with any ligands crossing over periodic boundaries frequently. This makes analysis difficult - so, EasyMD will automatically attempt to center and align your protein at the end of the simulation.
The centered trajectory will be saved with the suffix _aligned.dcd.
Adding Hydrogens
EasyMD has a simple utility for adding hydrogens to a structure. Using custom forcefield files and provided ligand SDFs, it will use OpenMM to add hydrogens and energy-minimize their pose (without affecting heavy atoms). The command is:
easymd reduce 1ohp.cif
And it takes the same forcefield and ligand parameters as easymd run.
Troubleshooting
Facing a CUDA error?
OpenMMException: There is no registered Platform called "CUDA"
This means OpenMM was built for a different cuda version than your system. Run the following command to re-install openmm:
conda install -c conda-forge openmm cuda-version=12
License
This project is licensed under the MIT License.
Contact
References
- md traj analysis examples: https://github.com/mdtraj/mdtraj/tree/master/examples
- OpenMM cookbook: https://openmm.github.io/openmm-cookbook/latest/cookbook
- PDBFixer Guide: https://htmlpreview.github.io/?https://github.com/openmm/pdbfixer/blob/master/Manual.html
- OpenFF implementation: https://github.com/openforcefield/openff-toolkit/blob/stable/examples/toolkit_showcase/toolkit_showcase.ipynb
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file easymd-3.2.3.tar.gz.
File metadata
- Download URL: easymd-3.2.3.tar.gz
- Upload date:
- Size: 33.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79287c3e0da1ab594d5b43297f5416e7bc9251bd439a88d6e3acdb69e9f89a65
|
|
| MD5 |
e294fa0fb0feb460c69bb9985b6bc1fd
|
|
| BLAKE2b-256 |
6616cb252c8298f6ea81d6e99ed858feb4d8452dd8a031db837dc74a359b1289
|
Provenance
The following attestation bundles were made for easymd-3.2.3.tar.gz:
Publisher:
publish.yml on degrado-lab/easyMD
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
easymd-3.2.3.tar.gz -
Subject digest:
79287c3e0da1ab594d5b43297f5416e7bc9251bd439a88d6e3acdb69e9f89a65 - Sigstore transparency entry: 367849959
- Sigstore integration time:
-
Permalink:
degrado-lab/easyMD@b6077aad4ca995674843c43002de4723b0094a1d -
Branch / Tag:
refs/tags/v3.2.3 - Owner: https://github.com/degrado-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b6077aad4ca995674843c43002de4723b0094a1d -
Trigger Event:
release
-
Statement type:
File details
Details for the file easymd-3.2.3-py3-none-any.whl.
File metadata
- Download URL: easymd-3.2.3-py3-none-any.whl
- Upload date:
- Size: 35.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12560c5c2e2d7fc970243dc380faf7d6d73906c66de57dccff0c3544c5e68d8e
|
|
| MD5 |
0e321e5854e5ed649dc1f4abc6f55da9
|
|
| BLAKE2b-256 |
0f558bbe072445074e6a141a028d38b428f2ccbe8e27954b4ff88f8e584a1d67
|
Provenance
The following attestation bundles were made for easymd-3.2.3-py3-none-any.whl:
Publisher:
publish.yml on degrado-lab/easyMD
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
easymd-3.2.3-py3-none-any.whl -
Subject digest:
12560c5c2e2d7fc970243dc380faf7d6d73906c66de57dccff0c3544c5e68d8e - Sigstore transparency entry: 367849983
- Sigstore integration time:
-
Permalink:
degrado-lab/easyMD@b6077aad4ca995674843c43002de4723b0094a1d -
Branch / Tag:
refs/tags/v3.2.3 - Owner: https://github.com/degrado-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b6077aad4ca995674843c43002de4723b0094a1d -
Trigger Event:
release
-
Statement type: