rdkit.Chem.rdchem.Mol - The Molecule Class

This section provides a quick introduction of the rdkit.Chem.rdchem.Mol class, which represents a molecule with its properties, child objcts, and operation methods.

What Is rdkit.Chem.rdchem.Mol? - rdkit.Chem.rdchem.Mol is the Molecule class located in the rdkit.Chem.rdchem module of the RDKit library.

rdkit.Chem.rdchem.Mol represents a molecule with the following main properties, child objects, and methods.

m = rdkit.Chem.rdmolfiles.MolFromSmiles('Cc1ccccc1') - Creates rdkit.Chem.rdchem.Mol object from the given SMILES.

m.Compute2DCoords() or rdkit.Chem.rdchem.Mol.Compute2DCoords(m) - Compute 2 dimensional coordinates of atoms and bonds of a given molecule to depict it as a 2-D structure.

m.GetNumAtoms() or rdkit.Chem.rdchem.Mol.GetNumAtoms(m) - Returns the number of atoms of the given molecule.

m.GetNumBonds() or rdkit.Chem.rdchem.Mol.GetNumBonds(m) - Returns the number of bonds of the given molecule.

m.SetProp(key, value) or rdkit.Chem.rdchem.Mol.SetProp(m, key, value) - Adds or updates a custom property in the given molecule.

m.GetProp(key) or rdkit.Chem.rdchem.Mol.SetProp(m, key) - Returns the value of a given custom property from the given molecule.

m.GetPropsAsDict() or rdkit.Chem.rdchem.Mol.GetPropsAsDict(m) - Returns all custom properties as a dictionary from the given molecule.

m.Debug() or rdkit.Chem.rdchem.Mol.Debug(m) - Prints debug information of the given molecule.

m.GetAtomWithIdx(i) or rdkit.Chem.rdchem.Mol.GetAtomWithIdx(m, i) - Returns the Atom object at a given index from the given molecule.

m.GetAtoms() or rdkit.Chem.rdchem.Mol.GetAtoms(m) - Returns a sequence that represents all child atoms of the given molecule.

m.GetBondWithIdx(i) or rdkit.Chem.rdchem.Mol.GetBondWithIdx(m, i) - Returns the Bond object at a given index from the given molecule.

m.GetBonds() or rdkit.Chem.rdchem.Mol.GetBonds(m) - Returns a sequence that represents all child bonds of the given molecule.

Here is an example session of using rdkit.Chem.rdchem.Mol class:

>>> import rdkit
>>> m = rdkit.Chem.rdmolfiles.MolFromSmiles('Cc1ccccc1')

>>> m.GetNumAtoms()
7
>>> m.GetNumBonds()
7
>>> rdkit.Chem.rdchem.Mol.GetNumAtoms(m)
7
>>> rdkit.Chem.rdchem.Mol.GetNumBonds(m)
7

>>> m.getProp("Tag", "MyMolecule")
>>> rdkit.Chem.rdchem.Mol.SetProp(m, "Note", "First Molecule")

>>> m.GetProp("Tag")
'MyMolecule'
>>> m.GetPropsAsDict()
{'Tag': 'MyMolecule', 'Note': 'First Molecule'}

Table of Contents

 About This Book

 SMILES (Simplified Molecular-Input Line-Entry System)

 Open Babel: The Open Source Chemistry Toolbox

 Using Open Babel Command: "obabel"

 Generating SVG Pictures with Open Babel

 Substructure Search with Open Babel

 Similarity Search with Open Babel

 Fingerprint Index for Fastsearch with Open Babel

 Stereochemistry with Open Babel

 Command Line Tools Provided by Open Babel

 RDKit: Open-Source Cheminformatics Software

rdkit.Chem.rdchem - The Core Module

 What Is rdkit.Chem.rdchem Module

rdkit.Chem.rdchem.Mol - The Molecule Class

 rdkit.Chem.rdchem.Atom - The Atom Class

 rdkit.Chem.rdchem.Bond - The Bond Class

 rdkit.Chem.rdchem.RWMol - The RWMol Class

 rdkit.Chem.rdmolfiles - Molecular File Module

 rdkit.Chem.rdDepictor - Compute 2D Coordinates

 rdkit.Chem.Draw - Handle Molecule Images

 Molecule Substructure Search with RDKit

 rdkit.Chem.rdmolops - Molecule Operations

 Daylight Fingerprint Generator in RDKit

 Morgan Fingerprint Generator in RDKit

 RDKit Performance on Substructure Search

 Introduction to Molecular Fingerprints

 OCSR (Optical Chemical Structure Recognition)

 AlphaFold - Protein Structure Prediction

 Resources and Tools

 Cheminformatics Related Terminologies

 References

 Full Version in PDF/EPUB