coarse-grained.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
  3. *
  4. * @author David Sehnal <david.sehnal@gmail.com>
  5. */
  6. import { mmCIF_Database as mmCIF } from 'mol-io/reader/cif/schema/mmcif'
  7. import { Tensor } from 'mol-math/linear-algebra';
  8. import { Column } from 'mol-data/db';
  9. interface CoarseGrained {
  10. isDefined: boolean,
  11. modelList: mmCIF['ihm_model_list'],
  12. spheres: CoarseGrained.Spheres,
  13. gaussians: CoarseGrained.Gaussians
  14. }
  15. namespace CoarseGrained {
  16. export const Empty: CoarseGrained = { isDefined: false } as any;
  17. interface Site {
  18. // index to the Model.hierarchy.entities table
  19. entityKey: number,
  20. // index to the CoarseGrained.modelList table
  21. modelKey: number,
  22. asym_id: string,
  23. seq_id_begin: number,
  24. seq_id_end: number,
  25. x: number,
  26. y: number,
  27. z: number
  28. }
  29. export interface Sphere extends Site {
  30. radius: number,
  31. rmsf: number
  32. }
  33. export interface Gaussian extends Site {
  34. weight: number,
  35. covarianceMatrix: Tensor.Data
  36. }
  37. export type Spheres = { count: number} & { [P in keyof Sphere]: Column<Sphere[P]> }
  38. export type Gaussians = { count: number} & { [P in keyof Gaussian]: Column<Gaussian[P]> }
  39. }
  40. export default CoarseGrained;