Molecular dynamics
This application integrates the Dynamics rust library for molecular dynamics. It's developed concurrently with this application, and the two are designed to interact. See its readme for details and assumptions. We also integrate ab-inito molecular dynamics by interfacing with Orca, if it's installed and available on the PATH. These computations are much slower, but are more accurate than Newtonian ones.
Molecular dynamics in this application is based on Amber force fields. These are Newtonian fields that are tuned for specific molecule categories, and assume unbreakable covalent bonds. We break them into the following discrete parts:
Bonded:
- Bond stretching between each pair of covalently-bonded atoms.
- Angle bending, between every set of 3 linearly covalently-bonded atoms.
- Dihedral forces (AKA Torsions), between every set of 4 linearly covalently-bonded atoms.
- Improper dihedral forces between certain sets of 4 atoms in hub-and-spoke configurations.
Non-bonded:
- Lennard Jones interactions
- Short-range Coulomb interactions
- Long-range SPME Coulomb interactions
It integrates the following Amber parameter sets: - Small organic molecules, e.g. ligands: General Amber Force Fields: GAFF2 - Protein/AA: FF19SB - Nucleic acids: Amber OL3 and RNA libraries - Lipids: Lipid21 - Water: OPC
We plan to support carbohydrates in the future.
Running MD
To run an MD computation, make sure the Dynamics toolbar is activated. On its left, you can select one or more molecules to run dynamics on. If at least one protein, and at least one small organic molecule
The simulation will compute in the background, but expect the GUI to be sluggish while it's running. You may abort the run at any point by clicking the Abort button which appears while a run is active. You can monitor the number of steps completed in the GUI as well.
Playing back the simulation.
Once a simulation is complete, you may navigate through its snapshots by clicking, or dragging the slider which appears upon completion.
Some details
These general parameters do not need to be loaded externally; they provide the information needed to perform dynamics with any amino acid sequence, and provide a baseline for dynamics of small organic molecules.
For small organic molecules, we may compute force field types, partial charges, and dihedral overrides. These can be provided directly from FRCMOD files, or suitably annotated Mol2 or SDF files, but are often absent. The computations we use are similar in principle to Amber's Antechamber tool, and we use parameters from it.
For details on how this parameterized approach works, see the Amber Reference Manual. Section 3 and 15 are of particular interest, regarding force field parameters.
Moleucule-specific overrides to these general parameters can be loaded from .frcmod, prmptom, and .dat files. We delegate this to the bio files library, or compute them directly if not present.
We load partial charges for ligands from mol2, sdf, and pdbqt files. Protein dynamics and water can be simulated using parameters built-in to the program (The Amber one above). Simulating ligands requires the loaded file (e.g. mol2) include partial charges. We recommend including ligand-specific override files as well, e.g. to load dihedral angles from .frcmod that aren't present in Gaff2.
The algorithm
This library uses a traditional MD workflow. We use the following components:
Integrators, thermostats, barostats
We provide a Velocity-Verlet integrator. It can be used with a Berendsen barostat, and either a CSVR/Bussi, or Langevin thermostat. These continuously update atom velocities (for molecules and solvents) to match target pressure and temperatures. The Langevin Middle thermostat is a good starting point.
Solvation
We use an explicit water solvation model: A 4-point rigid OPC model, with a point partial charge on each Hydrogen, and a M (or EP) point offset from the Oxygen. We use the SETTLE algorithm to maintain rigidity, while applying forces to each atom. Only the Oxygen atom carries a Lennard Jones(LJ) force. Solvation is set up by default, and requires no special adjustments. If you wish, you may change the size of the simulation box padding with its associated input on the MD toolbar.
The simulation box uses periodic boundary conditions: When a water molecule exits one side of it, it simultaneously re-appears on the opposite side. Further, our long-range SPME computations are designed to incorporate this periodic boundary position, simulating an infinitely-extending simulation box. Note that this has an unfortunate (But usually negligible) side effect of also including images of non-water molecules in computations.
Bonded forces
We use Amber-style spring-based forces to maintain covalent bonds. We maintain the following parameters:
- Bond length between each covalently-bonded atom pair
- Angle (sometimes called valence angle) between each 3-atom line of covalently-bonded atoms. (4atoms, 2 bonds)
- Dihedral (aka torsion) angles between each 4-atom line of covalently-bonded atoms. (4 atoms, 3 bonds). These usually have rotational symmetry of 2 or 3 values which are stable.
- Improper Dihedral angles between 4-atoms in a hub-and-spoke configuration. These, for example, maintain stability
- where rings meet other parts of the molecule, or other rings.
Non-bonded forces
These are Coulomb and Lennard Jones (LJ) interactions. These make up the large majority of computational effort. Coulomb forces represent electric forces occurring from dipoles and similar effects, or ions. We use atom-centered pre-computed partial charges for these. They occur within a molecule, between molecules, and between molecules and solvents.
We use a neighbors list (Sometimes called Verlet neighbors; not directly related to the Verlet integrator) to reduce computational effort. We use the SPME Ewald approximation to reduce computation time. This algorithm is suited for periodic boundary conditions, which we use for the solvent.
We use Amber's scaling and exclusion rules: LJ and Coulomb force is reduced between atoms separated by 1 and 2 covalent bonds, and skipped between atoms separated by 3 covalent bonds.
We have two modes of handling Hydrogen in bonded forces: The same as other atoms, and rigid, with position maintained using SHAKE and RATTLE algorithms. The latter allows for stability under higher timesteps. (e.g. 2ps)
Partial Charges
For small organic molecules, we infer AM1-BCC partial charges for each molecule when loading it. We do so using a machine learning algorithm trained on Amber's Geostd set. This is a set of ~30k small organic molecules that have force field types, partial charges, and parameter overrides assigned. For proteins, nucleic acids, and lipids, we use ones provided by Amber force fields directly.
If your small molecule already has partial charges, we use those directly instead of computing new ones. Partial charges may be provided in Mol2 files as part of their column data, or as SDF metadata. For the latter, we support both OpenFF's "atom.dprop.PartialCharge", and Pubchem's "PUBCHEM_MMFF94_PARTIAL_CHARGES" formats.
If ORCA is installed, you can use it to generate MBIS charges. This is one of the most accurate approaches, but is very slow; it may take several minutes to complete for a single small molecule. To use this, click Assign MBIS q from the ORCA UI section; it will update charges for the active molecule.
Bonded parameter overrides for small organic molecules
Small organic molecules use bonded parameters from Amber's Gaff2 set. Most molecules have dihedral parameters (proper and improper) that are not present in Gaff2. We substitute Gaff2 parameters in for these based on the closest match of their force field types to parameters present in Gaff2. We (rarely) do the same for missing bond and valence angle parameters. Alternatively, you may provide these overrides directly by opening FRDMOD or PRMPTOP files directly.
Initial relaxation
We run a relaxation / energy-minimization function prior to starting each simulation. This adjusts atom positions to reduce the amount of energy that comes from initial conditions deviating from bonded parameters.
Floating point precision
Mixed precision: 32-bit floating points for most operations. We use 64-bit accumulators, and in thermostat and barostat computations. This is especially relevant, as consumer GPUs have poor f64 performance.
How pH adjustment works
pH in proteins is represented by the protenation state of certain amino acids. In particular, His, Asp, Cys, Glu, and Lys are affected. These changes are affected in utility functions we provide that add Hydrogen atoms.
Saving results
Snapshots of results can be returned in memory, or saved to disk in DCD format.
More information
We plan to support carbohydrates and lipids later. If you're interested in these, please add a Github Issue.
These general parameters do not need to be loaded externally; they provide the information needed to perform MD with any amino acid sequence, and provide a baseline for dynamics of small organic molecules.
This program can automatically load ligands with Amber parameters, for the Amber Geostd set. This includes many common small organic molecules with force field parameters, and partial charges included. It can infer these from the protein loaded, or be queried by identifier.
You can load these molecules with parameters directly from the GUI by typing the identifier. If you load an SDF molecule, the program may be able to automatically update it using Amber parameters and partial charges.
For details on how dynamics using this parameterized approach works, see the Amber Reference Manual. Section 3 and 15 are of particular interest, regarding force field parameters.
We load partial charges for ligands from mol2, PDBQT etc files. Protein dynamics and water can be simulated using parameters built-in to the program (The Amber one above). For small organic molecules, we infer force field params, and partial charges for each atom, as well as molecule-specific frcmod overrides from GAFF2: Generally, this is proper and improper dihedral angles. It is, occasionally, bond and angle parameters.
You can load (and save) combined atom and forcefield data from Amber PRMTOP files; these combine these two data types into one file.
Use the code below, the Examples folder on Github, and the API documentation to learn how to use it. General workflow:
-Create a MdState struct with MdState::new().
This accepts a configuration, the molecules to simulate,
and force field parameters.
Run a simulation step by calling MdState::step(). This accepts an enum which defines the computation devices
(CPU/GPU), and the time step in picoseconds. This step can be called as required for your application. For example
you can call it repeatedly in a loop, or as required, e.g. to not block a GUI, or for interactive MD.
ORCA
If Orca is installed and available on your system's PATH environment variable, we can perform Ab initio molecular dynamics using it. The computations are run entirely from Orca, with Daedalus providing its input from GUI interactions, and collect and display its output.
See This ORCA documentation page for details on these computations.
To use this functionality, enable the ORCA toolkit by clicking its button in the UI. This will open a set of commands for applying MD on the active molecule. From here you can select the computation method/functional, basis set, and other options. Click Run Ab-initio MD to run. Note that this takes much longer to run than our native MD computations, but is more accurate.