1 |
/********************************************************************** |
2 |
chains.h - Parse for macromolecule chains and residues |
3 |
|
4 |
Copyright (C) 1998-2001 by OpenEye Scientific Software, Inc. |
5 |
Some portions Copyright (C) 2001-2006 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_CHAINS_H |
21 |
#define OB_CHAINS_H |
22 |
|
23 |
#define MaxMonoAtom 20 |
24 |
#define MaxMonoBond 20 |
25 |
|
26 |
namespace OpenBabel |
27 |
{ |
28 |
|
29 |
class OBAtom; |
30 |
class OBMol; |
31 |
|
32 |
//! Structure for atomic patterns (templates) in residues for OBChainsParser |
33 |
//! Implementation and documentation in chains.cpp |
34 |
typedef struct Template Template; |
35 |
|
36 |
//! \brief Perceives peptide or nucleotide chains and residues in an OBMol |
37 |
// |
38 |
//! Perceive peptide or nucleotide chains and residues from atom connectivity. |
39 |
//! Based on original RasMol code by Roger Sayle and modified by Joe Corkery. |
40 |
//! For more on Roger's original talk, see: |
41 |
//! http://www.daylight.com/meetings/mug96/sayle/sayle.html |
42 |
class OBAPI OBChainsParser |
43 |
{ |
44 |
public: |
45 |
|
46 |
OBChainsParser(void); |
47 |
~OBChainsParser(void); |
48 |
|
49 |
//! Perceive macromolecular (peptide and nucleotide) residues and chains |
50 |
//! \param mol - the molecule to parse and update |
51 |
//! \param nukeSingleResidue - if only one residue is found, clear information |
52 |
//! default = false -- single residue files should still be recognized. |
53 |
bool PerceiveChains(OBMol &mol, bool nukeSingleResidue = false); |
54 |
|
55 |
private: // internal methods |
56 |
|
57 |
bool DetermineHetAtoms(OBMol &); |
58 |
bool DetermineConnectedChains(OBMol &); |
59 |
bool DeterminePeptideBackbone(OBMol &); |
60 |
bool DeterminePeptideSidechains(OBMol &); |
61 |
bool DetermineNucleicBackbone(OBMol &); |
62 |
bool DetermineNucleicSidechains(OBMol &); |
63 |
bool DetermineHydrogens(OBMol &); |
64 |
|
65 |
void SetupMol(OBMol &); |
66 |
void SetResidueInformation(OBMol &, bool nukeSingleResidue); |
67 |
void ClearResidueInformation(OBMol &); |
68 |
void CleanupMol(void); |
69 |
|
70 |
void AssignResidue(OBMol &, int, int, int); |
71 |
int IdentifyResidue(void *, OBMol &, int, int); // ByteCode * |
72 |
|
73 |
void DefineMonomer(void **, int, char *); // ByteCode ** |
74 |
int IdentifyElement(char *); |
75 |
|
76 |
bool MatchConstraint(OBAtom *, int); |
77 |
bool Match2Constraints(Template *, OBAtom *, OBAtom *); |
78 |
bool Match3Constraints(Template *, OBAtom *, OBAtom *, OBAtom *); |
79 |
bool Match4Constraints(Template *, OBAtom *, OBAtom *, OBAtom *, OBAtom *); |
80 |
|
81 |
void ConstrainBackbone(OBMol &, Template *, int); |
82 |
|
83 |
int RecurseChain(OBMol &, int, int); |
84 |
void TraceNucleicChain(OBMol &, int, int); |
85 |
void TracePeptideChain(OBMol &, int, int); |
86 |
|
87 |
char *ParseSmiles(char *, int); |
88 |
|
89 |
private: // members |
90 |
|
91 |
void *PDecisionTree; // ByteCode * |
92 |
void *NDecisionTree; // ByteCode * |
93 |
|
94 |
int ResMonoAtom[MaxMonoAtom]; |
95 |
int ResMonoBond[MaxMonoBond]; |
96 |
|
97 |
unsigned short *bitmasks; |
98 |
unsigned char *resids; |
99 |
unsigned char *flags; |
100 |
bool *hetflags; |
101 |
short *atomids; |
102 |
short *resnos; |
103 |
short *sernos; //!< array of residue serial numbers |
104 |
char *hcounts; |
105 |
char *chains; |
106 |
}; |
107 |
|
108 |
} |
109 |
#endif // OB_CHAINS_H |
110 |
|
111 |
//! \file chains.h |
112 |
//! \brief Parse for macromolecule chains and residues. |