model.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 Sequence 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 from_gro from './formats/gro'
  14. import from_mmCIF from './formats/mmcif'
  15. /**
  16. * Interface to the "source data" of the molecule.
  17. *
  18. * "Atoms" are integers in the range [0, atomCount).
  19. */
  20. interface Model extends Readonly<{
  21. id: UUID,
  22. modelNum: number,
  23. sourceData: Format,
  24. symmetry: ModelSymmetry,
  25. entities: Entities,
  26. sequence: Sequence,
  27. atomicHierarchy: AtomicHierarchy,
  28. atomicConformation: AtomicConformation,
  29. coarseHierarchy: CoarseHierarchy,
  30. coarseConformation: CoarseConformation
  31. }> {
  32. } { }
  33. namespace Model {
  34. export function create(format: Format) {
  35. switch (format.kind) {
  36. //case 'gro': return from_gro(format);
  37. case 'mmCIF': return from_mmCIF(format);
  38. }
  39. }
  40. }
  41. export default Model