drugflow-molstar 0.3.77 → 0.4.1

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 (250) hide show
  1. package/build/drugflow-molstar-0.4.1.css +1 -0
  2. package/build/drugflow-molstar-component-0.4.1.js +25 -0
  3. package/build/drugflow-molstar-plugin-0.4.1.js +2 -0
  4. package/build/drugflow-molstar-plugin-0.4.1.js.LICENSE.txt +64 -0
  5. package/lib/alphafold-transparency.js +58 -125
  6. package/lib/contact.d.ts +15 -6
  7. package/lib/contact.js +71 -66
  8. package/lib/custom-events.js +16 -16
  9. package/lib/domain-annotations/behavior.js +20 -24
  10. package/lib/domain-annotations/color.d.ts +1 -1
  11. package/lib/domain-annotations/color.js +23 -22
  12. package/lib/domain-annotations/prop.d.ts +3 -3
  13. package/lib/domain-annotations/prop.js +54 -76
  14. package/lib/drugflow-molstar-component-build-0.3.78.js +2 -0
  15. package/lib/drugflow-molstar-component-build-0.4.1.js +2 -0
  16. package/lib/helpers.d.ts +4 -4
  17. package/lib/helpers.js +94 -99
  18. package/lib/index.js +1785 -2608
  19. package/lib/labels.d.ts +1 -1
  20. package/lib/labels.js +20 -23
  21. package/lib/loci-details.d.ts +2 -2
  22. package/lib/loci-details.js +26 -29
  23. package/lib/sifts-mapping.js +30 -34
  24. package/lib/sifts-mappings-behaviour.js +26 -30
  25. package/lib/spec.d.ts +1 -1
  26. package/lib/spec.js +50 -38
  27. package/lib/structure_contact3d.d.ts +13 -4
  28. package/lib/structure_contact3d.js +25 -46
  29. package/lib/subscribe-events.js +17 -17
  30. package/lib/superposition-export.js +100 -144
  31. package/lib/superposition-focus-representation.d.ts +1 -1
  32. package/lib/superposition-focus-representation.js +74 -112
  33. package/lib/superposition-sifts-mapping.d.ts +1 -1
  34. package/lib/superposition-sifts-mapping.js +56 -62
  35. package/lib/superposition.d.ts +2 -2
  36. package/lib/superposition.js +490 -726
  37. package/lib/ui/alphafold-superposition.d.ts +8 -9
  38. package/lib/ui/alphafold-superposition.js +96 -120
  39. package/lib/ui/alphafold-tranparency.d.ts +1 -2
  40. package/lib/ui/alphafold-tranparency.js +27 -43
  41. package/lib/ui/annotation-controls.d.ts +2 -3
  42. package/lib/ui/annotation-controls.js +81 -87
  43. package/lib/ui/export-superposition.js +33 -51
  44. package/lib/ui/pdbe-left-panel.d.ts +3 -3
  45. package/lib/ui/pdbe-left-panel.js +82 -106
  46. package/lib/ui/pdbe-screenshot-controls.d.ts +1 -1
  47. package/lib/ui/pdbe-screenshot-controls.js +54 -83
  48. package/lib/ui/pdbe-structure-controls.d.ts +4 -5
  49. package/lib/ui/pdbe-structure-controls.js +34 -57
  50. package/lib/ui/pdbe-viewport-controls.d.ts +1 -2
  51. package/lib/ui/pdbe-viewport-controls.js +23 -29
  52. package/lib/ui/segment-tree.d.ts +1 -2
  53. package/lib/ui/segment-tree.js +438 -590
  54. package/lib/ui/superposition-components.d.ts +1 -2
  55. package/lib/ui/superposition-components.js +196 -266
  56. package/lib/ui/superposition-viewport.d.ts +1 -2
  57. package/lib/ui/superposition-viewport.js +11 -18
  58. package/package.json +7 -4
  59. package/build/drugflow-molstar-0.3.62.css +0 -1
  60. package/build/drugflow-molstar-0.3.77.css +0 -1
  61. package/build/drugflow-molstar-component-0.3.62.js +0 -25
  62. package/build/drugflow-molstar-component-0.3.77.js +0 -25
  63. package/build/drugflow-molstar-light.css +0 -1
  64. package/build/drugflow-molstar-plugin-0.3.62.js +0 -2
  65. package/build/drugflow-molstar-plugin-0.3.62.js.LICENSE.txt +0 -39
  66. package/build/drugflow-molstar-plugin-0.3.77.js +0 -2
  67. package/build/drugflow-molstar-plugin-0.3.77.js.LICENSE.txt +0 -39
  68. package/lib/drugflow-molstar-component-build-0.1.2.js +0 -4268
  69. package/lib/drugflow-molstar-component-build-0.1.2.js.map +0 -1
  70. package/lib/drugflow-molstar-component-build-0.1.3.js +0 -2
  71. package/lib/drugflow-molstar-component-build-0.1.4.js +0 -2
  72. package/lib/drugflow-molstar-component-build-0.1.4.js.LICENSE.txt +0 -24
  73. package/lib/drugflow-molstar-component-build-0.1.5.js +0 -2
  74. package/lib/drugflow-molstar-component-build-0.1.5.js.LICENSE.txt +0 -24
  75. package/lib/drugflow-molstar-component-build-0.1.6.js +0 -2
  76. package/lib/drugflow-molstar-component-build-0.1.6.js.LICENSE.txt +0 -24
  77. package/lib/drugflow-molstar-component-build-0.2.10.js +0 -2
  78. package/lib/drugflow-molstar-component-build-0.2.10.js.LICENSE.txt +0 -24
  79. package/lib/drugflow-molstar-component-build-0.2.2.js +0 -2
  80. package/lib/drugflow-molstar-component-build-0.2.2.js.LICENSE.txt +0 -24
  81. package/lib/drugflow-molstar-component-build-0.2.3.js +0 -2
  82. package/lib/drugflow-molstar-component-build-0.2.3.js.LICENSE.txt +0 -24
  83. package/lib/drugflow-molstar-component-build-0.2.4.js +0 -2
  84. package/lib/drugflow-molstar-component-build-0.2.4.js.LICENSE.txt +0 -24
  85. package/lib/drugflow-molstar-component-build-0.2.5.js +0 -2
  86. package/lib/drugflow-molstar-component-build-0.2.5.js.LICENSE.txt +0 -24
  87. package/lib/drugflow-molstar-component-build-0.2.6.js +0 -2
  88. package/lib/drugflow-molstar-component-build-0.2.6.js.LICENSE.txt +0 -24
  89. package/lib/drugflow-molstar-component-build-0.2.7.js +0 -2
  90. package/lib/drugflow-molstar-component-build-0.2.7.js.LICENSE.txt +0 -24
  91. package/lib/drugflow-molstar-component-build-0.2.9.js +0 -2
  92. package/lib/drugflow-molstar-component-build-0.2.9.js.LICENSE.txt +0 -24
  93. package/lib/drugflow-molstar-component-build-0.3.1.js +0 -2
  94. package/lib/drugflow-molstar-component-build-0.3.1.js.LICENSE.txt +0 -24
  95. package/lib/drugflow-molstar-component-build-0.3.10.js +0 -2
  96. package/lib/drugflow-molstar-component-build-0.3.10.js.LICENSE.txt +0 -24
  97. package/lib/drugflow-molstar-component-build-0.3.11.js +0 -2
  98. package/lib/drugflow-molstar-component-build-0.3.11.js.LICENSE.txt +0 -24
  99. package/lib/drugflow-molstar-component-build-0.3.12.js +0 -2
  100. package/lib/drugflow-molstar-component-build-0.3.12.js.LICENSE.txt +0 -24
  101. package/lib/drugflow-molstar-component-build-0.3.13.js +0 -2
  102. package/lib/drugflow-molstar-component-build-0.3.13.js.LICENSE.txt +0 -24
  103. package/lib/drugflow-molstar-component-build-0.3.14.js +0 -2
  104. package/lib/drugflow-molstar-component-build-0.3.14.js.LICENSE.txt +0 -24
  105. package/lib/drugflow-molstar-component-build-0.3.15.js +0 -2
  106. package/lib/drugflow-molstar-component-build-0.3.15.js.LICENSE.txt +0 -24
  107. package/lib/drugflow-molstar-component-build-0.3.16.js +0 -2
  108. package/lib/drugflow-molstar-component-build-0.3.16.js.LICENSE.txt +0 -24
  109. package/lib/drugflow-molstar-component-build-0.3.17.js +0 -2
  110. package/lib/drugflow-molstar-component-build-0.3.17.js.LICENSE.txt +0 -24
  111. package/lib/drugflow-molstar-component-build-0.3.18.js +0 -2
  112. package/lib/drugflow-molstar-component-build-0.3.18.js.LICENSE.txt +0 -24
  113. package/lib/drugflow-molstar-component-build-0.3.19.js +0 -2
  114. package/lib/drugflow-molstar-component-build-0.3.19.js.LICENSE.txt +0 -24
  115. package/lib/drugflow-molstar-component-build-0.3.2.js +0 -2
  116. package/lib/drugflow-molstar-component-build-0.3.2.js.LICENSE.txt +0 -24
  117. package/lib/drugflow-molstar-component-build-0.3.20.js +0 -2
  118. package/lib/drugflow-molstar-component-build-0.3.20.js.LICENSE.txt +0 -24
  119. package/lib/drugflow-molstar-component-build-0.3.21.js +0 -2
  120. package/lib/drugflow-molstar-component-build-0.3.21.js.LICENSE.txt +0 -24
  121. package/lib/drugflow-molstar-component-build-0.3.22.js +0 -2
  122. package/lib/drugflow-molstar-component-build-0.3.22.js.LICENSE.txt +0 -24
  123. package/lib/drugflow-molstar-component-build-0.3.23.js +0 -2
  124. package/lib/drugflow-molstar-component-build-0.3.23.js.LICENSE.txt +0 -24
  125. package/lib/drugflow-molstar-component-build-0.3.24.js +0 -2
  126. package/lib/drugflow-molstar-component-build-0.3.24.js.LICENSE.txt +0 -24
  127. package/lib/drugflow-molstar-component-build-0.3.25.js +0 -2
  128. package/lib/drugflow-molstar-component-build-0.3.25.js.LICENSE.txt +0 -24
  129. package/lib/drugflow-molstar-component-build-0.3.26.js +0 -2
  130. package/lib/drugflow-molstar-component-build-0.3.26.js.LICENSE.txt +0 -24
  131. package/lib/drugflow-molstar-component-build-0.3.27.js +0 -2
  132. package/lib/drugflow-molstar-component-build-0.3.27.js.LICENSE.txt +0 -24
  133. package/lib/drugflow-molstar-component-build-0.3.28.js +0 -2
  134. package/lib/drugflow-molstar-component-build-0.3.28.js.LICENSE.txt +0 -24
  135. package/lib/drugflow-molstar-component-build-0.3.29.js +0 -2
  136. package/lib/drugflow-molstar-component-build-0.3.29.js.LICENSE.txt +0 -24
  137. package/lib/drugflow-molstar-component-build-0.3.3.js +0 -2
  138. package/lib/drugflow-molstar-component-build-0.3.3.js.LICENSE.txt +0 -24
  139. package/lib/drugflow-molstar-component-build-0.3.30.js +0 -2
  140. package/lib/drugflow-molstar-component-build-0.3.30.js.LICENSE.txt +0 -24
  141. package/lib/drugflow-molstar-component-build-0.3.31.js +0 -2
  142. package/lib/drugflow-molstar-component-build-0.3.31.js.LICENSE.txt +0 -24
  143. package/lib/drugflow-molstar-component-build-0.3.32.js +0 -2
  144. package/lib/drugflow-molstar-component-build-0.3.32.js.LICENSE.txt +0 -24
  145. package/lib/drugflow-molstar-component-build-0.3.33.js +0 -2
  146. package/lib/drugflow-molstar-component-build-0.3.33.js.LICENSE.txt +0 -24
  147. package/lib/drugflow-molstar-component-build-0.3.34.js +0 -2
  148. package/lib/drugflow-molstar-component-build-0.3.34.js.LICENSE.txt +0 -24
  149. package/lib/drugflow-molstar-component-build-0.3.35.js +0 -2
  150. package/lib/drugflow-molstar-component-build-0.3.35.js.LICENSE.txt +0 -24
  151. package/lib/drugflow-molstar-component-build-0.3.36.js +0 -2
  152. package/lib/drugflow-molstar-component-build-0.3.36.js.LICENSE.txt +0 -24
  153. package/lib/drugflow-molstar-component-build-0.3.37.js +0 -2
  154. package/lib/drugflow-molstar-component-build-0.3.37.js.LICENSE.txt +0 -24
  155. package/lib/drugflow-molstar-component-build-0.3.38.js +0 -2
  156. package/lib/drugflow-molstar-component-build-0.3.38.js.LICENSE.txt +0 -24
  157. package/lib/drugflow-molstar-component-build-0.3.39.js +0 -2
  158. package/lib/drugflow-molstar-component-build-0.3.39.js.LICENSE.txt +0 -24
  159. package/lib/drugflow-molstar-component-build-0.3.4.js +0 -2
  160. package/lib/drugflow-molstar-component-build-0.3.4.js.LICENSE.txt +0 -24
  161. package/lib/drugflow-molstar-component-build-0.3.40.js +0 -2
  162. package/lib/drugflow-molstar-component-build-0.3.40.js.LICENSE.txt +0 -24
  163. package/lib/drugflow-molstar-component-build-0.3.41.js +0 -2
  164. package/lib/drugflow-molstar-component-build-0.3.41.js.LICENSE.txt +0 -24
  165. package/lib/drugflow-molstar-component-build-0.3.42.js +0 -2
  166. package/lib/drugflow-molstar-component-build-0.3.42.js.LICENSE.txt +0 -24
  167. package/lib/drugflow-molstar-component-build-0.3.43.js +0 -2
  168. package/lib/drugflow-molstar-component-build-0.3.43.js.LICENSE.txt +0 -24
  169. package/lib/drugflow-molstar-component-build-0.3.44.js +0 -2
  170. package/lib/drugflow-molstar-component-build-0.3.44.js.LICENSE.txt +0 -24
  171. package/lib/drugflow-molstar-component-build-0.3.46.js +0 -2
  172. package/lib/drugflow-molstar-component-build-0.3.46.js.LICENSE.txt +0 -24
  173. package/lib/drugflow-molstar-component-build-0.3.47.js +0 -2
  174. package/lib/drugflow-molstar-component-build-0.3.47.js.LICENSE.txt +0 -24
  175. package/lib/drugflow-molstar-component-build-0.3.48.js +0 -2
  176. package/lib/drugflow-molstar-component-build-0.3.48.js.LICENSE.txt +0 -24
  177. package/lib/drugflow-molstar-component-build-0.3.49.js +0 -2
  178. package/lib/drugflow-molstar-component-build-0.3.49.js.LICENSE.txt +0 -24
  179. package/lib/drugflow-molstar-component-build-0.3.5.js +0 -2
  180. package/lib/drugflow-molstar-component-build-0.3.5.js.LICENSE.txt +0 -24
  181. package/lib/drugflow-molstar-component-build-0.3.50.js +0 -2
  182. package/lib/drugflow-molstar-component-build-0.3.50.js.LICENSE.txt +0 -24
  183. package/lib/drugflow-molstar-component-build-0.3.51.js +0 -2
  184. package/lib/drugflow-molstar-component-build-0.3.51.js.LICENSE.txt +0 -24
  185. package/lib/drugflow-molstar-component-build-0.3.52.js +0 -2
  186. package/lib/drugflow-molstar-component-build-0.3.52.js.LICENSE.txt +0 -24
  187. package/lib/drugflow-molstar-component-build-0.3.53.js +0 -2
  188. package/lib/drugflow-molstar-component-build-0.3.53.js.LICENSE.txt +0 -24
  189. package/lib/drugflow-molstar-component-build-0.3.54.js +0 -2
  190. package/lib/drugflow-molstar-component-build-0.3.54.js.LICENSE.txt +0 -24
  191. package/lib/drugflow-molstar-component-build-0.3.55.js +0 -2
  192. package/lib/drugflow-molstar-component-build-0.3.55.js.LICENSE.txt +0 -24
  193. package/lib/drugflow-molstar-component-build-0.3.56.js +0 -2
  194. package/lib/drugflow-molstar-component-build-0.3.56.js.LICENSE.txt +0 -24
  195. package/lib/drugflow-molstar-component-build-0.3.57.js +0 -2
  196. package/lib/drugflow-molstar-component-build-0.3.57.js.LICENSE.txt +0 -24
  197. package/lib/drugflow-molstar-component-build-0.3.58.js +0 -2
  198. package/lib/drugflow-molstar-component-build-0.3.58.js.LICENSE.txt +0 -24
  199. package/lib/drugflow-molstar-component-build-0.3.59.js +0 -2
  200. package/lib/drugflow-molstar-component-build-0.3.59.js.LICENSE.txt +0 -24
  201. package/lib/drugflow-molstar-component-build-0.3.6.js +0 -2
  202. package/lib/drugflow-molstar-component-build-0.3.6.js.LICENSE.txt +0 -24
  203. package/lib/drugflow-molstar-component-build-0.3.60.js +0 -2
  204. package/lib/drugflow-molstar-component-build-0.3.60.js.LICENSE.txt +0 -24
  205. package/lib/drugflow-molstar-component-build-0.3.61.js +0 -2
  206. package/lib/drugflow-molstar-component-build-0.3.61.js.LICENSE.txt +0 -24
  207. package/lib/drugflow-molstar-component-build-0.3.62.js +0 -2
  208. package/lib/drugflow-molstar-component-build-0.3.62.js.LICENSE.txt +0 -24
  209. package/lib/drugflow-molstar-component-build-0.3.63.js +0 -2
  210. package/lib/drugflow-molstar-component-build-0.3.63.js.LICENSE.txt +0 -24
  211. package/lib/drugflow-molstar-component-build-0.3.64.js +0 -2
  212. package/lib/drugflow-molstar-component-build-0.3.64.js.LICENSE.txt +0 -24
  213. package/lib/drugflow-molstar-component-build-0.3.65.js +0 -2
  214. package/lib/drugflow-molstar-component-build-0.3.65.js.LICENSE.txt +0 -24
  215. package/lib/drugflow-molstar-component-build-0.3.66.js +0 -2
  216. package/lib/drugflow-molstar-component-build-0.3.66.js.LICENSE.txt +0 -24
  217. package/lib/drugflow-molstar-component-build-0.3.67.js +0 -2
  218. package/lib/drugflow-molstar-component-build-0.3.67.js.LICENSE.txt +0 -24
  219. package/lib/drugflow-molstar-component-build-0.3.68.js +0 -2
  220. package/lib/drugflow-molstar-component-build-0.3.68.js.LICENSE.txt +0 -24
  221. package/lib/drugflow-molstar-component-build-0.3.69.js +0 -2
  222. package/lib/drugflow-molstar-component-build-0.3.69.js.LICENSE.txt +0 -24
  223. package/lib/drugflow-molstar-component-build-0.3.7.js +0 -2
  224. package/lib/drugflow-molstar-component-build-0.3.7.js.LICENSE.txt +0 -24
  225. package/lib/drugflow-molstar-component-build-0.3.70.js +0 -2
  226. package/lib/drugflow-molstar-component-build-0.3.70.js.LICENSE.txt +0 -24
  227. package/lib/drugflow-molstar-component-build-0.3.71.js +0 -2
  228. package/lib/drugflow-molstar-component-build-0.3.71.js.LICENSE.txt +0 -24
  229. package/lib/drugflow-molstar-component-build-0.3.72.js +0 -2
  230. package/lib/drugflow-molstar-component-build-0.3.72.js.LICENSE.txt +0 -24
  231. package/lib/drugflow-molstar-component-build-0.3.73.js +0 -2
  232. package/lib/drugflow-molstar-component-build-0.3.73.js.LICENSE.txt +0 -24
  233. package/lib/drugflow-molstar-component-build-0.3.74.js +0 -2
  234. package/lib/drugflow-molstar-component-build-0.3.74.js.LICENSE.txt +0 -24
  235. package/lib/drugflow-molstar-component-build-0.3.75.js +0 -2
  236. package/lib/drugflow-molstar-component-build-0.3.75.js.LICENSE.txt +0 -24
  237. package/lib/drugflow-molstar-component-build-0.3.76.js +0 -2
  238. package/lib/drugflow-molstar-component-build-0.3.76.js.LICENSE.txt +0 -24
  239. package/lib/drugflow-molstar-component-build-0.3.77.js +0 -2
  240. package/lib/drugflow-molstar-component-build-0.3.77.js.LICENSE.txt +0 -24
  241. package/lib/drugflow-molstar-component-build-0.3.8.js +0 -2
  242. package/lib/drugflow-molstar-component-build-0.3.8.js.LICENSE.txt +0 -24
  243. package/lib/drugflow-molstar-component-build-0.3.9.js +0 -2
  244. package/lib/drugflow-molstar-component-build-0.3.9.js.LICENSE.txt +0 -24
  245. package/lib/index2.d.ts +0 -1
  246. package/lib/index2.js +0 -1369
  247. package/lib/pdbe-molstar-component-build-3.1.2.js +0 -2
  248. package/lib/pdbe-molstar-component-build-3.1.2.js.LICENSE.txt +0 -24
  249. /package/lib/{drugflow-molstar-component-build-0.1.2.js.LICENSE.txt → drugflow-molstar-component-build-0.3.78.js.LICENSE.txt} +0 -0
  250. /package/lib/{drugflow-molstar-component-build-0.1.3.js.LICENSE.txt → drugflow-molstar-component-build-0.4.1.js.LICENSE.txt} +0 -0
