import%20marimo%0A%0A__generated_with%20%3D%20%220.13.6%22%0Aapp%20%3D%20marimo.App(width%3D%22medium%22)%0A%0Awith%20app.setup%3A%0A%20%20%20%20import%20marimo%20as%20mo%0A%20%20%20%20from%20deeporigin.drug_discovery%20import%20Protein%2C%20Ligand%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20%22%22%22%0A%20%20%20%20%2F%2F%2F%20attention%20%7C%20Work%20in%20progress%0A%0A%20%20%20%20Functionality%20shown%20here%20is%20under%20active%20development.%20%0A%20%20%20%20%2F%2F%2F%0A%0A%0A%20%20%20%20%23%20Docking%20using%20Deep%20Origin%0A%0A%20%20%20%20In%20this%20notebook%20we%20demonstrate%20how%20we%20can%20work%20with%20Proteins%20and%20Ligands%20to%20dock%20a%20Ligand%20to%20a%20Protein%20using%20the%20Deep%20Origin%20API.%0A%0A%20%20%20%20%23%23%20The%20%60Protein%60%20Class%0A%0A%20%20%20%20First%2C%20we%20can%20construct%20a%20protein%20object%20by%20specifying%20a%20PDB%20ID.%20We%20can%20inspect%20the%20protein%20by%20printing%20it%3A%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20protein%20%3D%20Protein.from_pdb_id(%221EBY%22)%0A%20%20%20%20protein%0A%20%20%20%20return%20(protein%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(%22%22%22%0A%20%20%20%20%23%23%23%20Visualizing%20the%20Protein%0A%0A%20%20%20%20We%20can%20visualize%20the%203D%20structure%20of%20the%20protein%20using%20the%20%60show%60%20method%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(protein)%3A%0A%20%20%20%20protein.show()%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20%22%22%22%0A%20%20%20%20%23%23%23%20Basic%20Protein%20Prep%0A%0A%20%20%20%20We%20notice%20that%20there%20are%20several%20heteratoms%20in%20the%20protein.%20We%20can%20remove%20them%20using%20the%20%60remove_hetatm%60%20method.%20This%20removes%20the%20waters%20and%20the%20ligand%20that%20is%20part%20of%20the%20structure%20we%20obtained%20from%20PDB%3A%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(protein)%3A%0A%20%20%20%20protein.remove_hetatm()%0A%20%20%20%20protein.show()%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20%22%22%22%0A%20%20%20%20%23%23%23%20Finding%20pockets%0A%0A%20%20%20%20We%20can%20now%20find%20pockets%20using%20the%20Pocket%20Finder%20tool.%20%0A%0A%20%20%20%20%2F%2F%2F%20admonition%20%7C%20Fast%20running%20tool%0A%0A%20%20%20%20This%20functionality%20uses%20the%20Deep%20Origin%20pocket%20finder%20tool.%20Fast%20running%20tools%20(functions)%20have%20near%20instant%20start%20up%20times%20and%20respond%20to%20requests%20over%20HTTP.%0A%0A%20%20%20%20%2F%2F%2F%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(protein)%3A%0A%20%20%20%20pockets%20%3D%20protein.find_pockets(pocket_count%3D1)%0A%20%20%20%20pocket%20%3D%20pockets%5B0%5D%0A%20%20%20%20return%20pocket%2C%20pockets%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(%22%22%22We%20can%20inspect%20properties%20of%20the%20pocket%20by%20simply%20calling%20the%20pocket%20object%3A%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(pocket)%3A%0A%20%20%20%20pocket%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20%22%22%22%0A%20%20%20%20%23%23%23%20Visualizing%20pocket%0A%0A%20%20%20%20We%20can%20visualize%20the%20pocket%20in%20the%20protein%20using%20the%20%60show%60%20method%20of%20the%20Protein%20class%3A%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(pockets%2C%20protein)%3A%0A%20%20%20%20protein.show(pockets%3Dpockets)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20%22%22%22%0A%20%20%20%20%23%23%20Ligand%20to%20dock%0A%0A%20%20%20%20Here%20we%20construct%20the%20Ligand%20object%20to%20dock%20to%20this%20protein%20from%20a%20SMILES%20string.%20We%20can%20view%20the%20structure%20of%20the%20ligand%20using%20the%20%60show%60%20method%3A%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20ligand%20%3D%20Ligand.from_smiles(%22CN(C)C(%3DO)c1cccc(-c2cn(C)c(%3DO)c3%5BnH%5Dccc23)c1%22)%0A%20%20%20%20ligand.show()%0A%20%20%20%20return%20(ligand%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20%22%22%22%0A%20%20%20%20%23%23%23%20Ligand%20ADMET%20properties%0A%0A%20%20%20%20We%20can%20use%20the%20Deep%20Origin%20%60molprops%60%20tool%20to%20compute%20ADMET%20properties%20of%20the%20Ligand%0A%0A%20%20%20%20%2F%2F%2F%20admonition%20%7C%20Fast%20running%20tool%0A%0A%20%20%20%20This%20functionality%20uses%20the%20Deep%20Origin%20%60molprops%60%20tool.%20Fast%20running%20tools%20(functions)%20have%20near%20instant%20start%20up%20times%20and%20respond%20to%20requests%20over%20HTTP.%0A%0A%20%20%20%20%2F%2F%2F%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(ligand)%3A%0A%20%20%20%20ligand.admet_properties()%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20%22%22%22%0A%20%20%20%20%23%23%20Docking%0A%0A%20%20%20%20We%20can%20now%20dock%20the%20ligand%20to%20the%20protein%20using%20the%20%60dock%60%20method%20of%20the%20Protein%20class.%20This%20will%20return%20a%20SDF%20file%20with%20the%20poses%20of%20the%20ligand%20in%20the%20protein.%20%0A%0A%20%20%20%20%2F%2F%2F%20admonition%20%7C%20Fast%20running%20tool%0A%0A%20%20%20%20This%20functionality%20uses%20the%20Deep%20Origin%20Docking%20tool.%20Fast%20running%20tools%20(functions)%20have%20near%20instant%20start%20up%20times%20and%20respond%20to%20requests%20over%20HTTP.%0A%0A%20%20%20%20%2F%2F%2F%0A%0A%20%20%20%20We%20can%20visualize%20these%20poses%20using%20the%20%60show%60%20method%20of%20the%20Protein%20class%3A%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(ligand%2C%20pocket%2C%20protein)%3A%0A%20%20%20%20poses_sdf%20%3D%20protein.dock(ligand%3Dligand%2Cpocket%3Dpocket)%0A%20%20%20%20protein.show(sdf_file%3Dposes_sdf)%0A%20%20%20%20return%20(poses_sdf%2C)%0A%0A%0A%40app.cell%0Adef%20_(poses_sdf)%3A%0A%20%20%20%20from%20deeporigin.drug_discovery.structures.ligand%20import%20ligands_to_dataframe%0A%0A%20%20%20%20df%20%3D%20ligands_to_dataframe(Ligand.from_sdf(poses_sdf))%0A%20%20%20%20df.loc%5B%3A%2C%5B%22POSE%20SCORE%22%2C%20%22Binding%20Energy%22%5D%5D%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
a8633797e7efdf920b0646bf9f2fc809ca4d8c39cae45fe292420d798d193268