header.ts 1.1 KB

1234567891011121314151617181920212223242526
  1. export type PdbHeaderData = {
  2. id_code?: string,
  3. dep_date?: string,
  4. classification?: string
  5. };
  6. export function addHeader(data: string, s: number, e: number, header: PdbHeaderData) {
  7. // COLUMNS DATA TYPE FIELD DEFINITION
  8. // ------------------------------------------------------------------------------------
  9. // 1 - 6 Record name "HEADER"
  10. // 11 - 50 String(40) classification Classifies the molecule(s).
  11. // 51 - 59 Date depDate Deposition date. This is the date the
  12. // coordinates were received at the PDB.
  13. // 63 - 66 IDcode idCode This identifier is unique within the PDB.
  14. // PDB to PDBx/mmCIF Data Item Correspondences
  15. // classification _struct_keywords.pdbx_keywords
  16. // depDate _pdbx_database_status.recvd_initial_deposition_date
  17. // idCode _entry.id
  18. const line = data.substring(s, e);
  19. header.id_code = line.substring(62, 66);
  20. header.dep_date = line.substring(50, 59);
  21. header.classification = line.substring(10, 50).trim();
  22. }