Introduction to Molecular Dynamics with GROMACS

From Education

Jump to: navigation, search

Overview

  • Protein folding
  • Molecular dynamics

Software

Groningen Machine for Chemical Simulations (GROMACS, www.gromacs.org) is a software package originally developed by Groningen University's department of Biophysical Chemistry. The goal of this package is to simulate forces and movements of atoms in molecular systems over time, i.e. molecular dynamics.

LAM-MPI is an implementation of the Message Passing Interface (MPI) standard from Indiana University, Bloomington. GROMACS makes use of this interface to provide a parallel implementation of the molecular dynamics simulation.

Acme is the operating system software, hardware, and curriculum supporting the science; in this case GROMACS. Acme is LittleFe, the hardware; the Bootable Cluster CD, the software; and the Computational Science Education Reference Desk (CSERD), the curriculum modules. For more information see:

Running GROMACS on an Acme Cluster

In order to begin our runs on a cluster we must first setup the parallel environment. Using LAM-MPI this is accomplished by starting lamd servers on each node in the cluster. LAM provides a simple means of doing this through the lamboot command.

cat ~/littlefe-hosts copies LittleFe's lam host file to the current directory and displays it. The copied file is just a list of the hostnames of each node in the cluster. lamboot littlefe-hosts begins lamd servers on each node in the cluster and prepares them to interact with one another, passing portion of the simulation around. It is now important to run lamhalt before logging off the cluster to stop all of the lamd servers running throughout the cluster. The Research Collaboratory for Structural Bioinformatics provides the Protein Data Bank at the website www.rcsb.org. Typing in 2LZM as the PDB ID at this site returns a reference to a particular molecule, Lysozyme. Selecting "Download/Display File" and then downloading an uncompressed PDB yields a file on the local machine which gives coordinates of every atom in the molecule. If you cannot download the PDB file, you can find 2LZM.pdb in the ~/gromacs/ directory. Next, running pdb2gmx on that molecule file and selecting the OPLS-AA (xxx - the G43A1 force field is now the default) force field will convert the file from the PDB format to a format with which GROMACS is able to work. Do this with the following command:

pdb2gmx -f 2LZM.pdb

This command creates three files: conf.gro, the coordinates of the atoms in the molecule, topol.top, the topology, and posre.itp, the position restraint data. At each time step the simulation will compute the forces between each atom in the system. For this to take a reasonable amount of time we restrict the size of the system by placing the molecule in a box. Only forces within this box are calculated. To restrict the box to a size of 0.5nm to the box's edge from any atom in the molecule we run the command:

editconf -f conf.gro -d 0.5 -o newbox.gro

At this point the box is empty save the Lysozyme molecule. In order to create a more realistic simulation we fill the empty space in the box with the SPC water model.

genbox -cp newbox.gro -cs spc216.gro -p topol.top -o solvated.pdb

Next we use energy minimization to remove overlapping atoms. This requires doing a short run of a gromacs simulation. Copy the configuration files required for the different steps in preparing and running the simulation and look through the em.mdp important for this energy minimization step.

cp ~/gromacs/em.mdp .
cat em.mdp
grompp -f em.mdp -p topol.top -c solvated.pdb -o em.tpr
mdrun -v -deffnm em

The next step runs the simulation for a small amount of time holding the target molecule stable but allowing the water to settle. Using grompp prepares the simulation. This step decides how to break the system up between the cluster nodes. Specify the number of processors you wish to run on with the -np option. To prepare the simulation for 8 nodes use:

cp ~/gromacs/pr.mdp .
grompp -f pr.mdp -p topol.top -c em.gro -o pr.tpr -np 8

In order to invoke the simulation on multiple nodes mpirun executes the simulation on each node and prepares the communication mechanism for internode communication. mdrun is a part of the gromacs package which does the actual molecular dynamics simulation.

mpirun -np 8 /usr/local/gromacs/i686-pc-linux-gnu/bin/mdrun -v -deffnm pr

The next step is to run the final simulation. This involves using a different set of configure options from run.mdp, but using the same process of preparing the simulation with grompp and running it with mdrun. Again the 8 here should be replaced with the desired number of processors on which the simulation will run.

cp ~/gromacs/run.mdp .
grompp -f run.mdp -p topol.top -c pr.gro -o run.tpr -np 8
mpirun -np 8 /usr/local/gromacs/i686-pc-linux-gnu/bin/mdrun -deffnm run

In order to visualize the process that has just been simulated a package called pymol animates gromacs simulation runs.

trjconv -s run.tpr -f lowpass.xtc -o lzmtraj.pdb
Select option 1 to view just the Lysozyme molecule
pymol lzmtraj.pdb
Personal tools
SC Education sites