<jupyter_start><jupyter_text>Imports<jupyter_code>import pandas as pd
import numpy as np<jupyter_output><empty_output><jupyter_text>Loading csv/tsv<jupyter_code>cns_smiles_df=pd.read_csv('cns_smiles.txt',sep='\t')
non_cns_smiles_df=pd.read_csv('non_cns_smiles.txt',sep='\t')<jupyter_output><empty_output><jupyter_text>DataSets<jupyter_code>def fixValues(df):
    indx=df.index[df['Name'].str.contains("/")]
    values=[x for x in df["Name"] if "/" in x]
    
    for i in range(len(values)):
        temp=values[i]
        temp=temp.replace("/","-")
        values[i]=temp
    
    for counter,i in enumerate(indx):
        df.loc[[i],"Name"]=values[counter]
    
    return df
cns_smiles_df=fixValues(cns_smiles_df)
non_cns_smiles_df=fixValues(non_cns_smiles_df)
cns_smiles_df
non_cns_smiles_df<jupyter_output><empty_output><jupyter_text>rdkit import<jupyter_code>from IPython.display import SVG
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import rdDepictor
from rdkit.Chem.Draw import rdMolDraw2D
from rdkit.Chem import Draw<jupyter_output>RDKit WARNING: [19:09:54] Enabling RDKit 2019.09.3 jupyter extensions<jupyter_text>Folder creation for imgs<jupyter_code>import os
path = os.getcwd()
print ("The current working directory is %s" % path)
path = os.getcwd()
cns_path = path+r"/cns_smiles_imgs"
try:
    os.mkdir(cns_path)
except OSError:
    print ("Creation of the directory {} failed".format(cns_path))
else:
    print ("Successfully created the directory {}".format(cns_path))
path = os.getcwd()
ncns_path = path+r"/non_cns_smiles_imgs"
try:
    os.mkdir(ncns_path)
except OSError:
    print ("Creation of the directory {} failed".format(ncns_path))
else:
    print ("Successfully created the directory {}".format(ncns_path))<jupyter_output>Successfully created the directory C:\Users\HGMI2\Desktop\Bio-mol/non_cns_smiles_imgs<jupyter_text>Molecules to img<jupyter_code>from rdkit.Chem.Draw import IPythonConsole
IPythonConsole.ipython_useSVG=True
def printMolImgs(df,route):   
    for m_name,m_smile in zip(df["Name"].values,df["Smiles"].values):
        m = Chem.MolFromSmiles(m_smile)
        AllChem.Compute2DCoords(m)
        new_path = route+"/"+m_name
        Draw.MolToFile(m,new_path,size=(800,600),imageType="png")
printMolImgs(cns_smiles_df,cns_path)
printMolImgs(non_cns_smiles_df,ncns_path)<jupyter_output>Warning: unable to load font metrics from dir C:\Users\HGMI2\Anaconda3\lib\site-packages\rdkit\sping\PIL\pilfonts
{'fraction_non_alphanumeric': 0.12277147487844409, 'fraction_numerical': 0.009724473257698542, 'mean_word_length': 5.896648044692737, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '332692', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1005, 'n_tokens_neox': 959, 'n_words': 157, 'path': 'Smiles.ipynb', 'repo_name': 'PaolaRondon/Biomol_classifier', 'size': '2468'}