schema.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /**
  2. * Copyright (c) 2017-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
  3. *
  4. * @author Alexander Rose <alexander.rose@weirdbyte.de>
  5. */
  6. import { Column } from '../../../mol-data/db';
  7. // Full format http://chemyang.ccnu.edu.cn/ccb/server/AIMMS/mol2.pdf
  8. // there are many records but for now ignore (pass over) all but the following
  9. // @<TRIPOS>MOLECULE
  10. // @<TRIPOS>ATOM
  11. // @<TRIPOS>BOND
  12. // @<TRIPOS>CRYSIN
  13. //
  14. // note that the format is not a fixed column format but white space separated
  15. export interface Mol2Molecule {
  16. mol_name: string
  17. num_atoms: number
  18. num_bonds: number
  19. num_subst: number
  20. num_feat: number
  21. num_sets: number
  22. mol_type: string
  23. charge_type: string
  24. status_bits: string
  25. mol_comment: string
  26. }
  27. export interface Mol2Atoms {
  28. count: number,
  29. atom_id: Column<number>,
  30. atom_name: Column<string>,
  31. x: Column<number>,
  32. y: Column<number>,
  33. z: Column<number>,
  34. atom_type: Column<string>,
  35. // optional in the format, assign UndefinedColumn if not available
  36. subst_id: Column<number>,
  37. subst_name: Column<string>,
  38. charge: Column<number>,
  39. status_bit: Column<string>
  40. }
  41. export interface Mol2Bonds {
  42. count: number,
  43. bond_id: Column<number>,
  44. origin_atom_id: Column<number>,
  45. target_atom_id: Column<number>,
  46. bond_type: Column<string>,
  47. // optional in the format, assign UndefinedColumn if not available
  48. status_bits: Column<string>
  49. }
  50. export interface Mol2Crysin {
  51. a: number
  52. b: number
  53. c: number
  54. alpha: number
  55. beta: number
  56. gamma: number
  57. spaceGroup: number
  58. setting: number
  59. }
  60. export interface Mol2Structure {
  61. molecule: Readonly<Mol2Molecule>,
  62. atoms: Readonly<Mol2Atoms>,
  63. bonds: Readonly<Mol2Bonds>
  64. crysin?: Readonly<Mol2Crysin>
  65. }
  66. export interface Mol2File {
  67. name: string
  68. structures: Mol2Structure[]
  69. }