Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 #ifndef __MMDB_Title__
00056 #define __MMDB_Title__
00057
00058 #include "mmdb_io_stream.h"
00059 #include "mmdb_defs.h"
00060 #include "mmdb_utils.h"
00061 #include "mmdb_mmcif_.h"
00062
00063 namespace mmdb {
00064
00065
00066
00067 DefineClass(TitleContainer);
00068 DefineStreamFunctions(TitleContainer);
00069
00070 class TitleContainer : public ClassContainer {
00071
00072 public :
00073
00074 TitleContainer () : ClassContainer() {}
00075 TitleContainer ( io::RPStream Object )
00076 : ClassContainer ( Object ) {}
00077 ~TitleContainer() {}
00078
00079 PContainerClass MakeContainerClass ( int ClassID );
00080
00081 };
00082
00083
00084
00085
00086 DefineClass(ObsLine);
00087 DefineStreamFunctions(ObsLine);
00088
00089 class ObsLine : public ContainerClass {
00090
00091 public :
00092
00093 Date repDate;
00094 IDCode idCode;
00095 IDCode rIdCode[8];
00096
00097 ObsLine ();
00098 ObsLine ( cpstr S );
00099 ObsLine ( io::RPStream Object );
00100 ~ObsLine();
00101
00102 void PDBASCIIDump ( pstr S, int N );
00103 void MakeCIF ( mmcif::PData CIF, int N );
00104 ERROR_CODE ConvertPDBASCII ( cpstr S );
00105 ERROR_CODE GetCIF ( mmcif::PData CIF, int & n );
00106 CLASS_ID GetClassID () { return ClassID_ObsLine; }
00107
00108 void Copy ( PContainerClass ObsLine );
00109
00110 void write ( io::RFile f );
00111 void read ( io::RFile f );
00112
00113 protected :
00114
00115 void InitObsLine();
00116
00117 };
00118
00119
00120
00121
00122 DefineClass(TitleLine);
00123 DefineStreamFunctions(TitleLine);
00124
00125 class TitleLine : public ContString {
00126
00127 public :
00128
00129 TitleLine ();
00130 TitleLine ( cpstr S );
00131 TitleLine ( io::RPStream Object );
00132 ~TitleLine();
00133
00134 ERROR_CODE ConvertPDBASCII ( cpstr S );
00135 void PDBASCIIDump ( pstr S, int N );
00136 bool PDBASCIIDump1 ( io::RFile ) { return false; }
00137 CLASS_ID GetClassID () { return ClassID_TitleLine; }
00138
00139 void write ( io::RFile f );
00140 void read ( io::RFile f );
00141
00142 protected :
00143
00144 void InitTitleLine();
00145
00146 };
00147
00148
00149
00150
00151 DefineClass(Caveat);
00152 DefineStreamFunctions(Caveat);
00153
00154 class Caveat : public ContString {
00155
00156 public :
00157
00158 IDCode idCode;
00159
00160 Caveat ();
00161 Caveat ( cpstr S );
00162 Caveat ( io::RPStream Object );
00163 ~Caveat();
00164
00165 void PDBASCIIDump ( pstr S, int N );
00166 bool PDBASCIIDump1 ( io::RFile ) { return false; }
00167 void MakeCIF ( mmcif::PData CIF, int N );
00168 ERROR_CODE ConvertPDBASCII ( cpstr S );
00169
00170
00171
00172
00173 CLASS_ID GetClassID () { return ClassID_CAVEAT; }
00174
00175 void Copy ( PContainerClass Caveat );
00176
00177 void write ( io::RFile f );
00178 void read ( io::RFile f );
00179
00180 protected :
00181
00182 void InitCaveat();
00183
00184 };
00185
00186
00187
00188
00189 DefineClass(Compound);
00190 DefineStreamFunctions(Compound);
00191
00192 class Compound : public ContString {
00193
00194 public :
00195
00196 Compound ();
00197 Compound ( cpstr S );
00198 Compound ( io::RPStream Object );
00199 ~Compound();
00200
00201 void PDBASCIIDump ( pstr S, int N );
00202 bool PDBASCIIDump1 ( io::RFile ) { return false; }
00203 ERROR_CODE ConvertPDBASCII ( cpstr S );
00204 CLASS_ID GetClassID () { return ClassID_Compound; }
00205
00206 void write ( io::RFile f );
00207 void read ( io::RFile f );
00208
00209 protected :
00210
00211 void InitCompound();
00212
00213 };
00214
00215
00216
00217
00218 DefineClass(Source);
00219 DefineStreamFunctions(Source);
00220
00221 class Source : public ContString {
00222
00223 public :
00224
00225 Source ();
00226 Source ( cpstr S );
00227 Source ( io::RPStream Object );
00228 ~Source();
00229
00230 void PDBASCIIDump ( pstr S, int N );
00231 bool PDBASCIIDump1 ( io::RFile ) { return false; }
00232 ERROR_CODE ConvertPDBASCII ( cpstr S );
00233 CLASS_ID GetClassID () { return ClassID_Source; }
00234
00235 void write ( io::RFile f );
00236 void read ( io::RFile f );
00237
00238 protected :
00239
00240 void InitSource();
00241
00242 };
00243
00244
00245
00246
00247 DefineClass(KeyWords);
00248 DefineStreamFunctions(KeyWords);
00249
00250 class KeyWords : public io::Stream {
00251
00252 public :
00253 int nKeyWords;
00254 psvector KeyWord;
00255
00256 KeyWords ();
00257 KeyWords ( cpstr S );
00258 KeyWords ( io::RPStream Object );
00259 ~KeyWords();
00260
00261 void Delete ();
00262
00263 void PDBASCIIDump ( io::RFile f );
00264 void MakeCIF ( mmcif::PData CIF );
00265
00266 int ConvertPDBASCII ( cpstr S );
00267 void GetCIF ( mmcif::PData CIF );
00268
00269 void Copy ( PKeyWords KeyWords );
00270
00271 void write ( io::RFile f );
00272 void read ( io::RFile f );
00273
00274 protected :
00275 bool Cont;
00276
00277 void Init();
00278
00279 };
00280
00281
00282
00283
00284 DefineClass(ExpData);
00285 DefineStreamFunctions(ExpData);
00286
00287 class ExpData : public ContString {
00288
00289 public :
00290
00291 ExpData ();
00292 ExpData ( cpstr S );
00293 ExpData ( io::RPStream Object );
00294 ~ExpData();
00295
00296 void PDBASCIIDump ( pstr S, int N );
00297 bool PDBASCIIDump1 ( io::RFile ) { return false; }
00298 ERROR_CODE ConvertPDBASCII ( cpstr S );
00299 CLASS_ID GetClassID () { return ClassID_ExpData; }
00300
00301 void write ( io::RFile f );
00302 void read ( io::RFile f );
00303
00304 protected :
00305
00306 void InitExpData();
00307
00308 };
00309
00310
00311
00312
00313 DefineClass(MdlType);
00314 DefineStreamFunctions(MdlType);
00315
00316 class MdlType : public ContString {
00317
00318 public :
00319
00320 MdlType ();
00321 MdlType ( cpstr S );
00322 MdlType ( io::RPStream Object );
00323 ~MdlType();
00324
00325 void PDBASCIIDump ( pstr S, int N );
00326 bool PDBASCIIDump1 ( io::RFile ) { return false; }
00327 ERROR_CODE ConvertPDBASCII ( cpstr S );
00328 CLASS_ID GetClassID () { return ClassID_MdlType; }
00329
00330 void write ( io::RFile f );
00331 void read ( io::RFile f );
00332
00333 protected :
00334
00335 void InitMdlType();
00336
00337 };
00338
00339
00340
00341
00342 DefineClass(Author);
00343 DefineStreamFunctions(Author);
00344
00345 class Author : public ContString {
00346
00347 public :
00348
00349 Author ();
00350 Author ( cpstr S );
00351 Author ( io::RPStream Object );
00352 ~Author();
00353
00354 void PDBASCIIDump ( pstr S, int N );
00355 bool PDBASCIIDump1 ( io::RFile ) { return false; }
00356 ERROR_CODE ConvertPDBASCII ( cpstr S );
00357 CLASS_ID GetClassID () { return ClassID_Author; }
00358
00359 void write ( io::RFile f );
00360 void read ( io::RFile f );
00361
00362 protected :
00363
00364 void InitAuthor();
00365
00366 };
00367
00368
00369
00370
00371 DefineClass(RevData);
00372 DefineStreamFunctions(RevData);
00373
00374 enum REVDAT_WARNING {
00375 REVDAT_WARN_MODNUM = 0x00000001,
00376 REVDAT_WARN_MODTYPE = 0x00000002
00377 };
00378
00379 class RevData : public ContainerClass {
00380
00381 public :
00382 int modNum;
00383 Date modDate;
00384 char modId[13];
00385 int modType;
00386 RecName record[4];
00387 word Warning;
00388
00389 RevData ();
00390 RevData ( cpstr S );
00391 RevData ( io::RPStream Object );
00392 ~RevData();
00393
00394 void PDBASCIIDump ( pstr S, int N );
00395 void MakeCIF ( mmcif::PData CIF, int N );
00396 ERROR_CODE ConvertPDBASCII ( cpstr S );
00397 ERROR_CODE GetCIF ( mmcif::PData CIF, int & n );
00398 CLASS_ID GetClassID () { return ClassID_RevData; }
00399
00400 void Copy ( PContainerClass RevData );
00401
00402 void write ( io::RFile f );
00403 void read ( io::RFile f );
00404
00405 protected :
00406
00407 void InitRevData();
00408
00409 };
00410
00411
00412
00413
00414 DefineClass(Supersede);
00415 DefineStreamFunctions(Supersede);
00416
00417 class Supersede : public ContainerClass {
00418
00419 public :
00420 Date sprsdeDate;
00421 IDCode idCode;
00422 IDCode sIdCode[8];
00423
00424 Supersede ();
00425 Supersede ( cpstr S );
00426 Supersede ( io::RPStream Object );
00427 ~Supersede();
00428
00429 void PDBASCIIDump ( pstr S, int N );
00430 void MakeCIF ( mmcif::PData CIF, int N );
00431 ERROR_CODE ConvertPDBASCII ( cpstr S );
00432 ERROR_CODE GetCIF ( mmcif::PData CIF, int & n );
00433 CLASS_ID GetClassID () { return ClassID_Supersede; }
00434
00435 void Copy ( PContainerClass Supersede );
00436
00437 void write ( io::RFile f );
00438 void read ( io::RFile f );
00439
00440 protected :
00441
00442 void InitSupersede();
00443
00444 };
00445
00446
00447
00448
00449 DefineClass(Journal);
00450 DefineStreamFunctions(Journal);
00451
00452 class Journal : public ContString {
00453
00454 public :
00455
00456 Journal ();
00457 Journal ( cpstr S );
00458 Journal ( io::RPStream Object );
00459 ~Journal();
00460
00461 void PDBASCIIDump ( pstr S, int N );
00462 bool PDBASCIIDump1 ( io::RFile ) { return false; }
00463 ERROR_CODE ConvertPDBASCII ( cpstr S );
00464 CLASS_ID GetClassID () { return ClassID_Journal; }
00465
00466 void write ( io::RFile f );
00467 void read ( io::RFile f );
00468
00469 protected :
00470
00471 void InitJournal();
00472
00473 };
00474
00475
00476
00477
00478 DefineClass(Remark);
00479 DefineStreamFunctions(Remark);
00480
00481 class Remark : public ContainerClass {
00482
00483 public :
00484
00485 int remarkNum;
00486 pstr remark;
00487
00488 Remark ();
00489 Remark ( cpstr S );
00490 Remark ( io::RPStream Object );
00491 ~Remark();
00492
00493 void PDBASCIIDump ( pstr S, int N );
00494 void MakeCIF ( mmcif::PData CIF, int N );
00495 ERROR_CODE ConvertPDBASCII ( cpstr S );
00496 ERROR_CODE GetCIF ( mmcif::PData CIF, int & n );
00497 CLASS_ID GetClassID () { return ClassID_Remark; }
00498
00499 void Copy ( PContainerClass RemarkClass );
00500
00501 void write ( io::RFile f );
00502 void read ( io::RFile f );
00503
00504 protected :
00505
00506 void InitRemark();
00507
00508 };
00509
00510
00511
00512 DefineClass(BMApply);
00513 DefineStreamFunctions(BMApply);
00514
00515 class BMApply : public io::Stream {
00516
00517 public :
00518 PChainID chain;
00519 int nChains;
00520 pmat44 tm;
00521 int nMatrices;
00522
00523 BMApply ();
00524 BMApply ( io::RPStream Object );
00525 ~BMApply();
00526
00527 void FreeMemory();
00528
00529 int addChains ( int & i, RPRemark rem, RTitleContainer Remark );
00530 int addMatrices ( int & i, RPRemark rem, RTitleContainer Remark );
00531
00532 void Copy ( PBMApply BMA );
00533
00534 void write ( io::RFile f );
00535 void read ( io::RFile f );
00536
00537 protected :
00538 void InitBMApply();
00539
00540 };
00541
00542
00543 DefineClass(Biomolecule);
00544 DefineStreamFunctions(Biomolecule);
00545
00546 class Biomolecule : public io::Stream {
00547
00548 public :
00549 PPBMApply bmApply;
00550 int nBMAs;
00551
00552 Biomolecule ();
00553 Biomolecule ( io::RPStream Object );
00554 ~Biomolecule();
00555
00556 void FreeMemory();
00557
00558 PBMApply addBMApply();
00559
00560 int Size();
00561 bool checkComposition ( PChainID chID, ivector occ,
00562 ivector wocc, int n );
00563
00564 void Copy ( PBiomolecule B );
00565
00566 void write ( io::RFile f );
00567 void read ( io::RFile f );
00568
00569 protected :
00570 void InitBiomolecule();
00571
00572 };
00573
00574
00575
00576 DefineClass(Title);
00577 DefineStreamFunctions(Title);
00578
00579 class Title : public io::Stream {
00580
00581 friend class Model;
00582 friend class Chain;
00583 friend class Root;
00584
00585 public :
00586
00587 Title ();
00588 Title ( io::RPStream Object );
00589 ~Title();
00590
00591 void FreeMemory ( bool keepBiomolecules );
00592
00593
00594 void SetHeader ( cpstr Classification,
00595 cpstr DepDate,
00596 cpstr ID_Code );
00597
00598
00599
00600
00601
00602
00603 ERROR_CODE ConvertPDBString ( pstr PDBString );
00604
00605
00606
00607 void MakePDBHeaderString ( pstr PDBString );
00608
00609
00610
00611
00612
00613
00614 pstr GetStructureTitle ( pstr & S );
00615
00616 PTitleContainer GetObsData () { return &obsData; }
00617 PTitleContainer GetCaveat () { return &caveat; }
00618 PTitleContainer GetCompound() { return &compound; }
00619 PTitleContainer GetSource () { return &source; }
00620 PKeyWords GetKeyWords() { return &keyWords; }
00621 PTitleContainer GetExpData () { return &expData; }
00622 PTitleContainer GetMdlType () { return &mdlType; }
00623 PTitleContainer GetRemarks () { return &remark; }
00624 PTitleContainer GetJournal () { return &journal; }
00625
00626 realtype GetResolution();
00627
00628 int ParseBiomolecules();
00629
00630
00631
00632 int GetNofBiomolecules();
00633 void GetBiomolecules ( PPBiomolecule & BM, int & nBMs );
00634 PBiomolecule GetBiomolecule ( int bmNo );
00635
00636
00637 void PDBASCIIDump ( io::RFile f );
00638 void MakeCIF ( mmcif::PData CIF );
00639
00640
00641
00642 ERROR_CODE GetCIF ( mmcif::PData CIF );
00643
00644 inline pstr GetIDCode() { return idCode; }
00645 inline bool GetCol73 () { return col73; }
00646 void TrimInput ( pstr PDBString );
00647
00648 void Copy ( PTitle TS );
00649
00650
00651 void write ( io::RFile f );
00652 void read ( io::RFile f );
00653
00654 protected :
00655
00656
00657 pstr classification;
00658 Date depDate;
00659 IDCode idCode;
00660 realtype resolution;
00661 bool col73;
00662
00663 TitleContainer obsData;
00664 TitleContainer title;
00665 TitleContainer caveat;
00666 TitleContainer compound;
00667 TitleContainer source;
00668 KeyWords keyWords;
00669 TitleContainer expData;
00670 TitleContainer mdlType;
00671 TitleContainer author;
00672 TitleContainer revData;
00673 TitleContainer supersede;
00674 TitleContainer journal;
00675 TitleContainer remark;
00676
00677 PPBiomolecule biomolecule;
00678 int nBiomolecules;
00679
00680 void Init();
00681 void FreeBiomolecules();
00682
00683 PBiomolecule addBiomolecule();
00684
00685 };
00686
00687 extern void TestHeader();
00688 extern void TestTitle ();
00689
00690
00691
00692 }
00693
00694
00695 #endif
00696