@@ -1,18 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SuperpositionFocusRepresentation = exports.SuperpositionFocusRepresentationTags = void 0;
4
- var tslib_1 = require("tslib");
5
- var structure_1 = require("Molstar/mol-model/structure");
6
- var structure_representation_params_1 = require("Molstar/mol-plugin-state/helpers/structure-representation-params");
7
- var transforms_1 = require("Molstar/mol-plugin-state/transforms");
8
- var behavior_1 = require("Molstar/mol-plugin/behavior");
9
- var builder_1 = require("Molstar/mol-script/language/builder");
10
- var mol_state_1 = require("Molstar/mol-state");
11
- var param_definition_1 = require("Molstar/mol-util/param-definition");
12
- var commands_1 = require("Molstar/mol-plugin/commands");
13
- var loci_details_1 = require("./loci-details");
14
- var SuperpositionFocusRepresentationParams = function (plugin) {
15
- var reprParams = transforms_1.StateTransforms.Representation.StructureRepresentation3D.definition.params(void 0, plugin);
4
+ const structure_1 = require("Molstar/mol-model/structure");
5
+ const structure_representation_params_1 = require("Molstar/mol-plugin-state/helpers/structure-representation-params");
6
+ const transforms_1 = require("Molstar/mol-plugin-state/transforms");
7
+ const behavior_1 = require("Molstar/mol-plugin/behavior");
8
+ const builder_1 = require("Molstar/mol-script/language/builder");
9
+ const mol_state_1 = require("Molstar/mol-state");
10
+ const param_definition_1 = require("Molstar/mol-util/param-definition");
11
+ const commands_1 = require("Molstar/mol-plugin/commands");
12
+ const loci_details_1 = require("./loci-details");
13
+ const SuperpositionFocusRepresentationParams = (plugin) => {
14
+ const reprParams = transforms_1.StateTransforms.Representation.StructureRepresentation3D.definition.params(void 0, plugin);
16
15
  return {
17
16
  expandRadius: param_definition_1.ParamDefinition.Numeric(5, { min: 1, max: 10, step: 1 }),
18
17
  surroundingsParams: param_definition_1.ParamDefinition.Group(reprParams, {
@@ -25,22 +24,14 @@ var SuperpositionFocusRepresentationTags;
25
24
  (function (SuperpositionFocusRepresentationTags) {
26
25
  SuperpositionFocusRepresentationTags["SurrSel"] = "superposition-focus-surr-sel";
27
26
  SuperpositionFocusRepresentationTags["SurrRepr"] = "superposition-focus-surr-repr";
28
- })(SuperpositionFocusRepresentationTags = exports.SuperpositionFocusRepresentationTags || (exports.SuperpositionFocusRepresentationTags = {}));
29
- var TagSet = new Set([SuperpositionFocusRepresentationTags.SurrSel, SuperpositionFocusRepresentationTags.SurrRepr]);
30
- var SuperpositionFocusRepresentationBehavior = /** @class */ (function (_super) {
31
- tslib_1.__extends(SuperpositionFocusRepresentationBehavior, _super);
32
- function SuperpositionFocusRepresentationBehavior() {
33
- return _super !== null && _super.apply(this, arguments) || this;
34
- }
35
- Object.defineProperty(SuperpositionFocusRepresentationBehavior.prototype, "surrLabel", {
36
- get: function () { return "[Focus] Surroundings (".concat(this.params.expandRadius, " \u00C5)"); },
37
- enumerable: false,
38
- configurable: true
39
- });
40
- SuperpositionFocusRepresentationBehavior.prototype.ensureShape = function (cell) {
41
- var state = this.plugin.state.data, tree = state.tree;
42
- var builder = state.build();
43
- var refs = mol_state_1.StateSelection.findUniqueTagsInSubtree(tree, cell.transform.ref, TagSet);
27
+ })(SuperpositionFocusRepresentationTags || (exports.SuperpositionFocusRepresentationTags = SuperpositionFocusRepresentationTags = {}));
28
+ const TagSet = new Set([SuperpositionFocusRepresentationTags.SurrSel, SuperpositionFocusRepresentationTags.SurrRepr]);
29
+ class SuperpositionFocusRepresentationBehavior extends behavior_1.PluginBehavior.WithSubscribers {
30
+ get surrLabel() { return `[Focus] Surroundings (${this.params.expandRadius} Å)`; }
31
+ ensureShape(cell) {
32
+ const state = this.plugin.state.data, tree = state.tree;
33
+ const builder = state.build();
34
+ const refs = mol_state_1.StateSelection.findUniqueTagsInSubtree(tree, cell.transform.ref, TagSet);
44
35
  // Selections
45
36
  if (!refs[SuperpositionFocusRepresentationTags.SurrSel]) {
46
37
  refs[SuperpositionFocusRepresentationTags.SurrSel] = builder
@@ -53,101 +44,72 @@ var SuperpositionFocusRepresentationBehavior = /** @class */ (function (_super)
53
44
  .to(refs[SuperpositionFocusRepresentationTags.SurrSel])
54
45
  .apply(transforms_1.StateTransforms.Representation.StructureRepresentation3D, this.params.surroundingsParams, { tags: SuperpositionFocusRepresentationTags.SurrRepr }).ref;
55
46
  }
56
- return { state: state, builder: builder, refs: refs };
57
- };
58
- SuperpositionFocusRepresentationBehavior.prototype.clear = function (root) {
59
- var state = this.plugin.state.data;
60
- var surrs = state.select(mol_state_1.StateSelection.Generators.byRef(root).subtree().withTag(SuperpositionFocusRepresentationTags.SurrSel));
47
+ return { state, builder, refs };
48
+ }
49
+ clear(root) {
50
+ const state = this.plugin.state.data;
51
+ const surrs = state.select(mol_state_1.StateSelection.Generators.byRef(root).subtree().withTag(SuperpositionFocusRepresentationTags.SurrSel));
61
52
  if (surrs.length === 0)
62
53
  return;
63
- var update = state.build();
64
- var expression = builder_1.MolScriptBuilder.struct.generator.empty();
65
- for (var _i = 0, surrs_1 = surrs; _i < surrs_1.length; _i++) {
66
- var s = surrs_1[_i];
67
- update.to(s).update(transforms_1.StateTransforms.Model.StructureSelectionFromExpression, function (old) { return (tslib_1.__assign(tslib_1.__assign({}, old), { expression: expression })); });
54
+ const update = state.build();
55
+ const expression = builder_1.MolScriptBuilder.struct.generator.empty();
56
+ for (const s of surrs) {
57
+ update.to(s).update(transforms_1.StateTransforms.Model.StructureSelectionFromExpression, old => ({ ...old, expression }));
68
58
  }
69
- return commands_1.PluginCommands.State.Update(this.plugin, { state: state, tree: update, options: { doNotLogTiming: true, doNotUpdateCurrent: true } });
70
- };
71
- SuperpositionFocusRepresentationBehavior.prototype.focus = function (sourceLoci) {
72
- return tslib_1.__awaiter(this, void 0, void 0, function () {
73
- var parent, loci, residueLoci, residueBundle, target, surroundings, lociDeatils, _a, state, builder, refs;
74
- var _this = this;
75
- return tslib_1.__generator(this, function (_b) {
76
- switch (_b.label) {
77
- case 0:
78
- parent = this.plugin.helpers.substructureParent.get(sourceLoci.structure);
79
- if (!parent || !parent.obj)
80
- return [2 /*return*/];
81
- loci = structure_1.StructureElement.Loci.remap(sourceLoci, parent.obj.data);
82
- residueLoci = structure_1.StructureElement.Loci.extendToWholeResidues(loci);
83
- residueBundle = structure_1.StructureElement.Bundle.fromLoci(residueLoci);
84
- target = structure_1.StructureElement.Bundle.toExpression(residueBundle);
85
- surroundings = builder_1.MolScriptBuilder.struct.modifier.includeSurroundings({
86
- 0: target,
87
- radius: this.params.expandRadius,
88
- 'as-whole-residues': true
89
- });
90
- lociDeatils = (0, loci_details_1.lociDetails)(sourceLoci);
91
- if (!lociDeatils) {
92
- surroundings = builder_1.MolScriptBuilder.struct.modifier.exceptBy({
93
- 0: surroundings,
94
- by: target
95
- });
96
- }
97
- _a = this.ensureShape(parent), state = _a.state, builder = _a.builder, refs = _a.refs;
98
- builder.to(refs[SuperpositionFocusRepresentationTags.SurrSel]).update(transforms_1.StateTransforms.Model.StructureSelectionFromExpression, function (old) { return (tslib_1.__assign(tslib_1.__assign({}, old), { expression: surroundings, label: _this.surrLabel })); });
99
- return [4 /*yield*/, commands_1.PluginCommands.State.Update(this.plugin, { state: state, tree: builder, options: { doNotLogTiming: true, doNotUpdateCurrent: true } })];
100
- case 1:
101
- _b.sent();
102
- return [2 /*return*/];
103
- }
104
- });
59
+ return commands_1.PluginCommands.State.Update(this.plugin, { state, tree: update, options: { doNotLogTiming: true, doNotUpdateCurrent: true } });
60
+ }
61
+ async focus(sourceLoci) {
62
+ const parent = this.plugin.helpers.substructureParent.get(sourceLoci.structure);
63
+ if (!parent || !parent.obj)
64
+ return;
65
+ const loci = structure_1.StructureElement.Loci.remap(sourceLoci, parent.obj.data);
66
+ const residueLoci = structure_1.StructureElement.Loci.extendToWholeResidues(loci);
67
+ const residueBundle = structure_1.StructureElement.Bundle.fromLoci(residueLoci);
68
+ const target = structure_1.StructureElement.Bundle.toExpression(residueBundle);
69
+ let surroundings = builder_1.MolScriptBuilder.struct.modifier.includeSurroundings({
70
+ 0: target,
71
+ radius: this.params.expandRadius,
72
+ 'as-whole-residues': true
105
73
  });
106
- };
107
- SuperpositionFocusRepresentationBehavior.prototype.register = function (ref) {
108
- var _this = this;
109
- this.subscribeObservable(this.plugin.managers.structure.focus.behaviors.current, function (entry) {
74
+ const lociDeatils = (0, loci_details_1.lociDetails)(sourceLoci);
75
+ if (!lociDeatils) {
76
+ surroundings = builder_1.MolScriptBuilder.struct.modifier.exceptBy({
77
+ 0: surroundings,
78
+ by: target
79
+ });
80
+ }
81
+ const { state, builder, refs } = this.ensureShape(parent);
82
+ builder.to(refs[SuperpositionFocusRepresentationTags.SurrSel]).update(transforms_1.StateTransforms.Model.StructureSelectionFromExpression, old => ({ ...old, expression: surroundings, label: this.surrLabel }));
83
+ await commands_1.PluginCommands.State.Update(this.plugin, { state, tree: builder, options: { doNotLogTiming: true, doNotUpdateCurrent: true } });
84
+ }
85
+ register(ref) {
86
+ this.subscribeObservable(this.plugin.managers.structure.focus.behaviors.current, (entry) => {
110
87
  // if (entry) this.focus(entry.loci);
111
88
  // else this.clear(StateTransform.RootRef);
112
- _this.clear(mol_state_1.StateTransform.RootRef);
89
+ this.clear(mol_state_1.StateTransform.RootRef);
113
90
  if (entry)
114
- _this.focus(entry.loci);
115
- });
116
- };
117
- SuperpositionFocusRepresentationBehavior.prototype.update = function (params) {
118
- return tslib_1.__awaiter(this, void 0, void 0, function () {
119
- var old, state, builder, all, _i, _a, repr;
120
- return tslib_1.__generator(this, function (_b) {
121
- switch (_b.label) {
122
- case 0:
123
- old = this.params;
124
- this.params = params;
125
- state = this.plugin.state.data;
126
- builder = state.build();
127
- all = mol_state_1.StateSelection.Generators.root.subtree();
128
- for (_i = 0, _a = state.select(all.withTag(SuperpositionFocusRepresentationTags.SurrRepr)); _i < _a.length; _i++) {
129
- repr = _a[_i];
130
- builder.to(repr).update(this.params.surroundingsParams);
131
- }
132
- return [4 /*yield*/, commands_1.PluginCommands.State.Update(this.plugin, { state: state, tree: builder, options: { doNotLogTiming: true, doNotUpdateCurrent: true } })];
133
- case 1:
134
- _b.sent();
135
- if (!(params.expandRadius !== old.expandRadius)) return [3 /*break*/, 3];
136
- return [4 /*yield*/, this.clear(mol_state_1.StateTransform.RootRef)];
137
- case 2:
138
- _b.sent();
139
- _b.label = 3;
140
- case 3: return [2 /*return*/, true];
141
- }
142
- });
91
+ this.focus(entry.loci);
143
92
  });
144
- };
145
- return SuperpositionFocusRepresentationBehavior;
146
- }(behavior_1.PluginBehavior.WithSubscribers));
93
+ }
94
+ async update(params) {
95
+ const old = this.params;
96
+ this.params = params;
97
+ const state = this.plugin.state.data;
98
+ const builder = state.build();
99
+ const all = mol_state_1.StateSelection.Generators.root.subtree();
100
+ for (const repr of state.select(all.withTag(SuperpositionFocusRepresentationTags.SurrRepr))) {
101
+ builder.to(repr).update(this.params.surroundingsParams);
102
+ }
103
+ await commands_1.PluginCommands.State.Update(this.plugin, { state, tree: builder, options: { doNotLogTiming: true, doNotUpdateCurrent: true } });
104
+ if (params.expandRadius !== old.expandRadius)
105
+ await this.clear(mol_state_1.StateTransform.RootRef);
106
+ return true;
107
+ }
108
+ }
147
109
  exports.SuperpositionFocusRepresentation = behavior_1.PluginBehavior.create({
148
110
  name: 'create-superposition-focus-representation',
149
111
  display: { name: 'Superposition Focus Representation' },
150
112
  category: 'interaction',
151
113
  ctor: SuperpositionFocusRepresentationBehavior,
152
- params: function (_, plugin) { return SuperpositionFocusRepresentationParams(plugin); }
114
+ params: (_, plugin) => SuperpositionFocusRepresentationParams(plugin)
153
115
  });
@@ -13,7 +13,7 @@ export interface AlignmentResult {
13
13
  zeroOverlapPairs: [number, number][];
14
14
  failedPairs: [number, number][];
15
15
  }
16
- declare type IncludeResidueTest = (traceElementOrFirstAtom: StructureElement.Location<Unit.Atomic>, residueIndex: ResidueIndex, startIndex: ElementIndex, endIndex: ElementIndex) => boolean;
16
+ type IncludeResidueTest = (traceElementOrFirstAtom: StructureElement.Location<Unit.Atomic>, residueIndex: ResidueIndex, startIndex: ElementIndex, endIndex: ElementIndex) => boolean;
17
17
  export declare function alignAndSuperposeWithSIFTSMapping(structures: Structure[], options?: {
18
18
  traceOnly?: boolean;
19
19
  includeResidueTest?: IncludeResidueTest;
@@ -1,58 +1,55 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.alignAndSuperposeWithSIFTSMapping = void 0;
4
- var int_1 = require("Molstar/mol-data/int");
5
- var minimize_rmsd_1 = require("Molstar/mol-math/linear-algebra/3d/minimize-rmsd");
6
- var sifts_mapping_1 = require("./sifts-mapping");
7
- var element_1 = require("Molstar/mol-model/structure/structure/element");
4
+ const int_1 = require("Molstar/mol-data/int");
5
+ const minimize_rmsd_1 = require("Molstar/mol-math/linear-algebra/3d/minimize-rmsd");
6
+ const sifts_mapping_1 = require("./sifts-mapping");
7
+ const element_1 = require("Molstar/mol-model/structure/structure/element");
8
8
  function alignAndSuperposeWithSIFTSMapping(structures, options) {
9
- var _a, _b;
10
- var indexMap = new Map();
11
- for (var i = 0; i < structures.length; i++) {
12
- var includeResidueTest = (_a = options === null || options === void 0 ? void 0 : options.includeResidueTest) !== null && _a !== void 0 ? _a : _includeAllResidues;
13
- if ((options === null || options === void 0 ? void 0 : options.applyTestIndex) && !options.applyTestIndex.includes(i))
9
+ const indexMap = new Map();
10
+ for (let i = 0; i < structures.length; i++) {
11
+ let includeResidueTest = options?.includeResidueTest ?? _includeAllResidues;
12
+ if (options?.applyTestIndex && !options.applyTestIndex.includes(i))
14
13
  includeResidueTest = _includeAllResidues;
15
- buildIndex(structures[i], indexMap, i, (_b = options === null || options === void 0 ? void 0 : options.traceOnly) !== null && _b !== void 0 ? _b : true, includeResidueTest);
14
+ buildIndex(structures[i], indexMap, i, options?.traceOnly ?? true, includeResidueTest);
16
15
  }
17
- var index = Array.from(indexMap.values());
16
+ const index = Array.from(indexMap.values());
18
17
  // TODO: support non-first structure pivots
19
- var pairs = findPairs(structures.length, index);
20
- var zeroOverlapPairs = [];
21
- var failedPairs = [];
22
- var entries = [];
23
- for (var _i = 0, pairs_1 = pairs; _i < pairs_1.length; _i++) {
24
- var p = pairs_1[_i];
18
+ const pairs = findPairs(structures.length, index);
19
+ const zeroOverlapPairs = [];
20
+ const failedPairs = [];
21
+ const entries = [];
22
+ for (const p of pairs) {
25
23
  if (p.count === 0) {
26
24
  zeroOverlapPairs.push([p.i, p.j]);
27
25
  }
28
26
  else {
29
- var _c = getPositionTables(index, p.i, p.j, p.count), a = _c[0], b = _c[1];
30
- var transform = minimize_rmsd_1.MinimizeRmsd.compute({ a: a, b: b });
27
+ const [a, b] = getPositionTables(index, p.i, p.j, p.count);
28
+ const transform = minimize_rmsd_1.MinimizeRmsd.compute({ a, b });
31
29
  if (Number.isNaN(transform.rmsd)) {
32
30
  failedPairs.push([p.i, p.j]);
33
31
  }
34
32
  else {
35
- entries.push({ transform: transform, pivot: p.i, other: p.j });
33
+ entries.push({ transform, pivot: p.i, other: p.j });
36
34
  }
37
35
  }
38
36
  }
39
- return { entries: entries, zeroOverlapPairs: zeroOverlapPairs, failedPairs: failedPairs };
37
+ return { entries, zeroOverlapPairs, failedPairs };
40
38
  }
41
39
  exports.alignAndSuperposeWithSIFTSMapping = alignAndSuperposeWithSIFTSMapping;
42
40
  function getPositionTables(index, pivot, other, N) {
43
- var xs = minimize_rmsd_1.MinimizeRmsd.Positions.empty(N);
44
- var ys = minimize_rmsd_1.MinimizeRmsd.Positions.empty(N);
45
- var o = 0;
46
- for (var _i = 0, index_1 = index; _i < index_1.length; _i++) {
47
- var pivots = index_1[_i].pivots;
48
- var a = pivots[pivot];
49
- var b = pivots[other];
41
+ const xs = minimize_rmsd_1.MinimizeRmsd.Positions.empty(N);
42
+ const ys = minimize_rmsd_1.MinimizeRmsd.Positions.empty(N);
43
+ let o = 0;
44
+ for (const { pivots } of index) {
45
+ const a = pivots[pivot];
46
+ const b = pivots[other];
50
47
  if (!a || !b)
51
48
  continue;
52
- var l = Math.min(a[2] - a[1], b[2] - b[1]);
49
+ const l = Math.min(a[2] - a[1], b[2] - b[1]);
53
50
  // TODO: check if residue types match?
54
- for (var i = 0; i < l; i++) {
55
- var eI = (a[1] + i);
51
+ for (let i = 0; i < l; i++) {
52
+ let eI = (a[1] + i);
56
53
  xs.x[o] = a[0].conformation.x(eI);
57
54
  xs.y[o] = a[0].conformation.y(eI);
58
55
  xs.z[o] = a[0].conformation.z(eI);
@@ -66,29 +63,28 @@ function getPositionTables(index, pivot, other, N) {
66
63
  return [xs, ys];
67
64
  }
68
65
  function findPairs(N, index) {
69
- var pairwiseCounts = [];
70
- for (var i = 0; i < N; i++) {
66
+ const pairwiseCounts = [];
67
+ for (let i = 0; i < N; i++) {
71
68
  pairwiseCounts[i] = [];
72
- for (var j = 0; j < N; j++)
69
+ for (let j = 0; j < N; j++)
73
70
  pairwiseCounts[i][j] = 0;
74
71
  }
75
- for (var _i = 0, index_2 = index; _i < index_2.length; _i++) {
76
- var pivots = index_2[_i].pivots;
77
- for (var i = 0; i < N; i++) {
72
+ for (const { pivots } of index) {
73
+ for (let i = 0; i < N; i++) {
78
74
  if (!pivots[i])
79
75
  continue;
80
- var lI = pivots[i][2] - pivots[i][1];
81
- for (var j = i + 1; j < N; j++) {
76
+ const lI = pivots[i][2] - pivots[i][1];
77
+ for (let j = i + 1; j < N; j++) {
82
78
  if (!pivots[j])
83
79
  continue;
84
- var lJ = pivots[j][2] - pivots[j][1];
80
+ const lJ = pivots[j][2] - pivots[j][1];
85
81
  pairwiseCounts[i][j] = pairwiseCounts[i][j] + Math.min(lI, lJ);
86
82
  }
87
83
  }
88
84
  }
89
- var ret = [];
90
- for (var j = 1; j < N; j++) {
91
- ret[j - 1] = { i: 0, j: j, count: pairwiseCounts[0][j] };
85
+ const ret = [];
86
+ for (let j = 1; j < N; j++) {
87
+ ret[j - 1] = { i: 0, j, count: pairwiseCounts[0][j] };
92
88
  }
93
89
  // TODO: support non-first structure pivots
94
90
  // for (let i = 0; i < N - 1; i++) {
@@ -105,31 +101,29 @@ function findPairs(N, index) {
105
101
  }
106
102
  function _includeAllResidues() { return true; }
107
103
  function buildIndex(structure, index, sI, traceOnly, includeTest) {
108
- var _a;
109
- var loc = element_1.StructureElement.Location.create(structure);
110
- for (var _i = 0, _b = structure.units; _i < _b.length; _i++) {
111
- var unit = _b[_i];
112
- if (unit.kind !== 0 /* Atomic */)
104
+ const loc = element_1.StructureElement.Location.create(structure);
105
+ for (const unit of structure.units) {
106
+ if (unit.kind !== 0 /* Unit.Kind.Atomic */)
113
107
  continue;
114
- var elements = unit.elements, model = unit.model;
108
+ const { elements, model } = unit;
115
109
  loc.unit = unit;
116
- var map = sifts_mapping_1.SIFTSMapping.Provider.get(model).value;
110
+ const map = sifts_mapping_1.SIFTSMapping.Provider.get(model).value;
117
111
  if (!map)
118
112
  return;
119
- var dbName = map.dbName, accession = map.accession, num = map.num;
120
- var chainsIt = int_1.Segmentation.transientSegments(unit.model.atomicHierarchy.chainAtomSegments, elements);
121
- var residuesIt = int_1.Segmentation.transientSegments(unit.model.atomicHierarchy.residueAtomSegments, elements);
122
- var traceElementIndex = unit.model.atomicHierarchy.derived.residue.traceElementIndex;
113
+ const { dbName, accession, num } = map;
114
+ const chainsIt = int_1.Segmentation.transientSegments(unit.model.atomicHierarchy.chainAtomSegments, elements);
115
+ const residuesIt = int_1.Segmentation.transientSegments(unit.model.atomicHierarchy.residueAtomSegments, elements);
116
+ const traceElementIndex = unit.model.atomicHierarchy.derived.residue.traceElementIndex;
123
117
  while (chainsIt.hasNext) {
124
- var chainSegment = chainsIt.move();
118
+ const chainSegment = chainsIt.move();
125
119
  residuesIt.setSegment(chainSegment);
126
120
  while (residuesIt.hasNext) {
127
- var residueSegment = residuesIt.move();
128
- var rI = residueSegment.index;
121
+ const residueSegment = residuesIt.move();
122
+ const rI = residueSegment.index;
129
123
  if (!dbName[rI])
130
124
  continue;
131
- var traceElement = traceElementIndex[rI];
132
- var start = void 0, end = void 0;
125
+ const traceElement = traceElementIndex[rI];
126
+ let start, end;
133
127
  if (traceOnly) {
134
128
  start = traceElement;
135
129
  if (start === -1)
@@ -143,12 +137,12 @@ function buildIndex(structure, index, sI, traceOnly, includeTest) {
143
137
  loc.element = (traceElement >= 0 ? traceElement : start);
144
138
  if (!includeTest(loc, rI, start, end))
145
139
  continue;
146
- var key = "".concat(dbName[rI], "-").concat(accession[rI].split('-')[0], "-").concat(num[rI]);
140
+ const key = `${dbName[rI]}-${accession[rI].split('-')[0]}-${num[rI]}`;
147
141
  if (!index.has(key)) {
148
- index.set(key, { key: key, pivots: (_a = {}, _a[sI] = [unit, start, end], _a) });
142
+ index.set(key, { key, pivots: { [sI]: [unit, start, end] } });
149
143
  }
150
144
  else {
151
- var entry = index.get(key);
145
+ const entry = index.get(key);
152
146
  if (!entry.pivots[sI]) {
153
147
  entry.pivots[sI] = [unit, start, end];
154
148
  }
@@ -1,13 +1,13 @@
1
1
  import { Mat4 } from 'Molstar/mol-math/linear-algebra';
2
2
  import { PluginContext } from 'Molstar/mol-plugin/context';
3
- declare type ClusterRec = {
3
+ type ClusterRec = {
4
4
  pdb_id: string;
5
5
  auth_asym_id: string;
6
6
  struct_asym_id: string;
7
7
  entity_id: string;
8
8
  is_representative: boolean;
9
9
  };
10
- export declare type SuperpositionData = {
10
+ export type SuperpositionData = {
11
11
  data: ClusterRec[];
12
12
  matrix: Mat4[];
13
13
  };