richor的个人博客分享 http://blog.sciencenet.cn/u/richor

博文

gromacs计算两个原子之间的距离

已有 7178 次阅读 2018-4-9 14:30 |个人分类:分子模拟|系统分类:科研笔记|关键词:学者| gnuplot, gnuplot, gnuplot, gnuplot, gnuplot, gnuplot

如何利用gromacs自带分析工具,计算两个原子之间的距离?

g_dist: g_dist can calculate the distance between the centers of mass of two groups of atoms as a function of time.

需要提供index文件。每个原子是一个group

还需要tpr文件,由于可能涉及到pbc

自动计算多组脚本:(同时将数据画出png图。)

(涉及到将交互过程中需要提供的变量提前存入一个文本文件中)

 

# dist.sh
# run1-run3, and 3 distances in each run.
i=1
until [ $i -eq 4 ]; do
cd run${i}
j=1
until [ $j -eq 4 ]; do
g_dist -f md.xtc -s md.tpr -n ../index.ndx -o dist${j}.xvg < ../para${j}.txt
j=$(($j+1))
done
gnuplot ../dist.plt
cd ..
i=$(($i+1))
done

Gromacs 5.0以后,g_dist弃用,改成gmx distance:

gmx distance -f md.xtc -s md.tpr -n index.ndx -oall < para

其中,index.ndx :

[bond1]

a1 a2

[bond2]

b1 b2

可以一次性计算多个距离。


where dist.plt is


#dist.plt
set term png 
set output "dist.png"
set xlabel "Time (ns)"
set ylabel "Distance (nm)"
plot 'dist1.xvg' u ($1/1000):2 w l title "Zn--HIS6:ND1",'dist2.xvg'...
 u ($1/1000):2 w l title "Zn--HIS13:NE2",'dist3.xvg'...
  u ($1/1000):2 w l title "Zn--HIS14:ND1"

... means 指令跨行,just means, not works。


对xyz文件轨迹的处理


【拟合两个构型】

用gromacs自带工具,拟合两个构型。

trjconv -f file1.pdb -s file2.pdb -fit rot+trans -n index.ndx -o out.pdb

  1. 首先转成pdb文件。

  2. 将两个pdb文件补或删成一样大小。(修改file1)

  3. 生成index.ndx.



https://m.sciencenet.cn/blog-485752-1108204.html

上一篇:如何用bash脚本批量提交多组任务
下一篇:gnuplot做直方图和设定坐标轴精度

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-6-2 15:25

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部