# YASARA MACRO # TOPIC: 5. Structure prediction # TITLE: Showing the docking results interactively # REQUIRES: Structure # AUTHOR: Elmar Krieger # LICENSE: GPL # DESCRIPTION: This macro cycles through the results of the various docking runs, and then shows the best complex in each cluster # You can either set the target structure by clicking on Options > Macro > Set target, # or by uncommenting the line below and specifying it directly. #MacroTarget='/home/myname/projects/docking/1sdf' # Normally no change required below this point # 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" # Load the result scene LoadSce (MacroTarget) # The ligand object contains one molecule for each docking run runs = CountMol Obj Ligand # Loop through the docking conformations # The segment names of the ligand conformations are C001, C002 etc. # The atomic B-factor contains the free energy of binding in kcal/mol. # The atomic property contains the picomolar [pM] binding constant. Console Off ShowButton Continue while 1 for i=001 to runs HideObj Ligand ShowAtom Segment C(i) bindnrg = BFactorAtom Segment C(i) bindconst = PropAtom Segment C(i) if bindnrg>0 bindconst=0.0+bindconst else bindconst='None' ShowMessage 'Docking run (0+i)/(runs): Binding energy (0.00+bindnrg) kcal/mol, binding constant (bindconst) pM' Wait 10 if ContinueButton break 2 # Count the clusters for clusters=000 to runs exists = FileSize (MacroTarget)(clusters+1).yob if !exists break # Show the clusters while 1 for i=001 to clusters DelAll LoadYOb (MacroTarget)(i) Style Ribbon,Stick BallStickRes HetGroup Free ShowHBoAll Color Element Center PosObj 1,0,0,50 # Identify the last molecule in the soup, which is the ligand ligand = ListMol Atom (atoms) bindnrg = BFactorMol (ligand) bindconst = PropMol (ligand) if bindnrg>0 bindconst=0.0+bindconst else bindconst='None' ShowMessage 'Cluster (0+i)/(clusters): Binding energy (0.00+bindnrg) kcal/mol, binding constant (bindconst) pM' Wait ContinueButton