Cheminformatics Tutorials - Herong's Tutorial Examples - v2.01, by Herong Yang
Impact of 'maxPath' on RDKFingerprint()
This section provides a tutorial example on impact of the 'maxPath' option on fingerprint generation with rdkit.Chem.rdmolops.RDKFingerprint() function.
The 'maxPath' option in the rdkit.Chem.rdmolops.RDKFingerprint() function call allows you to limit the number of bonds in selecting subgraphs to generate the fingerprint. The default is maxPath=7, which eliminates all subgraphs with more than 7 bonds.
Eliminating longer subgraphs helps to reduce the fingerprint length and computation time. But it also reduces the accuracy the final fingerprints.
1. For example, "CCCCCCCC" and "CCCCCCCCC" are 2 different molecules. But they have an identical fingerprint, when when "maxPath=7" is used. This is because the extra subgraph "CCCCCCCCC" in the second molecule has 8 bonds and is eliminated from the fingerprint generation process.
from rdkit import Chem mol = Chem.MolFromSmiles('CCCCCCCC') fp1 = Chem.RDKFingerprint(mol, fpSize=64, nBitsPerHash=1, maxPath=7) print(fp1.ToBitString()) mol = Chem.MolFromSmiles('CCCCCCCCC') fp2 = Chem.RDKFingerprint(mol, fpSize=64, nBitsPerHash=1, maxPath=7) print(fp2.ToBitString()) # output: 0000000000000100000011000000100001000000000100000000000001000000 0000000000000100000011000000100001000000000100000000000001000000
2. Now if we use "maxPath=8", "CCCCCCCC" and "CCCCCCCCC" will have different fingerprints.
mol = Chem.MolFromSmiles('CCCCCCCC') fp1 = Chem.RDKFingerprint(mol, fpSize=64, nBitsPerHash=1, maxPath=8) print(fp1.ToBitString()) mol = Chem.MolFromSmiles('CCCCCCCCC') fp2 = Chem.RDKFingerprint(mol, fpSize=64, nBitsPerHash=1, maxPath=8) print(fp2.ToBitString()) # output 0000000000000100000011000000100001000000000100000000000001000000 0000000000000100000011000000100001000000001100000000000001000000 ^ extra bit
Conclusion: We should increase maxPath as large as possible to include more subgraphs into the fingerprint.
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
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
What Is Daylight Fingerprint Generator in RDKit
RDKFingerprint() Method in RDKit
Impact of 'useBondOrder' on RDKFingerprint()
Impact of 'branchedPaths' on RDKFingerprint()
►Impact of 'maxPath' on RDKFingerprint()
Impact of 'fpSize' on RDKFingerprint()
Impact of 'tgtDensity' on RDKFingerprint()
Impact of 'nBitsPerHash' on RDKFingerprint()
UnfoldedRDKFingerprintCountBased() Method in RDKit
GetRDKitFPGenerator() Method 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