Skip to content

Open-sourced, this workflow stands out as one of the premier methods for generating protein-ligand interaction images. With direct accessibility through your browser, it prioritizes enhanced user-friendliness and accessibility.

License

quantaosun/labodock_binder

Repository files navigation

Labodock_binder

Acknowledgments

  • Credits to the Labodock project for developing an excellent and open-source suite for docking on Google Colab.
  • Credits to the Binder project for developing the fantastic interactive Jupiter notebook used on web browsers.
image

Stable version (Cloud, Recommended)

badge

In house receptor docking Binder

Latest version (Cloud)

badge

Use on Windows

Compared to cloud manner which is much more flexible and easy to use. Windows version takes some time to learn how to operate properly, and once it is set, it is more robust and stable.

We here use Docker as a container, to mimic a Linux machine

I assume you already installed Docker-desktop, and started it on the back. Also, I assume you already launched Windows PowerShell (The blue one) and have navigated to a folder where you want to do docking. Run:

docker pull qutesun/labodock_binder
docker run -p 8888:8888 -v ${PWD}:/home/jovyan/work qutesun/wemd

Your PowerShell terminal will output some crazy lines that you probably can't read properly, among which there will be a token pin, just copy it.

Now go to your default browser, and try

localhost:8888

your browser will start a Jupyter Notebook interface and ask for a token pin, which you have coped from the backend in the PowerShell interface.

After having entered the browser interface, double click wedock_win.ipynb, and you are ready to do the docking just as if you using the Binder badge above.

DOI

version

license

百度平台用户

请使用中国大陆手机号码注册登陆百度飞浆,在公开项目中搜索本仓库名称,复刻到本人名下,点击启动环境运行,在命令行内生成新环境后,开始在笔记本内完成对接。受制于百度平台的维护策略,在项目关闭后我们创建的环境将被清除,下次启动时请再次安装。

What happens once you click the launch binder badge?

This Binder section is copied from https://discourse.jupyter.org/t/how-to-reduce-mybinder-org-repository-startup-time/4956

Each time a user clicks a Binder link, these things happen:

A slot (called a “pod”) is reserved on one of the cloud machines. This takes 1-2 seconds. Binder looks to see if a Docker image exists for that repository If it doesn’t, Binder must first build the image for that repo using repo2docker (this takes time) The binder looks for a built image on the machine the user will use If it isn’t on the machine, Binder must first pull the image onto that machine (this takes time) Binder launches the user’s session. This includes: a small amount of time to start the “init pods to limit network access”, a few seconds for the Jupyter process to start, a few seconds for BinderHub to notice, and finally, your browser needs to follow the redirect.

Introduction

labodock_binder is an enhanced iteration of Labodock (https://github.com/RyanZR/labodock), primarily focusing on improved accessibility and user-friendliness. Notable modifications from Labodock version 2.0.0 include:

Seamless Access: Unlike the original Google Colab login requirement, labodock_binder allows free access from Chrome, Firefox, and Safari, without the need for signup or login. This is made possible through the implementation of Binder technology (https://mybinder.org/).

Pre-built Images: The labodock_binder image is pre-built. When a user clicks the link, the image is pulled from the cloud to the local browser, instead of installing all packages from scratch. This significantly accelerates the readiness for docking.

Simplified Execution: labodock_binder streamlines the process with one-click execution, eliminating the need for repetitive variable modifications.

High Safety Standard:All code executed, data analyzed, and files uploaded during a Binder session, including any modifications to the docking notebook, are automatically deleted when the user logs off or becomes inactive for a few minutes. This ensures that there's no concern about temporary uploads, such as small molecule structures, being leaked. Additionally, Binder retains only the IP addresses associated with the service visits for 30 days, and this information is solely utilized to identify potential abuse of the Binder service. Rest assured that all modifications to the docking notebook are automatically cleared upon closing the browser window, and the platform prioritizes user privacy by minimizing data retention

These enhancements collectively contribute to a more user-friendly and accessible experience. labodock_binder emerges as a versatile and convenient tool for users worldwide, requiring only internet availability—no Google account necessary.

image

Usage

PDB_ID is a four-letter code from the PDB bank website, for example, 3HTB

Native_lig below means the native ligand of the co-crystal structure of the PDB bank, it can be found on the PDB website, it should always be a three-letter code, for example, JZ4

smiles is the small molecule you want to dock, you can obtain this from ChemDraw, from Edit > Copy as smiles

(In wedock2.ipynb, smiles variable was replaced by a CSV file containing multiple smiles)

The first three cells are the only thing you should modify. From the top left, click Run > Run All Cells, and the docking will start automatically. Your docked 3D interaction diagram will be at the bottom of the notebook.

wedock.ipynb does not need manual intervention, but for wedock2.ipynb, if you wish to overlay two docked small molecules, you do need to specify several variables manually.

If docking with a local PDB complex, for example, an in-house structure, change this native ligand section, Instead of downloading the native ligand from online, it directly greps out the native ligand from a local PDB


Keyword = Native_lig # @param {type: 'string'}

def get_molblock(keyword: str) -> str:
    url_path = PRT_FLD
    pdb_file = os.path.join(NTV_FLD, Keyword + '.pdb')
    sdf_file = os.path.join(NTV_FLD, keyword + '.sdf')
    os.system(f'grep {keyword} {PDB_pdb_pFile} -O {pdb_file}')
    os.system(f'obabel -ipdb {pdb_file} -osdf -O {sdf_file}')
    molblock = [mol for mol in  Chem.SDMolSupplier(sdf_file) if mol is not None][0]
    os.remove(sdf_file)
    return molblock

def correct_bond_order(inpt_list: list, temp: Chem.rdchem.Mol) -> None:
    for inpt_file in inpt_list:
        targ = AllChem.MolFromPDBFile(inpt_file)
        cmol = AllChem.AssignBondOrdersFromTemplate(temp, targ)
        pdbb = Chem.MolToPDBBlock(cmol, flavor=4)
        with open(inpt_file, 'w') as oupt:
            oupt.write(pdbb)

true_id = Keyword[-3:] if len(Keyword) > 3 else Keyword
print(f'+ RCSB PDB link: https://www.rcsb.org/ligand/{true_id}')

ntv_pdb = Keyword.upper() + '.pdb'
ntv_pdb_nFile = os.path.join(NTV_FLD, ntv_pdb)
extract_entity(PDB_pdb_pFile, ntv_pdb_nFile, [Keyword, 'HETATM'])
extract_chains(ntv_pdb_nFile)

ntv_nFiles = sorted(glob.glob(NTV_FLD + '/' + Keyword + '_A.pdb'))
ntv_smiles = get_molblock(true_id)
correct_bond_order(ntv_nFiles, ntv_smiles)

About

Open-sourced, this workflow stands out as one of the premier methods for generating protein-ligand interaction images. With direct accessibility through your browser, it prioritizes enhanced user-friendliness and accessibility.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published