model.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * Copyright (c) 2017 mol* contributors, licensed under MIT, See LICENSE file for more info.
  3. *
  4. * @author David Sehnal <david.sehnal@gmail.com>
  5. */
  6. import UUID from 'mol-util/uuid'
  7. import Format from './format'
  8. import StructureSequence from './properties/sequence'
  9. import { AtomicHierarchy, AtomicConformation } from './properties/atomic'
  10. import { ModelSymmetry } from './properties/symmetry'
  11. import { CoarseHierarchy, CoarseConformation } from './properties/coarse'
  12. import { Entities } from './properties/common';
  13. import { SecondaryStructure } from './properties/seconday-structure';
  14. //import from_gro from './formats/gro'
  15. import from_mmCIF from './formats/mmcif'
  16. /**
  17. * Interface to the "source data" of the molecule.
  18. *
  19. * "Atoms" are integers in the range [0, atomCount).
  20. */
  21. interface Model extends Readonly<{
  22. id: UUID,
  23. label: string,
  24. modelNum: number,
  25. sourceData: Format,
  26. symmetry: ModelSymmetry,
  27. entities: Entities,
  28. sequence: StructureSequence,
  29. atomicHierarchy: AtomicHierarchy,
  30. atomicConformation: AtomicConformation,
  31. /** Various parts of the code can "cache" custom properties here */
  32. properties: { readonly secondaryStructure: SecondaryStructure } & { [customName: string]: any },
  33. coarseHierarchy: CoarseHierarchy,
  34. coarseConformation: CoarseConformation
  35. }> {
  36. } { }
  37. namespace Model {
  38. export function create(format: Format) {
  39. switch (format.kind) {
  40. //case 'gro': return from_gro(format);
  41. case 'mmCIF': return from_mmCIF(format);
  42. }
  43. }
  44. }
  45. export default Model