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
00034 typedef struct Template Template;
00035
00037
00042 class OBAPI OBChainsParser
00043 {
00044 public:
00045
00046 OBChainsParser(void);
00047 ~OBChainsParser(void);
00048
00053 bool PerceiveChains(OBMol &mol, bool nukeSingleResidue = false);
00054
00055 private:
00056
00057 bool DetermineHetAtoms(OBMol &);
00058 bool DetermineConnectedChains(OBMol &);
00059 bool DeterminePeptideBackbone(OBMol &);
00060 bool DeterminePeptideSidechains(OBMol &);
00061 bool DetermineNucleicBackbone(OBMol &);
00062 bool DetermineNucleicSidechains(OBMol &);
00063 bool DetermineHydrogens(OBMol &);
00064
00065 void SetupMol(OBMol &);
00066 void SetResidueInformation(OBMol &, bool nukeSingleResidue);
00067 void ClearResidueInformation(OBMol &);
00068 void CleanupMol(void);
00069
00070 void AssignResidue(OBMol &, int, int, int);
00071 int IdentifyResidue(void *, OBMol &, int, int);
00072
00073 void DefineMonomer(void **, int, char *);
00074 int IdentifyElement(char *);
00075
00076 bool MatchConstraint(OBAtom *, int);
00077 bool Match2Constraints(Template *, OBAtom *, OBAtom *);
00078 bool Match3Constraints(Template *, OBAtom *, OBAtom *, OBAtom *);
00079 bool Match4Constraints(Template *, OBAtom *, OBAtom *, OBAtom *, OBAtom *);
00080
00081 void ConstrainBackbone(OBMol &, Template *, int);
00082
00083 int RecurseChain(OBMol &, int, int);
00084 void TraceNucleicChain(OBMol &, int, int);
00085 void TracePeptideChain(OBMol &, int, int);
00086
00087 char *ParseSmiles(char *, int);
00088
00089 private:
00090
00091 void *PDecisionTree;
00092 void *NDecisionTree;
00093
00094 int ResMonoAtom[MaxMonoAtom];
00095 int ResMonoBond[MaxMonoBond];
00096
00097 unsigned short *bitmasks;
00098 unsigned char *resids;
00099 unsigned char *flags;
00100 bool *hetflags;
00101 short *atomids;
00102 short *resnos;
00103 short *sernos;
00104 char *hcounts;
00105 char *chains;
00106 };
00107
00108 }
00109 #endif // OB_CHAINS_H
00110