Skip to content

Add axes and transparent example grid box; how to get molecule coordinates #170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion scripts/gridbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,29 @@ def gridbox(center_x,center_y,center_z,size_x,size_y,size_z,name="gridbox",r1=0,



cmd.extend('gridbox', gridbox)
cmd.extend('gridbox', gridbox)

#Draw an example transparent grid box:
size_x,size_y,size_z=[10,15,15]
center_x,center_y,center_z=[34.82, 89.48, 45.98]
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)

#How to get coordinate of a selected residue or molecule:
#1: zoom
#2: print cmd.get_position()

#Add Axes
axes=True
if axes==True:
from pymol.cgo import CYLINDER, cyl_text
from pymol.vfont import plain

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,]

cyl_text(obj,plain,[-5.,-5.,-1],'Origin',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]])
cyl_text(obj,plain,[10.,0.,0.],'X',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]])
cyl_text(obj,plain,[0.,10.,0.],'Y',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]])

cmd.load_cgo(obj,'axes')