ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/openbabel/chains.hpp
Revision: 3057
Committed: Thu Oct 19 20:49:05 2006 UTC (17 years, 11 months ago) by gezelter
File size: 3877 byte(s)
Log Message:
updated OpenBabel to version 2.0.2

File Contents

# User Rev Content
1 tim 2440 /**********************************************************************
2     chains.h - Parse for macromolecule chains and residues
3    
4     Copyright (C) 1998-2001 by OpenEye Scientific Software, Inc.
5 gezelter 3057 Some portions Copyright (C) 2001-2006 by Geoffrey R. Hutchison
6 tim 2440
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 gezelter 3057 class OBAtom;
30     class OBMol;
31 tim 2440
32 gezelter 3057 //! Structure for atomic patterns (templates) in residues for OBChainsParser
33     //! Implementation and documentation in chains.cpp
34     typedef struct Template Template;
35 tim 2440
36 gezelter 3057 //! \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 tim 2440
46 gezelter 3057 OBChainsParser(void);
47     ~OBChainsParser(void);
48 tim 2440
49 gezelter 3057 //! 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 tim 2440
55 gezelter 3057 private: // internal methods
56 tim 2440
57 gezelter 3057 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 tim 2440
65 gezelter 3057 void SetupMol(OBMol &);
66     void SetResidueInformation(OBMol &, bool nukeSingleResidue);
67     void ClearResidueInformation(OBMol &);
68     void CleanupMol(void);
69 tim 2440
70 gezelter 3057 void AssignResidue(OBMol &, int, int, int);
71     int IdentifyResidue(void *, OBMol &, int, int); // ByteCode *
72 tim 2440
73 gezelter 3057 void DefineMonomer(void **, int, char *); // ByteCode **
74     int IdentifyElement(char *);
75 tim 2440
76 gezelter 3057 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 tim 2440
81 gezelter 3057 void ConstrainBackbone(OBMol &, Template *, int);
82 tim 2440
83 gezelter 3057 int RecurseChain(OBMol &, int, int);
84     void TraceNucleicChain(OBMol &, int, int);
85     void TracePeptideChain(OBMol &, int, int);
86 tim 2440
87 gezelter 3057 char *ParseSmiles(char *, int);
88 tim 2440
89 gezelter 3057 private: // members
90 tim 2440
91 gezelter 3057 void *PDecisionTree; // ByteCode *
92     void *NDecisionTree; // ByteCode *
93 tim 2440
94 gezelter 3057 int ResMonoAtom[MaxMonoAtom];
95     int ResMonoBond[MaxMonoBond];
96 tim 2440
97 gezelter 3057 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 tim 2440
108     }
109     #endif // OB_CHAINS_H
110    
111     //! \file chains.h
112     //! \brief Parse for macromolecule chains and residues.