1 |
/********************************************************************** |
2 |
phmodel.h - Read pH rules and assign charges. |
3 |
|
4 |
Copyright (C) 1998-2001 by OpenEye Scientific Software, Inc. |
5 |
Some portions Copyright (C) 2001-2005 by Geoffrey R. Hutchison |
6 |
|
7 |
This file is part of the Open Babel project. |
8 |
For more information, see <http://openbabel.sourceforge.net/> |
9 |
|
10 |
This program is free software; you can redistribute it and/or modify |
11 |
it under the terms of the GNU General Public License as published by |
12 |
the Free Software Foundation version 2 of the License. |
13 |
|
14 |
This program is distributed in the hope that it will be useful, |
15 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17 |
GNU General Public License for more details. |
18 |
***********************************************************************/ |
19 |
|
20 |
#ifndef OB_PHMODEL_H |
21 |
#define OB_PHMODEL_H |
22 |
|
23 |
#include "parsmart.hpp" |
24 |
#include "data.hpp" |
25 |
|
26 |
namespace OpenBabel |
27 |
{ |
28 |
|
29 |
// class introduction in phmodel.cpp |
30 |
class OBAPI OBChemTsfm |
31 |
{ |
32 |
std::vector<int> _vadel; |
33 |
std::vector<std::pair<int,int> > _vele; |
34 |
std::vector<std::pair<int,int> > _vchrg; |
35 |
std::vector<std::pair<int,int> > _vbdel; |
36 |
std::vector<std::pair<std::pair<int,int>,int> > _vbond; |
37 |
OBSmartsPattern _bgn,_end; |
38 |
public: |
39 |
OBChemTsfm() {} |
40 |
~OBChemTsfm() {} |
41 |
//! Initialize this transformation with the supplied SMARTS patterns |
42 |
bool Init(std::string&start, std::string &end); |
43 |
//! Apply this transformation to all matches in the supplied OBMol |
44 |
bool Apply(OBMol&); |
45 |
}; |
46 |
|
47 |
//! \brief Corrections for pH used by OBMol::CorrectForPH() |
48 |
class OBPhModel : public OBGlobalDataBase |
49 |
{ |
50 |
std::vector<std::vector<int> > _mlist; |
51 |
std::vector<OBChemTsfm*> _vtsfm; |
52 |
std::vector<std::pair<OBSmartsPattern*,std::vector<double> > > _vschrg; |
53 |
public: |
54 |
OBPhModel(); |
55 |
~OBPhModel(); |
56 |
|
57 |
void ParseLine(const char*); |
58 |
//! \return the number of chemical transformations |
59 |
unsigned int GetSize() { return _vtsfm.size();} |
60 |
void AssignSeedPartialCharge(OBMol&); |
61 |
void CorrectForPH(OBMol&); |
62 |
}; |
63 |
|
64 |
|
65 |
|
66 |
} //namespace OpenBabel |
67 |
|
68 |
#endif // OB_PHMODEL_H |
69 |
|
70 |
//! \file phmodel.h |
71 |
//! \brief Read pH rules and assign charges. |