FragCatalogUtils.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (C) 2003-2006 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_FRAG_CATALOG_UTILS_H_
00011 #define _RD_FRAG_CATALOG_UTILS_H_
00012 
00013 #include <GraphMol/Subgraphs/Subgraphs.h>
00014 #include <GraphMol/RDKitBase.h>
00015 #include <GraphMol/Substruct/SubstructMatch.h>
00016 #include "FragCatParams.h"
00017 #include <iostream>
00018 
00019 namespace RDKit {
00020   
00021   // get the functional groups from file or stream
00022   // each functional groups is read in as a molecule with queryatoms and 
00023   // querybonds
00024   MOL_SPTR_VECT readFuncGroups(std::string fileName);
00025   MOL_SPTR_VECT readFuncGroups(std::istream &inStream,int nToRead=-1);
00026   
00027   // REVIEW: should this return a vector of pairs or a map?
00028   // mark the functional groups of interest on the molecule
00029   // and return a vector os std::pair <aid, fid>
00030   //    aid - is the atom id in mol that connect to a functional (fid)
00031   //    fid - the functional groups in the list maintained in params
00032   // ARGUMENTS:
00033   //  mol - molecule of interest
00034   //  params - fragment catalog paramter object (contains a list of functional
00035   //             groups of interest
00036   //  fgBonds - container for bondIds in mol that are part of the functional groups 
00037   //            the connection bond is included. these need to be chopped from 
00038   //            the molecule later
00039   
00040   MatchVectType findFuncGroupsOnMol(const ROMol &mol, 
00041                                  const FragCatParams *params,
00042                                  INT_VECT &fgBonds);
00043  
00044   // This functions is called before either adding the fragments from a molecule
00045   // to a fragment catalog or generating the fincgerprint for this molecule
00046   // using a fragment catalog. These are the things this function does
00047   // - recognize the function groups (and their location) on the molecule
00048   // - chop these functional groups of the molecule to create a core molecule
00049   //   "coreMol"
00050   // - map the function group locations onto this "coreMol" (bacause the atom ids
00051   //   on coreMol are different from the original molecule
00052   // - return coreMol to the caller of this function and the enter the atom ids to func
00053   //   group ids mapping into aToFmap argument 
00054   ROMol *prepareMol(const ROMol &mol, const FragCatParams *fparams,
00055                     MatchVectType &aToFmap);
00056 
00057 }
00058 
00059 #endif