SubstructMatch.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (C) 2001-2006 Greg Landrum and Rational Discovery LLC
00003 //
00004 //   @@ All Rights Reserved  @@
00005 //
00006 #ifndef _RD_SUBSTRUCTMATCH_H__
00007 #define _RD_SUBSTRUCTMATCH_H__
00008 
00009 // std bits
00010 #include <vector>
00011 
00012 // vflib bits
00013 #include <argraph.h>
00014 #include <vf_mono_state.h>
00015 #include <vf2_mono_state.h>
00016 
00017 namespace RDKit{
00018   class ROMol;
00019   class Atom;
00020   class Bond;
00021 
00022   //! \brief used to return matches from substructure searching,
00023   //!   The format is (queryAtomIdx, molAtomIdx)
00024   typedef std::vector< std::pair<int,int> > MatchVectType; 
00025   //typedef VFMonoState MatcherState;
00026   typedef VF2MonoState MatcherState;
00027 
00028   typedef ARGraph<const Atom, const Bond> AR_MOLGRAPH;
00029   //! Internal Use Only
00030   AR_MOLGRAPH *getMolGraph(const ROMol &mol,bool registerIt=false);
00031 
00032 
00033 #ifdef CACHE_ARMOLGRAPHS
00034 namespace SubstructLocal {
00035   void clearMolGraphCache();
00036 }
00037 #endif  
00038 
00039 
00040   //! Find a substructure match for a query in a molecule
00041   /*!
00042       \param mol       The ROMol to be searched
00043       \param query     The query ROMol
00044       \param matchVect Used to return the match
00045                        (pre-existing contents will be deleted)
00046       \param recursionPossible  flags whether or not recursive matches are allowed
00047       \param useChirality  use atomic CIP codes as part of the comparison
00048       \param registerQuery cache the query (uses more memory but speeds up searches) 
00049 
00050       \return whether or not a match was found
00051     
00052   */
00053   bool SubstructMatch(const ROMol &mol,const ROMol &query,
00054                       MatchVectType &matchVect,
00055                       bool recursionPossible=true,
00056                       bool useChirality=false,
00057                       bool registerQuery=false);
00058   //! \overload
00059   bool SubstructMatch(AR_MOLGRAPH *molG,const ROMol &query,
00060                       MatchVectType &matchVect,
00061                       bool recursionPossible=true,
00062                       bool useChirality=false,
00063                       bool registerQuery=false);
00064 
00065   //! Find all substructure matches for a query in a molecule
00066   /*!
00067       \param mol       The ROMol to be searched
00068       \param query     The query ROMol
00069       \param matchVect Used to return the matches
00070                        (pre-existing contents will be deleted)
00071       \param uniquify  Toggles uniquification (by atom index) of the results
00072       \param recursionPossible  flags whether or not recursive matches are allowed
00073       \param useChirality  use atomic CIP codes as part of the comparison
00074       \param registerQuery cache the query (uses more memory but speeds up searches) 
00075 
00076       \return the number of matches found
00077     
00078   */
00079   unsigned int SubstructMatch(const ROMol &mol,const ROMol &query,
00080                               std::vector< MatchVectType > &matchVect,
00081                               bool uniquify=true,bool recursionPossible=true,
00082                               bool useChirality=false,
00083                               bool registerQuery=false);
00084   //! \overload
00085   unsigned int SubstructMatch(AR_MOLGRAPH *molG,const ROMol &query,
00086                               std::vector< MatchVectType > &matchVect,
00087                               bool uniquify=true,bool recursionPossible=true,
00088                               bool useChirality=false,
00089                               bool registerQuery=false);
00090 }
00091 
00092 #endif
00093 
00094 
00095 
00096 

Generated on Sat May 24 08:36:32 2008 for RDCode by  doxygen 1.5.3