DeepChem
Deep learning is machine learning utilized in the modern world to achieve goals. Deep learning can solve a wide range of issues. Large volumes of labeled data are preferred. For example, the creation of self-driving cars involves millions of photos and thousands of hours of video. Deep learning models are addressed as deep neural networks because most deep learning approaches use neural network designs. The number of hidden layers in a neural network is often called “deep.” Deep neural networks can have 150 hidden layers, whereas traditional neural networks only have 2–3.
Deep learning and machine learning can prove a milestone in drug discovery. Before we begin with our article, it’s necessary to know the meaning of the term DeepChem. As you can see, Deep is deriving the first three words from deep learning and Chem from that of Cheminformatics.
Let us first see how to install deepchem. By using pip, it can install.
>>>pip install deepchem
We will download the .csv file of the data aspirin from ChEMBL Database ChEMBL (ebi.ac.uk).
ChEMBL is a database of bioactive compounds with drug-like characteristics that has been carefully selected. It combines chemical, bioactivity, and genetic data to aid in the translation of genomic data into novel medications that work.
Aspirin, commonly known as acetylsalicylic acid (ASA), is a pain reliever, fever reducer, and inflammation reducer. When taken soon after a heart attack, aspirin lowers the risk of death. It is also used for long-term to prevent heart attacks, ischemic strokes, and blood clots.
An active drug follows rules of Lipinski’s.
1. HBA (Hydrogen-Bond Acceptors) not more then 10.
2. HBD (Hydrogen- Bond Donor) not more then 5.
3. Molecular weight less then 500.
4. AlogP not more than 5.
We will import aspirin.csv file.
import pandas as pd
from rdkit import Chem
from rdkit.Chem import Draw
from itertools import islice
data= pd.read_csv(‘aspirin.csv’)
data.head()
Partition Coefficients
The partition coefficient determines whether a chemical substance is hydrophilic (“water-loving”) or hydrophobic (“water-fearing”). Partition coefficients can be used to estimate drug distribution in the body. Hydrophobic medicines with high octanol-water partition coefficients are often found in hydrophobic regions like cell lipid bilayers. Hydrophilic medicines, on the other hand, are found largely in aqueous environments such as blood serum (low octanol/water partition coefficients).
LogP = log10 (Partition Coefficient) Partition Coefficient, P = [organic]/[aqueous]
AlogP — Aqueous solubility
Polar Surface Area The surface sum over all polar atoms or molecules, typically oxygen and nitrogen, including their connected hydrogen atoms, is described as the polar surface area (PSA) or topological polar surface area (TPSA) of a molecule.
PSA is a popular medicinal chemistry metric for determining how well a medication can infiltrate cells. Molecules with a polar surface area more than 140 angstroms squared have a hard time passing through cell membranes. A PSA of less than 90 angstroms squared is normally required for molecules to pass through the blood–brain barrier (and so act on receptors in the central nervous system).
fig, ax = plt.subplots(figsize=(100,40))
fig.set_size_inches(25.5, 10.5, forward=True)
id=final_df1[‘ChEMBL ID’]
psa=final_df1[‘Polar Surface Area’]
plt.plot(id, psa, color=’red’, marker=’o’)
plt.title(‘Polar Surface Area’, fontsize=18)
plt.xlabel(‘ChEMBL ID’, fontsize=14)
plt.ylabel(‘Polar Surface Area’, fontsize=18)
plt.grid(False)
plt.show()
Fig 1 ChEMBL 25 with Polar Surface Area less then 90.
Hydrogen- Bond Acceptor and Hydrogen-Bond Donor
Alcohol and phenol hydroxyls are ubiquitous in pharmaceuticals and are frequently implicated in hydrogen bonding, with oxygen acting as a hydrogen-bond acceptor (HBA) and hydrogen acting as a hydrogen-bond donor (HBD). Bond directions must be taken into account; minor variations are conceivable. Such bonds are critical in drug-target binding in general.
molecules = [Chem.MolFromSmiles(smiles)
Get sonia singla’s stories in your inbox
Join Medium for free to get updates from this writer.
for smiles in islice(data[‘Smiles’], 2)]
Draw.MolsToGridImage(molecules)
new_df=data[[‘ChEMBLID’,’MolecularWeight’,’Targets’,’AlogP’,’PolarSurface Area’,’HBA’,’HBD’,’Smiles’]]
def get_standard_value(chembl_id, standard_type):
records = new_client.activity.filter(molecule_chembl_id=chembl_id).filter(standard_units=’nM’).filter(standard_type=standard_type)
df = pd.DataFrame.from_dict(records)
if len(df)>0:
return (chembl_id,df[‘standard_value’][0])
Converted the x_list into dataframe by using df1
x_list = list()
i=1
for chem_id in new_df[‘ChEMBL ID’]:
f=get_standard_value(chem_id,’IC50')
if f!= None:
x_list.append(f)
i+=1
x_list
df1=pd.DataFrame(x_list)
df1
Renaming the columns 0 and 1 as ChEMBL ID and standard_value.df1.rename(columns={0:"ChEMBL ID",1:"standard_value"},inplace=True)
df1
#Columns with none, nan values, can be dropped further. We can do Data Visualization. Linear Regression, #Random Forest Classification, and can calculate molecular weight by Lipinksi rules.
#Convert None into nan and then drop the nan values.
final_df = new_df.replace([‘None’,’NONE’,’none’],np.nan)
final_df = new_df.dropna()
final_df.head()
final_df1=pd.merge(df1, final_df)
final_df1.head()
final_df1[[“AlogP”,”Polar Surface Area”,”standard_value”]].astype(str).astype(float)
final_df1.dtypes
Heatmap
# plotting correlation heatmap
dataplot = sns.heatmap(final_df1.corr(), cmap=”YlGnBu”, annot=True)
dataplot
Hydrogen Bonds Acceptor (HBA) and Polar Surface Area (PSA) are highly correlated with each other.





