RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
Subgraphs.h File Reference

functionality for finding subgraphs and paths in molecules More...

#include <RDGeneral/export.h>
#include <vector>
#include <list>
#include <map>
#include <unordered_map>

Go to the source code of this file.

Namespaces

namespace  RDKit
 Std stuff.
 

Typedefs

typedef std::vector< intRDKit::PATH_TYPE
 
typedef std::list< PATH_TYPERDKit::PATH_LIST
 
typedef PATH_LIST::const_iterator RDKit::PATH_LIST_CI
 
typedef std::map< int, PATH_LISTRDKit::INT_PATH_LIST_MAP
 
typedef INT_PATH_LIST_MAP::const_iterator RDKit::INT_PATH_LIST_MAP_CI
 
typedef INT_PATH_LIST_MAP::iterator RDKit::INT_PATH_LIST_MAP_I
 

Functions

RDKIT_SUBGRAPHS_EXPORT INT_PATH_LIST_MAP RDKit::findAllSubgraphsOfLengthsMtoN (const ROMol &mol, unsigned int lowerLen, unsigned int upperLen, bool useHs=false, int rootedAtAtom=-1)
 find all bond subgraphs in a range of sizes
 
RDKIT_SUBGRAPHS_EXPORT PATH_LIST RDKit::findAllSubgraphsOfLengthN (const ROMol &mol, unsigned int targetLen, bool useHs=false, int rootedAtAtom=-1)
 find all bond subgraphs of a particular size
 
RDKIT_SUBGRAPHS_EXPORT PATH_LIST RDKit::findUniqueSubgraphsOfLengthN (const ROMol &mol, unsigned int targetLen, bool useHs=false, bool useBO=true, int rootedAtAtom=-1)
 find unique bond subgraphs of a particular size
 
RDKIT_SUBGRAPHS_EXPORT PATH_LIST RDKit::findAllPathsOfLengthN (const ROMol &mol, unsigned int targetLen, bool useBonds=true, bool useHs=false, int rootedAtAtom=-1, bool onlyShortestPaths=false)
 find all paths of a particular size
 
RDKIT_SUBGRAPHS_EXPORT INT_PATH_LIST_MAP RDKit::findAllPathsOfLengthsMtoN (const ROMol &mol, unsigned int lowerLen, unsigned int upperLen, bool useBonds=true, bool useHs=false, int rootedAtAtom=-1, bool onlyShortestPaths=false)
 
RDKIT_SUBGRAPHS_EXPORT PATH_TYPE RDKit::findAtomEnvironmentOfRadiusN (const ROMol &mol, unsigned int radius, unsigned int rootedAtAtom, bool useHs=false, bool enforceSize=true, std::unordered_map< unsigned int, unsigned int > *atomMap=nullptr)
 Find bond subgraphs of a particular radius around an atom. Return empty result if there is no bond at the requested radius.
 

Detailed Description

functionality for finding subgraphs and paths in molecules

Difference between subgraphs and paths : Subgraphs are potentially branched, whereas paths (in our terminology at least) cannot be. So, the following graph:

            C--0--C--1--C--3--C
                  |
                  2
                  |
                  C

has 3 subgraphs of length 3: (0,1,2),(0,1,3),(2,1,3) but only 2 paths of length 3: (0,1,3),(2,1,3)

Definition in file Subgraphs.h.