BALL  1.4.1
aromaticityProcessor.h
Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 //
00005 
00006 #ifndef BALL_QSAR_AROMATICITYPROCESSOR_H
00007 #define BALL_QSAR_AROMATICITYPROCESSOR_H
00008 
00009 #ifndef BALL_KERNEL_ATOMCONTAINER_H
00010 # include <BALL/KERNEL/atomContainer.h>
00011 #endif
00012 
00013 #ifndef BALL_DATATYPE_OPTIONS_H
00014   #include <BALL/DATATYPE/options.h>
00015 #endif
00016 
00017 namespace BALL
00018 {
00028   class BALL_EXPORT AromaticityProcessor
00029     : public UnaryProcessor<AtomContainer>
00030   {
00031     public:
00032 
00036 
00037     struct BALL_EXPORT Option
00038     { 
00041       static const char* OVERWRITE_BOND_ORDERS; 
00042     };
00043 
00045     struct BALL_EXPORT Default
00046     {
00047       static const bool OVERWRITE_BOND_ORDERS;
00048     };
00050 
00054     BALL_CREATE(AromaticityProcessor)
00055 
00056     //@{
00059     AromaticityProcessor();
00060   
00063     AromaticityProcessor(const AromaticityProcessor& aro);
00064 
00067     virtual ~AromaticityProcessor();
00068 
00070 
00073 
00076     AromaticityProcessor& operator = (const AromaticityProcessor& aro);
00078 
00082 
00083     Options options;
00084 
00087     void setDefaultOptions();
00089 
00093 
00100     void aromatize(const vector<vector<Atom*> >& sssr, AtomContainer& ac);
00101 
00109     void aromatizeSimple(vector<vector<Atom*> >& sssr);
00110     
00112 
00115     
00117     Processor::Result operator () (AtomContainer& ac);
00118     
00120     virtual bool start();
00122 
00123 
00124     protected:
00125 
00129     bool isValid_(const AtomContainer& ac);
00131 
00132 
00133     private:
00134 
00135     /*_ simple criterion if a ring can be aromatic
00136     */
00137     bool simpleCanBeAromatic_(const HashSet<Atom*>& ring);
00138 
00139     /*_ simple criterion if a ring can be aromatic, with weaker condition
00140         double bonds not need to be alternating inside the ring
00141     */
00142     bool simpleCanBeAromaticWeaker_(const HashSet<Atom*>& ring);
00143 
00144     /*_ Tries to extend an aromatic system. Main method that tries to extend 
00145         the aromaticity to intersecting rings.
00146         @param SSSR ring set as vector<HashSet<Atom*> >, (vector of rings in HashSet<Atom*>)
00147         @param ring as HashSet<Atom*>, the ring to extended
00148     */    
00149     void extendAromaticSystem_(vector<HashSet<Atom*> >& sssr, HashSet<Atom*> ring);
00150       
00151     /*_ Predicate that return true if the ring has conjugated double bonds. The criterion 
00152         is very weak, beacuse the predicate only considers carbon atoms, no hetero atoms
00153         are counted.
00154         @param ring as HashSet<Atom*>, to be tested
00155     */
00156     bool hasConjugatedDoubleBonds_(HashSet<Atom*> ring);
00157       
00158     /*_ This mthod return the number of pi electrons in the ring (aromatic system)
00159         @param ring as HashSet<Atom*>, from which the number of pi electrons to count
00160     */
00161     Size countPiElectrons_(HashSet<Atom*>& ring);
00162 
00166     bool overwrite_bond_orders_;
00167   };
00168 } // namespace BALL
00169 
00170 #endif // BALL_QSAR_AROMATICITYPROCESSOR_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines