BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PDBdefs.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 
5 #ifndef BALL_FORMAT_PDBDEFS_H
6 #define BALL_FORMAT_PDBDEFS_H
7 
8 #ifndef BALL_COMMON_H
9 # include <BALL/common.h>
10 #endif
11 
12 #ifndef BALL_KERNEL_ATOM_H
13 # include <BALL/KERNEL/atom.h>
14 #endif
15 
16 #ifndef BALL_KERNEL_SECONDARYSTRUCTURE_H
18 #endif
19 
20 #ifndef BALL_KERNEL_CHAIN_H
21 # include <BALL/KERNEL/chain.h>
22 #endif
23 
24 #ifndef BALL_KERNEL_RESIDUE_H
25 # include <BALL/KERNEL/residue.h>
26 #endif
27 
28 #ifndef BALL_DATATYPES_HASHSET_H
29 # include <BALL/DATATYPE/hashSet.h>
30 #endif
31 
32 #ifndef BALL_MATHS_MATRIX44_H
33 # include <BALL/MATHS/matrix44.h>
34 #endif
35 
36 namespace BALL
37 {
38 
39 
45  namespace PDB
46  {
49  enum
50  {
54  };
55 
59  {
119 
121 
123  };
124 
127  BALL_EXPORT extern const char* FORMAT_UNKNOWN;
128  BALL_EXPORT extern const char* FORMAT_ANISOU;
129  BALL_EXPORT extern const char* FORMAT_ATOM;
130  BALL_EXPORT extern const char* FORMAT_ATOM_PARTIAL_CRG;
131  BALL_EXPORT extern const char* FORMAT_AUTHOR;
132  BALL_EXPORT extern const char* FORMAT_CAVEAT;
133  BALL_EXPORT extern const char* FORMAT_CISPEP;
134  BALL_EXPORT extern const char* FORMAT_COMPND;
135  BALL_EXPORT extern const char* FORMAT_CONECT;
136  BALL_EXPORT extern const char* FORMAT_CON06;
137  BALL_EXPORT extern const char* FORMAT_CON06_1;
138  BALL_EXPORT extern const char* FORMAT_CON06_2;
139  BALL_EXPORT extern const char* FORMAT_CON06_3;
140  BALL_EXPORT extern const char* FORMAT_CON06_4;
141  BALL_EXPORT extern const char* FORMAT_CRYST1;
142  BALL_EXPORT extern const char* FORMAT_DBREF;
143  BALL_EXPORT extern const char* FORMAT_END;
144  BALL_EXPORT extern const char* FORMAT_ENDMDL;
145  BALL_EXPORT extern const char* FORMAT_EXPDTA;
146  BALL_EXPORT extern const char* FORMAT_FORMUL;
147  BALL_EXPORT extern const char* FORMAT_FTNOTE;
148  BALL_EXPORT extern const char* FORMAT_HEADER;
149  BALL_EXPORT extern const char* FORMAT_HELIX;
150  BALL_EXPORT extern const char* FORMAT_HET;
151  BALL_EXPORT extern const char* FORMAT_HETATM;
152  BALL_EXPORT extern const char* FORMAT_HETNAM;
153  BALL_EXPORT extern const char* FORMAT_HETSYN;
154  BALL_EXPORT extern const char* FORMAT_HYDBND;
155  BALL_EXPORT extern const char* FORMAT_JRNL;
156  BALL_EXPORT extern const char* FORMAT_KEYWDS;
157  BALL_EXPORT extern const char* FORMAT_LINK;
158  BALL_EXPORT extern const char* FORMAT_MASTER;
159  BALL_EXPORT extern const char* FORMAT_MODEL;
160  BALL_EXPORT extern const char* FORMAT_MODRES;
161  BALL_EXPORT extern const char* FORMAT_MTRIX1;
162  BALL_EXPORT extern const char* FORMAT_MTRIX2;
163  BALL_EXPORT extern const char* FORMAT_MTRIX3;
164  BALL_EXPORT extern const char* FORMAT_OBSLTE;
165  BALL_EXPORT extern const char* FORMAT_ORIGX1;
166  BALL_EXPORT extern const char* FORMAT_ORIGX2;
167  BALL_EXPORT extern const char* FORMAT_ORIGX3;
168  BALL_EXPORT extern const char* FORMAT_REMARK;
169  BALL_EXPORT extern const char* FORMAT_REVDAT;
170  BALL_EXPORT extern const char* FORMAT_SCALE1;
171  BALL_EXPORT extern const char* FORMAT_SCALE2;
172  BALL_EXPORT extern const char* FORMAT_SCALE3;
173  BALL_EXPORT extern const char* FORMAT_SEQADV;
174  BALL_EXPORT extern const char* FORMAT_SEQRES;
175  BALL_EXPORT extern const char* FORMAT_SHEET;
176  BALL_EXPORT extern const char* FORMAT_SIGATM;
177  BALL_EXPORT extern const char* FORMAT_SIGUIJ;
178  BALL_EXPORT extern const char* FORMAT_SITE;
179  BALL_EXPORT extern const char* FORMAT_SLTBRG;
180  BALL_EXPORT extern const char* FORMAT_SOURCE;
181  BALL_EXPORT extern const char* FORMAT_SPRSDE;
182  BALL_EXPORT extern const char* FORMAT_SSBOND;
183  BALL_EXPORT extern const char* FORMAT_TER;
184  BALL_EXPORT extern const char* FORMAT_TITLE;
185  BALL_EXPORT extern const char* FORMAT_TURN;
186  BALL_EXPORT extern const char* FORMAT_TVECT;
188 
191  BALL_EXPORT extern const char* RECORD_TAG_ANISOU;
192  BALL_EXPORT extern const char* RECORD_TAG_ATOM;
193  BALL_EXPORT extern const char* RECORD_TAG_AUTHOR;
194  BALL_EXPORT extern const char* RECORD_TAG_CAVEAT;
195  BALL_EXPORT extern const char* RECORD_TAG_CISPEP;
196  BALL_EXPORT extern const char* RECORD_TAG_COMPND;
197  BALL_EXPORT extern const char* RECORD_TAG_CONECT;
198  BALL_EXPORT extern const char* RECORD_TAG_CON06;
199  BALL_EXPORT extern const char* RECORD_TAG_CON061;
200  BALL_EXPORT extern const char* RECORD_TAG_CON062;
201  BALL_EXPORT extern const char* RECORD_TAG_CON063;
202  BALL_EXPORT extern const char* RECORD_TAG_CON064;
203  BALL_EXPORT extern const char* RECORD_TAG_CRYST1;
204  BALL_EXPORT extern const char* RECORD_TAG_DBREF;
205  BALL_EXPORT extern const char* RECORD_TAG_END;
206  BALL_EXPORT extern const char* RECORD_TAG_ENDMDL;
207  BALL_EXPORT extern const char* RECORD_TAG_EXPDTA;
208  BALL_EXPORT extern const char* RECORD_TAG_FORMUL;
209  BALL_EXPORT extern const char* RECORD_TAG_FTNOTE;
210  BALL_EXPORT extern const char* RECORD_TAG_HEADER;
211  BALL_EXPORT extern const char* RECORD_TAG_HELIX;
212  BALL_EXPORT extern const char* RECORD_TAG_HET;
213  BALL_EXPORT extern const char* RECORD_TAG_HETATM;
214  BALL_EXPORT extern const char* RECORD_TAG_HETNAM;
215  BALL_EXPORT extern const char* RECORD_TAG_HETSYN;
216  BALL_EXPORT extern const char* RECORD_TAG_HYDBND;
217  BALL_EXPORT extern const char* RECORD_TAG_JRNL;
218  BALL_EXPORT extern const char* RECORD_TAG_KEYWDS;
219  BALL_EXPORT extern const char* RECORD_TAG_LINK;
220  BALL_EXPORT extern const char* RECORD_TAG_MASTER;
221  BALL_EXPORT extern const char* RECORD_TAG_MODEL;
222  BALL_EXPORT extern const char* RECORD_TAG_MODRES;
223  BALL_EXPORT extern const char* RECORD_TAG_MTRIX1;
224  BALL_EXPORT extern const char* RECORD_TAG_MTRIX2;
225  BALL_EXPORT extern const char* RECORD_TAG_MTRIX3;
226  BALL_EXPORT extern const char* RECORD_TAG_OBSLTE;
227  BALL_EXPORT extern const char* RECORD_TAG_ORIGX1;
228  BALL_EXPORT extern const char* RECORD_TAG_ORIGX2;
229  BALL_EXPORT extern const char* RECORD_TAG_ORIGX3;
230  BALL_EXPORT extern const char* RECORD_TAG_REMARK;
231  BALL_EXPORT extern const char* RECORD_TAG_REVDAT;
232  BALL_EXPORT extern const char* RECORD_TAG_SCALE1;
233  BALL_EXPORT extern const char* RECORD_TAG_SCALE2;
234  BALL_EXPORT extern const char* RECORD_TAG_SCALE3;
235  BALL_EXPORT extern const char* RECORD_TAG_SEQADV;
236  BALL_EXPORT extern const char* RECORD_TAG_SEQRES;
237  BALL_EXPORT extern const char* RECORD_TAG_SHEET;
238  BALL_EXPORT extern const char* RECORD_TAG_SIGATM;
239  BALL_EXPORT extern const char* RECORD_TAG_SIGUIJ;
240  BALL_EXPORT extern const char* RECORD_TAG_SITE;
241  BALL_EXPORT extern const char* RECORD_TAG_SLTBRG;
242  BALL_EXPORT extern const char* RECORD_TAG_SOURCE;
243  BALL_EXPORT extern const char* RECORD_TAG_SPRSDE;
244  BALL_EXPORT extern const char* RECORD_TAG_SSBOND;
245  BALL_EXPORT extern const char* RECORD_TAG_TER;
246  BALL_EXPORT extern const char* RECORD_TAG_TITLE;
247  BALL_EXPORT extern const char* RECORD_TAG_TURN;
248  BALL_EXPORT extern const char* RECORD_TAG_TVECT;
250 
254 
255  typedef char AChar;
257  typedef char Atom[5];
259  typedef char Character;
261  typedef long Continuation;
263  typedef char Date[10];
265  typedef char IDcode[5];
267  typedef long Integer;
269  typedef char PDBList[SIZE_OF_PDB_RECORD_LINE + 1];
271  typedef char LString[SIZE_OF_PDB_RECORD_LINE + 1];
273  typedef char LString2[3];
275  typedef char LString3[4];
277  typedef char LString4[5];
279  typedef char LString5[6];
281  typedef char LString6[7];
283  typedef char LString7[8];
285  typedef char LString8[9];
287  typedef char LString9[10];
289  typedef char LString10[11];
291  typedef char LString11[12];
293  typedef char LString12[13];
295  typedef char LString13[14];
297  typedef char LString21[22];
299  typedef double Real;
301  typedef char RecordName[7];
303  typedef char ResidueName[4];
305  typedef char SList[SIZE_OF_PDB_RECORD_LINE + 1];
313  typedef char String2[3];
315  typedef char String3[4];
317  typedef char String4[5];
319  typedef char String5[6];
321  typedef char String40[41];
323  typedef long SymmetryOperator;
325 
329 
333  {
334  public:
336  char string[7];
337  const char* format_string;
338  };
339 
341  {
346 
347  Residue() { clear(); }
348  void clear()
349  {
350  name[0] = '\0';
351  chain_ID = ' ';
352  sequence_number = 0;
353  insertion_code = ' ';
354  }
355  void set(const ::BALL::Residue& residue)
356  {
357  strncpy(name, residue.getName().c_str(), 3);
358  sequence_number = residue.getID().toInt();
359  const Chain* chain = residue.getChain();
360  chain_ID = (chain == 0 ? ' ' : chain->getName().c_str()[0]);
361  insertion_code = residue.getInsertionCode();
362  }
363  };
364 
365 
369  {
370  Real max_record_size[SIZE_OF_PDB_RECORD_LINE];
371  };
372 
376  {
392  };
393 
397  {
404  Real orthogonal_vector[3];
410  LString4 partial_charge; // not standard! Read if option PARSE_PARTIAL_CHARGES is set!
411  };
412 
416  {
421  };
422 
426  {
432  };
433 
437  {
442  Residue residue[2];
445  };
446 
450  {
455  };
456 
460  {
464  Integer bond_atom[4];
465  Integer hbond_atom[4];
466  Integer salt_bridge_atom[2];
467 
468  void clear()
469  {
470  record_type = PDB::RECORD_TYPE__CONECT;
471  record_name[0] = '\0';
472  atom_serial_number = 0;
473  bond_atom[0] = bond_atom[1] = bond_atom[2] = bond_atom[3] = 0;
474  hbond_atom[0] = hbond_atom[1] = hbond_atom[2] = hbond_atom[3] = 0;
475  salt_bridge_atom[0] = salt_bridge_atom[1] = 0;
476  }
477  };
478 
482  {
486  Integer bond_atom[4];
487 
488  void clear()
489  {
490  record_type = PDB::RECORD_TYPE__CON06;
491  record_name[0] = '\0';
492  atom_serial_number = 0;
493  bond_atom[0] = bond_atom[1] = bond_atom[2] = bond_atom[3] = 0;
494  }
495  };
496 
498  {
502  Integer bond_atom[4];
503 
504  void clear()
505  {
506  record_type = PDB::RECORD_TYPE__CON061;
507  record_name[0] = '\0';
508  atom_serial_number = 0;
509  bond_atom[0] = bond_atom[1] = bond_atom[2] = bond_atom[3] = 0;
510  }
511  };
512 
514  {
518  Integer bond_atom[1];
519 
520  void clear()
521  {
522  record_type = PDB::RECORD_TYPE__CON062;
523  record_name[0] = '\0';
524  atom_serial_number = 0;
525  bond_atom[0] = 0;
526  }
527  };
528 
530  {
534  Integer bond_atom[2];
535 
536  void clear()
537  {
538  record_type = PDB::RECORD_TYPE__CON063;
539  record_name[0] = '\0';
540  atom_serial_number = 0;
541  bond_atom[0] = bond_atom[1] = 0;
542  }
543  };
544 
546  {
550  Integer bond_atom[3];
551 
552  void clear()
553  {
554  record_type = PDB::RECORD_TYPE__CON064;
555  record_name[0] = '\0';
556  atom_serial_number = 0;
557  bond_atom[0] = bond_atom[1] = bond_atom[2] = 0;
558  }
559  };
560 
561 
565  {
569  struct UnitCell
570  {
579  } unit_cell;
580  };
581 
585  {
592  {
595  } initial_sequence;
598  {
601  } ending_sequence;
607  {
610  } initial_database_segment;
613  {
616  } ending_database_segment;
617  };
618 
621  {
624  };
625 
628  {
631  };
632 
635  {
640  };
641 
644  {
652  };
653 
656  {
661  };
662 
665  {
671  };
672 
675  {
685 
686  RecordHELIX() { clear(); }
687  void clear()
688  {
689  record_type = RECORD_TYPE__HELIX;
690  strncpy(record_name, RECORD_TAG_HELIX, 6);
691  serial_number = 0;
692  helix_ID[0] = '\0';
693  initial_residue.clear();
694  terminal_residue.clear();
695  helix_class = 0;
696  comment[0] = '\0';
697  length = 0;
698  }
699  };
700 
703  {
709  };
710 
713  {
720  Real orthogonal_vector[3];
726  };
727 
730  {
736  };
737 
740  {
746  };
747 
750  {
755  {
759  };
760 
761  HydrogenPartnerAtom hydrogen_partner_atom[2];
764  {
768  };
772  };
773 
776  {
780  };
783  {
788  };
791  {
796  {
800  };
801  LinkPartner link_partner[2];
804  };
807  {
822 
823  RecordMASTER() { clear(); }
824  void clear()
825  {
826  record_type = RECORD_TYPE__MASTER;
827  strcpy(record_name, RECORD_TAG_MASTER);
828  zero = number_of_HET_records = number_of_HELIX_records
829  = number_of_SHEET_records = number_of_TURN_records
830  = number_of_SITE_records = number_of_ORIGX_SCALE_MTRIX_records
831  = number_of_ATOM_HETATM_records = number_of_TER_records
832  = number_of_CONECT_records = number_of_SEQRES_records = 0;
833  }
834  };
837  {
841  };
844  {
851  };
854  {
858  Real transformation_matrix[4];
860  };
863  {
867  Real transformation_matrix[4];
869  };
872  {
876  Real transformation_matrix[4];
878  };
881  {
887  IDcode replacing_entry_code[8];
888  };
891  {
894  Real transformation_matrix[4];
895  };
898  {
901  Real transformation_matrix[4];
902  };
905  {
908  Real transformation_matrix[4];
909  };
912  {
917  };
920  {
928  LString6 name_of_modified_record[4];
929  };
930 
933  {
936  Real transformation_matrix[4];
937  };
938 
941  {
944  Real transformation_matrix[4];
945  };
946 
949  {
952  Real transformation_matrix[4];
953  };
954 
957  {
967  };
968 
971  {
977  ResidueName residue_name[13];
978 
980  {
981  clear();
982  }
983 
984  void clear()
985  {
986  record_type = RECORD_TYPE__SEQRES;
987  strncpy(record_name, RECORD_TAG_SEQRES, 6);
988  serial_number = 0;
989  chain_ID = ' ';
990  number_of_residues_in_chain = 0L;
991  residue_name[0][0] = '\0';
992  residue_name[1][0] = '\0';
993  residue_name[2][0] = '\0';
994  residue_name[3][0] = '\0';
995  residue_name[4][0] = '\0';
996  residue_name[5][0] = '\0';
997  residue_name[6][0] = '\0';
998  residue_name[7][0] = '\0';
999  residue_name[8][0] = '\0';
1000  residue_name[9][0] = '\0';
1001  residue_name[10][0] = '\0';
1002  residue_name[11][0] = '\0';
1003  residue_name[12][0] = '\0';
1004  }
1005  };
1006 
1009  {
1022 
1023  RecordSHEET() { clear(); }
1024  void clear()
1025  {
1026  record_type = RECORD_TYPE__SHEET;
1027  strncpy(record_name, RECORD_TAG_SHEET, 6);
1028  strand_number = 0;
1029  sheet_ID[0] = '\0';;
1030  number_of_strands = 0;
1031  initial_residue.clear();
1032  terminal_residue.clear();
1033  sense_of_strand = 0;
1034  atom_name_in_current_strand[0] = '\0';
1035  residue_in_current_strand.clear();
1036  atom_name_in_previous_strand[0] = '\0';
1037  residue_in_previous_strand.clear();
1038  }
1039  };
1040 
1043  {
1050  Real standard_vector_deviation[3];
1056  };
1057 
1060  {
1076  };
1077 
1080  {
1086  Residue residue[4];
1087  };
1088 
1091  {
1096  {
1100  };
1101 
1102  PartnerAtom partner_atom[2];
1105  };
1106 
1109  {
1114  };
1115 
1118  {
1124  IDcode old_codes[8];
1125  };
1126 
1129  {
1133  Residue partner_residue[2];
1134  SymmetryOperator symmetry_operator[2];
1135 
1136  RecordSSBOND() { clear(); }
1137  void clear()
1138  {
1139  record_type = RECORD_TYPE__SSBOND;
1140  strncpy(record_name, RECORD_TAG_SSBOND, 6);
1141  serial_number = 0;
1142  partner_residue[0].clear();
1143  partner_residue[1].clear();
1144  symmetry_operator[0] = 0;
1145  symmetry_operator[1] = 0;
1146  }
1147  };
1148 
1152  {
1157  };
1158 
1162  {
1167  };
1168 
1172  {
1180 
1181  RecordTURN() { clear(); }
1182  void clear()
1183  {
1184  record_type = RECORD_TYPE__TURN;
1185  strncpy(record_name, RECORD_TAG_TURN, 6);
1186  sequence_number = 0;
1187  turn_ID[0] = '\0';;
1188  initial_residue.clear();
1189  terminal_residue.clear();
1190  comment[0] = '\0';
1191  }
1192  };
1193 
1197  {
1201  Real translation_vector[3];
1203  };
1205 
1210  {
1222 
1224  {
1225  clear();
1226  }
1227 
1228  void clear()
1229  {
1230  remark_records = 0;
1231  het_records = 0;
1232  helix_records = 0;
1233  sheet_records = 0;
1234  turn_records = 0;
1235  site_records = 0;
1236  coordinate_transformation_records = 0;
1237  atomic_coordinate_records = 0;
1238  ter_records = 0;
1239  conect_records = 0;
1240  seqres_records = 0;
1241  }
1242  };
1243 
1244 
1246  {
1248  {
1254  {
1255  atom = &a;
1256  residue = a.getResidue();
1257  sec_struct = a.getSecondaryStructure();
1258  chain = a.getChain();
1259  }
1260  };
1261 
1262 
1264  {
1266  std::list<Position> bonds;
1267  std::list<Position> hbonds;
1268  std::list<Position> saltbridges;
1269  };
1270 
1272  {
1281 
1283  : a(0),
1284  b(0),
1285  c(0),
1286  alpha(0),
1287  beta(0),
1288  gamma(0),
1289  z_value(-1)
1290  {
1291  strcpy(space_group, "");
1292  }
1293  } unitcell_info;
1294 
1296  {
1297  Real matrix[12];
1299  NCSMatrix(const BALL::Matrix4x4& m, bool is_given)
1300  {
1301  matrix[0] = m(0,0); matrix[1] = m(0,1); matrix[2] = m(0,2); matrix[3] = m(0,3);
1302  matrix[4] = m(1,0); matrix[5] = m(1,1); matrix[6] = m(1,2); matrix[7] = m(1,3);
1303  matrix[8] = m(2,0); matrix[9] = m(2,1); matrix[10] = m(2,2); matrix[11] = m(2,3);
1304  isgiven = is_given;
1305  }
1306  };
1307 
1308  std::vector<NCSMatrix> ncs_matrices;
1309  std::vector<AtomEntry> atoms;
1310 
1312  std::vector<const Bond*> hydrogen_bonds;
1313  std::vector<const Bond*> saltbridges;
1314  std::vector<const Bond*> ssbonds;
1315 
1316  std::vector<std::pair<AChar, String> > chain_residue_names;
1317  std::vector<const SecondaryStructure*> sec_structs;
1318 
1319  void clear()
1320  {
1321  atoms.clear();
1322  conect_atoms.clear();
1323  hydrogen_bonds.clear();
1324  saltbridges.clear();
1325  ssbonds.clear();
1326  }
1327 
1328  };
1329 
1334  {
1336  const ::BALL::Residue* current_residue;
1342  Position number; // number of the ATOM/HETATM/TER record
1343 
1345  : current_chain(0x0),
1346  current_residue(0x0),
1347  residue_id(1),
1348  residue_insertion_code(' '),
1349  chain_id(' '),
1350  number(1)
1351  {
1352  strncpy(residue_name, "UNK", 4);
1353  strncpy(pdb_id, " ", 5);
1354  }
1355  };
1356 
1359  BALL_EXPORT extern const RecordTypeFormat RECORD_TYPE_FORMAT [];
1360 
1361  } // namespace PDB
1362 
1363 } // namespace BALL
1364 
1365 #endif // BALL_FORMAT_PDBDEFS_H