mmcif.ts 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. /**
  2. * Copyright (c) 2017 molio contributors, licensed under MIT, See LICENSE file for more info.
  3. *
  4. * @author David Sehnal <david.sehnal@gmail.com>
  5. */
  6. import { Database, Column } from 'mol-base/collections/database'
  7. import Types = Column.Type
  8. const str = Types.str;
  9. const int = Types.int;
  10. const float = Types.float;
  11. const entry = {
  12. id: str
  13. }
  14. type EntityType = 'polymer' | 'non-polymer' | 'water' | 'macrolide'
  15. const entity = {
  16. id: str,
  17. type: Types.aliased<EntityType>(str),
  18. src_method: str,
  19. pdbx_description: str,
  20. formula_weight: float,
  21. pdbx_number_of_molecules: int,
  22. details: str,
  23. pdbx_mutation: str,
  24. pdbx_fragment: str,
  25. pdbx_ec: str
  26. }
  27. const exptl = {
  28. entry_id: str,
  29. method: str
  30. }
  31. const cell = {
  32. entry_id: str,
  33. length_a: float,
  34. length_b: float,
  35. length_c: float,
  36. angle_alpha: float,
  37. angle_beta: float,
  38. angle_gamma: float,
  39. Z_PDB: int,
  40. pdbx_unique_axis: str
  41. }
  42. const symmetry = {
  43. entry_id: str,
  44. 'space_group_name_H-M': str,
  45. 'pdbx_full_space_group_name_H': str,
  46. cell_setting: str,
  47. Int_Tables_number: int,
  48. space_group_name_Hall: str
  49. }
  50. const struct_conf = {
  51. conf_type_id: str,
  52. id: str,
  53. pdbx_PDB_helix_id: int,
  54. beg_label_comp_id: str,
  55. beg_label_asym_id: str,
  56. beg_label_seq_id: int,
  57. pdbx_beg_PDB_ins_code: str,
  58. end_label_comp_id: str,
  59. end_label_asym_id: str,
  60. end_label_seq_id: int,
  61. pdbx_end_PDB_ins_code: str,
  62. beg_auth_comp_id: str,
  63. beg_auth_asym_id: str,
  64. beg_auth_seq_id: int,
  65. end_auth_comp_id: str,
  66. end_auth_asym_id: str,
  67. end_auth_seq_id: int,
  68. pdbx_PDB_helix_class: int,
  69. details: str,
  70. pdbx_PDB_helix_length: int
  71. }
  72. const struct_sheet_range = {
  73. sheet_id: str,
  74. id: int,
  75. beg_label_comp_id: str,
  76. beg_label_asym_id: str,
  77. beg_label_seq_id: int,
  78. pdbx_beg_PDB_ins_code: str,
  79. end_label_comp_id: str,
  80. end_label_asym_id: str,
  81. end_label_seq_id: int,
  82. pdbx_end_PDB_ins_code: str,
  83. beg_auth_comp_id: str,
  84. beg_auth_asym_id: str,
  85. beg_auth_seq_id: int,
  86. end_auth_comp_id: str,
  87. end_auth_asym_id: str,
  88. end_auth_seq_id: int
  89. }
  90. type StructConnTypeId =
  91. | 'covale'
  92. | 'covale_base'
  93. | 'covale_phosphate'
  94. | 'covale_sugar'
  95. | 'disulf'
  96. | 'hydrog'
  97. | 'metalc'
  98. | 'mismat'
  99. | 'modres'
  100. | 'saltbr'
  101. type BondValueOrder =
  102. | 'SING'
  103. | 'DOUB'
  104. | 'TRIP'
  105. | 'QUAD'
  106. const struct_conn = {
  107. id: str,
  108. conn_type_id: Types.aliased<StructConnTypeId>(str),
  109. pdbx_PDB_id: str,
  110. ptnr1_label_asym_id: str,
  111. ptnr1_label_comp_id: str,
  112. ptnr1_label_seq_id: int,
  113. ptnr1_label_atom_id: str,
  114. pdbx_ptnr1_label_alt_id: str,
  115. pdbx_ptnr1_PDB_ins_code: str,
  116. pdbx_ptnr1_standard_comp_id: str,
  117. ptnr1_symmetry: str,
  118. ptnr2_label_asym_id: str,
  119. ptnr2_label_comp_id: str,
  120. ptnr2_label_seq_id: int,
  121. ptnr2_label_atom_id: str,
  122. pdbx_ptnr2_label_alt_id: str,
  123. pdbx_ptnr2_PDB_ins_code: str,
  124. ptnr1_auth_asym_id: str,
  125. ptnr1_auth_comp_id: str,
  126. ptnr1_auth_seq_id: int,
  127. ptnr2_auth_asym_id: str,
  128. ptnr2_auth_comp_id: str,
  129. ptnr2_auth_seq_id: int,
  130. ptnr2_symmetry: str,
  131. pdbx_ptnr3_label_atom_id: str,
  132. pdbx_ptnr3_label_seq_id: int,
  133. pdbx_ptnr3_label_comp_id: str,
  134. pdbx_ptnr3_label_asym_id: str,
  135. pdbx_ptnr3_label_alt_id: str,
  136. pdbx_ptnr3_PDB_ins_code: str,
  137. details: str,
  138. pdbx_dist_value: float,
  139. pdbx_value_order: Types.aliased<BondValueOrder>(str)
  140. }
  141. const struct_conn_type = {
  142. id: Types.aliased<StructConnTypeId>(str),
  143. criteria: str,
  144. reference: str
  145. }
  146. const chem_comp_bond = {
  147. comp_id: str,
  148. pdbx_stereo_config: str,
  149. pdbx_ordinal: int,
  150. pdbx_aromatic_flag: Types.aliased<'Y' | 'N'>(str),
  151. atom_id_1: str,
  152. atom_id_2: str,
  153. value_order: Types.aliased<BondValueOrder>(str)
  154. }
  155. const pdbx_struct_assembly = {
  156. id: str,
  157. details: str,
  158. method_details: str,
  159. oligomeric_details: str,
  160. oligomeric_count: int
  161. }
  162. const pdbx_struct_assembly_gen = {
  163. assembly_id: str,
  164. oper_expression: str,
  165. asym_id_list: str
  166. }
  167. const pdbx_struct_oper_list = {
  168. id: str,
  169. type: str,
  170. name: str,
  171. symmetry_operation: str,
  172. matrix: Types.matrix(3, 3),
  173. vector: Types.vector(3)
  174. }
  175. const pdbx_struct_mod_residue = {
  176. id: int,
  177. label_asym_id: str,
  178. label_seq_id: int,
  179. label_comp_id: str,
  180. auth_asym_id: str,
  181. auth_seq_id: int,
  182. auth_comp_id: str,
  183. PDB_ins_code: str,
  184. parent_comp_id: str,
  185. details: str
  186. }
  187. const atom_site = {
  188. group_PDB: str,
  189. id: int,
  190. type_symbol: str,
  191. label_atom_id: str,
  192. label_alt_id: str,
  193. label_comp_id: str,
  194. label_asym_id: str,
  195. label_entity_id: str,
  196. label_seq_id: int,
  197. pdbx_PDB_ins_code: str,
  198. pdbx_formal_charge: str,
  199. Cartn_x: float,
  200. Cartn_y: float,
  201. Cartn_z: float,
  202. occupancy: float,
  203. B_iso_or_equiv: float,
  204. auth_atom_id: str,
  205. auth_comp_id: str,
  206. auth_asym_id: str,
  207. auth_seq_id: int,
  208. pdbx_PDB_model_num: int
  209. }
  210. export const Schema = {
  211. entry,
  212. entity,
  213. exptl,
  214. cell,
  215. symmetry,
  216. struct_conf,
  217. struct_sheet_range,
  218. struct_conn,
  219. struct_conn_type,
  220. chem_comp_bond,
  221. pdbx_struct_assembly,
  222. pdbx_struct_assembly_gen,
  223. pdbx_struct_oper_list,
  224. pdbx_struct_mod_residue,
  225. atom_site
  226. };
  227. export type Schema = typeof Schema;
  228. export interface Database extends Database<typeof Schema> { }