<jupyter_start><jupyter_text>NCI Open DatabaseThis notebook check if any of the fragment-like set compounds have experimental logPs reposted in the NCI Open Database.I downloaded NCI Open Database August 2006 release `ncidb_August2006.sdf ` to ./ncidb directory, because this versionincluded experimental logP values. This directory is not included in the repository due to size. It can be downloadedfrom https://cactus.nci.nih.gov/download/nciBefore running this notebook, convert SDF file of database to csv for easier manipulation:  $ python convert.py ncidb_August2006.sdf  ncidb_August2006.csv<jupyter_code>import pandas as pd
import pickle
import numpy as np
from openeye import oechem, oedepict, oemolprop
# Import dataframe of selecyed drug-like set compounds 
df_drug = pd.read_csv("df_drug_final.csv", index_col=[0])

# Convert canonical isomeric SMILES to canonical SMILES for comparison to NCI Open Database/
df_drug["canonical SMILES"] = None

ifs = oechem.oemolistream()
ofs = oechem.oemolostream()

ifs.SetFormat(oechem.OEFormat_ISM)
ofs.SetFormat(oechem.OEFormat_CAN)

for i, row in df_drug.iterrows():
    #print(i, row["eMolecules ID"])
    can_iso_smiles = row["canonical isomeric SMILES"]
    mol = oechem.OEGraphMol()
    oechem.OESmilesToMol(mol, can_iso_smiles)
    canonical_smiles = oechem.OECreateCanSmiString(mol)
    df_drug.loc[i, "canonical SMILES"]= canonical_smiles

df_drug.head()
# Read NCI Open Database CSV file
df_ncidb = pd.read_csv("./ncidb/ncidb_August2006.csv")
df_ncidb.head()
# Search fragment-like set compounds in NCI Open Database with canonical SMILES
drug_can_smiles_list = list(df_drug["canonical SMILES"])
df_ncidb.loc[df_ncidb["SMILES"].isin(drug_can_smiles_list)]
# Search fragment-like set compounds in NCI Open Database with canonical isomeric SMILES
drug_can_iso_smiles_list = list(df_drug["canonical isomeric SMILES"])
df_ncidb.loc[df_ncidb["SMILES"].isin(drug_can_iso_smiles_list)]<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup