# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     name: python3
# ---

# + [markdown] id="jyJ3Yev3hzwQ"
# <a href="https://colab.research.google.com/github/ohuelab/QEPPI/blob/main/notebook/QEPPI.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>

# + [markdown] id="3Ezk4xyjiVNV"
# ## Notes
#
# This notebook is designed to be run in **Colab (Google Colaboratory)**, not in your local Jupyter Notebook environment.
#
# So, if you want to run it locally, please rewrite the PATH settings of each cell and the file input/output code appropriately.

# + id="XirDETzAV0s4"
# !pip install rdkit-pypi
from rdkit import rdBase
from rdkit import Chem
from rdkit.Chem import Draw
print(rdBase.rdkitVersion)

# + id="W9iCv8X5GxSd"
# !git clone https://github.com/ohuelab/QEPPI.git

# + id="Bo609XfrOINp"
#Move the working directory to path
import os
path = "/content/QEPPI"
os.chdir(path)

# + [markdown] id="510NKIkmlFPn"
# # Calculation QEPPI for Your "SMILES"
#

# + id="RLZj8WajlikM"
#@markdown ##### Example SMILES: **Idasanutlin** is a potent and selective p53-MDM2 inhibitor
#@markdown ##### Replace with the "SMILES" you are interested in.
SMILES = "COC1=CC(=CC=C1NC(=O)[C@@H]1N[C@@H](CC(C)(C)C)[C@@](C#N)([C@H]1C1=CC=CC(Cl)=C1F)C1=CC=C(Cl)C=C1F)C(O)=O" #@param {type:"string"}
if len(SMILES) == 0:
    print("Please enter SMILES.")
else:
    # !python calc_QEPPI.py --smiles '$SMILES'
mol = Chem.MolFromSmiles(SMILES)
img = Draw.MolToImage(mol)
img

# + [markdown] id="MNIh6cFLH_0B"
# # Calculation QEPPI for Your "SDF file"
# If you upload the SDF, the result of calculating QEPPI will be returned as CSV with SMILES.

# + id="k5zXO7IRToX_"
from google.colab import files

print("Please your SDF file upload")
uploaded = files.upload()
file_name = list(uploaded.keys())[0]
# !python calc_QEPPI.py --sdf $file_name
# !rm -rf $file_name
files.download("result.csv")

StarcoderdataJupyterScriptsDedupFiltered