rdkit.Chem.rdGeneralizedSubstruct module — The RDKit 2025.09.6 documentation

# rdkit.Chem.rdGeneralizedSubstruct module

Module containing functions for generalized substructure searching

rdkit.Chem.rdGeneralizedSubstruct.CreateExtendedQueryMol((rdkit.Chem.rdchem.Mol)mol[, (bool)doEnumeration=True[, (bool)doTautomers=True[, (bool)adjustQueryProperties=False[, (rdkit.Chem.rdmolops.AdjustQueryParameters)adjustQueryParameters=None]]]]) → ExtendedQueryMol :

  Creates an ExtendedQueryMol from the input molecule

  > This takes a query molecule and, conceptually, performs the following steps to produce an ExtendedQueryMol:

  > > 1. Enumerates features like Link Nodes and SRUs

  > > 2. Converts everything into TautomerQueries

  > > 3. Runs adjustQueryProperties()

  > Each step is optional

  C++ signature :

    RDKit::GeneralizedSubstruct::ExtendedQueryMol* CreateExtendedQueryMol(RDKit::ROMol [,bool=True [,bool=True [,bool=False [,RDKit::MolOps::AdjustQueryParameters*=None]]]])

class rdkit.Chem.rdGeneralizedSubstruct.ExtendedQueryMol((object)self, (str)text[, (bool)isJSON=False]) → None :

  Bases: `instance`

  Extended query molecule for use in generalized substructure searching.

  constructor from either a binary string (from ToBinary()) or a JSON string.

  C++ signature :

    void __init__(_object*,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,bool=False])

  InitFromBinary((ExtendedQueryMol)self, (str)pkl) → None :
    C++ signature :

      void InitFromBinary(RDKit::GeneralizedSubstruct::ExtendedQueryMol {lvalue},std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)

  InitFromJSON((ExtendedQueryMol)self, (str)text) → None :
    C++ signature :

      void InitFromJSON(RDKit::GeneralizedSubstruct::ExtendedQueryMol {lvalue},std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)

  PatternFingerprintQuery((ExtendedQueryMol)self[, (int)fingerprintSize=2048]) → object :
    C++ signature :

      std::unique_ptr<ExplicitBitVect, std::default_delete<ExplicitBitVect> > PatternFingerprintQuery(RDKit::GeneralizedSubstruct::ExtendedQueryMol {lvalue} [,unsigned int=2048])

  ToBinary((ExtendedQueryMol)self) → object :
    C++ signature :

      boost::python::api::object ToBinary(RDKit::GeneralizedSubstruct::ExtendedQueryMol)

  ToJSON((ExtendedQueryMol)self) → str :
    C++ signature :

      std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > ToJSON(RDKit::GeneralizedSubstruct::ExtendedQueryMol {lvalue})

rdkit.Chem.rdGeneralizedSubstruct.MolGetSubstructMatch((rdkit.Chem.rdchem.Mol)mol, (ExtendedQueryMol)query[, (rdkit.Chem.rdchem.SubstructMatchParameters)params=None]) → object :

  returns first match (if any) of a molecule to a generalized substructure query

  C++ signature :

    _object* MolGetSubstructMatch(RDKit::ROMol,RDKit::GeneralizedSubstruct::ExtendedQueryMol [,RDKit::SubstructMatchParameters*=None])

rdkit.Chem.rdGeneralizedSubstruct.MolGetSubstructMatches((rdkit.Chem.rdchem.Mol)mol, (ExtendedQueryMol)query[, (rdkit.Chem.rdchem.SubstructMatchParameters)params=None]) → object :

  returns all matches (if any) of a molecule to a generalized substructure query

  C++ signature :

    _object* MolGetSubstructMatches(RDKit::ROMol,RDKit::GeneralizedSubstruct::ExtendedQueryMol [,RDKit::SubstructMatchParameters*=None])

rdkit.Chem.rdGeneralizedSubstruct.MolHasSubstructMatch((rdkit.Chem.rdchem.Mol)mol, (ExtendedQueryMol)query[, (rdkit.Chem.rdchem.SubstructMatchParameters)params=None]) → bool :

  determines whether or not a molecule is a match to a generalized substructure query

  C++ signature :

    bool MolHasSubstructMatch(RDKit::ROMol,RDKit::GeneralizedSubstruct::ExtendedQueryMol [,RDKit::SubstructMatchParameters*=None])

rdkit.Chem.rdGeneralizedSubstruct.PatternFingerprintTarget((rdkit.Chem.rdchem.Mol)target[, (int)fingerprintSize=2048]) → object :

  Creates a pattern fingerprint for a target molecule that is compatible with an extended query

  C++ signature :

    std::unique_ptr<ExplicitBitVect, std::default_delete<ExplicitBitVect> > PatternFingerprintTarget(RDKit::ROMol [,unsigned int=2048])