Professional Documents
Culture Documents
Dock Run
Dock Run
# Parameter section - adjust as needed, but NOTE that some changes only take effect
# if you start an entirely new docking job, not if you continue an existing one.
# =================================================================================
# 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'
# Number of docking runs (maximally 999, each run can take up to an hour)
runs=25
# Set to 1 to keep the ligand completely rigid (alternatively you can provide
# the ligand as a *.yob file and fix certain dihedral angles only).
rigid=0
# Set to 1 to calculate the binding energy spread in each cluster (takes longer)
calcspread=1
# Force field used for charge assignment (AutoDock only, not VINA) and to determine
which ligand bonds can rotate.
# Do not change to an in vacuo force field (NOVA), all other force fields should
work too (not tested).
ForceField AMBER03
# Uncomment below to set a certain random seed
# RandomSeed 1000
# 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"
if runs>999
RaiseError 'Too many docking runs selected, (runs) would take forever'
structlist='receptor','ligand'
# Must be done during simulation so that the contact surface between different
objects can be calculated
RemoveObj RecepFlex
Sim Pause
Sim On
# Save a log file with an analysis
Console Off
RecordLog (MacroTarget)
print 'Global docking result analysis'
print '=============================='
print
print '(runs) (method) docking runs of the ligand object (ligand) to the receptor
object (receptor) yielded the following results,'
print 'sorted by binding energy [more positive energies indicate stronger binding,
and negative energies mean no binding]'
print '"Con.Surf" is the molecular contact surface.'
print
print 'Run |Bind.energy[kcal/mol]|Dissoc. constant [pM]| Con.Surf[A^2] | Contacting
receptor residues'
print '----+---------------------+---------------------+---------------
+-----------------------------'
clusters=0
for i=001 to runs
# Ligands have SegmentID C001, C002 etc.
result = DockingResult i,'Obj (receptor)','Segment C(i)'
print (result)
# Count the clusters
exists = FileSize (MacroTarget)_(i).yob
if exists
clusters=clusters+1
if !(i%10)
ShowMessage 'Analyzing docking results, (100*i/runs)% completed...'
Wait 1
Sim Off
print
print 'After clustering the (runs) runs, the following (clusters) distinct complex
conformations were found:'
print '[They all differ by at least (rmsdmin) A heavy atom RMSD after superposing
on the receptor]'
print
print 'Clu |Bind.energy[kcal/mol]|Dissoc. constant [pM]| Con.Surf[A^2] | Contacting
receptor residues'
print '----+---------------------+---------------------+---------------
+-----------------------------'
for i=001 to clusters
DelAll
LoadYOb (MacroTarget)_(i)
# Convert clusters to PDB format if requested
if pdbsaved
SavePDB 1,(MacroTarget)_(i)
# Determine SegmentID of the ligand that seeds this cluster
segnamelist(i) = SegAtom Segment C???
# Ligands have SegmentID C001, C002 etc.
result = DockingResult i,'Segment !C???','Segment C???'
print (result)
print
if calcspread
# Additionally calculate the binding energy spread in each cluster (average and
standard deviation)
print 'While the table above lists the best binding energy in each cluster, it is
sometimes'
print 'helpful to also look at the energy spread [average and standard
deviation], the'
print 'dissociation constant has been recalculated from the average binding
energy:'
print
print 'Clu |Members|Bind.energy spread [kcal/mol]|Dissoc. constant [pM]'
print '----+-------+-----------------------------+---------------------'
LoadSce (MacroTarget)
for i=001 to clusters
# Collect the binding energies of all poses that belong to the current cluster
ShowMessage 'Calculating energy spread, (100*i/clusters)% completed...'
Wait 1
bindnrglist()=0
lastbindnrg=-1e99
members=0
for j=001 to runs
if !count assigned(j)
r = RMSDAtom Segment C(j) Element !H Obj Ligand,Segment (segnamelist(i))
Element !H Obj Ligand
if r<rmsdmin
# Found a member of this cluster
bindnrg = BFactorAtom Segment C(j)
if bindnrg!=lastbindnrg
# Not a duplicate pose
members=members+1
bindnrglist(members)=bindnrg
lastbindnrg=bindnrg
assigned(j)=1
# Calculate the mean dissociation constant: Ki = exp(deltaG/(R*T))
bindnrg=mean bindnrglist
if bindnrg<=0
dissconst=' None'
else
# 4184. converts from kcal/mol to J/mol, AvoConst*BoltzConst/JToUnit is R in
[J/(K*mol)]
dissconst= 00000000000000.0000+exp
(-bindnrg*4184./(AvoConst*(BoltzConst/JToUnit)*298.15))*1e12
# Print the spread
print '(000+i) | (000+members) | (000000.0000+bindnrg)+-
(000000.0000+stddev bindnrglist) | (dissconst)'
print
rndseed = RandomSeed
print 'The current random seed is (rndseed).'
fof = ForceField
print 'Point charges and dihedral barriers were obtained from the (fof) force
field.'
print 'The results of the (runs) runs have been combined in a single scene at
(MacroTarget).sce',Convert=No
print 'The (clusters) clusters have been saved as:'
LoadSce (MacroTarget)
for i=001 to clusters
print '(MacroTarget)_(i).yob',Convert=No
StopLog
HideMessage
Console On
# Exit YASARA if this macro was provided as command line argument in console mode
if runWithMacro and ConsoleMode
Exit