<jupyter_start><jupyter_text>- [x] **Makes  `names` into  `molecules`**- [x] **Makes  `molecules` into `atomic matrices`**<jupyter_code># Author : <NAME> <<EMAIL>>

import os
import re
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_theme()

%matplotlib inline
data = pd.read_csv("../Data/external/Dataset_1.tsv", sep='\t')
data = data.filter(['Ligand SMILES', 'IC50 (nM)'])
lig, ic50 = data['Ligand SMILES'], data['IC50 (nM)']
desc = pd.read_csv("../Data/processed/descriptors.csv").T[1:].T
col = desc.columns.to_list()
names = os.listdir("../Data/processed/")
names.remove("descriptors.csv")
names.remove(".DS_Store")
names.sort(key=lambda var:[int(x) if x.isdigit() else x for x in re.findall(r'[^0-9]|[0-9]+', var)])<jupyter_output><empty_output><jupyter_text>`a` is the numpy array [`(m, 3)`] holding `m`  `X, Y, Z`   `aa` is the numpy array [`(m, m)`] holding `m x m` atomic dostance matrix`  `aaa` is the numpy array [`(number_of_molecules,)`] holding  `m x m atomic distance matrix` WITHOUT  `DIAGONAL MATRIX`  `aaaa` is the numpy array `(number_of_molecules,molecular_descriptors)` holding  `m x m atomic` `distance matrix` WITH  `DIAGONAL MATRIX`<jupyter_code>aaaa = []

for n, i in enumerate(names):
    with open(f"../Data/processed/{i}") as f:
        data = [i.split() for i in f.readlines()[10:]]

    a = pd.DataFrame(data)
    a.columns = ["ID", "ATOM", "X", "Y", "Z", "tmp"]
    atom = a["ID"].to_numpy()
    a = a.drop(['ATOM','ID','tmp'], axis = 1)
    a = a.to_numpy('float64')

    aa = []
    for j in a:
        Dist = []
        for k in a:
            Dist.append(np.linalg.norm(j - k))
        aa.append(Dist)
    aa = np.array(aa)
    
    aaa = []
    for l in col:
        np.fill_diagonal(aa, desc[l][n])
        aaa.append(aa)
    aaaa.append(np.array(aaa))
len(aaaa)<jupyter_output><empty_output><jupyter_text>Uncomment the next cell for Heatmaps<jupyter_code># for i in range(29):    
#     plt.figure(dpi=1000)
#     b = sns.heatmap(aaaa[i][0], cmap = 'tab20c',vmin = 0, vmax = 30)
#     b.axes.set_title(f"{i+1}'th molecule's Distance matrix populated with interatomic distances in the off-diagonal elements &\nwith {col[i]} in the diagonal",fontsize=7)
#     b.set_xlabel("Atomic Distances",fontsize=5)
#     b.set_ylabel("Atomic Distances",fontsize=5)
#     b.tick_params(labelsize=5)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1783783783783784, 'fraction_numerical': 0.014553014553014554, 'mean_word_length': 3.950617283950617, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '69098', 'license': 'MIT', 'n_tokens_mistral': 983, 'n_tokens_neox': 926, 'n_words': 224, 'path': 'Notebooks/final_matrices.ipynb', 'repo_name': 'Manas02/pyEVANS', 'size': '2427'}