00001 // $Id: mmdb_utils.h $ 00002 // ================================================================= 00003 // 00004 // CCP4 Coordinate Library: support of coordinate-related 00005 // functionality in protein crystallography applications. 00006 // 00007 // Copyright (C) Eugene Krissinel 2000-2008. 00008 // 00009 // This library is free software: you can redistribute it and/or 00010 // modify it under the terms of the GNU Lesser General Public 00011 // License version 3, modified in accordance with the provisions 00012 // of the license to address the requirements of UK law. 00013 // 00014 // You should have received a copy of the modified GNU Lesser 00015 // General Public License along with this library. If not, copies 00016 // may be downloaded from http://www.ccp4.ac.uk/ccp4license.php 00017 // 00018 // This program is distributed in the hope that it will be useful, 00019 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 // GNU Lesser General Public License for more details. 00022 // 00023 // ================================================================= 00024 // 00025 // 12.09.13 <-- Date of Last Modification. 00026 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00027 // ----------------------------------------------------------------- 00028 // 00029 // **** Module : MMDBF_Utils <interface> 00030 // ~~~~~~~~~ 00031 // **** Project : MacroMolecular Data Base (MMDB) 00032 // ~~~~~~~~~ 00033 // 00034 // **** Classes : mmdb::ContainerClass ( containered class template ) 00035 // ~~~~~~~~~ mmdb::ContString ( containered string ) 00036 // mmdb::ClassContainer ( container of classes ) 00037 // mmdb::AtomPath ( atom path ID ) 00038 // mmdb::QuickSort ( quick sort of integers ) 00039 // 00040 // **** Functions : Date9to11 ( DD-MMM-YY -> DD-MMM-YYYY ) 00041 // ~~~~~~~~~~~ Date11to9 ( DD-MMM-YYYY -> DD-MMM-YY ) 00042 // Date9toCIF ( DD-MMM-YY -> YYYY-MM-DD ) 00043 // Date11toCIF( DD-MMM-YYYY -> YYYY-MM-DD ) 00044 // DateCIFto9 ( YYYY-MM-DD -> DD-MMM-YY ) 00045 // DateCIFto11( YYYY-MM-DD -> DD-MMM-YYYY ) 00046 // GetInteger ( reads integer from a string ) 00047 // GetReal ( reads real from a string ) 00048 // GetIntIns ( reads integer and insert code ) 00049 // PutInteger ( writes integer into a string ) 00050 // PutRealF ( writes real in F-form into a string ) 00051 // PutIntIns ( writes integer and insert code ) 00052 // CIFGetInteger ( reads and deletes int from CIF ) 00053 // CIFGetReal ( reads and deletes real from CIF ) 00054 // CIFGetString ( reads and deletes string from CIF) 00055 // CIFGetInteger1 (reads and del-s int from CIF loop) 00056 // CIFGetReal1 (reads and del-s int from CIF loop) 00057 // Mat4Inverse ( inversion of 4x4 matrices ) 00058 // GetErrorDescription (ascii line to an Error_XXXXX) 00059 // ParseAtomID ( parses atom ID line ) 00060 // ParseResID ( parses residue ID line ) 00061 // ParseAtomPath ( parses full atom path ) 00062 // 00063 // (C) E. Krissinel 2000-2013 00064 // 00065 // ================================================================= 00066 // 00067 00068 #ifndef __MMDB_Utils__ 00069 #define __MMDB_Utils__ 00070 00071 #include "mmdb_io_stream.h" 00072 #include "mmdb_mmcif_.h" 00073 #include "mmdb_defs.h" 00074 00075 namespace mmdb { 00076 00077 // ================== Date functions =================== 00078 00079 // converts DD-MMM-YY to DD-MMM-YYYY; appends terminating zero 00080 extern void Date9to11 ( cpstr Date9, pstr Date11 ); 00081 00082 // converts DD-MMM-YYYY to DD-MMM-YY; does not append terminating zero 00083 extern void Date11to9 ( cpstr Date11, pstr Date9 ); 00084 00085 // converts DD-MMM-YY to YYYY-MM-DD; appends terminating zero 00086 extern void Date9toCIF ( cpstr Date9, pstr DateCIF ); 00087 00088 // converts DD-MMM-YYYY to YYYY-MM-DD; appends terminating zero 00089 extern void Date11toCIF ( cpstr Date11, pstr DateCIF ); 00090 00091 // converts YYYY-MM-DD to DD-MMM-YY; appends terminating zero 00092 extern void DateCIFto9 ( cpstr DateCIF, pstr Date9 ); 00093 00094 // converts YYYY-MM-DD to DD-MMM-YYYY; appends terminating zero 00095 extern void DateCIFto11 ( cpstr DateCIF, pstr Date11 ); 00096 00097 00098 // ================= Format functions ================== 00099 00100 // Returns true if S contains an integer number in its 00101 // first M characters. This number is returned in N. 00102 // The return is false if no integer number may be 00103 // recognized. In this case, N is assigned MinInt4 value. 00104 extern bool GetInteger ( int & N, cpstr S, int M ); 00105 00106 // Returns true if S contains a real number in its 00107 // first M characters. This number is returned in R. 00108 // The return is false if no real number may be 00109 // recognized. In this case, R is assigned -MaxReal value. 00110 extern bool GetReal ( realtype & R, cpstr S, int M ); 00111 00112 // Returns true if S contains an integer number in its 00113 // first M characters. This number is returned in N. In addition 00114 // to that, GetIntIns() retrieves the insertion code which may 00115 // follow the integer and returns it in "ins" (1 character + 00116 // terminating 0). 00117 // The return is false if no integer number may be 00118 // recognized. In this case, N is assigned MinInt4 value, 00119 // "ins" just returns (M+1)th symbol of S (+terminating 0). 00120 extern bool GetIntIns ( int & N, pstr ins, cpstr S, int M ); 00121 00122 // Integer N is converted into ASCII string of length M 00123 // and pasted onto first M characters of string S. No 00124 // terminating zero is added. 00125 // If N is set to MinInt4, then first M characters of 00126 // string S are set to space. 00127 extern void PutInteger ( pstr S, int N, int M ); 00128 00129 // Real R is converted into ASCII string of length M 00130 // and pasted onto first M characters of string S. No 00131 // terminating zero is added. The conversion is done 00132 // according to fixed format FM.L 00133 // If R is set to -MaxReal, then first M characters of 00134 // string S are set to the space character. 00135 extern void PutRealF ( pstr S, realtype R, int M, int L ); 00136 00137 // Integer N is converted into ASCII string of length M 00138 // and pasted onto first M characters of string S. No 00139 // terminating zero is added. The insert code ins is put 00140 // immediately after the integer. 00141 // If N is set to MinInt4, then first M+1 characters of 00142 // string S are set to space, and no insert code are 00143 // appended. 00144 extern void PutIntIns ( pstr S, int N, int M, cpstr ins ); 00145 00146 00147 // CIFInteger(..), CIFReal(..) and CIFGetString(..) automate 00148 // extraction and analysis of data from CIF file. If the data 00149 // is erroneous or absent, they store an error message in 00150 // CIFErrorLocation string (below) and return non-zero. 00151 extern ERROR_CODE CIFGetInteger ( int & I, mmcif::PStruct Struct, 00152 cpstr Tag, 00153 bool Remove=true ); 00154 extern ERROR_CODE CIFGetReal ( realtype & R, mmcif::PStruct Struct, 00155 cpstr Tag, 00156 bool Remove=true ); 00157 extern ERROR_CODE CIFGetString ( pstr S, mmcif::PStruct Struct, 00158 cpstr Tag, int SLen, 00159 cpstr DefS, 00160 bool Remove=true ); 00161 00162 extern ERROR_CODE CIFGetInteger ( int & I, mmcif::PLoop Loop, cpstr Tag, 00163 int & Signal ); 00164 extern ERROR_CODE CIFGetIntegerD ( int & I, mmcif::PLoop Loop, cpstr Tag, 00165 int defValue=MinInt4 ); 00166 extern ERROR_CODE CIFGetInteger1 ( int & I, mmcif::PLoop Loop, cpstr Tag, 00167 int nrow ); 00168 00169 extern ERROR_CODE CIFGetReal ( realtype & R, mmcif::PLoop Loop, 00170 cpstr Tag, int & Signal ); 00171 extern ERROR_CODE CIFGetReal1 ( realtype & R, mmcif::PLoop Loop, 00172 cpstr Tag, int nrow ); 00173 00174 extern ERROR_CODE CIFGetString ( pstr S, mmcif::PLoop Loop, cpstr Tag, 00175 int row, int SLen, cpstr DefS ); 00176 00177 // Calculates AI=A^{-1} 00178 extern void Mat4Inverse ( mat44 & A, mat44 & AI ); 00179 // Calculates A=B*C 00180 extern void Mat4Mult ( mat44 & A, mat44 & B, mat44 & C ); 00181 // Calculates A=B^{-1}*C 00182 extern void Mat4Div1 ( mat44 & A, mat44 & B, mat44 & C ); 00183 // Calculates A=B*C^{-1} 00184 extern void Mat4Div2 ( mat44 & A, mat44 & B, mat44 & C ); 00185 // Calculates determinant of the rotation part 00186 extern realtype Mat4RotDet ( mat44 & T ); 00187 00188 // Sets up a unit matrix 00189 extern void Mat4Init ( mat44 & A ); 00190 extern void Mat3Init ( mat33 & A ); 00191 00192 // Calculates AI=A^{-1}, returns determinant 00193 extern realtype Mat3Inverse ( mat33 & A, mat33 & AI ); 00194 00195 extern bool isMat4Unit ( mat44 & A, realtype eps, bool rotOnly ); 00196 00197 // Copies A into AC 00198 extern void Mat4Copy ( mat44 & A, mat44 & ACopy ); 00199 extern void Mat3Copy ( mat33 & A, mat33 & ACopy ); 00200 extern bool isMat4Eq ( mat44 & A, mat44 & B, realtype eps, 00201 bool rotOnly ); 00202 00203 extern void TransformXYZ ( mat44 & T, 00204 realtype & X, realtype & Y, realtype & Z ); 00205 extern realtype TransformX ( mat44 & T, 00206 realtype X, realtype Y, realtype Z ); 00207 extern realtype TransformY ( mat44 & T, 00208 realtype X, realtype Y, realtype Z ); 00209 extern realtype TransformZ ( mat44 & T, 00210 realtype X, realtype Y, realtype Z ); 00211 00212 00213 extern char CIFErrorLocation[200]; 00214 00215 // Returns ASCII string explaining the nature of 00216 // Error_xxxx error code. 00217 extern cpstr GetErrorDescription ( ERROR_CODE ErrorCode ); 00218 00219 00220 00221 // ================ ContainerClass ==================== 00222 00223 DefineClass(ContainerClass); 00224 DefineStreamFunctions(ContainerClass); 00225 00226 class ContainerClass : public io::Stream { 00227 00228 friend class ClassContainer; 00229 00230 public : 00231 00232 ContainerClass (); 00233 ContainerClass ( io::RPStream Object ); 00234 ~ContainerClass() {} 00235 00236 // ConvertPDBASCII(..) will return one of the Error_XXXXX 00237 // constants, see <mmdb_defs.h> 00238 virtual ERROR_CODE ConvertPDBASCII ( cpstr ) 00239 { return Error_NoError; } 00240 virtual void PDBASCIIDump ( pstr, int ) {} 00241 virtual bool PDBASCIIDump1 ( io::RFile ) { return false; } 00242 virtual void MakeCIF ( mmcif::PData, int ) {} 00243 00244 // Append(..) should return true if CC is appended to this class. 00245 // If this is not the case, CC is merely put on the top of 00246 // container. 00247 // Note: Append(..) detects the necessity to append CC and 00248 // performs all the necessary actions for that. The rest of CC 00249 // will be disposed by Class Container. 00250 // Note: Class Container checks every new class, which is 00251 // being added to it (see CClassContainer::AddData(..)), only 00252 // against the top of container. 00253 virtual bool Append ( PContainerClass CC ); 00254 00255 // GetCIF(..) extracts any necessary information from CIF and 00256 // returns in Signal: 00257 // Error_noError : the information was successfully extracted, 00258 // this instance of container class should be 00259 // stored, and unchanged value of Signal should 00260 // be passed to the next (newly created) instance 00261 // of this container class. 00262 // Error_EmptyCIF : there is no information for this type of 00263 // containers to extract. This instance of 00264 // container class should be deleted and input 00265 // for this type of container class terminated. 00266 // Other : the corresponding error. This instance of 00267 // container class should be deleted and the 00268 // whole input stopped. 00269 virtual ERROR_CODE GetCIF ( mmcif::PData, int & n ) 00270 { n = -1; return Error_EmptyCIF; } 00271 virtual CLASS_ID GetClassID () { return ClassID_Template; } 00272 00273 virtual void Copy ( PContainerClass ) {} 00274 00275 void write ( io::RFile ) {} 00276 void read ( io::RFile ) {} 00277 00278 protected : 00279 int ContinuationNo; 00280 00281 }; 00282 00283 00284 // ======================== ContString ========================= 00285 00286 DefineClass(ContString); 00287 DefineStreamFunctions(ContString); 00288 00289 class ContString : public ContainerClass { 00290 00291 public : 00292 00293 pstr Line; // a string 00294 00295 ContString (); 00296 ContString ( cpstr S ); 00297 ContString ( io::RPStream Object ); 00298 ~ContString(); 00299 00300 ERROR_CODE ConvertPDBASCII ( cpstr S ); 00301 void PDBASCIIDump ( pstr S, int N ); 00302 bool PDBASCIIDump1 ( io::RFile f ); 00303 void MakeCIF ( mmcif::PData CIF, int N ); 00304 // void GetCIF1 ( mmcif::PData CIF, ERROR_CODE & Signal, 00305 // int & pos ); 00306 bool Append ( PContainerClass ContString ); 00307 CLASS_ID GetClassID () { return ClassID_String; } 00308 00309 void Copy ( PContainerClass CString ); 00310 00311 void write ( io::RFile f ); 00312 void read ( io::RFile f ); 00313 00314 protected : 00315 pstr CIFCategory,CIFTag; 00316 00317 void InitString(); 00318 00319 }; 00320 00321 00322 // ============== ClassContainer ==================== 00323 00324 DefineClass(ClassContainer); 00325 DefineStreamFunctions(ClassContainer); 00326 00327 class ClassContainer : public io::Stream { 00328 00329 public : 00330 00331 ClassContainer (); 00332 ClassContainer ( io::RPStream Object ); 00333 ~ClassContainer (); 00334 00335 void FreeContainer (); 00336 void AddData ( PContainerClass Data ); 00337 virtual void PDBASCIIDump ( io::RFile f ); 00338 virtual void MakeCIF ( mmcif::PData CIF ); 00339 // GetCIF(..) will return one of the Error_XXXXX constants, 00340 // see <mmdb_defs.h> 00341 virtual ERROR_CODE GetCIF ( mmcif::PData CIF, int ClassID ); 00342 virtual PContainerClass MakeContainerClass ( int ClassID ); 00343 00344 // Copy will empty the class if parameter is set to NULL 00345 virtual void Copy ( PClassContainer CContainer ); 00346 00347 inline int Length() { return length; } 00348 PContainerClass GetContainerClass ( int ContClassNo ); 00349 00350 void write ( io::RFile f ); 00351 void read ( io::RFile f ); 00352 00353 protected : 00354 int length; 00355 PPContainerClass Container; 00356 00357 void Init(); 00358 00359 }; 00360 00361 00362 // ====================== ID parsers ========================== 00363 00364 DefineClass(AtomPath); 00365 DefineStreamFunctions(AtomPath); 00366 00367 enum APATH_FLAG { 00368 APATH_ModelNo = 0x00000001, 00369 APATH_ChainID = 0x00000002, 00370 APATH_SeqNum = 0x00000004, 00371 APATH_InsCode = 0x00000008, 00372 APATH_ResName = 0x00000010, 00373 APATH_AtomName = 0x00000020, 00374 APATH_Element = 0x00000040, 00375 APATH_AltLoc = 0x00000080, 00376 APATH_Incomplete = 0x00000100, 00377 APATH_WC_ModelNo = 0x00001000, 00378 APATH_WC_ChainID = 0x00002000, 00379 APATH_WC_SeqNum = 0x00004000, 00380 APATH_WC_InsCode = 0x00008000, 00381 APATH_WC_ResName = 0x00010000, 00382 APATH_WC_AtomName = 0x00020000, 00383 APATH_WC_Element = 0x00040000, 00384 APATH_WC_AltLoc = 0x00080000 00385 }; 00386 00387 class AtomPath : public io::Stream { 00388 00389 public : 00390 00391 int modelNo; 00392 ChainID chainID; 00393 int seqNum; 00394 InsCode insCode; 00395 ResName resName; 00396 AtomName atomName; 00397 Element element; 00398 AltLoc altLoc; 00399 int isSet; 00400 00401 AtomPath (); 00402 AtomPath ( cpstr ID ); 00403 AtomPath ( io::RPStream Object ); 00404 ~AtomPath (); 00405 00406 // SetPath(..) parses the Atom Path ID string, which 00407 // may be incomplete. Below {..} means blocks that 00408 // may be omitted; any elements within such blocks 00409 // may be omitted as well. 00410 // 00411 // 1. If ID starts with '/' then the ID must be of 00412 // the following form: 00413 // /mdl{/chn{/seq(res).i{/atm[elm]:a}}} 00414 // 00415 // 2. If ID starts with a letter: 00416 // chn{/seq(res).i{/atm[elm]:a}} 00417 // 00418 // 3. If ID starts with a number or '(': 00419 // seq(res).i{/atm[elm]:a} 00420 // 00421 // 4. If ID contains colon ':' or '[' then 00422 // it may be just 00423 // atm[elm]:a 00424 // 00425 // The following are valid samples of IDs: 00426 // 00427 // /1 model number 1 00428 // /1/A/23(GLU).A/CA[C]:A model number 1, chain A, 00429 // residue 23 GLU insertion code A, C-alpha 00430 // atom in alternative location A 00431 // A/23 residue 23 of chain A 00432 // CA[C]: atom C-alpha 00433 // [C] a carbon 00434 // *[C]:* same as above 00435 // :A an atom with insertion code A 00436 // 5 residue number 5 00437 // (GLU) residue GLU 00438 // 00439 // All spaces are ignored. SetPath(..) sets bit of isSet 00440 // for each element present. Any element may be a wildcard 00441 // '*'. Wildcard for model will set modelNo=0, for sequence 00442 // number will set seqNum=MinInt4. 00443 // 00444 // Returns: 00445 // 0 <-> Ok 00446 // -1 <-> wrong numerical format for model 00447 // -2 <-> wrong numerical format for sequence number 00448 int SetPath ( cpstr ID ); 00449 00450 void write ( io::RFile f ); 00451 void read ( io::RFile f ); 00452 00453 protected : 00454 void InitAtomPath(); 00455 00456 }; 00457 00458 00459 // -------------------------------------------------------------- 00460 00461 DefineClass(QuickSort); 00462 00463 class QuickSort : public io::Stream { 00464 00465 public : 00466 QuickSort (); 00467 QuickSort ( io::RPStream Object ); 00468 ~QuickSort() {} 00469 virtual int Compare ( int i, int j ); 00470 virtual void Swap ( int i, int j ); 00471 void Sort ( void * sortdata, int data_len ); 00472 00473 protected : 00474 int selSortLimit,dlen; 00475 void * data; 00476 00477 void SelectionSort ( int left, int right ); 00478 int Partition ( int left, int right ); 00479 void Quicksort ( int left, int right ); 00480 00481 }; 00482 00483 00484 // -------------------------------------------------------------- 00485 00486 extern void takeWord ( pstr & p, pstr wrd, cpstr ter, int l ); 00487 00488 // ParseAtomID(..) reads the atom ID of the following form: 00489 // {name} {[element]} {:altcode} 00490 // (here {} means that the item may be omitted; any field may have 00491 // value of wildcard '*'), and returns the atom name in aname, 00492 // element name - in elname, and alternate location code - in aloc. 00493 // Except for the alternate location code, missing items are 00494 // replaced by wildcards. Missing alternate location code is 00495 // returned as empty string "". 00496 // Leading spaces are allowed; any other space will terminate 00497 // the parsing. 00498 // The followings are perfectly valid atom IDs: 00499 // CA[C]:A (carbon C_alpha in location A) 00500 // CA[*]:A (either C_alpha or Ca in location A) 00501 // CA:A (same as above) 00502 // CA (either C_alpha or Ca with no location indicator) 00503 // CA[] (same as above) 00504 // CA[C]: (C_alpha with no location indicator) 00505 // [C] (any carbon with no location indicator) 00506 // [C]:* (any carbon with any location indicator) 00507 // *[C]:* (same as above) 00508 // :A (any atom in location A) 00509 // *[*]:A (same as above) 00510 // *[*]:* (any atom) 00511 // * (any atom with no alternate location indicator) 00512 extern void ParseAtomID ( cpstr ID, AtomName aname, 00513 Element elname, AltLoc aloc ); 00514 00515 // ParseResID(..) reads the residue ID of the following form: 00516 // {seqnum} {(name)} {.inscode} 00517 // (here {} means that the item may be omitted; any field may have 00518 // value of wildcard '*'), and returns the sequence number in sn, 00519 // insertion code - in inscode, and residue name - in resname. 00520 // If a wildcard was specified for the sequence number, then 00521 // ParseResID(..) returns 1. Missing residue name is replaced by 00522 // the wildcard '*', and misisng insertion code is returned as empty 00523 // string "". 00524 // Leading spaces are allowed; any other space will terminate 00525 // the parsing. 00526 // Return 0 means Ok, 1 - wildcard for the sequence number, 00527 // 2 - an error in numerical format of the sequence number 00528 // (other items are parsed). 00529 // The followings are perfectly valid residue IDs: 00530 // 27(ALA).A (residue 27A ALA) 00531 // 27().A (residue 27A) 00532 // 27(*).A (same as above) 00533 // 27.A (same as above) 00534 // 27 (residue 27) 00535 // 27(). (same as above) 00536 // (ALA) (any ALA without insertion code) 00537 // (ALA). (same as above) 00538 // (ALA).* (any ALA) 00539 // *(ALA).* (any ALA) 00540 // .A (any residue with insertion code A) 00541 // *(*).A (same as above) 00542 // *(*).* (any residue) 00543 // * (any residue with no insertion code) 00544 extern int ParseResID ( cpstr ID, int & sn, 00545 InsCode inscode, ResName resname ); 00546 00547 00548 // ParseAtomPath(..) parses an atom path string of the following 00549 // structure: 00550 // /mdl/chn/seq(res).i/atm[elm]:a 00551 // where all items may be represented by a wildcard '*' and 00552 // mdl - model number (mandatory); at least model #1 is always 00553 // present; returned in mdl; on a wildcard mdl is set to 0 00554 // chn - chain identifier ( mandatory); returned in chn; on a 00555 // wildcard chn is set to '*' 00556 // seq - residue sequence number (mandatory); returned in sn; 00557 // on a wild card ParseAtomPath(..) returns 1 00558 // (res) - residue name in round brackets (may be omitted); 00559 // returnded in res; on a wildcard res is set to '*' 00560 // .i - insert code after a dot; if '.i' or 'i' is missing 00561 // then a residue without an insertion code is looked for; 00562 // returned in ic; on a wildcard (any insertion code would 00563 // do) ic is set to '*' 00564 // atm - atom name (mandatory); returned in atm; on a wildcard 00565 // atm is set to '*' 00566 // [elm] - chemical element code in square brackets; it may 00567 // be omitted but could be helpful for e.g. 00568 // distinguishing C_alpha and CA; returned in elm; 00569 // in a wildcard elm is set to '*' 00570 // :a - alternate location indicator after colon; if 00571 // ':a' or 'a' is missing then an atom without 00572 // alternate location indicator is looked for; returned 00573 // in aloc; on a wildcard (any alternate code would do) 00574 // aloc is set to '*'. 00575 // All spaces are ignored, all identifiers should be in capital 00576 // letters (comparisons are case-sensitive). 00577 // The atom path string may be incomplete. If DefPath is supplied, 00578 // the function will try to get missing elements from there. If 00579 // missing items may not be found in DefPath, they are replaced by 00580 // wildcards. 00581 // ParseAtomPath(..) returns the following bits: 00582 // 0 - Ok 00583 // APATH_Incomplete - if path contains wildcards. Wildcards for 00584 // residue name and chemical element will be 00585 // ignored here if sequence number and 00586 // atom name, correspondingly, are provided. 00587 // APATH_WC_XXXXX - wildcard for different elements 00588 // -1 - wrong numerical format for model (fatal) 00589 // -2 - wrong numerical format for seqNum (fatal) 00590 00591 extern int ParseAtomPath ( cpstr ID, 00592 int & mdl, 00593 ChainID chn, 00594 int & sn, 00595 InsCode ic, 00596 ResName res, 00597 AtomName atm, 00598 Element elm, 00599 AltLoc aloc, 00600 PAtomPath DefPath=NULL ); 00601 00602 00603 00604 extern int ParseSelectionPath ( cpstr CID, 00605 int & iModel, 00606 pstr Chains, 00607 int & sNum1, 00608 InsCode ic1, 00609 int & sNum2, 00610 InsCode ic2, 00611 pstr RNames, 00612 pstr ANames, 00613 pstr Elements, 00614 pstr altLocs ); 00615 00616 00617 00618 extern void MakeSelectionPath ( pstr CID, 00619 int iModel, 00620 cpstr Chains, 00621 int sNum1, 00622 const InsCode ic1, 00623 int sNum2, 00624 const InsCode ic2, 00625 cpstr RNames, 00626 cpstr ANames, 00627 cpstr Elements, 00628 cpstr altLocs ); 00629 00630 } // namespace mmdb 00631 00632 #endif 00633
1.7.2