Gromacs can work with a number of trajectory file formats.
The two most important are
You can get more information on trajectory file types (popup).
All trajectory conversions can be performed with the Gromacs tool
Create a trajectory file containing only protein atoms (select the protein group):
gmx trjconv -f md.xtc -s md.tpr -o md_protein.xtc -center -ur compact -pbc mol
*.pdbfile that contains the exact particles as the trajectory, so other programs know how to interpret the numbers in the trajectory. It is possible to dump the first frame at time 0 into a
gmx trjconv -f md.xtc -s md.tpr -o md_protein.pdb -center -ur compact -pbc mol -dump 0
*.tpr) with the exact same particles (protein atoms in this case), as it contains explicit information on bonds and enables Gromacs tools to handle artifacts that are produced by molecules that cross periodic boundary conditions:
gmx convert-tpr -s md.tpr -o md_protein.tpr
Secondary Structure & DSSP
Before doing any analysis, you should have a look at the data in
md.edr and of course view the trajectory in VMD.
Play around with it and test different representations.
Unfortunately, VMD does not automatically update secondary structure information of proteins on its own,
but you can download a
script for VMD that updates secondary structure.
Save the file in the directory where you opened VMD.
source sscache.tcl into the VMD console to load the script,
start_sscache top to start updating the secondary
structure information for the currently active molecule.
Now you should see the secondary structure change.
It is also possible to generate a plot of the secondary structure per residue versus time using Gromacs. You first need to make sure that the program DSSP is either installed on your computer (just try to run the command
dssp and check if it works)
or download it from the DSSP website.
Now you need to export a variable that contains the full path to your dssp executable:
which dssp. This step is only necessary to enable Gromacs to find the dssp executable. Now execute these three commands in order:
gmx do_dssp -f md_protein.xtc -s md_protein.tpr -o ss.xpm
gmx xpm2ps -f ss.xpm -o ss.eps -bx 1 -by 30
ps2pdf -sPAPERSIZE=ledger ss.eps ss.pdf
Depending on the actual number of frames in your trajectory you might want to pass the
do_dssptogether with a time in ps to extract only a subset of frames. If the ps2pdf tool is not installed, google to find a way to open an eps file directly. Open the obtained file
ss.pdfwith a pdf reader of your choice. You should obtain a plot that shows how the secondary structure of [KIGAKI]3 evolves with time, similar to the figure to the right.
Gromacs can also measure all kinds of distances between atoms and atom groups for the trajectory.
You will have noticed by now, that Gromacs knows about several standard groups that you can often select when you work with the tools.
Some standard groups are protein atoms, solvent atoms, or only Cα atoms.
Now we are interested in how the distance between the Cα atoms of the N- and C-terminal residues evolves with time.
Gromacs needs to now the indices of these atoms in the trajectory.
We could look them up manually in one of the structure files, but there is a more comfortable way.
make_ndx can create index files with non-standard groups.
You can run it with
gmx make_ndx -f md_protein.tpr -o NC_distance.ndx
3 & ri 1 18
Then type enter again to list the defined groups. The new group will appear at the end. You can write everything to the previously specified file
Now we can use our newly defined group to plot the distance of these two atoms versus time. This is done with the tool
gmx distance -f md_protein.xtc -s md_protein.tpr -oall NC_dist.xvg -oh NC_disthist.xvg -n NC_distance.ndx -tu ns -len 2 -binw 0.01
We pass the trajectory and structure files, together with output filenames for a distance plot and a histogram. A time unit can be specified with
-tu ns, in this case nanoseconds. The
-binwarguments specify the center of the histogram and the width of the bins. Both output files can be viewed with
xmgrace. Your outputs should look similar to the plots to the right.
This tutorial is relatively new and has not been tested much in real life learning situation. Therefore we have to rely on your feedback to improve it. Please take a few minutes at the end to send some words of feedback about problems you encountered, or things you did not like by e-mail to Oliver Schillinger.