typer.h

Go to the documentation of this file.
00001 /**********************************************************************
00002 typer.h - Open Babel atom and aromaticity typer.
00003  
00004 Copyright (C) 1998-2001 by OpenEye Scientific Software, Inc.
00005 Some portions Copyright (C) 2001-2005 by Geoffrey R. Hutchison
00006  
00007 This file is part of the Open Babel project.
00008 For more information, see <http://openbabel.sourceforge.net/>
00009  
00010 This program is free software; you can redistribute it and/or modify
00011 it under the terms of the GNU General Public License as published by
00012 the Free Software Foundation version 2 of the License.
00013  
00014 This program is distributed in the hope that it will be useful,
00015 but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 GNU General Public License for more details.
00018 ***********************************************************************/
00019 
00020 #ifndef OB_TYPER_H
00021 #define OB_TYPER_H
00022 
00023 #include <openbabel/parsmart.h>
00024 #include <openbabel/data.h>
00025 
00026 namespace OpenBabel
00027 {
00028 
00029 // class introduction in typer.cpp
00030 class OBAPI OBAtomTyper : public OBGlobalDataBase
00031 {
00032   //    int                                                      _rc;
00033   std::vector<std::vector<int> >                           _mlist; 
00034   std::vector<std::pair<OBSmartsPattern*,int> >            _vinthyb; 
00035   std::vector<std::pair<OBSmartsPattern*,int> >            _vimpval; 
00036   std::vector<std::pair<OBSmartsPattern*,std::string> >    _vexttyp; 
00037 
00038 public:
00039     OBAtomTyper();
00040     ~OBAtomTyper();
00041 
00042     void ParseLine(const char*);
00044     unsigned int GetSize()                 { return _vimpval.size();}
00045 
00047     void AssignHyb(OBMol&);
00049     void AssignTypes(OBMol&);
00052     void AssignImplicitValence(OBMol&);
00054     void CorrectAromaticNitrogens(OBMol&);
00055 };
00056 
00057 // class introduction in typer.cpp
00058 class OBAPI OBAromaticTyper : public OBGlobalDataBase
00059 {
00060     std::vector<bool>             _vpa;   
00061     std::vector<bool>             _visit;
00062     std::vector<bool>             _root;
00063     std::vector<std::vector<int> >     _mlist;
00064     std::vector<OBSmartsPattern*> _vsp;   
00065     std::vector<std::pair<int,int> >   _verange; 
00066     std::vector<std::pair<int,int> >   _velec;   
00067 public:
00068     OBAromaticTyper();
00069     ~OBAromaticTyper();
00070 
00072     unsigned int GetSize()                 { return _vsp.size();}
00073 
00074     void ParseLine(const char*);
00076     void AssignAromaticFlags(OBMol &);
00079     void PropagatePotentialAromatic(OBAtom*);
00080     // Documentation in typer.cpp
00081     void SelectRootAtoms(OBMol &, bool avoidInnerRingAtoms = true);
00083     void ExcludeSmallRing(OBMol &);
00085     void CheckAromaticity(OBAtom *root,int searchDepth);
00086     // Documentation in typer.cpp
00087     bool TraverseCycle(OBAtom *root, OBAtom *atom, OBBond *prev,
00088                        std::pair<int,int> &er,int depth);
00089 };
00090 
00091 } //namespace OpenBabel
00092 
00093 #endif // OB_TYPER_H
00094