Protenix-dock

TODO: get more conformers in sdf file, and test for virtual screening

Install instruction

After install

Test whether the notebook can import it successfully

if vscode:

export LD_LIBRARY_PATH=${CONDA_PREFIX}/lib:$LD_LIBRARY_PATH

If jupyterlab on a cloud, need to set secrete:

import os
conda_lib_path = os.path.join(os.environ["CONDA_PREFIX"], "lib")
current_path = os.environ.get("LD_LIBRARY_PATH", "")
print(conda_lib_path,current_path)

# if in cloud, set the secrete according to below
os.environ['LD_LIBRARY_PATH'] ="/home/zeus/miniconda3/envs/cloudspace/lib:/opt/jupyter/envs/main/lib"
print(os.environ['LD_LIBRARY_PATH'])

Setup

One-time protenix-dock

get_rec_lig('7OFF','VCB','protenix_test')
7OFF.pdb is detected!
('/teamspace/studios/this_studio/kdock/nbs/protenix/protenix_test/7OFF_receptor.pdb',
 '/teamspace/studios/this_studio/kdock/nbs/protenix/protenix_test/7OFF_lig.sdf')
box = get_box('protenix_test/7OFF_lig.sdf',tolist=True)
box
[38.848, -26.77, 10.419, 14.652, 8.942, 12.509]

source

capture_output


def capture_output(
    log_path
):

source

get_protenix_dock


def get_protenix_dock(
    receptor_pdb, # pdb path
    ligand_sdf, # sdf path
    box:list, # center xyz + size xyz
    out_dir:str='.', # output directory
    num_walker:int=20, # number of Monte Carlo threads, the more walkers the more space to explore
    mc_prune_energy_threshold:int=500, # maximum allowed energy for a pose; if exceeds, skipped
    include_affinity:bool=True, # include bscore
    kwargs:VAR_KEYWORD
):

Use protenix-dock to dock ligand sdf to receptor pdb using protenix-dock

The function will output -prepared-ligand/receptor.json in the same directory as the receptor & ligand files

And output a out.json and log in the out_dir

# %%time
# get_protenix_dock('protenix_test/7OFF_receptor.pdb',
#                   'protenix_test/7OFF_lig.sdf',
#                   box,
#                   out_dir='protenix_test/dock_result',
#                   num_walker=20
#                  )

Protenix-vina

Vina function in protenix-dock repository


source

get_protenix_vina_dock


def get_protenix_vina_dock(
    receptor_pdb, # pdb path
    ligand_sdf, # sdf path
    box:list, # center xyz + size xyz
    out_dir:str='.', # output directory
    kwargs:VAR_KEYWORD
):

Dock ligand sdf to receptor pdb using protenix-dock

# %%time
# get_protenix_vina_dock('protenix_test/7OFF_receptor.pdb',
#                   'protenix_test/7OFF_lig.sdf',
#                   box,
#                   out_dir='protenix_test/vina_result',
#                  )

Output to sdf


source

json2sdf


def json2sdf(
    json_path, sdf_path:NoneType=None, # .sdf to be saved
):
list(Path('protenix_test/dock_result').glob('*_out.json'))
[PosixPath('protenix_test/dock_result/7OFF_lig-prepared-ligand-0_out.json')]
# json2sdf('protenix_test/dock_result/7OFF_lig-prepared-ligand-0_out.json',
#          sdf_path='protenix_test/predicted.sdf')

End