<jupyter_start><jupyter_text>Dependencies:<jupyter_code>import os
import torch #pip install torch
import numpy as np #pip install numpy
#import pandas as pd 
import pickle
import xgboost as xgb #pip install xgboost
import tensorflow as tf #pip install tensorflow
from tensorflow.keras import layers
#from rdkit import Chem #conda install -c rdkit rdkit
#from rdkit.Chem import Crippen 
#from rdkit.Chem import Descriptors
import shutil
import warnings
import esm #pip install fair-esm
from KM_prediction import *
import os
from os.path import join 
#import torch
CURRENT_DIR = os.getcwd()<jupyter_output><empty_output><jupyter_text>Before using KM prediction for the first time, we have to download the ESM-1b model:<jupyter_code>import esm
model, alphabet = torch.hub.load("facebookresearch/esm:v0.4.0", "esm1b_t33_650M_UR50S")<jupyter_output>Downloading: "https://github.com/facebookresearch/esm/archive/v0.4.0.zip" to C:\Users\alexk/.cache\torch\hub\v0.4.0.zip<jupyter_text>Example for calculating KM prediction. You can enter multiple enyzmes and substrates. Enzyme 1 will be paired with substrate 1, enzyme 2 will be paired with substrate 2 and so on... Enter enzymes as amino acid sequences and substrate either as SMILES strings, KEGG Compound IDs, or InChI strings.<jupyter_code>from KM_prediction import *

KM_predicton(substrate_list = ["InChI=1S/C21H27N7O14P2/c22-17-12-19(25-7-24-17)28(8-26-12)21-16(32)14(30)11(41-21)6-39-44(36,37)42-43(34,35)38-5-10-13(29)15(31)20(40-10)27-3-1-2-9(4-27)18(23)33/h1-4,7-8,10-11,13-16,20-21,29-32H,5-6H2,(H5-,22,23,24,25,33,34,35,36,37)/p-1/t10-,11-,13-,14-,15-,16-,20-,21-/m1/s1"], 
             enzyme_list = ["MSIPETQKGVIFYESHGKLEYKDIPVPKPKANELLINVKYSGVCHTDLHAWHGDWPLPVKLPLVGGHEGAGVVVGMGENVKWKIGDYAGIKWLNGSCMACEYCELGNESNCPHADLSGYTHDGSFQQYATADAVQAAHIPQGTDLAQVAPILCAGITVYKALKSANLMAGHWVAISGAAGGLGSLAVQYAKAMGYRVLGIDGGEGKEELFRSIGGEVFIDFTKEKDIVGAVLKATDGGAHGVINVSVSEAAIEASTRYVRANGTTVLVGMPAGAKCCSDVFNQVVKSISIVGSYVGNRADTREALDFFARGLVKSPIKVVGLSTLPEIYEKMEKGQIVGRYVVDTSK"])<jupyter_output>Step 1/3: Calculating numerical representations for all metabolites.
.....1(a) Calculating input matrices for Graph Neural Network
.....1(b) Calculating numerical metabolite representations using a Graph Neural Network
Step 2/3: Calculating numerical representations for all enzymes.
.....2(a) Loading ESM-1b model.
.....2(b) Calculating enzyme representations.
Step 3/3: Making predictions for KM.
{'fraction_non_alphanumeric': 0.10276516714816343, 'fraction_numerical': 0.07924061081304168, 'mean_word_length': 6.171597633136095, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '335184', 'license': 'MIT', 'n_tokens_mistral': 1096, 'n_tokens_neox': 937, 'n_words': 200, 'path': 'code/Tutorial KM prediction.ipynb', 'repo_name': 'AlexanderKroll/KM_prediction_function', 'size': '2423'}