model.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 { 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: Sequence,
  29. atomicHierarchy: AtomicHierarchy,
  30. atomicConformation: AtomicConformation,
  31. properties: { secondaryStructure: SecondaryStructure },
  32. coarseHierarchy: CoarseHierarchy,
  33. coarseConformation: CoarseConformation
  34. }> {
  35. } { }
  36. namespace Model {
  37. export function create(format: Format) {
  38. switch (format.kind) {
  39. //case 'gro': return from_gro(format);
  40. case 'mmCIF': return from_mmCIF(format);
  41. }
  42. }
  43. }
  44. export default Model