Mathematica中文论坛-非官方
标题:
pymol gromacs 轨迹 自动存储 画图 papa的儿子
[打印本页]
作者:
meatball1982
时间:
2016-3-11 16:41
标题:
pymol gromacs 轨迹 自动存储 画图 papa的儿子
#####################################
# outline
# use pymol to auto save a trj pdb into figures
#
# example :
# pymol -c Py_draw.py -- iamref.pdb iamtraj.pdb iamanme 3000 iamfigname
#####################################
import pymol
import cmd
import sys, time, os
#####################################
# inputs
# pdb : a structure file. .pdb .gro
# trj : a trajectory file. .pdb(multi frames), .trr
# name : the name of the trj u import into pymol, it is anything u like
# ray_size : ray number, usually bigger, more clear
# fig_name : the output figure name
pdb = sys.argv[1]
trj = sys.argv[2]
name = sys.argv[3]
ray_size = sys.argv[4]
fig_name = sys.argv[5]
####################################
# load and plot
cmd.load(pdb,name)# load reference structure
cmd.load(trj,name)# load traj file
cmd.show("cartoon",name)#use cartoon to plot pdb
cmd.hide("line",name)# hide the line
cmd.color("red","ss h")# set alpha red
cmd.color("yellow","ss s")# set beta yellow
cmd.color("green","ss l+''")# set other green
cmd.set("ray_opaque_background","off")# background transpancy
for x in range(1,12,2) :# plot range for 1 to 12 int 1
cmd.frame("%d" %x )
cmd.zoom(name,state=-1)# zoom, show a big pdb in each frame
cmd.ray(ray_size)# clearer
cmd.png("fig_name"+str(x-1)+".png")# output fig
cmd.quit()# quit pymol
####################################
# logs
# typed by : meatball1982@163.com
#
复制代码
有一个轨迹, 有一个ref的pdb,如何自动将轨迹中的每隔2frame的图存出来.
post.rar
2016-3-11 16:40 上传
点击文件名下载附件
122.97 KB, 下载次数: 0
example
欢迎光临 Mathematica中文论坛-非官方 (http://www.ilovemathematica.com/)
Powered by Discuz! X3.2