molstar 3.0.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +194 -194
  3. package/build/viewer/embedded.html +43 -43
  4. package/build/viewer/index.html +106 -106
  5. package/build/viewer/molstar.js +1 -1
  6. package/lib/apps/docking-viewer/index.html +36 -36
  7. package/lib/apps/docking-viewer/viewport.d.ts +2 -0
  8. package/lib/apps/viewer/app.d.ts +1 -0
  9. package/lib/apps/viewer/app.js +6 -3
  10. package/lib/apps/viewer/embedded.html +43 -43
  11. package/lib/apps/viewer/index.html +106 -106
  12. package/lib/commonjs/apps/docking-viewer/viewport.d.ts +2 -0
  13. package/lib/commonjs/apps/viewer/app.d.ts +1 -0
  14. package/lib/commonjs/apps/viewer/app.js +8 -5
  15. package/lib/commonjs/extensions/anvil/behavior.d.ts +1 -0
  16. package/lib/commonjs/extensions/dnatco/confal-pyramids/behavior.d.ts +1 -0
  17. package/lib/commonjs/extensions/model-archive/quality-assessment/behavior.d.ts +2 -0
  18. package/lib/commonjs/extensions/rcsb/assembly-symmetry/behavior.d.ts +4 -2
  19. package/lib/commonjs/extensions/rcsb/graphql/types.d.ts +11 -11
  20. package/lib/commonjs/extensions/rcsb/validation-report/behavior.d.ts +3 -0
  21. package/lib/commonjs/mol-canvas3d/helper/interaction-events.js +1 -1
  22. package/lib/commonjs/mol-canvas3d/passes/draw.d.ts +1 -1
  23. package/lib/commonjs/mol-canvas3d/passes/draw.js +3 -3
  24. package/lib/commonjs/mol-geo/geometry/cylinders/cylinders.d.ts +2 -2
  25. package/lib/commonjs/mol-geo/geometry/lines/lines.d.ts +0 -1
  26. package/lib/commonjs/mol-geo/geometry/points/points.d.ts +1 -1
  27. package/lib/commonjs/mol-gl/renderer.d.ts +2 -2
  28. package/lib/commonjs/mol-gl/renderer.js +3 -3
  29. package/lib/commonjs/mol-gl/shader/chunks/apply-light-color.glsl.d.ts +2 -2
  30. package/lib/commonjs/mol-gl/shader/chunks/apply-light-color.glsl.js +2 -2
  31. package/lib/commonjs/mol-gl/shader/cylinders.frag.d.ts +2 -2
  32. package/lib/commonjs/mol-gl/shader/cylinders.frag.js +2 -2
  33. package/lib/commonjs/mol-gl/shader/direct-volume.frag.d.ts +2 -2
  34. package/lib/commonjs/mol-gl/shader/direct-volume.frag.js +2 -2
  35. package/lib/commonjs/mol-gl/shader/mesh.frag.d.ts +2 -2
  36. package/lib/commonjs/mol-gl/shader/mesh.frag.js +2 -2
  37. package/lib/commonjs/mol-gl/shader/spheres.frag.d.ts +2 -2
  38. package/lib/commonjs/mol-gl/shader/spheres.frag.js +2 -2
  39. package/lib/commonjs/mol-io/reader/cif/schema/bird.d.ts +1 -1
  40. package/lib/commonjs/mol-io/reader/cif/schema/bird.js +1 -1
  41. package/lib/commonjs/mol-io/reader/cif/schema/ccd.d.ts +1 -1
  42. package/lib/commonjs/mol-io/reader/cif/schema/ccd.js +1 -1
  43. package/lib/commonjs/mol-io/reader/cif/schema/mmcif.d.ts +24 -2
  44. package/lib/commonjs/mol-io/reader/cif/schema/mmcif.js +23 -1
  45. package/lib/commonjs/mol-math/geometry/primitives/sphere3d.d.ts +1 -1
  46. package/lib/commonjs/mol-math/geometry/primitives/sphere3d.js +17 -4
  47. package/lib/commonjs/mol-model/structure/export/categories/atom_site.js +68 -1
  48. package/lib/commonjs/mol-model/structure/export/categories/secondary-structure.js +8 -8
  49. package/lib/commonjs/mol-model/structure/model/properties/coarse/hierarchy.d.ts +1 -1
  50. package/lib/commonjs/mol-model/structure/model/properties/coarse/hierarchy.js +24 -2
  51. package/lib/commonjs/mol-model/structure/structure/element/loci.d.ts +1 -1
  52. package/lib/commonjs/mol-model/structure/structure/element/loci.js +4 -2
  53. package/lib/commonjs/mol-model/structure/structure/util/superposition-sifts-mapping.d.ts +21 -0
  54. package/lib/commonjs/mol-model/structure/structure/util/{superposition-db-mapping.js → superposition-sifts-mapping.js} +40 -20
  55. package/lib/commonjs/mol-model/volume/volume.d.ts +7 -0
  56. package/lib/commonjs/mol-model/volume/volume.js +18 -0
  57. package/lib/commonjs/mol-model-formats/structure/basic/schema.d.ts +5 -0
  58. package/lib/commonjs/mol-model-formats/structure/common/property.d.ts +5 -2
  59. package/lib/commonjs/mol-model-formats/structure/common/property.js +20 -8
  60. package/lib/commonjs/mol-model-formats/structure/property/bonds/index-pair.d.ts +1 -0
  61. package/lib/commonjs/mol-model-formats/structure/property/bonds/index-pair.js +2 -1
  62. package/lib/commonjs/mol-model-props/computed/interactions/common.d.ts +1 -1
  63. package/lib/commonjs/mol-model-props/computed/interactions/common.js +16 -24
  64. package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.d.ts +1 -1
  65. package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.js +44 -18
  66. package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +14 -4
  67. package/lib/commonjs/mol-model-props/sequence/{best-database-mapping.d.ts → sifts-mapping.d.ts} +7 -5
  68. package/lib/commonjs/mol-model-props/sequence/{best-database-mapping.js → sifts-mapping.js} +29 -26
  69. package/lib/{mol-model-props/sequence/themes/best-database-mapping.d.ts → commonjs/mol-model-props/sequence/themes/sifts-mapping.d.ts} +5 -5
  70. package/lib/commonjs/mol-model-props/sequence/themes/{best-database-mapping.js → sifts-mapping.js} +22 -22
  71. package/lib/commonjs/mol-plugin/behavior/dynamic/custom-props/sequence/{best-database-mapping.d.ts → sifts-mapping.d.ts} +1 -1
  72. package/lib/commonjs/mol-plugin/behavior/dynamic/custom-props/sequence/{best-database-mapping.js → sifts-mapping.js} +11 -11
  73. package/lib/commonjs/mol-plugin/behavior/dynamic/custom-props.d.ts +1 -1
  74. package/lib/commonjs/mol-plugin/behavior/dynamic/custom-props.js +2 -2
  75. package/lib/commonjs/mol-plugin/behavior/dynamic/representation.d.ts +1 -1
  76. package/lib/commonjs/mol-plugin/behavior/dynamic/representation.js +11 -6
  77. package/lib/commonjs/mol-plugin/behavior/dynamic/selection/structure-focus-representation.d.ts +2 -1
  78. package/lib/commonjs/mol-plugin/behavior/dynamic/selection/structure-focus-representation.js +16 -7
  79. package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/model.d.ts +2 -3
  80. package/lib/commonjs/mol-plugin/behavior/static/representation.js +1 -1
  81. package/lib/commonjs/mol-plugin-state/actions/volume.d.ts +1 -1
  82. package/lib/commonjs/mol-plugin-state/actions/volume.js +3 -3
  83. package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +2 -0
  84. package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy.d.ts +1 -0
  85. package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.d.ts +155 -125
  86. package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.js +5 -31
  87. package/lib/commonjs/mol-plugin-state/builder/structure/representation.d.ts +2 -1
  88. package/lib/commonjs/mol-plugin-state/formats/volume.js +1 -11
  89. package/lib/commonjs/mol-plugin-state/manager/structure/component.d.ts +2 -1
  90. package/lib/commonjs/mol-plugin-state/manager/structure/component.js +11 -8
  91. package/lib/commonjs/mol-plugin-ui/controls/icons.d.ts +2 -1
  92. package/lib/commonjs/mol-plugin-ui/controls/icons.js +8 -5
  93. package/lib/commonjs/mol-plugin-ui/controls.d.ts +1 -1
  94. package/lib/commonjs/mol-plugin-ui/controls.js +2 -1
  95. package/lib/commonjs/mol-plugin-ui/structure/quick-styles.d.ts +25 -0
  96. package/lib/commonjs/mol-plugin-ui/structure/quick-styles.js +131 -0
  97. package/lib/commonjs/mol-plugin-ui/structure/superposition.d.ts +4 -1
  98. package/lib/commonjs/mol-plugin-ui/structure/superposition.js +66 -30
  99. package/lib/commonjs/mol-plugin-ui/structure/volume.js +4 -4
  100. package/lib/commonjs/mol-repr/shape/loci/common.d.ts +1 -1
  101. package/lib/commonjs/mol-repr/shape/loci/common.js +3 -3
  102. package/lib/commonjs/mol-repr/structure/registry.d.ts +1 -1
  103. package/lib/commonjs/mol-repr/structure/representation/cartoon.d.ts +4 -4
  104. package/lib/commonjs/mol-repr/structure/representation/cartoon.js +3 -3
  105. package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -1
  106. package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.js +2 -2
  107. package/lib/commonjs/mol-repr/structure/visual/util/bond.d.ts +1 -1
  108. package/lib/commonjs/mol-repr/structure/visual/util/bond.js +5 -4
  109. package/lib/commonjs/mol-script/language/builder.d.ts +1 -0
  110. package/lib/commonjs/mol-state/transform.js +12 -2
  111. package/lib/commonjs/mol-theme/color/element-symbol.d.ts +46 -2
  112. package/lib/commonjs/mol-theme/color/element-symbol.js +15 -10
  113. package/lib/commonjs/mol-theme/color/entity-id.js +14 -11
  114. package/lib/commonjs/mol-theme/color/illustrative.d.ts +32 -32
  115. package/lib/commonjs/mol-theme/color.d.ts +39 -17
  116. package/lib/commonjs/servers/volume/config.js +3 -3
  117. package/lib/commonjs/servers/volume/query.js +1 -1
  118. package/lib/examples/alpha-orbitals/index.html +61 -61
  119. package/lib/examples/basic-wrapper/index.html +137 -137
  120. package/lib/examples/lighting/index.html +88 -88
  121. package/lib/examples/proteopedia-wrapper/index.html +236 -236
  122. package/lib/extensions/anvil/behavior.d.ts +1 -0
  123. package/lib/extensions/dnatco/confal-pyramids/behavior.d.ts +1 -0
  124. package/lib/extensions/model-archive/quality-assessment/behavior.d.ts +2 -0
  125. package/lib/extensions/rcsb/assembly-symmetry/behavior.d.ts +4 -2
  126. package/lib/extensions/rcsb/graphql/types.d.ts +11 -11
  127. package/lib/extensions/rcsb/validation-report/behavior.d.ts +3 -0
  128. package/lib/mol-canvas3d/helper/interaction-events.js +1 -1
  129. package/lib/mol-canvas3d/passes/draw.d.ts +1 -1
  130. package/lib/mol-canvas3d/passes/draw.js +3 -3
  131. package/lib/mol-geo/geometry/cylinders/cylinders.d.ts +2 -2
  132. package/lib/mol-geo/geometry/lines/lines.d.ts +0 -1
  133. package/lib/mol-geo/geometry/points/points.d.ts +1 -1
  134. package/lib/mol-gl/renderer.d.ts +2 -2
  135. package/lib/mol-gl/renderer.js +3 -3
  136. package/lib/mol-gl/shader/chunks/apply-light-color.glsl.d.ts +2 -2
  137. package/lib/mol-gl/shader/chunks/apply-light-color.glsl.js +2 -2
  138. package/lib/mol-gl/shader/cylinders.frag.d.ts +2 -2
  139. package/lib/mol-gl/shader/cylinders.frag.js +2 -2
  140. package/lib/mol-gl/shader/direct-volume.frag.d.ts +2 -2
  141. package/lib/mol-gl/shader/direct-volume.frag.js +2 -2
  142. package/lib/mol-gl/shader/mesh.frag.d.ts +2 -2
  143. package/lib/mol-gl/shader/mesh.frag.js +2 -2
  144. package/lib/mol-gl/shader/spheres.frag.d.ts +2 -2
  145. package/lib/mol-gl/shader/spheres.frag.js +2 -2
  146. package/lib/mol-io/reader/cif/schema/bird.d.ts +1 -1
  147. package/lib/mol-io/reader/cif/schema/bird.js +1 -1
  148. package/lib/mol-io/reader/cif/schema/ccd.d.ts +1 -1
  149. package/lib/mol-io/reader/cif/schema/ccd.js +1 -1
  150. package/lib/mol-io/reader/cif/schema/mmcif.d.ts +24 -2
  151. package/lib/mol-io/reader/cif/schema/mmcif.js +23 -1
  152. package/lib/mol-math/geometry/primitives/sphere3d.d.ts +1 -1
  153. package/lib/mol-math/geometry/primitives/sphere3d.js +17 -4
  154. package/lib/mol-model/structure/export/categories/atom_site.js +68 -1
  155. package/lib/mol-model/structure/export/categories/secondary-structure.js +8 -8
  156. package/lib/mol-model/structure/model/properties/coarse/hierarchy.d.ts +1 -1
  157. package/lib/mol-model/structure/model/properties/coarse/hierarchy.js +24 -2
  158. package/lib/mol-model/structure/structure/element/loci.d.ts +1 -1
  159. package/lib/mol-model/structure/structure/element/loci.js +4 -2
  160. package/lib/mol-model/structure/structure/util/superposition-sifts-mapping.d.ts +21 -0
  161. package/lib/mol-model/structure/structure/util/{superposition-db-mapping.js → superposition-sifts-mapping.js} +38 -18
  162. package/lib/mol-model/volume/volume.d.ts +7 -0
  163. package/lib/mol-model/volume/volume.js +18 -0
  164. package/lib/mol-model-formats/structure/basic/schema.d.ts +5 -0
  165. package/lib/mol-model-formats/structure/common/property.d.ts +5 -2
  166. package/lib/mol-model-formats/structure/common/property.js +20 -8
  167. package/lib/mol-model-formats/structure/property/bonds/index-pair.d.ts +1 -0
  168. package/lib/mol-model-formats/structure/property/bonds/index-pair.js +2 -1
  169. package/lib/mol-model-props/computed/interactions/common.d.ts +1 -1
  170. package/lib/mol-model-props/computed/interactions/common.js +16 -24
  171. package/lib/mol-model-props/computed/representations/interactions-inter-unit-cylinder.d.ts +1 -1
  172. package/lib/mol-model-props/computed/representations/interactions-inter-unit-cylinder.js +44 -18
  173. package/lib/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +14 -4
  174. package/lib/mol-model-props/sequence/{best-database-mapping.d.ts → sifts-mapping.d.ts} +7 -5
  175. package/lib/mol-model-props/sequence/{best-database-mapping.js → sifts-mapping.js} +28 -25
  176. package/lib/{commonjs/mol-model-props/sequence/themes/best-database-mapping.d.ts → mol-model-props/sequence/themes/sifts-mapping.d.ts} +5 -5
  177. package/lib/mol-model-props/sequence/themes/{best-database-mapping.js → sifts-mapping.js} +19 -19
  178. package/lib/mol-plugin/behavior/dynamic/custom-props/sequence/{best-database-mapping.d.ts → sifts-mapping.d.ts} +1 -1
  179. package/lib/mol-plugin/behavior/dynamic/custom-props/sequence/{best-database-mapping.js → sifts-mapping.js} +8 -8
  180. package/lib/mol-plugin/behavior/dynamic/custom-props.d.ts +1 -1
  181. package/lib/mol-plugin/behavior/dynamic/custom-props.js +1 -1
  182. package/lib/mol-plugin/behavior/dynamic/representation.d.ts +1 -1
  183. package/lib/mol-plugin/behavior/dynamic/representation.js +11 -6
  184. package/lib/mol-plugin/behavior/dynamic/selection/structure-focus-representation.d.ts +2 -1
  185. package/lib/mol-plugin/behavior/dynamic/selection/structure-focus-representation.js +16 -7
  186. package/lib/mol-plugin/behavior/dynamic/volume-streaming/model.d.ts +2 -3
  187. package/lib/mol-plugin/behavior/static/representation.js +1 -1
  188. package/lib/mol-plugin/version.js +2 -2
  189. package/lib/mol-plugin-state/actions/volume.d.ts +1 -1
  190. package/lib/mol-plugin-state/actions/volume.js +3 -3
  191. package/lib/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +2 -0
  192. package/lib/mol-plugin-state/builder/structure/hierarchy.d.ts +1 -0
  193. package/lib/mol-plugin-state/builder/structure/representation-preset.d.ts +155 -125
  194. package/lib/mol-plugin-state/builder/structure/representation-preset.js +5 -31
  195. package/lib/mol-plugin-state/builder/structure/representation.d.ts +2 -1
  196. package/lib/mol-plugin-state/formats/volume.js +1 -11
  197. package/lib/mol-plugin-state/manager/structure/component.d.ts +2 -1
  198. package/lib/mol-plugin-state/manager/structure/component.js +11 -8
  199. package/lib/mol-plugin-ui/controls/icons.d.ts +2 -1
  200. package/lib/mol-plugin-ui/controls/icons.js +5 -3
  201. package/lib/mol-plugin-ui/controls.d.ts +1 -1
  202. package/lib/mol-plugin-ui/controls.js +2 -1
  203. package/lib/mol-plugin-ui/skin/base/base.scss +32 -32
  204. package/lib/mol-plugin-ui/skin/base/components/controls-base.scss +333 -333
  205. package/lib/mol-plugin-ui/skin/base/components/controls.scss +418 -418
  206. package/lib/mol-plugin-ui/skin/base/components/help.scss +27 -27
  207. package/lib/mol-plugin-ui/skin/base/components/line-graph.scss +67 -67
  208. package/lib/mol-plugin-ui/skin/base/components/log.scss +100 -100
  209. package/lib/mol-plugin-ui/skin/base/components/misc.scss +643 -643
  210. package/lib/mol-plugin-ui/skin/base/components/sequence.scss +125 -125
  211. package/lib/mol-plugin-ui/skin/base/components/slider.scss +165 -165
  212. package/lib/mol-plugin-ui/skin/base/components/tasks.scss +99 -99
  213. package/lib/mol-plugin-ui/skin/base/components/toast.scss +83 -83
  214. package/lib/mol-plugin-ui/skin/base/components/transformer.scss +163 -163
  215. package/lib/mol-plugin-ui/skin/base/components/viewport.scss +127 -127
  216. package/lib/mol-plugin-ui/skin/base/layout/common.scss +71 -71
  217. package/lib/mol-plugin-ui/skin/base/layout/controls-landscape.scss +89 -89
  218. package/lib/mol-plugin-ui/skin/base/layout/controls-outside.scss +98 -98
  219. package/lib/mol-plugin-ui/skin/base/layout/controls-portrait.scss +108 -108
  220. package/lib/mol-plugin-ui/skin/base/layout.scss +40 -40
  221. package/lib/mol-plugin-ui/skin/base/logo.scss +12 -12
  222. package/lib/mol-plugin-ui/skin/base/normalize.scss +209 -209
  223. package/lib/mol-plugin-ui/skin/base/ui.scss +40 -40
  224. package/lib/mol-plugin-ui/skin/base/variables.scss +85 -85
  225. package/lib/mol-plugin-ui/skin/blue.scss +1 -1
  226. package/lib/mol-plugin-ui/skin/colors/blue.scss +23 -23
  227. package/lib/mol-plugin-ui/skin/colors/dark.scss +23 -23
  228. package/lib/mol-plugin-ui/skin/colors/light.scss +29 -29
  229. package/lib/mol-plugin-ui/skin/dark.scss +1 -1
  230. package/lib/mol-plugin-ui/skin/light.scss +1 -1
  231. package/lib/mol-plugin-ui/structure/quick-styles.d.ts +25 -0
  232. package/lib/mol-plugin-ui/structure/quick-styles.js +128 -0
  233. package/lib/mol-plugin-ui/structure/superposition.d.ts +4 -1
  234. package/lib/mol-plugin-ui/structure/superposition.js +66 -30
  235. package/lib/mol-plugin-ui/structure/volume.js +4 -4
  236. package/lib/mol-repr/shape/loci/common.d.ts +1 -1
  237. package/lib/mol-repr/shape/loci/common.js +3 -3
  238. package/lib/mol-repr/structure/registry.d.ts +1 -1
  239. package/lib/mol-repr/structure/representation/cartoon.d.ts +4 -4
  240. package/lib/mol-repr/structure/representation/cartoon.js +3 -3
  241. package/lib/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -1
  242. package/lib/mol-repr/structure/visual/molecular-surface-mesh.js +2 -2
  243. package/lib/mol-repr/structure/visual/util/bond.d.ts +1 -1
  244. package/lib/mol-repr/structure/visual/util/bond.js +5 -4
  245. package/lib/mol-script/language/builder.d.ts +1 -0
  246. package/lib/mol-state/transform.js +12 -2
  247. package/lib/mol-theme/color/element-symbol.d.ts +46 -2
  248. package/lib/mol-theme/color/element-symbol.js +15 -10
  249. package/lib/mol-theme/color/entity-id.js +14 -11
  250. package/lib/mol-theme/color/illustrative.d.ts +32 -32
  251. package/lib/mol-theme/color.d.ts +39 -17
  252. package/lib/servers/volume/config.js +3 -3
  253. package/lib/servers/volume/query.js +1 -1
  254. package/package.json +160 -163
  255. package/lib/commonjs/mol-model/structure/structure/util/superposition-db-mapping.d.ts +0 -13
  256. package/lib/mol-model/structure/structure/util/superposition-db-mapping.d.ts +0 -13
