Script de YASARA para hacer "scoring" de muchos complejos proteína-ligando.

Después de llevar a cabo una simulación de docking de la libreria química de casi 700,000 compuestos (en fragmentos de 3,000 compuestos en formato sdf) hemos ordenado los 200 mejores en función del valor de ΔG (Kcal/mol) calculado. Sobre ellos (ficheros con extensión *.yob de YASARA) aplicaremos el macro dock_rescore.mcr (justo debajo vemos las lineas modificadas a nuestro antojo...), que carga un complejo receptor-ligando, minimiza energéticamente cada pose de ligando y la rescata utilizando la búsqueda local de AutoDock VINA, confinada estrechamente a la pose original del ligando.

# MacroTarget 'E:\docking_autodock_mejores-100\2XQQ-DYNLL2-mejores100_004-H-UNL'

# Docking method, either VINALS or AutoDockLS.
method='AutoDockLS'

# Number of local docking runs per ligand (maximally 999, 
# 0 lets YASARA choose based on the number of CPUs)
runs=999

# Sort results either by ligand number ('ligandnum'), binding energy ('bindnrg') or by
# efficiency ('effi'), i.e. binding energy per heavy atom, which addresses the bias towards
# larger ligands in screening.
sortby='ligandnum'

# Force field used to determine which ligand bonds can rotate, 
# and also point charges if method='AutoDockLS'
forcefield='AMBER03'

# Selection of receptor atoms that are free to move during the minimization of each ligand pose.
# By default, only polar hydrogens are allowed to reorient.
# recminsel='Element H with bond to Element N O P S'
# Alternatively, let all receptor side-chains move instead. Note that the more receptor atoms move, 
# the better the # ligand will bind. But since the energetic cost of the receptor's structural
# change is not considered in AutoDock's
# scoring function, moving receptor atoms may add noise instead of prediction accuracy.
# recminsel='Sidechain'
# Alternatively, let the entire receptor move.
# scoring function,  
recminsel='All'

LoadYOb E:\aaa\[variable-1].yob
SegRes UNL,___
NameMol Res Unl,H
SaveYOb 1,E:\aaa\[variable-1]-H-UNL.yob
SavePDB 1,E:\aaa\[variable-1]-H-UNL.pdb,Format=PDB,Transform=Yes,UseCIF=No
MacroTarget E:\aaa\[variable-1]-H-UNL.yob,Remove=Extension
PlayMacro E:\aaa\_dock_rescore.mcr
Clear

Puedes ejecutar el siguiente script (adecua las rutas a tus necesidades) desde Visual Studio code como un fichero de Jupiter.

import subprocess

# Rutas de los archivos y comando, lista.txt contiene en columna todos los
# nombres de los complejos proteína-ligando que queremos someter al 
# script "_dock_rescore.mcr"
yasara_exe = r"E:\yasara-24.4.10\yasara.exe"
macro_script = r"E:\aaa\_dock_rescore.mcr"
list_file = r"E:\aaa\_lista.txt"

# Leer el archivo de lista
with open(list_file, 'r') as f:
    lines = f.readlines()

# Iterar sobre las líneas del archivo de lista
for line in lines:
    # Obtener el valor de la variable
    variable = line.split()[0]
    
    # Construir la ruta del objetivo
    target_path = fr"E:\aaa\{variable}"
    
    # Construir y ejecutar el comando
    command = [yasara_exe, "-txt", macro_script, f"MacroTarget='{target_path}'"]
    try:
        subprocess.run(command, check=True)
        print(f"Comando ejecutado para {variable}")
    except subprocess.CalledProcessError as e:
        print(f"Error al ejecutar el comando para {variable}: {e}")





Última modificación: