grep -v HOH 1aki.pdb > 1aki_cleaned.pdb
gmx pdb2gmx -f 1aki_cleaned.pdb -o 1aki_processed.gro -water spce
After running this command force field list will be promted (15 OPLS-AA/L selected).
The purpose of pdb2gmx is to generate three files:
- The topology for the molecule.
- A position restraint file.
- A post-processed structure file.
gmx editconf -f 1aki_processed.gro -o 1aki_newbox.gro -c -d 1.0 -bt cubic
The above command centers the protein in the box (-c), and places it at least 1.0 nm from the box edge (-d 1.0). The box type is defined as a cube (-bt cubic).
gmx solvate -cp 1aki_newbox.gro -cs spc216.gro -o 1aki_solv.gro -p topol.top
The configuration of the protein (-cp) is contained in the output of the previous editconf step, and the configuration of the solvent (-cs) is part of the standard GROMACS installation.
gmx grompp -f ions.mdp -c 1aki_solv.gro -p topol.top -o ions.tpr -maxwarn 5
It will generate an atomic-level description of the system in the binary file ions.tpr.
In CLI:
gmx genion -s ions.tpr -o 1aki_solv_ions.gro -p topol.top -pname NA -nname CL -neutral
After prompting 13 Sol was selected.
In Jupyter Notebook:
printf "SOL" | gmx genion -s ions.tpr -o 1aki_solv_ions.gro -p topol.top -pname NA -nname CL -neutral
In the genion command, we provide the structure/state file (-s) as input, generate a .gro file as output (-o), process the topology (-p) to reflect the removal of water molecules and addition of ions, define positive and negative ion names (-pname and -nname, respectively), and tell genion to add only the ions necessary to neutralize the net charge on the protein by adding the correct number of negative ions (-neutral, which in this case will add 8 Cl- ions to offset the +8 charge on the protein).
gmx grompp -f minim.mdp -c 1aki_solv_ions.gro -p topol.top -o em.tpr
gmx mdrun -ntmpi 2 -ntomp 1 -deffnm em -v -pin on [-nb gpu]
-nb gpu is for running in GPU.
We will get 4 files:
- em.log: ASCII-text log file of the EM process
- em.edr: Binary energy file
- em.trr: Binary full-precision trajectory
- em.gro: Energy-minimized structure
In CLI:
gmx energy -f em.edr -o potential.xvg
After prompting "10 0" was selected.
In Jupyter Notebook:
printf "10 0" | gmx energy -f em.edr -o potential.xvg
%matplotlib inline
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
potential = np.genfromtxt([i for i in open('potential.xvg').read().splitlines() if not i.startswith(('#','@'))])
plt.plot(*potential.T)
plt.xlabel('step')
plt.ylabel('potential')
gmx grompp -f nvt.mdp -c em.gro -r em.gro -p topol.top -o nvt.tpr
gmx mdrun -deffnm nvt
In CLI:
gmx energy -f nvt.edr -o temperature.xvg
After prompting "16 0" was selected.
In Jupyter Notebook:
printf "16 0" | gmx energy -f nvt.edr -o temperature.xvg
temperature = np.genfromtxt([i for i in open('temperature.xvg').read().splitlines() if not i.startswith(('#','@'))])
plt.plot(*temperature.T)
plt.xlabel('time-ps')
plt.ylabel('temperature')