SubstructMatch.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (C) 2001-2010 Greg Landrum and Rational Discovery LLC
00003 //
00004 //   @@ All Rights Reserved @@
00005 //  This file is part of the RDKit.
00006 //  The contents are covered by the terms of the BSD license
00007 //  which is included in the file license.txt, found at the root
00008 //  of the RDKit source tree.
00009 //
00010 #ifndef _RD_SUBSTRUCTMATCH_H__
00011 #define _RD_SUBSTRUCTMATCH_H__
00012 
00013 // std bits
00014 #include <vector>
00015 
00016 namespace RDKit{
00017   class ROMol;
00018   class Atom;
00019   class Bond;
00020 
00021   //! \brief used to return matches from substructure searching,
00022   //!   The format is (queryAtomIdx, molAtomIdx)
00023   typedef std::vector< std::pair<int,int> > MatchVectType; 
00024 
00025   //! Find a substructure match for a query in a molecule
00026   /*!
00027       \param mol       The ROMol to be searched
00028       \param query     The query ROMol
00029       \param matchVect Used to return the match
00030                        (pre-existing contents will be deleted)
00031       \param recursionPossible  flags whether or not recursive matches are allowed
00032       \param useChirality  use atomic CIP codes as part of the comparison
00033 
00034       \return whether or not a match was found
00035     
00036   */
00037   bool SubstructMatch(const ROMol &mol,const ROMol &query,
00038                       MatchVectType &matchVect,
00039                       bool recursionPossible=true,
00040                       bool useChirality=false);
00041 
00042   //! Find all substructure matches for a query in a molecule
00043   /*!
00044       \param mol       The ROMol to be searched
00045       \param query     The query ROMol
00046       \param matchVect Used to return the matches
00047                        (pre-existing contents will be deleted)
00048       \param uniquify  Toggles uniquification (by atom index) of the results
00049       \param recursionPossible  flags whether or not recursive matches are allowed
00050       \param useChirality  use atomic CIP codes as part of the comparison
00051 
00052       \return the number of matches found
00053     
00054   */
00055   unsigned int SubstructMatch(const ROMol &mol,const ROMol &query,
00056                               std::vector< MatchVectType > &matchVect,
00057                               bool uniquify=true,bool recursionPossible=true,
00058                               bool useChirality=false);
00059 }
00060 
00061 #endif
00062 
00063 
00064 
00065