[转载]VMD的TK Console中的内置命令
(2015-01-09 15:30:37)| 分类: 分子模拟 |
VMD的console是十分强大的,也提供了很多内置命令,这里把当年研究VMD内置命令的笔记的一小部分发上来。和user guide有相似之处,但是我都尽量写成例子的形式来说明,绝大部分都是亲自试过的。可能当时有些地方写的不准确,也不完整,但是现在也懒得check了。有疑问还是对照user guide中的严格说法。
*****一些额外内容*****
VMD里面所有行为,都可以用命令描述出来。打开VMD之后运行log sdf.txt,接下来干你的事,你干的所有事的等价的命令行都被记录到sdf.txt当中,运行log off停止记录。
atomselect之后占用内存,选择范围的原子越多占得越大,应当用完之后删除,比如atomselect1 delete,内存就释放了。但是atomselect编号仍然继续往后延,并不会重新占用已经删了的。
修改TKconsole的设置,通过修改D:\study\VMD186\plugins\noarch\tcl\vmdtkcon1.0\tkcon-modified.tcl。比如里面的font create tkconfixed -family Courier -size 12,把12改成20,字号就变成20了。
在.vmdrc或者vmd.rc里面有很多被注释掉的内容,也有没有被注释的,都是控制启动后vmd的默认设置,比如开哪些窗口,窗口位置,光源什么的
*****以下为正文*****
animate dup 0
复制当前帧到最后新的一帧
animate dup frame 2 0 复制22帧到新的帧
animate pause 暂停播放,按回车或者随便瞎输个命令就可继续
animate forward/for向下播放
animate reverse/rev向前播放
animate prev/next 向前/向后一帧
animate skip 设置播放时的step
animate delete all 删除所有帧
animate speed 0.3 设置速度为0.3,数值>=0,<=1
animate style once/loop/rock 设置播放模式
animate styles 显示可用的播放模式,其实就是显示once、loop、rock
animate goto
start/end/n
atomselect
keywords显示所有可以选择的关键字
macro指的就是那些charged、acidic之类的整体。
atomselect macro 显示所有macro
atomselect macro charged 显示charged的定义
atomselect delmacro
ions
atomselect macro sdfsdf {resname ALA and
hydrogen}
设好的macro在graphics
representations-selection-singlewords里面也会出现
atomselect 3 "resid 25" frame last 选择3号分子最后一帧的resid 25。分子可以是数字或者top,所选内容就是普通的selection,用双引号或者{}括住,帧号可以是数字、first、last、now。
选择之后,会出现比如atomselect0,然后可以运行:
atomselect0
num
atomselect0
list
atomselect0
text
atomselect0
molid
atomselect0
frame
atomselect0
delete
atomselect0
global
atomselect0 get mass 得到atomselect0所选范围的质量,还可以是{x y
z}得坐标,{x}仅x坐标。get后面可以接任何属性,见manual p77
atomselect0 get structure 可以得到结构中每个残基所处的二级结构
实际上不管是在图形界面选择newcartoon还是文本控制台输入get structure,都要调用stride来计算
atomselect0 getbonds 得到成键列表
atomselect0 setbonds 按照成键列表成键,比如{{2 5} {4 6}}
atomselect0 move
atomselect0 moveby {1 1
6}
atomselect0 lmoveby
offset_list:
atomselect0 moveto { 3 6
5}
atomselect0 moveto
position_list:
atomselect0 writepdb
a.pdb
set kk
[atomselect 0 {resname
ALA}]
set mass [$sel get
mass]
set kkk 4
incr
kkk
$sel set beta
0
$sel set beta
$mass
axes locations 显示所有坐标轴可能显示的位置
axes location 得到当前坐标轴的位置
axes location < of | origin | lowerleft | lowerright | upperleft
| upperright
>
color scale
method RGB设置调节颜色方法为RGB,也可以是BGR、RWB之类
colorinfo scale methods得到所有颜色调节方法列表
colorinfo scale method得到现在用的颜色调节方法
colorinfo scale midpoint或min或max 得到这三种情况对应的数值,比如0.5,0.1,1.0
colorinfo
categories
colorinfo category
Resname
colorinfo
colors
colorinfo index或rgb
purple
display update
off 禁止屏幕刷新,display屏幕就卡住了
display
resetview
display distance
x
display
get
rendermode | size | stereo | projection | nearclip |
farclip
mol new在分子列表中创建一个空分子
draw xxxx命令大多数情况下与graphics [molid] xxxx是等价的,draw只能在top层上绘图,而graphics可以自己指定,相对于draw是更底层的绘图命令。graphics不能自定义绘图命令比如vmd_draw_unitcell这样的。如果当前一层都没有,draw可以自动生成一层,graphics不行。以下的都可以用draw来代替。
graphics 3 {0 2
0} 在3号分子,0,2,0位置上画个点
graphics 3 {0 0 0} {3 4
5}
graphics 5 cylinder {0 1 0} {3 14 0} radius 1 filled yes resolution
20
graphics 5 triangle {0 0 0} {5 5 5} {0 4 0} 指定三个点画一个三角
draw sphere { 0 0 0 } radius 3 resolution
15
draw text { 0 0 0 } "haha" size
3
draw color
4
draw material
Glossy
draw delete
all
draw delete
0
draw
list
draw exists
4
draw info
2
draw replace
3
下面示例中label中只要是写Bonds的,都可以是Atoms|Bonds|Angles|Dihedrals之一
和分子ID不一样,并非固定,比如Bonds 3,如果在label里面把之前的Bond的label都删了,就成了Bonds
0了
label list 显示所有的label分类
label list Bonds 显示所有键的label
label add Bonds 0/347
0/4440
label show/hide Bonds
all
label delete Atoms
all
用鼠标点,新生成的label号从0开始,1、2、3、4...,从Graphics-label里面能看到顺序
label graph Bonds
0
label textsize
2.2
light
num
light 2
on/off
light 0
status
light 1 rot x
40
light 0
pos
light 1
default
light 1 pos { 2 3 1.1 } 将1号光源移到2,3,1.1位置
logfile
sdf.txt
logfile
off
logfile
console
material
list
material settings
Steel
material add
ttt
material copy
ttt
material rename ttt
xxx
material delete
ttt
material change diffuse xx
0;99
measure avpos
atomselect3 first 1 last 300 step 1
得到atomselect3选择的原子的从1至300帧之间的每个原子的平均位置
measure center atomselect3 weight
mass
measure contacts 5 atomselect3 atomselect4
得到在atomselect4中的任意原子的5埃范围内的atomselect3中的未与之成键的原子。如果只写一个atomselect3,则atomselect4等于atomselect3。
measure fit atomselect5 atomselect6
得到作用在atomselect5上,能使之与atomselect6的RMSD最小的4x4变换矩阵,可以套进atomselect0
move用
measure
gofr
measure sumweights atomselect7 weight
mass
measure hbonds 3.5 30 atomselect0
atomselect1
measure inverse {{1 2 3 4} { 2 5 6 8} { 8 3 5 6} { 1 4 6
2}}得到4*4矩阵的逆矩阵
measure rgyr atomselect0 weight
mass
measure minmax
atomselect0
measure rmsf atomselect0 first 50 last 100 step 2
得到atomselect0的每个原子从50帧到100帧的rmsf,两帧取样一次。可以省略selection后面的,默认为从头到尾,step=1。
measure rmsd atomselect0 atomselect1 weight
mass
measure sasa 1.4
atomselect1
mol命令用的分子号,可以是独立的一个mol
ID,也可以是all, top, active,
inactive, displayed, on, off, fixed, free。
mol
new
mol new
f:\sustiva.pdb
mol addfile
f:\sustiva.pdb
mol new和mol addfile后面都可以接参数,type
pdb读入pdb类型,还支持其它的,包括轨迹等。first

加载中…