phmodel.h

Go to the documentation of this file.
00001 /**********************************************************************
00002 phmodel.h - Read pH rules and assign charges.
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_PHMODEL_H
00021 #define OB_PHMODEL_H
00022 
00023 #include <openbabel/parsmart.h>
00024 #include <openbabel/data.h>
00025 
00026 namespace OpenBabel
00027 {
00028 
00029 // class introduction in phmodel.cpp
00030 class OBAPI OBChemTsfm
00031 {
00032     std::vector<int>                            _vadel;
00033     std::vector<std::pair<int,int> >            _vele;
00034     std::vector<std::pair<int,int> >            _vchrg;
00035     std::vector<std::pair<int,int> >            _vbdel;
00036     std::vector<std::pair<std::pair<int,int>,int> >  _vbond;
00037     OBSmartsPattern _bgn,_end;
00038 public:
00039     OBChemTsfm()    {}
00040     ~OBChemTsfm()   {}
00042     bool Init(std::string&start, std::string &end);
00044     bool Apply(OBMol&);
00045 };
00046 
00048 class OBPhModel : public OBGlobalDataBase
00049 {
00050     std::vector<std::vector<int> >                      _mlist;
00051     std::vector<OBChemTsfm*>                            _vtsfm;
00052     std::vector<std::pair<OBSmartsPattern*,std::vector<double> > > _vschrg;
00053 public:
00054     OBPhModel();
00055     ~OBPhModel();
00056 
00057     void ParseLine(const char*);
00059     unsigned int GetSize()                 { return _vtsfm.size();}
00060     void AssignSeedPartialCharge(OBMol&);
00061     void CorrectForPH(OBMol&);
00062 };
00063 
00064 
00065 
00066 } //namespace OpenBabel
00067 
00068 #endif // OB_PHMODEL_H
00069