# YASARA MACRO # TOPIC: 5. Structure prediction # TITLE: Docking a ligand to a receptor # REQUIRES: Structure # AUTHOR: Elmar Krieger # LICENSE: GPL # DESCRIPTION: This macro predicts the structure of a ligand-receptor complex. It can also continue a docking run that got interrupted. An analysis log file is written at the end. # Parameter section - adjust as needed # ==================================== # 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' # Number of docking runs (each run can take up to an hour) runs = 25 # Docking results usually cluster around certain hot spot conformations, # and the lowest energy complex in each cluster is saved. Two complexes belong to # different clusters if the ligand RMSD is larger than this minimum [A]: rmsdmin = 5.0 # Forcefield to use for docking ForceField Amber99 # 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" if runs>999 RaiseError 'Too many docking runs selected, (runs) would take forever' structlist='receptor','ligand' # Load receptor and ligand Clear # Do we already have a receptor scene? scefilename='(MacroTarget)_receptor.sce' scene = FileSize (scefilename) if !scene # No, load PDB or YOB files of receptor and ligand for struct in structlist (struct)=0 for type in 'yob','pdb' filename='(MacroTarget)_(struct).(type)' exists = FileSize (filename) if exists (struct) = Load(type) (filename) break if not (struct) RaiseError 'The (struct) was not found at (filename)' # Orient the receptor, create a docking cell that includes the entire receptor # and also has enough empty space around to accomodate the ligand (which has to # be removed temporarily, since 'Cell Auto' encloses the entire soup). ligandradius = RadiusObj (ligand) NiceOriObj (receptor) RemoveObj (ligand) Cell Auto,Extension=(ligandradius*2) AddObj (ligand) TypeBond Obj (ligand),Obj (ligand) else # Yes, a scene is present LoadSce (scefilename) # The receptor is the object containing the first atom receptor = ListObj Atom 1 # Load the ligand ligand=0 for type in 'yob','pdb' filename='(MacroTarget)_ligand.(type)' exists = FileSize (filename) if exists ligand = Load(type) (filename) break if not ligand RaiseError 'The ligand was not found at (filename)' # Warn if the cell is too large x,y,z = Cell if x>47 or y>47 or z>47 ShowMessage "A cell axis is longer than 47 A, which may reduce docking accuracy. Consider focusing on the active site." Wait ContinueButton HideMessage # Docking is done without periodic boundaries Boundary Wall Longrange None # Rename receptor and ligand objects to make sure they can be identified later NameObj (receptor),Receptor NameObj (ligand),Ligand # Perform the docking Experiment Docking Method AutoDockLGA ReceptorObj (receptor) LigandObj (ligand) Runs (runs) ClusterRMSD (rmsdmin) ResultFile (MacroTarget)001 # Note that temporary files are saved in YASARA's current working directory, # NOT at (MacroTarget). If you want to keep all temporary files, uncomment below: # TmpFileID YourChoice Experiment On Wait ExpEnd # Save a scene with receptor and all ligand conformations SaveSce (MacroTarget) # Save a log file with an analysis Console Off RecordLog (MacroTarget) print 'Docking result analysis' print '=======================' print print '(runs) docking runs of the ligand object (ligand) to the receptor object (receptor) yielded the following results,' print 'sorted by binding energy: [More positive values indicates stronger binding, and negative values mean no binding]' print print 'Run |Bind.energy[kcal/mol]|Bind.constant [pM]| Contacting receptor residues' print '----+---------------------+------------------+-----------------------------' clusters=0 for i=001 to runs bindnrg = BFactorAtom Segment C(i) bindconst = PropAtom Segment C(i) if bindnrg<=0 bindconst=' None' else bindconst=0000000000000.00+bindconst reslist() = ListRes Obj (receptor) with distance<4.5 from Segment C(i),Format='RESNAME MOLNAME RESNUM' print '(i) | (000000.0000+bindnrg) | (bindconst) | (join reslist)' # Count the clusters exists = FileSize (MacroTarget)(i).yob if exists clusters=clusters+1 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]' print print 'Cluster|Bind.energy[kcal/mol]|Bind.constant [pM]| Contacting receptor residues' print '-------+---------------------+------------------+-----------------------------' for i=001 to clusters DelAll LoadYOb (MacroTarget)(i) # 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=' None' else bindconst=0000000000000.00+bindconst reslist() = ListRes not Mol (ligand) with distance<4.5 from Mol (ligand),Format='RESNAME MOLNAME RESNUM' print '(i) | (000000.0000+bindnrg) | (bindconst) | (join reslist)' print 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:' for i=001 to clusters print '(MacroTarget)(i).yob',Convert=No LoadSce (MacroTarget) StopLog