How to analysis trajectories with Gromacs
Analyze NAMD and Amber MD trajectories with Gromacs 4.5
Gromacs 4.5 can be linked to VMD libraries so that it can read any trajectory format that VMD can read, so now there is no file conversion necessary. The only thing you have to do is set the VMD_PLUGIN_PATH environmental variable to point to VMD, for example I added this to my .bashrc file:
export VMD_PLUGIN_PATH=/home/apps/lib/vmd-1.9/plugins/LINUXAMD64/molfile/
It works well for DCD files. Netcdf files are a little tricky it seems, as the plugin goes based on the file extension. To get it to work with Gromacs you can't use the .nc extension that VMD uses (no idea why), instead it needs to be .netcdf You can either rename the trajectory file or just create a symbolic link with the correct file extension.
For the majority of the analisys implemented in gromacs, you don't need the tpr, a pdb and the xtc are ok. If you use the latest gromacs version (4.5.1) you need only the pdb because gromacs is able to read each format vmd is able to read. To enable this feature, you have:
- Compiling gromacs with the flags "-L/usr/lib -ldl"
- At runtime setting the VMD_PLUGIN_PATH to the sub-directory molfile of VMD
Oguz GURBULAK: I compiled gromacs with the option
./configure --with-gsl --enable-double --prefix=$SOFT
and it worked.
If you do this, you can do:
trjconv -f trajectpry.dcd -s file.pdb
........
and the same with each tools
Now you should be able to run, for example:
g_rms -f .dcd -s .pdb
If your trajectory is composed by moltiple files, you must concatenate them using:
trjcat -f *.dcd *.dcd *.dcd -o trajectory.xtc
Usually, the timeof the different frames is 0 so you should change the time for each frame running
trjconv on trajectory.xtc
there is one additional issue that can arise: some of the gromacs tools require information about particle charges and masses, which are taken from a .tpr file. the VMD topotools plugin has an feature http://www.ks.uiuc.edu/Research/vmd/plugins/topotools/ that can help with it. you can load your .psf and .pdb file into VMD and then do: topo writegmxtop myfile.top and it should generate a "fake" .top file that provides enough information to be able to generate a .tpr file. it will not be sufficient for simulations, but should cover the needs of the analysis tools that require a .tpr file.
Regarding conversion, I think editconf is the bestsolution
http://www.mail-archive.com/gmx-users@gromacs.org/msg33964.html