Analyze NAMD and Amber MD trajectories with Gromacs 4.5

** 原文地址 编译 gmx-4.6.5 编译不成功,4.5.7 可以,5.* 并未测试 ... :( **

GMX 在其编译时可选择 link to VMD libraries, 进而利用 vmd 读取轨迹文件,故不需再进行轨迹的格式转换。 需要:

  1. 添加环境变量 (编译之前和使用之前)
    1
    export VMD_PLUGIN_PATH=/path/to/vmd-1.9/plugins/LINUXAMD64/molfile/
  2. 编译之前修改 CMakeLists.txt 文件
    1
    设置 GMX_USE_PLUGINS 为 ON (gmx-4.5.7不需要修改,其与4.6.5文件内容不同)

完成后能够打开 DCD 文件,但 Netcdf 文件无法打开 (vmd 会根据后缀名进行判断),需要将后缀由 .nc 修改为 .netcdf。

对于不需要 tpr 文件就能使用的 gmx 分析工具,现在就可以直接使用了,因为 gmx 现在能够像 vmd 一样读取轨迹文件了,比如:

1
2
3
4
5
6
7
trjconv -f trajectpry.dcd -s file.pdb 

g_rms -f traj.dcd -s ref.pdb

trjcat -f *.dcd *.dcd *.dcd -o traj.xtc # If your trajectory is composed by moltiple files, you must concatenate them using:

trjconv -f traj.dcd -t0 0 -timestep 2 -o traj_with_timestep.xtc # Usually, the time of the different frames is 0 so you should change the time for each frame running trjconv on trajectory.xtc
而对于需要 tpr 文件作为输入的工具 (比如需要 tpr 中的 particle charges and masses 等信息),则可使用 VMD 的 topotools plugin 来将 psf 和 pdb 文件转化为一个 "faked" .top 文件 (topo writegmxtop myfile.top),再用此来形成新的 tpr 文件 (此 tpr 文件不能用来做模拟,但是足以用来进行分析)。 通常,还可以借助 editconf 实现 .top 到 .tpr 的转换