1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
set lipid [atomselect top "resname $lipres"];
set lipidbox [measure minmax $lipid];
set xmin [lindex [lindex $lipidbox 0] 0];
set xmax [lindex [lindex $lipidbox 1] 0];
set ymin [lindex [lindex $lipidbox 0] 1];
set ymax [lindex [lindex $lipidbox 1] 1];
set zmin [lindex [lindex $lipidbox 0] 2];
set zmax [lindex [lindex $lipidbox 1] 2];
set selA [atomselect top "same residue as water and z>$zmin and z<$zmax"] set selB [atomselect top "all not {same residue as water and z>$zmin and z<$zmax}"] puts "all not {same residue as water and z>$zmin and z<$zmax}"
set rmwatlen [llength [$selA get resid]];
set rmwatnum [expr $rmwatlen/3];
puts "remove water atom is $rmwatlen, and molecular is $rmwatnum"
$selB writepdb rmfinal.pdb
set all [atomselect top water]
set allwat [expr [llength [$all get resid]]/3];
set rmwatnum [expr $allwat-$rmwatnum];
puts "Original water molecules number is $allwat"
puts "Water molecules left $rmwatnum";
$lipres替换成你要的磷脂resname

第一个脚本是可以单独抽取出来命名成你自己的脚本,比如test.tcl,然后在工作目录下直接source test.tcl就好,直接生成删除水后的pdb,注意修改里面lipids的resname,比如POPC、POPE等
第二个是加了命名空间的,调用需要加命名空间加函数名的

第二个的可以新建一个文件夹,然后把sysTool.tcl和index的那个tcl放到一起,一个文件夹中,然后在vmd的安装目录下,有个vmd.rc的文件打开,在末尾加入source d:/WorkSpace/MD/VMDScript/SysTool/sysTool.tcl
source d:/WorkSpace/MD/VMDScript/SysTool/sysTool.tcl
注意source后直接写你的新建的那个文件夹名称
windows下注意斜杠和反斜杠的区别

来源:刘胜堂@苏州

如有侵权,请与博主联系