@@ -5,6 +5,8 @@
5
5
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
6
6
  */
7
7
  import { CifWriter } from '../../../../mol-io/writer/cif';
8
+ import { MmcifFormat } from '../../../../mol-model-formats/structure/mmcif';
9
+ import { SIFTSMapping } from '../../../../mol-model-props/sequence/sifts-mapping';
8
10
  import { StructureProperties as P } from '../../structure';
9
11
  var CifField = CifWriter.Field;
10
12
  var E = CifWriter.Encodings;
@@ -22,6 +24,61 @@ function atom_site_auth_asym_id(e) {
22
24
  return l;
23
25
  return l + suffix;
24
26
  }
27
+ var atom_site_pdbx_label_index = {
28
+ shouldInclude: function (s) {
29
+ var _a;
30
+ return !!((_a = s.atom_site) === null || _a === void 0 ? void 0 : _a.pdbx_label_index.isDefined);
31
+ },
32
+ value: function (e, d) {
33
+ var srcIndex = d.sourceIndex.value(e.element);
34
+ return d.atom_site.pdbx_label_index.value(srcIndex);
35
+ },
36
+ };
37
+ var SIFTS = {
38
+ shouldInclude: function (s) {
39
+ return SIFTSMapping.isAvailable(s.structure.models[0]);
40
+ },
41
+ pdbx_sifts_xref_db_name: {
42
+ value: function (e, d) {
43
+ var srcIndex = d.sourceIndex.value(e.element);
44
+ return d.atom_site.pdbx_sifts_xref_db_name.value(srcIndex);
45
+ },
46
+ valueKind: function (e, d) {
47
+ var srcIndex = d.sourceIndex.value(e.element);
48
+ return d.atom_site.pdbx_sifts_xref_db_name.valueKind(srcIndex);
49
+ },
50
+ },
51
+ pdbx_sifts_xref_db_acc: {
52
+ value: function (e, d) {
53
+ var srcIndex = d.sourceIndex.value(e.element);
54
+ return d.atom_site.pdbx_sifts_xref_db_acc.value(srcIndex);
55
+ },
56
+ valueKind: function (e, d) {
57
+ var srcIndex = d.sourceIndex.value(e.element);
58
+ return d.atom_site.pdbx_sifts_xref_db_acc.valueKind(srcIndex);
59
+ },
60
+ },
61
+ pdbx_sifts_xref_db_num: {
62
+ value: function (e, d) {
63
+ var srcIndex = d.sourceIndex.value(e.element);
64
+ return d.atom_site.pdbx_sifts_xref_db_num.value(srcIndex);
65
+ },
66
+ valueKind: function (e, d) {
67
+ var srcIndex = d.sourceIndex.value(e.element);
68
+ return d.atom_site.pdbx_sifts_xref_db_num.valueKind(srcIndex);
69
+ },
70
+ },
71
+ pdbx_sifts_xref_db_res: {
72
+ value: function (e, d) {
73
+ var srcIndex = d.sourceIndex.value(e.element);
74
+ return d.atom_site.pdbx_sifts_xref_db_res.value(srcIndex);
75
+ },
76
+ valueKind: function (e, d) {
77
+ var srcIndex = d.sourceIndex.value(e.element);
78
+ return d.atom_site.pdbx_sifts_xref_db_res.valueKind(srcIndex);
79
+ },
80
+ }
81
+ };
25
82
  var atom_site_fields = function () { return CifWriter.fields()
26
83
  .str('group_PDB', P.residue.group_PDB)
27
84
  .index('id')
@@ -53,6 +110,12 @@ var atom_site_fields = function () { return CifWriter.fields()
53
110
  .int('auth_seq_id', P.residue.auth_seq_id, { encoder: E.deltaRLE })
54
111
  .str('auth_asym_id', atom_site_auth_asym_id)
55
112
  .int('pdbx_PDB_model_num', P.unit.model_num, { encoder: E.deltaRLE })
113
+ .int('pdbx_label_index', atom_site_pdbx_label_index.value, { shouldInclude: atom_site_pdbx_label_index.shouldInclude })
114
+ // SIFTS
115
+ .str('pdbx_sifts_xref_db_name', SIFTS.pdbx_sifts_xref_db_name.value, { shouldInclude: SIFTS.shouldInclude, valueKind: SIFTS.pdbx_sifts_xref_db_name.valueKind })
116
+ .str('pdbx_sifts_xref_db_acc', SIFTS.pdbx_sifts_xref_db_acc.value, { shouldInclude: SIFTS.shouldInclude, valueKind: SIFTS.pdbx_sifts_xref_db_acc.valueKind })
117
+ .str('pdbx_sifts_xref_db_num', SIFTS.pdbx_sifts_xref_db_num.value, { shouldInclude: SIFTS.shouldInclude, valueKind: SIFTS.pdbx_sifts_xref_db_num.valueKind })
118
+ .str('pdbx_sifts_xref_db_res', SIFTS.pdbx_sifts_xref_db_res.value, { shouldInclude: SIFTS.shouldInclude, valueKind: SIFTS.pdbx_sifts_xref_db_res.valueKind })
56
119
  // .str('operator_name', P.unit.operator_name, {
57
120
  // shouldInclude: structure => structure.units.some(u => !u.conformation.operator.isIdentity)
58
121
  // })
@@ -64,7 +127,11 @@ export var _atom_site = {
64
127
  return {
65
128
  fields: atom_site_fields(),
66
129
  source: structures.map(function (s) { return ({
67
- data: s,
130
+ data: {
131
+ structure: s,
132
+ sourceIndex: s.model.atomicHierarchy.atomSourceIndex,
133
+ atom_site: MmcifFormat.is(s.model.sourceData) ? s.model.sourceData.data.db.atom_site : void 0
134
+ },
68
135
  rowCount: s.elementCount,
69
136
  keys: function () { return s.elementLocations(); }
70
137
  }); })
@@ -59,13 +59,13 @@ function findElements(ctx, kind) {
59
59
  var key = secondaryStructure.key, elements = secondaryStructure.elements;
60
60
  var ssElements = [];
61
61
  var structure = ctx.structures[0];
62
- for (var _i = 0, _a = structure.units; _i < _a.length; _i++) {
63
- var unit = _a[_i];
64
- // currently can only support this for "identity" operators.
65
- if (!Unit.isAtomic(unit) || !unit.conformation.operator.isIdentity)
62
+ for (var _i = 0, _a = structure.unitSymmetryGroups; _i < _a.length; _i++) {
63
+ var units = _a[_i].units;
64
+ var u = units[0];
65
+ if (!Unit.isAtomic(u))
66
66
  continue;
67
- var segs = unit.model.atomicHierarchy.residueAtomSegments;
68
- var residues = Segmentation.transientSegments(segs, unit.elements);
67
+ var segs = u.model.atomicHierarchy.residueAtomSegments;
68
+ var residues = Segmentation.transientSegments(segs, u.elements);
69
69
  var current = void 0, move = true;
70
70
  while (residues.hasNext) {
71
71
  if (move)
@@ -84,8 +84,8 @@ function findElements(ctx, kind) {
84
84
  if (startIdx !== key[current.index]) {
85
85
  move = false;
86
86
  ssElements[ssElements.length] = {
87
- start: StructureElement.Location.create(structure, unit, segs.offsets[start]),
88
- end: StructureElement.Location.create(structure, unit, segs.offsets[prev]),
87
+ start: StructureElement.Location.create(structure, u, segs.offsets[start]),
88
+ end: StructureElement.Location.create(structure, u, segs.offsets[prev]),
89
89
  length: prev - start + 1,
90
90
  element: element
91
91
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author David Sehnal <david.sehnal@gmail.com>
5
5
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
@@ -1,11 +1,33 @@
1
1
  /**
2
- * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author David Sehnal <david.sehnal@gmail.com>
5
5
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
6
6
  */
7
+ import { Column } from '../../../../../mol-data/db';
8
+ import { Segmentation } from '../../../../../mol-data/int';
9
+ import { SortedRanges } from '../../../../../mol-data/int/sorted-ranges';
10
+ var EmptyCoarseElements = {
11
+ chainKey: [],
12
+ entityKey: [],
13
+ findSequenceKey: function () { return -1; },
14
+ findChainKey: function () { return -1; },
15
+ getEntityFromChain: function () { return -1; },
16
+ count: 0,
17
+ entity_id: Column.Undefined(0, Column.Schema.str),
18
+ asym_id: Column.Undefined(0, Column.Schema.str),
19
+ seq_id_begin: Column.Undefined(0, Column.Schema.int),
20
+ seq_id_end: Column.Undefined(0, Column.Schema.int),
21
+ chainElementSegments: Segmentation.create([]),
22
+ polymerRanges: SortedRanges.ofSortedRanges([]),
23
+ gapRanges: SortedRanges.ofSortedRanges([]),
24
+ };
7
25
  export var CoarseHierarchy;
8
26
  (function (CoarseHierarchy) {
9
- CoarseHierarchy.Empty = { isDefined: false };
27
+ CoarseHierarchy.Empty = {
28
+ isDefined: false,
29
+ spheres: EmptyCoarseElements,
30
+ gaussians: EmptyCoarseElements
31
+ };
10
32
  })(CoarseHierarchy || (CoarseHierarchy = {}));
11
33
  //# sourceMappingURL=hierarchy.js.map
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2017-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2017-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author David Sehnal <david.sehnal@gmail.com>
5
5
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2017-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2017-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author David Sehnal <david.sehnal@gmail.com>
5
5
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
@@ -487,7 +487,9 @@ export function Loci(structure, elements) {
487
487
  if (!elementIndices)
488
488
  continue;
489
489
  var indices = getUnitIndices(unit.elements, elementIndices);
490
- elements[elements.length] = { unit: unit, indices: indices };
490
+ if (OrderedSet.size(indices)) {
491
+ elements[elements.length] = { unit: unit, indices: indices };
492
+ }
491
493
  }
492
494
  return Loci(loci.structure, elements);
493
495
  }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright (c) 2021-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
+ *
4
+ * @author David Sehnal <david.sehnal@gmail.com>
5
+ * @author Sebastian Bittrich <sebastian.bittrich@rcsb.org>
6
+ */
7
+ import { MinimizeRmsd } from '../../../../mol-math/linear-algebra/3d/minimize-rmsd';
8
+ import { Structure } from '../structure';
9
+ export interface AlignmentResultEntry {
10
+ transform: MinimizeRmsd.Result;
11
+ pivot: number;
12
+ other: number;
13
+ }
14
+ export interface AlignmentResult {
15
+ entries: AlignmentResultEntry[];
16
+ zeroOverlapPairs: [number, number][];
17
+ failedPairs: [number, number][];
18
+ }
19
+ export declare function alignAndSuperposeWithSIFTSMapping(structures: Structure[], options?: {
20
+ traceOnly?: boolean;
21
+ }): AlignmentResult;
@@ -1,29 +1,41 @@
1
1
  /**
2
- * Copyright (c) 2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2021-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author David Sehnal <david.sehnal@gmail.com>
5
+ * @author Sebastian Bittrich <sebastian.bittrich@rcsb.org>
5
6
  */
6
7
  import { Segmentation } from '../../../../mol-data/int';
7
- import { Mat4 } from '../../../../mol-math/linear-algebra';
8
8
  import { MinimizeRmsd } from '../../../../mol-math/linear-algebra/3d/minimize-rmsd';
9
- import { BestDatabaseSequenceMapping } from '../../../../mol-model-props/sequence/best-database-mapping';
10
- export function alignAndSuperposeWithBestDatabaseMapping(structures) {
9
+ import { SIFTSMapping } from '../../../../mol-model-props/sequence/sifts-mapping';
10
+ export function alignAndSuperposeWithSIFTSMapping(structures, options) {
11
+ var _a;
11
12
  var indexMap = new Map();
12
13
  for (var i = 0; i < structures.length; i++) {
13
- buildIndex(structures[i], indexMap, i);
14
+ buildIndex(structures[i], indexMap, i, (_a = options === null || options === void 0 ? void 0 : options.traceOnly) !== null && _a !== void 0 ? _a : true);
14
15
  }
15
16
  var index = Array.from(indexMap.values());
16
17
  // TODO: support non-first structure pivots
17
18
  var pairs = findPairs(structures.length, index);
18
- var ret = [];
19
+ var zeroOverlapPairs = [];
20
+ var failedPairs = [];
21
+ var entries = [];
19
22
  for (var _i = 0, pairs_1 = pairs; _i < pairs_1.length; _i++) {
20
23
  var p = pairs_1[_i];
21
- var _a = getPositionTables(index, p.i, p.j, p.count), a = _a[0], b = _a[1];
22
- var transform = MinimizeRmsd.compute({ a: a, b: b });
23
- console.log(Mat4.makeTable(transform.bTransform), transform.rmsd);
24
- ret.push({ transform: transform, pivot: p.i, other: p.j });
24
+ if (p.count === 0) {
25
+ zeroOverlapPairs.push([p.i, p.j]);
26
+ }
27
+ else {
28
+ var _b = getPositionTables(index, p.i, p.j, p.count), a = _b[0], b = _b[1];
29
+ var transform = MinimizeRmsd.compute({ a: a, b: b });
30
+ if (Number.isNaN(transform.rmsd)) {
31
+ failedPairs.push([p.i, p.j]);
32
+ }
33
+ else {
34
+ entries.push({ transform: transform, pivot: p.i, other: p.j });
35
+ }
36
+ }
25
37
  }
26
- return ret;
38
+ return { entries: entries, zeroOverlapPairs: zeroOverlapPairs, failedPairs: failedPairs };
27
39
  }
28
40
  function getPositionTables(index, pivot, other, N) {
29
41
  var xs = MinimizeRmsd.Positions.empty(N);
@@ -36,7 +48,6 @@ function getPositionTables(index, pivot, other, N) {
36
48
  if (!a || !b)
37
49
  continue;
38
50
  var l = Math.min(a[2] - a[1], b[2] - b[1]);
39
- // TODO: allow to use just backbone atoms?
40
51
  // TODO: check if residue types match?
41
52
  for (var i = 0; i < l; i++) {
42
53
  var eI = (a[1] + i);
@@ -90,19 +101,20 @@ function findPairs(N, index) {
90
101
  // }
91
102
  return ret;
92
103
  }
93
- function buildIndex(structure, index, sI) {
104
+ function buildIndex(structure, index, sI, traceOnly) {
94
105
  var _a;
95
106
  for (var _i = 0, _b = structure.units; _i < _b.length; _i++) {
96
107
  var unit = _b[_i];
97
108
  if (unit.kind !== 0 /* Atomic */)
98
109
  continue;
99
110
  var elements = unit.elements, model = unit.model;
100
- var map = BestDatabaseSequenceMapping.Provider.get(model).value;
111
+ var map = SIFTSMapping.Provider.get(model).value;
101
112
  if (!map)
102
113
  return;
103
114
  var dbName = map.dbName, accession = map.accession, num = map.num;
104
115
  var chainsIt = Segmentation.transientSegments(unit.model.atomicHierarchy.chainAtomSegments, elements);
105
116
  var residuesIt = Segmentation.transientSegments(unit.model.atomicHierarchy.residueAtomSegments, elements);
117
+ var traceElementIndex = unit.model.atomicHierarchy.derived.residue.traceElementIndex;
106
118
  while (chainsIt.hasNext) {
107
119
  var chainSegment = chainsIt.move();
108
120
  residuesIt.setSegment(chainSegment);
@@ -111,8 +123,17 @@ function buildIndex(structure, index, sI) {
111
123
  var rI = residueSegment.index;
112
124
  if (!dbName[rI])
113
125
  continue;
114
- var start = elements[residueSegment.start];
115
- var end = elements[residueSegment.end - 1] + 1;
126
+ var start = void 0, end = void 0;
127
+ if (traceOnly) {
128
+ start = traceElementIndex[rI];
129
+ if (start === -1)
130
+ continue;
131
+ end = start + 1;
132
+ }
133
+ else {
134
+ start = elements[residueSegment.start];
135
+ end = elements[residueSegment.end - 1] + 1;
136
+ }
116
137
  var key = "".concat(dbName[rI], "-").concat(accession[rI], "-").concat(num[rI]);
117
138
  if (!index.has(key)) {
118
139
  index.set(key, { key: key, pivots: (_a = {}, _a[sI] = [unit, start, end], _a) });
@@ -126,6 +147,5 @@ function buildIndex(structure, index, sI) {
126
147
  }
127
148
  }
128
149
  }
129
- console.log(index);
130
150
  }
131
- //# sourceMappingURL=superposition-db-mapping.js.map
151
+ //# sourceMappingURL=superposition-sifts-mapping.js.map
@@ -48,6 +48,13 @@ export declare namespace Volume {
48
48
  function toRelative(value: IsoValue, stats: Grid['stats']): Relative;
49
49
  function toString(value: IsoValue): string;
50
50
  }
51
+ function adjustedIsoValue(volume: Volume, value: number, kind: 'absolute' | 'relative'): Readonly<{
52
+ kind: "absolute";
53
+ absoluteValue: number;
54
+ }> | Readonly<{
55
+ kind: "relative";
56
+ relativeValue: number;
57
+ }>;
51
58
  function createIsoValueParam(defaultValue: Volume.IsoValue, stats?: Grid['stats']): PD.Conditioned<Readonly<{
52
59
  kind: "absolute";
53
60
  absoluteValue: number;
@@ -13,6 +13,7 @@ import { equalEps } from '../../mol-math/linear-algebra/3d/common';
13
13
  import { CustomProperties } from '../custom-property';
14
14
  import { ParamDefinition as PD } from '../../mol-util/param-definition';
15
15
  import { toPrecision } from '../../mol-util/number';
16
+ import { DscifFormat } from '../../mol-model-formats/volume/density-server';
16
17
  export var Volume;
17
18
  (function (Volume) {
18
19
  function is(x) {
@@ -57,6 +58,23 @@ export var Volume;
57
58
  }
58
59
  IsoValue.toString = toString;
59
60
  })(IsoValue = Volume.IsoValue || (Volume.IsoValue = {}));
61
+ // Converts iso value to relative if using downsample VolumeServer data
62
+ function adjustedIsoValue(volume, value, kind) {
63
+ if (kind === 'relative')
64
+ return IsoValue.relative(value);
65
+ var absolute = IsoValue.absolute(value);
66
+ if (DscifFormat.is(volume.sourceData)) {
67
+ var stats = {
68
+ min: volume.sourceData.data.volume_data_3d_info.min_source.value(0),
69
+ max: volume.sourceData.data.volume_data_3d_info.max_source.value(0),
70
+ mean: volume.sourceData.data.volume_data_3d_info.mean_source.value(0),
71
+ sigma: volume.sourceData.data.volume_data_3d_info.sigma_source.value(0),
72
+ };
73
+ return Volume.IsoValue.toRelative(absolute, stats);
74
+ }
75
+ return absolute;
76
+ }
77
+ Volume.adjustedIsoValue = adjustedIsoValue;
60
78
  var defaultStats = { min: -1, max: 1, mean: 0, sigma: 0.1 };
61
79
  function createIsoValueParam(defaultValue, stats) {
62
80
  var sts = stats || defaultStats;
@@ -125,6 +125,11 @@ export declare const BasicSchema: {
125
125
  pdbx_PDB_ins_code: import("../../../mol-data/db/column").Column.Schema.Str;
126
126
  pdbx_PDB_model_num: import("../../../mol-data/db/column").Column.Schema.Int;
127
127
  pdbx_formal_charge: import("../../../mol-data/db/column").Column.Schema.Int;
128
+ pdbx_label_index: import("../../../mol-data/db/column").Column.Schema.Int;
129
+ pdbx_sifts_xref_db_name: import("../../../mol-data/db/column").Column.Schema.Str;
130
+ pdbx_sifts_xref_db_acc: import("../../../mol-data/db/column").Column.Schema.Str;
131
+ pdbx_sifts_xref_db_num: import("../../../mol-data/db/column").Column.Schema.Str;
132
+ pdbx_sifts_xref_db_res: import("../../../mol-data/db/column").Column.Schema.Str;
128
133
  ihm_model_id: import("../../../mol-data/db/column").Column.Schema.Int;
129
134
  };
130
135
  ihm_sphere_obj_site: {
@@ -1,7 +1,8 @@
1
1
  /**
2
- * Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2020-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
+ * @author David Sehnal <david.sehnal@gmail.com>
5
6
  */
6
7
  import { Model } from '../../../mol-model/structure';
7
8
  import { ModelFormat } from '../../format';
@@ -24,5 +25,7 @@ interface FormatPropertyProvider<T> {
24
25
  delete(model: Model): void;
25
26
  }
26
27
  declare namespace FormatPropertyProvider {
27
- function create<T>(descriptor: CustomPropertyDescriptor): FormatPropertyProvider<T>;
28
+ function create<T>(descriptor: CustomPropertyDescriptor, options?: {
29
+ asDynamic?: boolean;
30
+ }): FormatPropertyProvider<T>;
28
31
  }
@@ -1,7 +1,8 @@
1
1
  /**
2
- * Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2020-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
+ * @author David Sehnal <david.sehnal@gmail.com>
5
6
  */
6
7
  var FormatRegistry = /** @class */ (function () {
7
8
  function FormatRegistry() {
@@ -29,7 +30,7 @@ var FormatRegistry = /** @class */ (function () {
29
30
  export { FormatPropertyProvider };
30
31
  var FormatPropertyProvider;
31
32
  (function (FormatPropertyProvider) {
32
- function create(descriptor) {
33
+ function create(descriptor, options) {
33
34
  var name = descriptor.name;
34
35
  var formatRegistry = new FormatRegistry();
35
36
  return {
@@ -39,22 +40,33 @@ var FormatPropertyProvider;
39
40
  return formatRegistry.isApplicable(model);
40
41
  },
41
42
  get: function (model) {
42
- if (model._staticPropertyData[name])
43
- return model._staticPropertyData[name];
43
+ var store = (options === null || options === void 0 ? void 0 : options.asDynamic) ? model._dynamicPropertyData : model._staticPropertyData;
44
+ if (store[name])
45
+ return store[name];
44
46
  if (model.customProperties.has(descriptor))
45
47
  return;
46
48
  var obtain = formatRegistry.get(model.sourceData.kind);
47
49
  if (!obtain)
48
50
  return;
49
- model._staticPropertyData[name] = obtain(model);
51
+ store[name] = obtain(model);
50
52
  model.customProperties.add(descriptor);
51
- return model._staticPropertyData[name];
53
+ return store[name];
52
54
  },
53
55
  set: function (model, value) {
54
- model._staticPropertyData[name] = value;
56
+ if (options === null || options === void 0 ? void 0 : options.asDynamic) {
57
+ model._dynamicPropertyData[name] = value;
58
+ }
59
+ else {
60
+ model._staticPropertyData[name] = value;
61
+ }
55
62
  },
56
63
  delete: function (model) {
57
- delete model._staticPropertyData[name];
64
+ if (options === null || options === void 0 ? void 0 : options.asDynamic) {
65
+ delete model._dynamicPropertyData[name];
66
+ }
67
+ else {
68
+ delete model._staticPropertyData[name];
69
+ }
58
70
  }
59
71
  };
60
72
  }
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) 2019-2022 Mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
+ * @author David Sehnal <david.sehnal@gmail.com>
5
6
  */
6
7
  import { CustomPropertyDescriptor } from '../../../../mol-model/custom-property';
7
8
  import { IntAdjacencyGraph } from '../../../../mol-math/graph';
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) 2019-2022 Mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
+ * @author David Sehnal <david.sehnal@gmail.com>
5
6
  */
6
7
  import { __assign } from "tslib";
7
8
  import { IntAdjacencyGraph } from '../../../../mol-math/graph';
@@ -26,7 +27,7 @@ export var IndexPairBonds;
26
27
  IndexPairBonds.Descriptor = {
27
28
  name: 'index_pair_bonds',
28
29
  };
29
- IndexPairBonds.Provider = FormatPropertyProvider.create(IndexPairBonds.Descriptor);
30
+ IndexPairBonds.Provider = FormatPropertyProvider.create(IndexPairBonds.Descriptor, { asDynamic: true });
30
31
  IndexPairBonds.DefaultProps = {
31
32
  /**
32
33
  * If negative, test using element-based threshold, otherwise distance in Angstrom.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2019-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2019-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
5
  */
@@ -62,29 +62,21 @@ var InteractionsInterContacts = /** @class */ (function (_super) {
62
62
  __extends(InteractionsInterContacts, _super);
63
63
  function InteractionsInterContacts(map, unitsFeatures) {
64
64
  var _this = _super.call(this, map) || this;
65
- var count = 0;
66
- var elementKeyIndex = new Map();
67
- var add = function (index, unitId) {
68
- var vertexKey = _this.getElementKey(index, unitId);
69
- var e = elementKeyIndex.get(vertexKey);
70
- if (e === undefined)
71
- elementKeyIndex.set(vertexKey, [count]);
72
- else
73
- e.push(count);
74
- };
75
- _this.map.forEach(function (pairEdgesArray) {
76
- pairEdgesArray.forEach(function (_a) {
77
- var unitA = _a.unitA, connectedIndices = _a.connectedIndices;
78
- connectedIndices.forEach(function (indexA) {
79
- var _a = unitsFeatures.get(unitA), offsetsA = _a.offsets, membersA = _a.members;
80
- for (var j = offsetsA[indexA], jl = offsetsA[indexA + 1]; j < jl; ++j) {
81
- add(membersA[j], unitA);
82
- }
83
- count += 1;
84
- });
85
- });
86
- });
87
- _this.elementKeyIndex = elementKeyIndex;
65
+ _this.elementKeyIndex = new Map();
66
+ for (var i = 0, il = _this.edges.length; i < il; ++i) {
67
+ var _a = _this.edges[i], unitA = _a.unitA, indexA = _a.indexA;
68
+ var _b = unitsFeatures.get(unitA), offsets = _b.offsets, members = _b.members;
69
+ for (var j = offsets[indexA], jl = offsets[indexA + 1]; j < jl; ++j) {
70
+ var vertexKey = _this.getElementKey(members[j], unitA);
71
+ var e = _this.elementKeyIndex.get(vertexKey);
72
+ if (e === undefined) {
73
+ _this.elementKeyIndex.set(vertexKey, [i]);
74
+ }
75
+ else {
76
+ e.push(i);
77
+ }
78
+ }
79
+ }
88
80
  return _this;
89
81
  }
90
82
  InteractionsInterContacts.prototype.getContactIndicesForElement = function (index, unit) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2019-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
5
  */