Cheminformatics Tutorials - Herong's Tutorial Examples - v2.03, by Herong Yang
MolFromSmiles/MolToSmiles for SMILES Format
This section provides a tutorial example on how to use rdkit.Chem.rdmolfiles.MolFromSmiles(s) and rdkit.Chem.rdmolfiles.MolToSmiles(m) methods to handle molecules expressed in SMILES strings.
There are two main methods that handle molecules expressed in SMILES strings:
1. rdkit.Chem.rdmolfiles.MolFromSmiles(s) or rdkit.Chem.MolFromSmiles(s) - Constructs a molecule object from a given SMILES string.
2. rdkit.Chem.rdmolfiles.MolToSmiles(m) or rdkit.Chem.MolToSmiles(m) - Returns a SMILES string representing the molecule from a given molecule object.
Here is an example session of using these two methods:
>>> from rdkit import Chem >>> m = Chem.MolFromSmiles('Cc1ccccc1') >>> m.GetNumAtoms() 7 >>> m.GetNumBonds() 7 >>> s = Chem.MolToSmiles(m) >>> print(s) Cc1ccccc1
Table of Contents
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
►rdkit.Chem.rdmolfiles - Molecular File Module
What Is rdkit.Chem.rdmolfiles Module
►MolFromSmiles/MolToSmiles for SMILES Format
MolFromMolBlock/MolToMolBlock for Mol Block
SmilesMolSupplier/SDWriter for SMILES Files
SDMolSupplier/SDWriter for SDF Files
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