[PYTHON] Pharmaceutical company researchers summarized RDKit

Introduction

Here, we will explain about RDKit, which is indispensable for chemoinformatics. I will summarize the basic method using Python.

Installation and import

To use RDKit, it is recommended to install Anaconda and install it with conda.

$ conda install -c rdkit rdkit

When using it, import it as follows.

from rdkit import Chem

Molecule reading and writing

For example, to save the structure of the compound shown in SMILES as a png file, do as follows.

from rdkit import Chem


molecule = Chem.MolFromSmiles(Compound SMILES)
Chem.Draw.MolToFile(molecule, 'file name.png')

It can also be created from a mol file.

from rdkit import Chem


molecule = Chem.MolFromMolFile(Compound mol file)
Chem.Draw.MolToFile(molecule, 'file name.png')

Calculation of compound descriptor

To calculate the descriptor of a compound read by SMILES:

from rdkit import Chem
from rdkit.ML.Descriptors import MoleculeDescriptors


smiles_list = [List of SMILES of target compounds]
target_descriptors = []
for desc in Chem.Descriptors.descList:
    target_descriptors.append(desc[0]) #desc is a tuple of descriptor names and related information.
print(len(target_descriptors))
print(target_descirptors)

descriptor_calculator = MoleculeDescriptors.MolecularDescriptorCalculator(target_descriptors)
descriptors = []
for smiles in smiles_list:
    molecule = Chem.MolFromSmiles(smiles)
    descriptors.append(descriptor_calculator.CalcDescriptors(molecule))
print(descriptors)

Summary

Here, I explained how to use RDKit in Python. If you understand this content, you will be able to easily calculate the descriptor of a compound.

Reference materials / links

How can chemoinformatics help pharmaceutical companies? What kind of knowledge do you need?

Recommended Posts

Pharmaceutical company researchers summarized RDKit
Pharmaceutical company researchers summarized scikit-learn
Pharmaceutical company researchers summarized Pandas
Pharmaceutical company researchers summarized NumPy
Pharmaceutical company researchers summarized Matplotlib
Pharmaceutical company researchers summarized Seaborn
Pharmaceutical company researchers summarized Python's comprehensions
Pharmaceutical company researchers summarized Python unit tests
Pharmaceutical company researchers summarized classes in Python
Pharmaceutical company researchers summarized functions in Python
Pharmaceutical company researchers summarized Python exception handling
Pharmaceutical company researchers summarized Python coding standards
Pharmaceutical company researchers summarized variables in Python
Pharmaceutical company researchers summarized regular expressions in Python
Pharmaceutical company researchers summarized web scraping using Python
Pharmaceutical company researchers summarized file scanning in Python
Pharmaceutical company researchers summarized database operations using Python
Pharmaceutical company researchers have summarized the operators used in Python
How to install Python for pharmaceutical company researchers
A pharmaceutical company researcher summarized the basic description rules of Python