Mathematica中文论坛-非官方

标题: 豆粑粑 VMD提取轨迹的特定帧 [打印本页]

作者: meatball1982    时间: 2022-3-21 13:19
标题: 豆粑粑 VMD提取轨迹的特定帧
我有一条轨迹,
我想提取其中的某一帧。

通过VMD实现。
之前都是gromacs整。后来发现 vmd 也行,也不用生成 top之类。直接提取就行。

其中,2就是要提的第3帧(从0开始)。
traj_align.pdb是轨迹文件。
cen0.pdb 是输出文件。

tcl_draw_cen.tcl
  1. #!/usr/local/bin/vmd
  2. # VMD script written by save_state $Revision: 1.48 $
  3. # VMD version: 1.9.4a12
  4. mol new ./traj_align.pdb type pdb first 0 last -1 step 1 filebonds 1 autobonds 1 waitfor all
  5. animate write pdb {./cen0.pdb} beg 2 end 2 skip 1 0
  6. q
复制代码


是用vmd 提交,无界面
  1. vmd -dispdev text -e tcl_draw_cen.tcl
复制代码


如果多次提取,可以通过sed替换nfr.
tmp.tcl
  1. #!/usr/local/bin/vmd
  2. # VMD script written by save_state $Revision: 1.48 $
  3. # VMD version: 1.9.4a12
  4. mol new ./traj_align.pdb type pdb first 0 last -1 step 1 filebonds 1 autobonds 1 waitfor all
  5. animate write pdb {./cen0.pdb} beg nfr end nfr skip 1 0
  6. q
复制代码

提交修改脚本。
  1. num=2
  2. sed "s/nfr/${num}/g" tmp.tcl > tcl_draw_cen.tcl
复制代码







欢迎光临 Mathematica中文论坛-非官方 (http://www.ilovemathematica.com/) Powered by Discuz! X3.2