- run axes.py
- axes
- axes(2)
- axes(3)
Envelope proteins of Zika virus (PDB code: 5IRE) |
from pymol.cgo import *
from pymol import cmd
from pymol.vfont import plain
def axes(size=1.0):
"""
DESCRIPTION:
show the axes
USAGE: the number is the size of the axes
axes
axes(2)
axes(3)
"""
w = 0.06 # cylinder width
l = 0.75 # cylinder length
h = 0.25 # cone hight
w, l, h = size*0.3, size*3.75, size*1.25
d = w * 1.618 # cone base diameter
obj = [CYLINDER, 0.0, 0.0, 0.0, l, 0.0, 0.0, w, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0,
CYLINDER, 0.0, 0.0, 0.0, 0.0, l, 0.0, w, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0,
CYLINDER, 0.0, 0.0, 0.0, 0.0, 0.0, l, w, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0,
CONE, l, 0.0, 0.0, h+l, 0.0, 0.0, d, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0,
CONE, 0.0, l, 0.0, 0.0, h+l, 0.0, d, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 1.0,
CONE, 0.0, 0.0, l, 0.0, 0.0, h+l, d, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0]
#cyl_text(obj,plain,[-1.5,-1.5,-1.5],'O',0.2, axes=[[2,0,0],[0,2,0],[0,0,2]])
cyl_text(obj,plain,[size*5.8, 0. ,0. ],'X', size*0.20, axes=[[size,0,0],[0,size,0],[0,0,size]])
cyl_text(obj,plain,[0. ,size*5.8,0. ],'Y', size*0.20, axes=[[size,0,0],[0,size,0],[0,0,size]])
cyl_text(obj,plain,[0. ,0. ,size*5.8],'Z', size*0.20, axes=[[size,0,0],[0,size,0],[0,0,size]])
cmd.load_cgo(obj, 'axes')
cmd.extend('axes', axes)
_EOF_
阿操你好~我照著這個方式
回覆刪除先run了python scruipt
再輸入axes
但它好像說NameError: global name 'CONE' is not defined
不知道該怎麼辦呢~
謝謝你的文章~很實用