Cheminformatics Tutorials - Herong's Tutorial Examples - v2.01, by Herong Yang
MolFromMolBlock/MolToMolBlock for Mol Block
This section provides a tutorial example on how to use rdkit.Chem.rdmolfiles.MolFromMolBlock(s) and rdkit.Chem.rdmolfiles.MolToMolBlock(m) methods to handle molecules expressed in Mol blocks.
There are two main methods that handle molecules expressed in Mol blocks, which is the SDF format without custom properties:
1. rdkit.Chem.rdmolfiles.MolFromMolBlock(s) or rdkit.Chem.MolFromMolBlock(s) - Constructs a molecule object from a given Mol block.
2. rdkit.Chem.rdmolfiles.MolToMolBlock(m) or rdkit.Chem.MolToMolBlock(m) - Returns a Mol block 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') >>> s = Chem.MolToMolBlock(m) >>> print(s) RDKit 2D 7 7 0 0 0 0 0 0 0 0999 V2000 3.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 1.5000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 0.7500 -1.2990 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -0.7500 -1.2990 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -1.5000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -0.7500 1.2990 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 0.7500 1.2990 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 0 2 3 2 0 3 4 1 0 4 5 2 0 5 6 1 0 6 7 2 0 7 2 1 0 M END
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