SubgraphUtils.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (C) 2003-2009 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_SUBGRAPHUTILS_H_
00011 #define _RD_SUBGRAPHUTILS_H_
00012 
00013 #include "Subgraphs.h"
00014 #include <boost/tuple/tuple.hpp>
00015 #include <boost/cstdint.hpp>
00016 
00017 namespace RDKit{
00018   class ROMol;
00019 
00020   namespace Subgraphs {
00021     //! used to return path discriminators (three unsigned ints):
00022     typedef boost::tuples::tuple<boost::uint32_t,boost::uint32_t,boost::uint32_t> DiscrimTuple;
00023 
00024     
00025     DiscrimTuple calcPathDiscriminators(const ROMol &mol,const PATH_TYPE &path,
00026                                         bool useBO=true,
00027                                         std::vector<boost::uint32_t> *extraInvars=0);
00028     PATH_LIST uniquifyPaths (const ROMol &mol, const PATH_LIST &allPathsb,
00029                              bool useBO=true);
00030 
00031     // Return the list of bond that connect a list of atoms
00032     // ASSUMPTION: the atoms specified in the list are connected
00033     PATH_TYPE bondListFromAtomList(const ROMol &mol, const PATH_TYPE &atomIds);
00034 
00035     // create a new molecule object from a part of molecule "mol". The part of
00036     // of the molecule is specified as a list of bonds in "path".
00037     // the optional argument "useQuery" will set all the bond and atoms in the 
00038     // the new molecule to "QueryAtoms" and "QueryBonds" instead of regular Atoms and Bonds
00039     //  atomIdxMap provides a mapping between the atomsIds in mol to the atomIds in
00040     // the newly created sub-molecule (the molecule that is returned)
00041     ROMol *pathToSubmol(const ROMol &mol, const PATH_TYPE &path, 
00042                         bool useQuery,
00043                         std::map<int,int> &atomIdxMap);
00044     ROMol *pathToSubmol(const ROMol &mol, const PATH_TYPE &path, 
00045                         bool useQuery=false);
00046   } // end of namespace Subgraphs
00047 }
00048 
00049 
00050 #endif