Mathematica中文论坛-非官方

标题: 在vmd中,将第一个分子轨迹根据resid 0-148 对齐到第二个分子的resid 3-150 [打印本页]

作者: meatball1982    时间: 昨天 15:41
标题: 在vmd中,将第一个分子轨迹根据resid 0-148 对齐到第二个分子的resid 3-150
两个分子,一个是reference 分子。
另一个,是一个轨迹。
把轨迹中的部分,根据部分原子进行对齐。
在vmd中,将第一个分子轨迹根据 resid 0-148 对齐到第二个分子的resid 3-150 上,
  1. # 定义分子ID(根据实际修改)
  2. set mol1 0  ;# 第一个分子(待移动的轨迹)
  3. set mol2 1  ;# 第二个分子(参考结构)

  4. # 选择对齐的原子组
  5. set mobile [atomselect $mol1 "resid 0 to 148"]
  6. set ref [atomselect $mol2 "resid 3 to 150"]

  7. # 遍历每一帧进行对齐
  8. for {set frame 0} {$frame < [molinfo $mol1 get numframes]} {incr frame} {
  9.     # 更新到当前帧
  10.     $mobile frame $frame
  11.     $ref frame $frame ;# 若mol2是静态结构,可省略此行

  12.     # 计算变换矩阵并应用到整个分子
  13.     set trans_mat [measure fit $mobile $ref]
  14.     set all_mol1 [atomselect $mol1 "all" frame $frame]
  15.     $all_mol1 move $trans_mat
  16.     $all_mol1 delete ;# 清理内存
  17. }

  18. # 清理临时选择
  19. $mobile delete
  20. $ref delete
复制代码







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