Gromacs Quick Start
GROMACS Quick Start
Official Documentation:
https://manual.gromacs.org/current/user-guide/index.html
Gromacs Server and Environment:
Gromacs is pre-installed on a Levich server and user accounts are initilized to include Gromacs path.
In case you want to see how the Gromacs environment was set, Here it is:
In file ~/.profile, the last line points to gromacs environment initialization:
source /usr/local/gromacs/bin/GMXRC
Users are expected to install their own Python and Python modules.
Install Conda Python and Python modules:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
chmod +x Miniconda3-latest-Linux-x86_64.sh
./Miniconda3-latest-Linux-x86_64.sh
(answer yes to initialize Minicoda3)Logout and back in to have conda environment, then run:
conda install numpy scipy matplotlib pandas
Conda can be deactivated or reactivated by command:
conda deactivate
conda activate
Gromacs Command
Main Command:
gmk
Examples:
gmx -h
(print help)gmk -v
(show version)gmx help [module]
(documentation of a module)Example 1: Lysozyme
In this example, we are going to use hen egg white lysozyme (PDB ID 1AKI) to run a MD simulation.
Prepare structure and topology files
Create a working directory:
mkdir lysozyme
cd lysozyme
Download a pdb file from Protein Data Bank
getpdb 1aki
Pymol molecule structure viewer is preinstalled on the system. Due the Python dependency, one needs to deactivate conda to run Pymol.
conda deactivate
pymol 1aki.pdb
After verifying structure, quit pymol and activate conda again.
conda activate
Delete crystal water molecules. Water in the pdb file are crystal water molecules. Gromacs has its own way to add solvent water.
grep -v HOH 1aki.pdb > 1aki_clean.pdb
Create topology file and process the structure file
gmx pdb2gmx -f 1aki_clean.pdb -o 1AKI_processed.gro -water spce
When it will prompts to select a force field, select choice 15 - OPLS force field.
The explanation of pdb2gmx module can be found by running:
gmx help pdb2gmx
-f 1aki_clean.pdb: Input file
-o 1AKI_processed.gro: Output file for Gromacs use
-water spce: The model to build solvent water
Other two files are
- topol.top Topology file defines atom and bond parameters.
- posre.itp Position restraint file
Define the simulation box and solvent
Step 1: Define the box dimensions using the editconf module
gmx editconf -f 1AKI_processed.gro -o 1AKI_newbox.gro -c -d 1.0 -bt cubic
This command use module editconf to center and define a box.
- -f 1AKI_processed.gro: Input file
- -o 1AKI_newbox.gro: Output file, the box is 0,0,0 and the coordinates at the bottom line
- -c: center the box
- -d 1.0: Leave at least 1 nm at the edge
- -bt cubic: Use cubic box. There are other choices such as rhombic dodecahedron.
Step 2: Fill the box with water using the solvate module
gmx solvate -cp 1AKI_newbox.gro -cs spc216.gro -o 1AKI_solv.gro -p topol.top
This command uses module solvate to add water molecules into the box.
- -cp 1AKI_newbox.pro: Configuration of the protein from the named file
- -cs spc216.gro: Configuration of the solvent. Spc216.gro is a generic equilibrated 3-point solvent model good for SPC, SPC/E, or TIP3P water.
- -o 1AKI_solv.gro: Output file name
- -p topol.top: Topology file name. Solvate module will update this file to include both protein molecule and solvate (SOL) line
Add ions
In topology file [ atom ] section, the protein total charge is calculated. The charge at the end of this section is the net charge.
1960 opls_272 129 LEU O2 682 -0.8 15.9994 ; qtot 8
In this example, the net charge is 8.
In MD simulation, we need to balance the charge with ions so that we have a neutral system.