typer.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef OB_TYPER_H
00021 #define OB_TYPER_H
00022
00023 #include <openbabel/babelconfig.h>
00024
00025 #include <vector>
00026 #include <string>
00027
00028 #include <openbabel/parsmart.h>
00029 #include <openbabel/data.h>
00030
00031 namespace OpenBabel
00032 {
00033
00034
00035 class OBSmartsPattern;
00036
00037
00038 class OBAPI OBAtomTyper : public OBGlobalDataBase
00039 {
00040
00041 std::vector<std::vector<int> > _mlist;
00042 std::vector<std::pair<OBSmartsPattern*,int> > _vinthyb;
00043 std::vector<std::pair<OBSmartsPattern*,int> > _vimpval;
00044 std::vector<std::pair<OBSmartsPattern*,std::string> > _vexttyp;
00045
00046 public:
00047 OBAtomTyper();
00048 ~OBAtomTyper();
00049
00050 void ParseLine(const char*);
00052 size_t GetSize() { return _vimpval.size();}
00053
00055 void AssignHyb(OBMol&);
00057 void AssignTypes(OBMol&);
00060 void AssignImplicitValence(OBMol&);
00062 void CorrectAromaticNitrogens(OBMol&);
00063 };
00064
00065
00066 class OBAPI OBAromaticTyper : public OBGlobalDataBase
00067 {
00068 std::vector<bool> _vpa;
00069 std::vector<bool> _visit;
00070 std::vector<bool> _root;
00071 std::vector<std::vector<int> > _mlist;
00072 std::vector<OBSmartsPattern*> _vsp;
00073 std::vector<std::pair<int,int> > _verange;
00074 std::vector<std::pair<int,int> > _velec;
00075 public:
00076 OBAromaticTyper();
00077 ~OBAromaticTyper();
00078
00080 size_t GetSize() { return _vsp.size();}
00081
00082 void ParseLine(const char*);
00084 void AssignAromaticFlags(OBMol &);
00087 void PropagatePotentialAromatic(OBAtom*);
00088
00089 void SelectRootAtoms(OBMol &, bool avoidInnerRingAtoms = true);
00091 void ExcludeSmallRing(OBMol &);
00093 void CheckAromaticity(OBAtom *root,int searchDepth);
00094
00095 bool TraverseCycle(OBAtom *root, OBAtom *atom, OBBond *prev,
00096 std::pair<int,int> &er,int depth);
00097 };
00098
00099
00100 class OBAPI OBRingTyper : public OBGlobalDataBase
00101 {
00102 std::vector<std::vector<int> > _mlist;
00103 std::vector<std::pair<OBSmartsPattern*,std::string> > _ringtyp;
00104
00105 public:
00106 OBRingTyper();
00107 ~OBRingTyper();
00108
00109 void ParseLine(const char*);
00111 size_t GetSize() { return _ringtyp.size();}
00112
00114 void AssignTypes(OBMol&);
00115 };
00116
00117
00118 }
00119
00120 #endif // OB_TYPER_H
00121