|
本帖子的目的是使用 topo 来生成lammps,NAMD,Gromacs中比较难搞的 原子之间的bond,angle,dihedral等信息!
注意:生成的 top 文件不准确,有很多地方需要修改,请各位注意!(可用于lammps输出.trr文件,使用gromacs中的分析程序进行数据分析时使用,因为在使用gromacs中内嵌的分析程序时一般需要提供.tpr文件,用于生成.tpr文件所用)
我这里以水分子为例进行说明,阅读本帖之前请自行了解.tcl文件或者是参考 Sob老师发的帖子http://bbs.keinsci.com/forum.php ... 7&highlight=tcl
1 输入文件:water.pdb
2 脚本文件:water.tcl
打开VMD(版本1.9.2),切换到 Extensions/TK Console部分,保证water.tcl, water.pdb 文件在 当前的操作目录下,比如在桌面位置
>> source water.tcl
几秒之后,会生成.psf, .data, .top文件
对于生成的文件,需要自己检查!(一定要养成 check 的好习惯)
!! source之后 VMD一开始会卡住,请不要关闭VMD,等几分钟即可,可能是程序写的不够简洁所致(个人能力有限 )
我们来查看一下 water.tcl 文件
# load .pdb file
mol load pdb water.pdb
# set charge of water
set a [atomselect top "name OW"]
$a set charge -0.8476
$a delete
set b [atomselect top "name HW1 or name HW2"]
$b set charge 0.4238
$b delete
# require topotools
package require topotools
topo clearbonds
# selecte atom in water molecules
set sel [atomselect top "name OW HW1 HW2"]
set ids [$sel get index]
# foreach atoms in $sel
foreach {id1 id2 id3} $ids {
topo addbond $id1 $id2; # add bond in OW-HW1
topo addbond $id1 $id3; # add bond in OW-HW2
topo addangle $id2 $id1 $id3; # add angle in HW1-OW-HW2
}
mol reanalyze $sel
topo retypebonds $sel
topo retypeangles $sel
set name water
animate write pdb $name\.pdb
animate write psf $name\.psf
topo writegmxtop $name\.top
topo writelammpsdata $name\.data full
第一步是:加载构型文件
第二步是:赋予相应原子的信息,比如 mass,charge, name , atom name, resname等
第三步是:加载 topo模块
第四步是:设定 bond,angle等信息(可省),使用下面命令代替
topo guessbonds
topo guessangles
topo guessdihedrals
topo guessimpropers
第四步输出文件
建议自行查看 topo的help文件信息
|
-
-
water.pdb
970.86 KB, 下载次数 Times of downloads: 393
-
-
water.tcl
969 Bytes, 下载次数 Times of downloads: 420
评分 Rate
-
查看全部评分 View all ratings
|