Professional Documents
Culture Documents
Dock Play
Dock Play
Dock Play
# You can either set the target structure by clicking on Options > Macro > Set
target,
# by providing it as command line argument (see docs at Essentials > The command
line),
# or by uncommenting the line below and specifying it directly.
#MacroTarget='/home/myname/projects/docking/1sdf'
# Sanity checks
if MacroTarget==''
RaiseError "This macro requires a target. Either edit the macro file or click
Options > Macro > Set target to choose a target structure"
Console off
intnamelist='Hydrophobic','PiPi','CationPi','Ionic'
PrintHUD
FillRect
Font Arial,Height=20,Color=White
PosText X=160,Y=8,Justify=Center
Print 'Docking (type) Player'
FillRect X=15,Y=30,Width=290,Height=1,Color=White
Font Height=14,Spacing=1.3
PosText X=25,Y=46,Justify=Left
if type=='Pose'
Print 'Docking run:\n'
else
Print 'Cluster:\n'
Print 'Binding energy:\nDiss.constant:\nLigand:'
# Create the clickable color gradient on the right.
# Its position 'gpos' is made global, so that it can be used by function
UpdatePlayer
Font MonoSpaced,Spacing=1
gpos=240,135
FillRect (gpos1),(gpos2+5),Width=32,Height=241,Color=White
for i=0 to 10
PosText (gpos1/8+6),(gpos2/12+i*2+1),Justify=Left
Print '(i*10)%'
FillRect (gpos1+32),(gpos2+i*24+5),Width=8,Height=1,Color=White
# Top and bottom button have half the height
if !i
y=gpos2+6
h=12
else
y=gpos2+i*24-7
h=24-12*(i==10)
ShowButton X=(gpos1+16),Y=(y),Width=30,Height=(h),Border=0,
Color=(i*320/11),Action='Go ClickGradient,GoPar=(i)'
PosText (gpos1/8+3),(gpos2/12+22),Justify=Center
Print 'Click'
PosText (gpos1/8+3),(gpos2/12+23),Justify=Center
Print 'above'
# Create the buttons
Font Arial,Height=14,Spacing=1.3
ShowButton 'Play',X=70,Y=(gpos2)
ShowButton 'Pause',X=160,Y=(gpos2)
ShowButton 'Step backward',X=120,Y=(gpos2+50)
ShowButton 'Step forward',X=120,Y=(gpos2+100)
ShowButton 'Fast forward',X=120,Y=(gpos2+150)
ShowButton 'Rewind to start',X=120,Y=(gpos2+200)
if type=='Pose'
if ligands
# We cannot save poses during covalent docking, because the flexible part is
in a different object
PosText X=0,Y=(gpos2+260)
Print 'Save pose:'
ShowButton 'PDB',X=130,Y=(gpos2+250)
ShowButton 'YOb',X=190,Y=(gpos2+250)
ShowButton 'Proceed to cluster
analysis',X=174,Y=(gpos2+300),Color=404040,Action='Go DockingClusters'
else
# Show the interaction buttons to toggle
namelist='H-Bonds','Hydrophobic','Pi/Pi','+/Pi','Ionic'
poslist=40,130,205,248,294
for i=1 to count namelist
if intflags&(1<<(i-1))
buttoncol='808080'
fontcol='White'
else
buttoncol='303030'
fontcol='Black'
Font Height=11,Color=(fontcol),Spacing=1.3
ShowButton (namelist(i)),X=(poslist(i)),Y=(gpos2+320),Color=(buttoncol)
Font Arial,Height=14,Color=White,Spacing=1.3
PosText X=160,Y=(gpos2+300),Justify=Center
Print 'Select interactions to show:'
ShowButton 'Return to all poses',X=120,Y=(gpos2+250),Color=404040,Action='Go
DockingPoses'
# The atomic B-factor contains the free binding energy in kcal/mol (positive is
better).
bindnrg = BFactorAtom (ligandsel)
# The atomic property contains the picomolar [pM] dissociation constant.
dissconst = PropAtom (ligandsel)
if bindnrg<=0
dissconst='None'
elif dissconst>=100000000
dissconst='Gigantic'
elif dissconst>=100000
dissconst=0+dissconst
else
dissconst=0.000+dissconst
# Display run, binding energy and dissociation constant
FillRect X=170,Y=44,Width=150,Height=70
PosText X=170,Y=46,Justify=Left
Print '(1+run)/(0+runs)\n(0.00+bindnrg) kcal/mol\n(dissconst) pM'
# Display first 20 characters of ligand name (compound)
FillRect X=100,Y=115,Width=220,Height=18
compound = CompoundMol (ligandsel)
if compound==''
compound='unnamed'
compound()=crack compound
PosText X=100,Y=115,Justify=Left
len=count compound
# Maximum reached with uppercase ALCOHOL DEHYDROGENASE
if len>15
len=15
for i=1 to len
Print '(compound(i))'
if runs>1
# Show the '>' at the color gradient
FillRect X=(gpos1-20),Y=(gpos2),Width=15,Height=260
PosText X=(gpos1-20),Y=(gpos2+240*run/(runs-1))
Print '>'
SavePose:
# Ask for PDB/YOb filename to save
_,filename = ShowWin Type=FileSelection,Title='Choose filename to save current
complex in (format) format',
MultipleSelections=No,Filename='*.(format)'
# Duplicate the receptor ligand objects
objlist() = DuplicateObj (recobj) (ligobj)
# Keep only the current ligand pose
DelAtom Segment !(seg) Obj (objlist2)
# Transfer atom coordinates of flexible residues to receptor
reslist() = ListRes Obj (flxobj),Format='RESNAME RESNUM Mol MOLNAME'
for res in reslist
# Get atom names in PDB3 format, so that equivalent hydrogens are numbered
atomlist() = ListAtom Res (res) Segment (seg) Obj (flxobj)
namelist() = ListAtom (join atomlist),Format='ATOMNAMEPDB3'
poslist() = PosAtom (join atomlist)
for i=1 to count atomlist
PosAtom PDB3 (namelist(i)) Res (res) Obj (objlist1),(poslist(i*3-2)),
(poslist(i*3-1)),(poslist(i*3))
# Recreate aliphatic hydrogens of flexible residues in receptor, docking doesn't
yield coordinates for them
DelAtom Element H Res (res) Obj (objlist1) with bond to Element C
AddHydRes (res) Obj (objlist1),Update=No
# Join to single object and add aliphatic hydrogens again
JoinObj (objlist2),(objlist1)
FreeObj (objlist1)
# Save and delete
Save(format) (objlist1),(filename)
DelObj (objlist1)
Go (mainloop)
# Hydrophobic interactions
Hydrophobic:
intflags=intflags^2
ShowPlayer 'Cluster'
Go (mainloop)
# Pi/Pi interactions
PiPi:
intflags=intflags^4
ShowPlayer 'Cluster'
Go (mainloop)
# Cation/Pi interactions
CationPi:
intflags=intflags^8
ShowPlayer 'Cluster'
Go (mainloop)
# Ionic interactions
Ionic:
intflags=intflags^16
ShowPlayer 'Cluster'
Go (mainloop)