VMD细碎知识点(2)

本文介绍了VisualMolecularDynamics(VMD)中的关键编程接口和功能,如坐标轴位置设置、颜色调整、绘图命令、标签管理、光源控制、材质设置、测量工具和鼠标操作等,帮助用户理解和使用这款分子可视化软件进行高级定制。
摘要由CSDN通过智能技术生成
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  显示所有颜色分类,比如Type之类
colorinfo category Resname  显示某个颜色分类,比如Resname分类下包含的预置的对不同残基的颜色
colorinfo colors    显示有多少种预置颜色,比如red
colorinfo index或rgb purple  显示purple颜色的序号或者rgb值(默认以1为最大)
display update off 禁止屏幕刷新,display屏幕就卡住了
display resetview        重置
display distance x  设置东西与屏幕的距离,越大则分子离屏幕越近,相当于放大。不可太小比如几十,否则有凸镜的效果
display get        eyesep | focallength | height | distance | antialias | depthcue | culling |
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}   在0,0,0与3,4,5之间连线。几个坐标之间大括号必须有空格隔开
graphics 5 cylinder {0 1 0} {3 14 0} radius 1 filled yes resolution 20  在5号分子这两个点之间画一个柱形,半径是1,里面都充满,否则从截面就一个壳。resolution越大,越圆滑。
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        graphics 4 color red3    设定颜色,不会对已经画好的物件生效,只管以后的。对几何和文字颜色都管用。
draw material Glossy   设定绘制的物件的材质。即便是已经画好的,也立刻变成现在设定的。
draw delete all   删除所有画的物件
draw delete 0   每画完一个物件,都会立刻显示此物件的id,这里删的是id=0的物件
draw list    列出现在所有物件的id
draw exists 4  检查id=4的物件是否存在,存在返回1,否为0
draw info 2   显示创造2号物件时用的指令
draw replace 3  接下来创造的物件的id=3,代替之前3号id的物件。即便是更改颜色、材质的操作,也算一个id。
下面示例中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   设定index 347和index 4440的键的label
label show/hide Bonds all      显示/隐藏所有键的label,all也可以是label号来具体控制
label delete Atoms all     删除所有原子的label,all也可以是label号来具体控制
用鼠标点,新生成的label号从0开始,1、2、3、4...,从Graphics-label里面能看到顺序
label graph Bonds 0  [文件名]  显示0号Bond lable的长度,输出所有帧中的长度。如果写了文件名,则输出到文件中而不显示
label textsize 2.2   把label文字设成2.2,所有文字立刻生效。默认是1.0
light num  显示目前有多少个光源    注意光源编号是从0开始的,0-3
light 2 on/off     把2号光源开或者关
light 0 status     显示0号光源的状态
light 1 rot x 40   把0号光源根据x轴转40度
light 0 pos        显示0号光源目前坐标
light 1 default    显示1号光源默认坐标
light 1 pos { 2 3 1.1 } 将1号光源移到2,3,1.1位置
logfile sdf.txt    把log信息写入sdf.txt。注意只有使改变了状态的指令才会被写入,比如light 0 pos {1.1 1 1},而draw color red或者查询状态的命令都不会被写入。
logfile off        停止写入
logfile console    把本来要写入文件的信息直接在console里显示出来
material list  显示所有材质,比如Opaque之类的
material settings Steel    显示Steel代表的具体的材质控制参数,5个小数。代表ambient, specular, diffuse, shininess, opacity
material add ttt           新加一个叫ttt的材质,默认等价于Opaque
material copy ttt          拷贝ttt成为一个新的材质,名字自动生成显示出来
material rename ttt xxx    把ttt改名为ttt
material delete ttt        删除ttt材质
material change diffuse xx 0;99   把xx材质的diffuse属性设为0.99
measure avpos atomselect3 first 1 last 300 step 1 得到atomselect3选择的原子的从1至300帧之间的每个原子的平均位置
measure center atomselect3 weight mass   得到atomselect3的中心,用mass属性来作为权重参考。weight后面可以接各种属性,在手册77页table 5.5里面。比如还可以x、radius之类
measure contacts 5 atomselect3 atomselect4 得到在atomselect4中的任意原子的5埃范围内的atomselect3中的未与之成键的原子。如果只写一个atomselect3,则atomselect4等于atomselect3。
measure fit atomselect5 atomselect6 得到作用在atomselect5上,能使之与atomselect6的RMSD最小的4x4变换矩阵,可以套进atomselect0 move用
measure gofr  计算rdf等内容。见p103
measure sumweights atomselect7 weight mass  把atomselect7的所有原子的质量加起来。如果atomselect top protein,那么得到的就是蛋白质总质量,若charge,得到的就是总电荷。
measure hbonds 3.5 30 atomselect0 atomselect1  显示所有氢键,角度<30,距离<3.5A。!!!!!!如果两个atomselect都有,则认为0是donor,1是acceptor!!!!!!。得到的结果第一个列表是donor的index,第二个列表是acceptor的index,第三个是氢的index。两个atomselect都必须在一个ID内。donor可以是氢,也可以是氢连着的原子。
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      得到atomselect0的radius of gyration
measure minmax atomselect0        显示atomselect0里面x、y、z坐标最小和最大的原子坐标
measure rmsf atomselect0 first 50 last 100 step 2 得到atomselect0的每个原子从50帧到100帧的rmsf,两帧取样一次。可以省略selection后面的,默认为从头到尾,step=1。
measure rmsd atomselect0 atomselect1 weight mass  得到两个selection之间的rmsd并考虑质量权重,所选的这两个部分必须原子数相同。比如可以选不同的帧的同一个部分。
measure sasa 1.4 atomselect1  以1.4埃为探测球的半径,得atomselect1的SASA。还可以加[-points varname] [-restrict restrictedsel] [-samples numsamples]参数,见P104。得到的结果和mm_pbsa得到的输出文件的surface area项基本一致。用这个方法算,两个部分不能相加,比如1的sasa和2的sasa之和不等于1和2的总sasa
mol命令用的分子号,可以是独立的一个mol ID,也可以是all, top, active,
inactive, displayed, on, off, fixed, free。
mol new   创建一个新的空分子
mol new f:sustiva.pdb   创建一个新分子,读入此文件
mol addfile f:sustiva.pdb   读入此分子到top分子中
mol new和mol addfile后面都可以接参数,type pdb读入pdb类型,还支持其它的,包括轨迹等。first <frame>、last <frame>、step <frame>设置读入轨迹文件时读哪些以及间隔多少。autobonds on/off决定是否自动连键。molid 5读入到id=5的分子,只对addfile管用。
mol load pdb f:\sustiva.pdb  好像和mol new没区别,不能接其它参数
mol urlload <file_type> <URL> 从某个URL地址读取
mol pdbload 2BBM      读取某个四个字母的pdb结构,从RCSB获得
mol list 显示目前已读取的分子信息
mol list 分子号      显示分子号包括的全部分子的详细信息,包括显示方式
mol color Chain     将默认原子上色方式改为Chain,似乎不管用
mol representation  CPK 将默认原子显示方式改为CPK,似乎不管用
mol selection [select_method]     改变默认选择方法
mol modcolor 0 top Chain    将top分子的0号representation改成Chain上色方式
mol modmaterial 0 top ghost 将top分子的0号representation改成Ghost风格
mol modmaterial 0 top CPK   将top分子的0号representation改成CPK显示方式
mol modselect 0 top {index 3} 将top分子0号representation选择内容为index 3
mol addrep 0    给0号分子新增一个representation
mol delrep 1 top  删掉top分子1号representation
mol delete top  删掉top分子
mol on/off 2   显示/不显示mol id=2的分子
mol active/inactive 2  激活/取消激活mol id=2的分子
mol default style  显示style的默认设置
mol default style CPK  设置默认style为CPK
mol modrep 1 top   将top分子的1号representation套用默认设置,似乎没用
mol fix/free 2   设置molid=2的分子是否fix(固定)
mol top      3     设置3号分子为top分子
mol cancel    3       停止3号分子载入轨迹
mol reanalyze 2      重新分析并输出2号原子的结构,比如成键情况
mol ssrecalc top     重新计算top分子的二级结构
mol rename top  pppp    重命名top分子为ppppp
mol repname top 0   显示top分子0号representation的名字
mol rename top rep0   显示top分子名为rep0的representation的序号,若得到-1,说明没那个名字
mol selupdate/colupdate 0 top on/off  对top分子0号representation,开不开Update Selection或Color Every Frame的选项
mol smoothrep top 0 12对top分子0号representation的smooth显示值设为12
mol showrep top 0 on/off 设置top分子0号representation显示不显示
mol scaleminmax top 0 0.3 4.6 设置top分子0号rep的color scale范围为0.3-4.6
mol scaleminmax top auto 设置top分子0号rep的color scale为自动
mol drawframes molecule_number rep_number [frame specification] 可以同时播放多个轨迹,见P108
molinfo list  列出所有分子的ID。 分子即便删了,它的ID以后也不会再次被使用
molinfo num   显示分子数数目
molinfo top   显示top分子的ID
molinfo index 3  显示第3个分子的ID
molinfo top get { frame numframes a filename} 得到top分子的当前帧号,总帧数,和cell的a边长,和文件名。大括号里面写多少都行(如果就一个可不写大括号),属性都会以空格来分隔输出。大括号里支持的keywords见Tabel 8.3
molinfo 0 get { {rep 0} {color 0} {rep 1} {color 1} } 得到第1、2个representation的形式和参数(比如NewCartoon和其调节参数),和第1、2个图层用的Coloring Method意义(如name)。注意读入轨迹后,切换到不同帧,get得到的是当前帧的信息,比如molinfo molinfo top get {a b c alpha beta gamma}得到的是当前帧的盒子信息。
mouse mode x 设置鼠标成为某种模式。x=0代表设为旋转,1平移,2缩放,3 N设置为旋转第N个光源。4 N,N可以是
0: query item 1: pick center 2: pick atom 3: pick bond 4: pick angle 5: pick dihedral 6: move atom 7: move residue 8: move fragment 9: move molecule 10: force on atom 11: force on residue 12: force on fragment   比如mouse mode 4 0 设鼠标为查询某个原子信息状态
mouse rocking on/off  设置鼠标拉动分子后,是否让分子继续旋转
mouse stoprotation    停止分子旋转,包括用鼠标拉动其自动旋转,和rock等命令让分子旋转所导致的

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值