Skip to content

Commit 0db887b

Browse files
committed
Add axes and transparent example grid box; show how to get molecule coordinates in PyMOL
This commit improves the functionality of gridbox.py by adding visual axes, a transparent example box, and instructions for obtaining molecular coordinates in PyMOL.
1 parent 1269bf0 commit 0db887b

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

scripts/gridbox.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,29 @@ def gridbox(center_x,center_y,center_z,size_x,size_y,size_z,name="gridbox",r1=0,
110110

111111

112112

113-
cmd.extend('gridbox', gridbox)
113+
cmd.extend('gridbox', gridbox)
114+
115+
#Draw an example transparent grid box:
116+
size_x,size_y,size_z=[10,15,15]
117+
center_x,center_y,center_z=[34.82, 89.48, 45.98]
118+
gridbox(center_x,center_y,center_z,size_x,size_y,size_z,name="gridbox_1",r1=0,g1=1,b1=1,trasp=0.3)
119+
120+
#How to get coordinate of a selected residue or molecule:
121+
#1: zoom
122+
#2: print cmd.get_position()
123+
124+
#Add Axes
125+
axes=True
126+
if axes==True:
127+
from pymol.cgo import CYLINDER, cyl_text
128+
from pymol.vfont import plain
129+
130+
obj = [CYLINDER, 0., 0., 0., 10., 0., 0., 0.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0., CYLINDER, 0., 0., 0., 0., 10., 0., 0.2, 1.0, 1.0, 1.0, 0., 1.0, 0.,CYLINDER, 0., 0., 0., 0., 0., 10., 0.2, 1.0, 1.0, 1.0, 0., 0.0, 1.0,]
131+
132+
cyl_text(obj,plain,[-5.,-5.,-1],'Origin',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]])
133+
cyl_text(obj,plain,[10.,0.,0.],'X',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]])
134+
cyl_text(obj,plain,[0.,10.,0.],'Y',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]])
135+
136+
cmd.load_cgo(obj,'axes')
137+
138+

0 commit comments

Comments
 (0)