00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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
00033
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:
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);
00081
00082 void DefineMonomer(void **, int, const char *);
00083 int IdentifyElement(const 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 private:
00099
00100 void *PDecisionTree;
00101 void *NDecisionTree;
00102
00103 int ResMonoAtom[MaxMonoAtom];
00104 int ResMonoBond[MaxMonoBond];
00105
00106 unsigned short *bitmasks;
00107 bool *visits;
00108 unsigned char *resids;
00109 unsigned char *flags;
00110 bool *hetflags;
00111 int *atomids;
00112 short *resnos;
00113 short *sernos;
00114 char *hcounts;
00115 char *chains;
00116 };
00117
00118 }
00119 #endif // OB_CHAINS_H
00120