chains.h
Go to the documentation of this file.
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 Some portions Copyright (C) 2008 by Tim Vandermeersch
00007 
00008 This file is part of the Open Babel project.
00009 For more information, see <http://openbabel.org/>
00010 
00011 This program is free software; you can redistribute it and/or modify
00012 it under the terms of the GNU General Public License as published by
00013 the Free Software Foundation version 2 of the License.
00014 
00015 This program is distributed in the hope that it will be useful,
00016 but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 GNU General Public License for more details.
00019 ***********************************************************************/
00020 
00021 #ifndef OB_CHAINS_H
00022 #define OB_CHAINS_H
00023 
00024 #define MaxMonoAtom 20
00025 #define MaxMonoBond 20
00026 
00027 #include <openbabel/babelconfig.h>
00028 #include <vector>
00029 
00030 namespace OpenBabel
00031 {
00032 
00033   class OBAtom;
00034   class OBMol;
00035 
00037   // implementation in chains.cpp
00038   struct Template;
00039   typedef struct Template Template;
00040 
00049   class OBAPI OBChainsParser
00050   {
00051     public:
00052 
00053       OBChainsParser(void);
00054       ~OBChainsParser(void);
00055 
00062       bool PerceiveChains(OBMol &mol, bool nukeSingleResidue = false);
00063 
00064     private: // internal methods
00065 
00067 
00068 
00075       bool DetermineHetAtoms(OBMol &);
00077 
00079 
00080 
00089       bool DetermineConnectedChains(OBMol &);
00098       unsigned int RecurseChain(OBMol &mol, unsigned int i, int c);
00100 
00102 
00103 
00110       bool DeterminePeptideBackbone(OBMol &);
00121       void ConstrainBackbone(OBMol &mol, Template *templ, int tmax);
00125       bool MatchConstraint(OBAtom *atom, int mask);
00130       bool Match2Constraints(Template *templ, OBAtom *na, OBAtom *nb);
00135       bool Match3Constraints(Template *templ, OBAtom *na, OBAtom *nb, OBAtom *nc);
00140       bool Match4Constraints(Template *templ, OBAtom *na, OBAtom *nb, OBAtom *nc, OBAtom *nd);
00150       void TracePeptideChain(OBMol &mol, unsigned int i, int r);
00152 
00154 
00155 
00161       bool  DeterminePeptideSidechains(OBMol &);
00173       int IdentifyResidue(void *tree, OBMol &mol, unsigned int seed, int resno); // ByteCode *
00181       void  AssignResidue(OBMol &mol, int r, int c, int i);
00183 
00185 
00186 
00190       bool  DetermineHydrogens(OBMol &);
00192 
00194 
00195 
00201       void  SetResidueInformation(OBMol &, bool nukeSingleResidue);
00203 
00205 
00206 
00213       bool  DetermineNucleicBackbone(OBMol &);
00221       void  TraceNucleicChain(OBMol &, unsigned int i, int r);
00228       bool  DetermineNucleicSidechains(OBMol &);
00230 
00235       void  SetupMol(OBMol &);
00239       void  ClearResidueInformation(OBMol &mol);
00243       void CleanupMol();
00250       void  DefineMonomer(void **tree, int resid, const char *smiles); // ByteCode **
00255       int   IdentifyElement(char *ptr);
00261       const char *ParseSmiles(const char *smiles, int prev);
00265       void DumpState();
00266 
00267       void *PDecisionTree; 
00268       void *NDecisionTree; 
00269 
00270       int   ResMonoAtom[MaxMonoAtom];
00271       int   ResMonoBond[MaxMonoBond];
00272 
00273       std::vector<unsigned short> bitmasks;
00274       std::vector<bool>           visits;   
00275       std::vector<unsigned char>  resids;
00276       std::vector<unsigned char>  flags;
00277       std::vector<bool>           hetflags;
00278       std::vector<int>            atomids;
00279       std::vector<short>          resnos;
00280       std::vector<short>          sernos;   
00281       std::vector<char>           hcounts;
00282       std::vector<char>           chains;
00283     };
00284 
00285 }
00286 #endif // OB_CHAINS_H
00287 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines