00001 /********************************************************************** 00002 chains.h - Parse for macromolecule chains and residues 00003 00004 Copyright (C) 1998-2001 by OpenEye Scientific Software, Inc. 00005 Some portions Copyright (C) 2001-2006 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_CHAINS_H 00021 #define OB_CHAINS_H 00022 00023 #define MaxMonoAtom 20 00024 #define MaxMonoBond 20 00025 00026 namespace OpenBabel 00027 { 00028 00029 class OBAtom; 00030 class OBMol; 00031 00032 // Structure template for atomic patterns in residues for OBChainsParser 00033 // implementation in chains.cpp 00034 typedef struct Template Template; 00035 00038 // 00043 class OBAPI OBChainsParser 00044 { 00045 public: 00046 00047 OBChainsParser(void); 00048 ~OBChainsParser(void); 00049 00054 bool PerceiveChains(OBMol &mol, bool nukeSingleResidue = false); 00055 00056 private: // internal methods 00057 00059 bool DetermineHetAtoms(OBMol &); 00061 bool DetermineConnectedChains(OBMol &); 00063 bool DeterminePeptideBackbone(OBMol &); 00065 bool DeterminePeptideSidechains(OBMol &); 00067 bool DetermineNucleicBackbone(OBMol &); 00069 bool DetermineNucleicSidechains(OBMol &); 00071 bool DetermineHydrogens(OBMol &); 00072 00074 void SetupMol(OBMol &); 00075 void SetResidueInformation(OBMol &, bool nukeSingleResidue); 00076 void ClearResidueInformation(OBMol &); 00077 void CleanupMol(void); 00078 00079 void AssignResidue(OBMol &, int, int, int); 00080 int IdentifyResidue(void *, OBMol &, int, int); // ByteCode * 00081 00082 void DefineMonomer(void **, int, const char *); // ByteCode ** 00083 int IdentifyElement(char *); 00084 00085 bool MatchConstraint(OBAtom *, int); 00086 bool Match2Constraints(Template *, OBAtom *, OBAtom *); 00087 bool Match3Constraints(Template *, OBAtom *, OBAtom *, OBAtom *); 00088 bool Match4Constraints(Template *, OBAtom *, OBAtom *, OBAtom *, OBAtom *); 00089 00090 void ConstrainBackbone(OBMol &, Template *, int); 00091 00092 int RecurseChain(OBMol &, int, int); 00093 void TraceNucleicChain(OBMol &, int, int); 00094 void TracePeptideChain(OBMol &, int, int); 00095 00096 const char *ParseSmiles(const char *, int); 00097 00098 // debugging 00099 void DumpState(); 00100 00101 private: // members 00102 00103 void *PDecisionTree; // ByteCode * 00104 void *NDecisionTree; // ByteCode * 00105 00106 int ResMonoAtom[MaxMonoAtom]; 00107 int ResMonoBond[MaxMonoBond]; 00108 00109 std::vector<unsigned short> bitmasks; 00110 std::vector<bool> visits; 00111 std::vector<unsigned char> resids; 00112 std::vector<unsigned char> flags; 00113 std::vector<bool> hetflags; 00114 std::vector<int> atomids; 00115 std::vector<short> resnos; 00116 std::vector<short> sernos; 00117 std::vector<char> hcounts; 00118 std::vector<char> chains; 00119 }; 00120 00121 } 00122 #endif // OB_CHAINS_H 00123
This file is part of the documentation for Open Babel, version 2.2.0.