model.ts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 StructureSequence from './properties/sequence';
  8. import { AtomicHierarchy, AtomicConformation } from './properties/atomic';
  9. import { ModelSymmetry } from './properties/symmetry';
  10. import { CoarseHierarchy, CoarseConformation } from './properties/coarse';
  11. import { Entities } from './properties/common';
  12. import { CustomProperties } from './properties/custom';
  13. import { SecondaryStructure } from './properties/seconday-structure';
  14. import { SaccharideComponentMap } from '../structure/carbohydrates/constants';
  15. import { ModelFormat } from 'mol-model-formats/structure/format';
  16. import { ChemicalComponentMap } from './properties/chemical-component';
  17. /**
  18. * Interface to the "source data" of the molecule.
  19. *
  20. * "Atoms" are integers in the range [0, atomCount).
  21. */
  22. export interface Model extends Readonly<{
  23. id: UUID,
  24. label: string,
  25. // for IHM, corresponds to ihm_model_list.model_id
  26. modelNum: number,
  27. sourceData: ModelFormat,
  28. symmetry: ModelSymmetry,
  29. entities: Entities,
  30. sequence: StructureSequence,
  31. atomicHierarchy: AtomicHierarchy,
  32. atomicConformation: AtomicConformation,
  33. properties: {
  34. /** secondary structure provided by the input file */
  35. readonly secondaryStructure: SecondaryStructure,
  36. /** maps modified residue name to its parent */
  37. readonly modifiedResidues: Readonly<{
  38. parentId: ReadonlyMap<string, string>,
  39. details: ReadonlyMap<string, string>
  40. }>,
  41. /** maps residue name to `ChemicalComponent` data */
  42. readonly chemicalComponentMap: ChemicalComponentMap
  43. /** maps residue name to `SaccharideComponent` data */
  44. readonly saccharideComponentMap: SaccharideComponentMap
  45. },
  46. customProperties: CustomProperties,
  47. /**
  48. * Not to be accessed directly, each custom property descriptor
  49. * defines property accessors that use this field to store the data.
  50. */
  51. _staticPropertyData: { [name: string]: any },
  52. _dynamicPropertyData: { [name: string]: any },
  53. coarseHierarchy: CoarseHierarchy,
  54. coarseConformation: CoarseConformation
  55. }> {
  56. } { }
  57. export namespace Model {
  58. // TODO: is this enough?
  59. export type Trajectory = ReadonlyArray<Model>
  60. }