00001 /********************************************************************** 00002 residue.h - Defines for residue properties, names, etc. 00003 00004 Copyright (C) 2001, 2002 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.org/> 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 /********************************************************************** 00021 Global arrays Residue, ElemDesc and function GetResidueNumber were 00022 obtained in part or whole from RasMol2 by Roger Sayle. 00023 ***********************************************************************/ 00024 00025 #ifndef OB_RESIDUE_H 00026 #define OB_RESIDUE_H 00027 00028 #include <openbabel/babelconfig.h> 00029 00030 #ifndef EXTERN 00031 # define EXTERN extern 00032 #endif 00033 00034 #include <vector> 00035 #include <string> 00036 00037 #include <openbabel/base.h> 00038 00039 namespace OpenBabel { 00040 00041 class OBAtom; 00043 typedef std::vector<OBAtom*>::iterator OBAtomIterator; 00044 class OBBond; 00046 typedef std::vector<OBBond*>::iterator OBBondIterator; 00047 00048 // Class OBResidue 00049 // class introduction in residue.cpp 00050 class OBAPI OBResidue : public OBBase 00051 { 00052 public: 00053 00055 OBResidue(void); 00057 OBResidue(const OBResidue &); 00059 virtual ~OBResidue(void); 00060 00061 OBResidue &operator=(const OBResidue &); 00062 00064 void AddAtom(OBAtom *atom); 00066 void InsertAtom(OBAtom *atom); 00068 void RemoveAtom(OBAtom *atom); 00073 bool Clear(); 00074 00079 void SetName(const std::string &resname); 00081 void SetNum(const unsigned int resnum); 00082 void SetNum(const std::string resnum); 00084 void SetChain(const char chain); 00086 void SetChainNum(const unsigned int chainnum); 00089 void SetIdx(const unsigned int idx); 00090 00093 void SetAtomID(OBAtom *atom, const std::string &id); 00094 void SetHetAtom(OBAtom *atom, bool hetatm); 00096 void SetSerialNum(OBAtom *atom, unsigned int sernum); 00097 00099 std::string GetName(void) const; 00101 unsigned int GetNum(void); 00102 std::string GetNumString(void); 00104 unsigned int GetNumAtoms() const; 00106 char GetChain(void) const; 00108 unsigned int GetChainNum(void) const; 00110 unsigned int GetIdx(void) const; 00112 unsigned int GetResKey(void) const; 00113 00115 std::vector<OBAtom*> GetAtoms(void) const; 00118 std::vector<OBBond*> GetBonds(bool exterior= true)const; 00119 00122 std::string GetAtomID(OBAtom *atom) const; 00124 unsigned GetSerialNum(OBAtom *atom) const; 00125 00128 bool GetAminoAcidProperty(int) const; 00131 bool GetAtomProperty(OBAtom *a, int) const; 00134 bool GetResidueProperty(int) const; 00135 00137 bool IsHetAtom(OBAtom *atom) const; 00140 bool IsResidueType(int) const; 00141 00143 00144 00145 OBAtomIterator BeginAtoms() { return _atoms.begin(); } 00147 OBAtomIterator EndAtoms() { return _atoms.end(); } 00150 OBAtom *BeginAtom(std::vector<OBAtom*>::iterator &i); 00153 OBAtom *NextAtom(std::vector<OBAtom*>::iterator &i); 00155 00156 protected: // members 00157 00158 unsigned int _idx; 00159 char _chain; 00160 unsigned int _aakey; 00161 unsigned int _reskey; 00162 std::string _resnum; 00163 std::string _resname; 00164 00165 std::vector<bool> _hetatm; 00166 std::vector<std::string> _atomid; 00167 std::vector<OBAtom*> _atoms; 00168 std::vector<unsigned int> _sernum; 00169 // Now in OBBase 00170 // std::vector<OBGenericData*> _vdata; //!< Custom data 00171 }; // OBResidue 00172 00174 typedef std::vector<OBResidue*>::iterator OBResidueIterator; 00175 00177 // Global Definitions 00179 00180 #define MAXSETNO 40 00181 #define MAXELEM 1024 00182 #define MINELEM 29 00183 #define MAXRES 100 00184 #define MINRES 54 00185 00187 // Amino Acid Definitions 00189 00190 #define AA_ALA (1<<1) 00191 #define AA_GLY (1<<2) 00192 #define AA_LEU (1<<3) 00193 #define AA_SER (1<<4) 00194 #define AA_VAL (1<<5) 00195 #define AA_THR (1<<6) 00196 #define AA_LYS (1<<7) 00197 #define AA_ASP (1<<8) 00198 #define AA_ILE (1<<9) 00199 #define AA_ASN (1<<10) 00200 #define AA_GLU (1<<11) 00201 #define AA_PRO (1<<12) 00202 #define AA_ARG (1<<13) 00203 #define AA_PHE (1<<14) 00204 #define AA_GLN (1<<15) 00205 #define AA_TYR (1<<16) 00206 #define AA_HIS (1<<17) 00207 #define AA_CYS (1<<18) 00208 #define AA_MET (1<<19) 00209 #define AA_TRP (1<<20) 00210 00212 // Amino Acid Property Definitions 00214 #define IS_ACIDIC(x) ((x) & ((AA_ASP)|(AA_GLU))) 00215 #define IS_ACYCLIC(x) ((x) & ((AA_ALA)|(AA_GLY)|(AA_LEU)|(AA_SER)| \ 00216 (AA_VAL)|(AA_THR)|(AA_LYS)|(AA_ASP)| \ 00217 (AA_ILE)|(AA_ASN)|(AA_GLU)|(AA_GLN)| \ 00218 (AA_CYS)|(AA_MET))) 00219 #define IS_ALIPHATIC(x) ((x) & ((AA_ALA)|(AA_GLY)|(AA_ILE)|(AA_LEU)| \ 00220 (AA_VAL))) 00221 #define IS_AROMATIC(x) ((x) & ((AA_HIS)|(AA_PHE)|(AA_TRP)|(AA_TYR))) 00222 #define IS_BASIC(x) ((x) & ((AA_ARG)|(AA_HIS)|(AA_LYS))) 00223 #define IS_BURIED(x) ((x) & ((AA_ALA)|(AA_CYS)|(AA_ILE)|(AA_LEU)| \ 00224 (AA_MET)|(AA_PHE)|(AA_TRP)|(AA_VAL))) 00225 #define IS_CHARGED(x) ((x) & ((AA_ASP)|(AA_GLU)|(AA_ARG)|(AA_HIS)| \ 00226 (AA_LYS))) 00227 #define IS_CYCLIC(x) ((x) & ((AA_HIS)|(AA_PHE)|(AA_PRO)|(AA_TRP)| \ 00228 (AA_TYR))) 00229 #define IS_HYDROPHOBIC(x) ((x) & ((AA_ALA)|(AA_LEU)|(AA_VAL)|(AA_ILE)| \ 00230 (AA_PRO)|(AA_PHE)|(AA_MET)|(AA_TRP))) 00231 #define IS_LARGE(x) ((x) & ((AA_ARG)|(AA_PHE)|(AA_GLN)|(AA_TYR)| \ 00232 (AA_HIS)|(AA_LEU)|(AA_LYS)|(AA_ILE)| \ 00233 (AA_GLU)|(AA_MET)|(AA_TRP))) 00234 #define IS_MEDIUM(x) ((x) & ((AA_VAL)|(AA_THR)|(AA_ASP)|(AA_ASN)| \ 00235 (AA_PRO)|(AA_CYS))) 00236 #define IS_NEGATIVE(x) ((x) & ((AA_ASP)|(AA_GLU))) 00237 #define IS_NEUTRAL(x) ((x) & ((AA_ALA)|(AA_GLY)|(AA_LEU)|(AA_SER)| \ 00238 (AA_VAL)|(AA_THR)|(AA_PHE)|(AA_GLN)| \ 00239 (AA_TYR)|(AA_HIS)|(AA_CYS)|(AA_MET)| \ 00240 (AA_TRP)|(AA_ILE)|(AA_ASN)|(AA_PRO))) 00241 #define IS_POLAR(x) ((x) & ((AA_ASP)|(AA_ILE)|(AA_ASN)|(AA_GLU)| \ 00242 (AA_SER)|(AA_THR)|(AA_ARG)|(AA_GLN)| \ 00243 (AA_CYS)|(AA_HIS))) 00244 #define IS_POSITIVE(x) ((x) & ((AA_ARG)|(AA_HIS)|(AA_LYS))) 00245 #define IS_SMALL(x) ((x) & ((AA_ALA)|(AA_GLY)|(AA_SER))) 00246 #define IS_SURFACE(x) ((x) & ((AA_THR)|(AA_LYS)|(AA_ASP)|(AA_ILE)| \ 00247 (AA_ASN)|(AA_GLU)|(AA_PRO)|(AA_ARG)| \ 00248 (AA_GLY)|(AA_SER)|(AA_GLN)|(AA_TYR)| \ 00249 (AA_HIS))) 00250 00252 namespace OBAminoAcidProperty 00253 { 00254 enum 00255 { 00256 ACIDIC = 0, 00257 ACYCLIC = 1, 00258 ALIPHATIC = 2, 00259 AROMATIC = 3, 00260 BASIC = 4, 00261 BURIED = 5, 00262 CHARGED = 6, 00263 CYCLIC = 7, 00264 HYDROPHOBIC = 8, 00265 LARGE = 9, 00266 MEDIUM = 10, 00267 NEGATIVE = 11, 00268 NEUTRAL = 12, 00269 POLAR = 13, 00270 POSITIVE = 14, 00271 SMALL = 15, 00272 SURFACE = 16 00273 }; 00274 } 00275 00277 namespace OBResidueAtomProperty 00278 { 00279 enum 00280 { 00281 ALPHA_CARBON = 0, 00282 AMINO_BACKBONE = 1, 00283 BACKBONE = 2, 00284 CYSTEINE_SULPHUR = 3, 00285 LIGAND = 4, 00286 NUCLEIC_BACKBONE = 5, 00287 SHAPELY_BACKBONE = 6, 00288 SHAPELY_SPECIAL = 7, 00289 SIDECHAIN = 8, 00290 SUGAR_PHOSPHATE = 9 00291 }; 00292 } 00293 00295 // some of these are invalid or troublesome in scripting interfaces 00296 // so they are removed by the #ifndef SWIG parts 00297 // (otherwise ignore them for C++ use) 00298 namespace OBResidueIndex 00299 { 00300 enum 00301 { 00302 ALA = 0, 00303 GLY = 1, 00304 LEU = 2, 00305 SER = 3, 00306 VAL = 4, 00307 #ifndef SWIGPERL 00308 THR = 5, 00309 #endif 00310 LYS = 6, 00311 ASP = 7, 00312 ILE = 8, 00313 ASN = 9, 00314 GLU = 10, 00315 PRO = 11, 00316 ARG = 12, 00317 PHE = 13, 00318 GLN = 14, 00319 TYR = 15, 00320 HIS = 16, 00321 CYS = 17, 00322 MET = 18, 00323 TRP = 19, 00324 ASX = 20, 00325 GLX = 21, 00326 PCA = 22, 00327 HYP = 23, 00328 A = 24, 00329 C = 25, 00330 G = 26, 00331 T = 27, 00332 U = 28, 00333 UPLUS = 29, 00334 I = 30, 00335 _1MA = 32, 00336 _5MC = 32, 00337 OMC = 33, 00338 _1MG = 34, 00339 _2MG = 35, 00340 M2G = 36, 00341 _7MG = 37, 00342 OMG = 38, 00343 YG = 39, 00344 H2U = 40, 00345 _5MU = 41, 00346 PSU = 42, 00347 UNK = 43, 00348 ACE = 44, 00349 FOR = 45, 00350 HOH = 46, 00351 DOD = 47, 00352 SO4 = 48, 00353 PO4 = 49, 00354 NAD = 50, 00355 COA = 51, 00356 NAP = 52, 00357 NDP = 53 00358 }; 00359 } 00360 00362 namespace OBResidueProperty 00363 { 00364 enum 00365 { 00366 AMINO = 0, 00367 AMINO_NUCLEO = 1, 00368 COENZYME = 2, 00369 ION = 3, 00370 NUCLEO = 4, 00371 PROTEIN = 5, 00372 PURINE = 6, 00373 PYRIMIDINE = 7, 00374 SOLVENT = 8, 00375 WATER = 9 00376 }; 00377 } 00378 00380 // Global Variables 00382 00383 EXTERN char Residue[MAXRES][4]; 00384 EXTERN char ElemDesc[MAXELEM][4]; 00385 EXTERN unsigned int ResNo; 00386 EXTERN unsigned int ElemNo; 00387 } // end namespace OpenBabel 00388 00389 #endif 00390
This file is part of the documentation for Open Babel, version 2.3.