Rings.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (C) 2004-2008 Greg Landrum and Rational Discovery LLC
00003 //
00004 //   @@ All Rights Reserved  @@
00005 //
00006 
00007 //! \file Rings.h
00008 //! \brief utility functionality for working with ring systems
00009 
00010 #ifndef _RDRINGS_H_
00011 #define _RDRINGS_H_
00012 
00013 #include <vector>
00014 #include <map>
00015 #include <boost/dynamic_bitset_fwd.hpp>
00016 
00017 namespace RDKit {
00018   class ROMol;
00019 };
00020 
00021 
00022 namespace RingUtils {
00023   typedef std::vector<int>  INT_VECT;
00024   typedef std::vector< std::vector<int> > VECT_INT_VECT;
00025   typedef std::map< int, std::vector<int> > INT_INT_VECT_MAP;
00026   
00027   //! Pick a set of rings that are fused together and contain a specified ring
00028   /*!
00029 
00030      \param curr      the ID for the irng that should be in the fused system
00031      \param neighMap  adjacency lists for for all rings in the molecule.
00032              See documentation for makeNeighMap 
00033      \param res       used to return the results: a list of rings that are fused
00034              with curr in them
00035      \param done      a bit vector recording the rings that are already dealt with
00036              this also can be used to avoid any rings that should not be included in
00037              the fused system
00038    
00039   */
00040   void pickFusedRings(int curr, const INT_INT_VECT_MAP &neighMap, INT_VECT &res,
00041                       boost::dynamic_bitset<> &done,int depth=0);
00042 
00043   //! \brief For each ring in bring compute and strore the ring that are fused
00044   //! (share atleast one bond with it). 
00045   /*!
00046     Useful both for the keulization stuff and aromaticity perception. 
00047    
00048     \param brings   list of rings - each ring is specified as a list of bond IDs
00049     \param neighMap an STL map into which the results are stored. Each entry in the 
00050                 map is indexed by the ring ID and the conents are the list
00051                 rings (rather their IDs) that are fused with this ring
00052                 
00053   */
00054   void makeRingNeighborMap(const VECT_INT_VECT &brings, INT_INT_VECT_MAP &neighMap);
00055 
00056 
00057   //! converts a list of atom indices into a list of bond indices
00058   /*!
00059 
00060      \param res    list of ring - each ring is a list of atom ids
00061      \param brings reference to a list of rings to the write the results to
00062                    each ring here is list of bonds ids
00063      \param mol    the molecule of interest
00064      
00065     <b>Assumptions:</b>
00066      - each list of atom ids in "res" form a legitimate ring           
00067      - each of these list of ordered such that a ring can be traversed
00068   */
00069   void convertToBonds(const VECT_INT_VECT &res, VECT_INT_VECT &brings,
00070                       const RDKit::ROMol &mol);
00071 
00072 };
00073 
00074 #endif
00075 

Generated on Fri Apr 3 06:03:02 2009 for RDCode by  doxygen 1.5.6