Impact of 'fromAtoms' on GetMorganFingerprint()

This section provides a tutorial example on impact of the 'fromAtoms' option on fingerprint generation with rdkit.Chem.rdMolDescriptors.GetMorganFingerprint() function.

The 'fromAtoms' option in the rdkit.Chem.rdMolDescriptors.GetMorganFingerprint() function call allows you to keep identifiers a given list of atom nodes only. The default value is useBondTypes=[], which returns identifiers for all atom nodes.

For example, the following code shows you how to keep identifiers of atom 0 and atom 2 of molecule "CCC" in the fingerprint.

from rdkit.Chem import AllChem
mol = AllChem.MolFromSmiles('CCC')

bitInfo = {}
fp = AllChem.GetMorganFingerprint(mol, 1, fromAtoms=[], bitInfo=bitInfo)
print(bitInfo)

bitInfo = {}
fp = AllChem.GetMorganFingerprint(mol, 1, fromAtoms=[0,2], bitInfo=bitInfo)
print(bitInfo)

# output: 
{2068133184: ((1, 1),), 
 2245384272: ((1, 0),), 
 2246728737: ((0, 0), (2, 0)), 
 3542456614: ((0, 1), (2, 1))}

{2246728737: ((0, 0), (2, 0)), 
 3542456614: ((0, 1), (2, 1))}

Conclusion: The 'fromAtoms' option is useful only if you want get a subset of the final final fingerprint.

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

 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

 What Is Morgan Fingerprint Generator in RDKit

 GetMorganFingerprint() Method in RDKit

 Impact of 'radius' on GetMorganFingerprint()

 Impact of 'useCounts' on GetMorganFingerprint()

 Impact of 'invariants' on GetMorganFingerprint()

 Impact of 'useBondTypes' on GetMorganFingerprint()

Impact of 'fromAtoms' on GetMorganFingerprint()

 GetMorganFingerprintAsBitVect() Method in RDKit

 Impact of 'nBits' on GetMorganFingerprintAsBitVect()

 GetHashedMorganFingerprint() Method in RDKit

 Impact of 'nBits' on GetHashedMorganFingerprint()

 GetMorganGenerator() Method in RDKit

 Morgan Fingerprint Generator in RDKit for FCFP

 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