What Is rdkit.Chem.rdmolfiles Module

This section provides a quick introduction of the molecule file module of the RDKit library, rdkit.Chem.rdmolfiles, which provides functionalities to handle molecule strings/files with different formats like SMILES, SDF, FASTA, SVG, etc..

What Is rdkit.Chem.rdmolfiles Module? - rdkit.Chem.rdmolfiles module provides functionalities to handle molecule strings/files with different formats like SMILES, SDF, FASTA, SVG, etc..

rdkit.Chem.rdmolfiles contains the following main methods:

rdkit.Chem.rdmolfiles.MolFromFASTA(s) - Constructs a molecule object from a FASTA string.

rdkit.Chem.rdmolfiles.MolFromMolBlock(s) - Constructs a molecule object from a Mol block string, which is really a SDF (Structure Data Format) string without custom properties.

rdkit.Chem.rdmolfiles.MolFromMolFile(f) - Constructs a molecule object from a Mol block file, which is really a SDF (Structure Data Format) file without custom properties.

rdkit.Chem.rdmolfiles.MolFromPDBBlock(s) - Constructs a molecule object from a PDB (Protein Database) string.

rdkit.Chem.rdmolfiles.MolFromPDBFile(f) - Constructs a molecule object from a FASTA string.

rdkit.Chem.rdmolfiles.MolFromPNGFile(f) - Constructs a molecule object from metadata in a PNG (Portable Network Graphics) file.

rdkit.Chem.rdmolfiles.MolFromPNGString(s) - Constructs a molecule object from metadata in a PNG (Portable Network Graphics) string.

rdkit.Chem.rdmolfiles.MolFromRDKitSVG(s) - Constructs a molecule object from a RDKit-generate SVG (Scalable Vector Graphic) string.

rdkit.Chem.rdmolfiles.MolFromSequence(s) - Constructs a molecule object from a DNA sequence string.

rdkit.Chem.rdmolfiles.MolFromSmarts(s) - Constructs a molecule object from a SMARTS string.

rdkit.Chem.rdmolfiles.MolFromSmiles(s) - Constructs a molecule object from a SMILES string.

rdkit.Chem.rdmolfiles.MolToFASTA(m) - Returns the FASTA string from a molecule object.

rdkit.Chem.rdmolfiles.MolToMolBlock(s) - Returns the Mol block string from a molecule object.

rdkit.Chem.rdmolfiles.MolToMolFile(s, f) - Writes a Mol (SDF) file for a molecule object.

rdkit.Chem.rdmolfiles.MolToPDBBlock(s) - Returns a PDB block string from a molecule object.

rdkit.Chem.rdmolfiles.MolToPDBFile(s, f) - Writes a PDB file for a molecule object.

rdkit.Chem.rdmolfiles.MolToSmarts(s) - Returns a SMARTS string from a molecule object.

rdkit.Chem.rdmolfiles.MolToSmiles(s) - Returns a SMILES string from a molecule object.

rdkit.Chem.rdmolfiles also contains some classes:

rdkit.Chem.rdmolfiles.SDMolSupplier - A class to read multiple molecules from a SDF file.

rdkit.Chem.rdmolfiles.SDWriter - A class to write multiple molecules to a SDF file.

rdkit.Chem.rdmolfiles.SmilesMolSupplier - A class to read multiple molecules from a SMILES list file.

rdkit.Chem.rdmolfiles.SmilesWriter - A class to write multiple molecules to a SMILES list file.

To simplify access names, rdkit.Chem.rdmolfiles module members are also imported at the rdkit.Chem package level. So you can access module members at both levels: the rdkit.Chem package level and the rdkit.Chem.rdmolfiles module level, as shown below:

herong$ python
>>> import rdkit.Chem.rdmolfiles
>>> m = rdkit.Chem.rdmolfiles.MolFromSmiles('Cc1ccccc1')
>>> exit()

herong$ python
>>> import rdkit.Chem
>>> m = rdkit.Chem.rdmolfiles.MolFromSmiles('Cc1ccccc1')
>>> exit()

herong$ python
>>> from rdkit.Chem import rdmolfiles
>>> m = rdmolfiles.MolFromSmiles('Cc1ccccc1')
>>> exit()

herong$ python
>>> from rdkit import Chem
>>> m = Chem.rdmolfiles.MolFromSmiles('Cc1ccccc1')
>>> exit()

rdkit.Chem.rdmolfiles module methods and classes can also accessed directly from the package name "rdkit.Chem" without module name "rdmolfiles" as shown below:

herong$ python
>>> from rdkit import Chem

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

For more information, see rdkit.Chem.rdmolfiles module reference document at http://rdkit.org/docs/source/rdkit.Chem.rdmolfiles.html.

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

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

 Resources and Tools

 Cheminformatics Related Terminologies

 References

 Full Version in PDF/EPUB