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.
- package/build/drugflow-molstar-0.4.1.css +1 -0
- package/build/drugflow-molstar-component-0.4.1.js +25 -0
- package/build/drugflow-molstar-plugin-0.4.1.js +2 -0
- package/build/drugflow-molstar-plugin-0.4.1.js.LICENSE.txt +64 -0
- package/lib/alphafold-transparency.js +58 -125
- package/lib/contact.d.ts +15 -6
- package/lib/contact.js +71 -66
- package/lib/custom-events.js +16 -16
- package/lib/domain-annotations/behavior.js +20 -24
- package/lib/domain-annotations/color.d.ts +1 -1
- package/lib/domain-annotations/color.js +23 -22
- package/lib/domain-annotations/prop.d.ts +3 -3
- package/lib/domain-annotations/prop.js +54 -76
- package/lib/drugflow-molstar-component-build-0.3.78.js +2 -0
- package/lib/drugflow-molstar-component-build-0.4.1.js +2 -0
- package/lib/helpers.d.ts +4 -4
- package/lib/helpers.js +94 -99
- package/lib/index.js +1785 -2608
- package/lib/labels.d.ts +1 -1
- package/lib/labels.js +20 -23
- package/lib/loci-details.d.ts +2 -2
- package/lib/loci-details.js +26 -29
- package/lib/sifts-mapping.js +30 -34
- package/lib/sifts-mappings-behaviour.js +26 -30
- package/lib/spec.d.ts +1 -1
- package/lib/spec.js +50 -38
- package/lib/structure_contact3d.d.ts +13 -4
- package/lib/structure_contact3d.js +25 -46
- package/lib/subscribe-events.js +17 -17
- package/lib/superposition-export.js +100 -144
- package/lib/superposition-focus-representation.d.ts +1 -1
- package/lib/superposition-focus-representation.js +74 -112
- package/lib/superposition-sifts-mapping.d.ts +1 -1
- package/lib/superposition-sifts-mapping.js +56 -62
- package/lib/superposition.d.ts +2 -2
- package/lib/superposition.js +490 -726
- package/lib/ui/alphafold-superposition.d.ts +8 -9
- package/lib/ui/alphafold-superposition.js +96 -120
- package/lib/ui/alphafold-tranparency.d.ts +1 -2
- package/lib/ui/alphafold-tranparency.js +27 -43
- package/lib/ui/annotation-controls.d.ts +2 -3
- package/lib/ui/annotation-controls.js +81 -87
- package/lib/ui/export-superposition.js +33 -51
- package/lib/ui/pdbe-left-panel.d.ts +3 -3
- package/lib/ui/pdbe-left-panel.js +82 -106
- package/lib/ui/pdbe-screenshot-controls.d.ts +1 -1
- package/lib/ui/pdbe-screenshot-controls.js +54 -83
- package/lib/ui/pdbe-structure-controls.d.ts +4 -5
- package/lib/ui/pdbe-structure-controls.js +34 -57
- package/lib/ui/pdbe-viewport-controls.d.ts +1 -2
- package/lib/ui/pdbe-viewport-controls.js +23 -29
- package/lib/ui/segment-tree.d.ts +1 -2
- package/lib/ui/segment-tree.js +438 -590
- package/lib/ui/superposition-components.d.ts +1 -2
- package/lib/ui/superposition-components.js +196 -266
- package/lib/ui/superposition-viewport.d.ts +1 -2
- package/lib/ui/superposition-viewport.js +11 -18
- package/package.json +7 -4
- package/build/drugflow-molstar-0.3.62.css +0 -1
- package/build/drugflow-molstar-0.3.77.css +0 -1
- package/build/drugflow-molstar-component-0.3.62.js +0 -25
- package/build/drugflow-molstar-component-0.3.77.js +0 -25
- package/build/drugflow-molstar-light.css +0 -1
- package/build/drugflow-molstar-plugin-0.3.62.js +0 -2
- package/build/drugflow-molstar-plugin-0.3.62.js.LICENSE.txt +0 -39
- package/build/drugflow-molstar-plugin-0.3.77.js +0 -2
- package/build/drugflow-molstar-plugin-0.3.77.js.LICENSE.txt +0 -39
- package/lib/drugflow-molstar-component-build-0.1.2.js +0 -4268
- package/lib/drugflow-molstar-component-build-0.1.2.js.map +0 -1
- package/lib/drugflow-molstar-component-build-0.1.3.js +0 -2
- package/lib/drugflow-molstar-component-build-0.1.4.js +0 -2
- package/lib/drugflow-molstar-component-build-0.1.4.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.1.5.js +0 -2
- package/lib/drugflow-molstar-component-build-0.1.5.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.1.6.js +0 -2
- package/lib/drugflow-molstar-component-build-0.1.6.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.10.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.10.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.2.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.2.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.3.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.3.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.4.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.4.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.5.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.5.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.6.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.6.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.7.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.7.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.9.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.9.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.1.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.1.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.10.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.10.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.11.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.11.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.12.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.12.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.13.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.13.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.14.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.14.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.15.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.15.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.16.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.16.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.17.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.17.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.18.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.18.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.19.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.19.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.2.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.2.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.20.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.20.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.21.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.21.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.22.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.22.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.23.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.23.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.24.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.24.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.25.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.25.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.26.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.26.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.27.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.27.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.28.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.28.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.29.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.29.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.3.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.3.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.30.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.30.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.31.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.31.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.32.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.32.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.33.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.33.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.34.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.34.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.35.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.35.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.36.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.36.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.37.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.37.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.38.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.38.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.39.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.39.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.4.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.4.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.40.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.40.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.41.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.41.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.42.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.42.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.43.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.43.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.44.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.44.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.46.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.46.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.47.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.47.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.48.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.48.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.49.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.49.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.5.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.5.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.50.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.50.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.51.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.51.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.52.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.52.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.53.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.53.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.54.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.54.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.55.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.55.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.56.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.56.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.57.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.57.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.58.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.58.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.59.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.59.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.6.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.6.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.60.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.60.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.61.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.61.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.62.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.62.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.63.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.63.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.64.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.64.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.65.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.65.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.66.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.66.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.67.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.67.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.68.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.68.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.69.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.69.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.7.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.7.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.70.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.70.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.71.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.71.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.72.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.72.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.73.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.73.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.74.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.74.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.75.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.75.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.76.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.76.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.77.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.77.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.8.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.8.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.9.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.9.js.LICENSE.txt +0 -24
- package/lib/index2.d.ts +0 -1
- package/lib/index2.js +0 -1369
- package/lib/pdbe-molstar-component-build-3.1.2.js +0 -2
- package/lib/pdbe-molstar-component-build-3.1.2.js.LICENSE.txt +0 -24
- /package/lib/{drugflow-molstar-component-build-0.1.2.js.LICENSE.txt → drugflow-molstar-component-build-0.3.78.js.LICENSE.txt} +0 -0
- /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,60 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StructureSelectionsContact3D = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var StructureSelectionsContact3D = objects_1.PluginStateTransform.BuiltIn({
|
|
4
|
+
const mol_state_1 = require("molstar/lib/mol-state");
|
|
5
|
+
const mol_task_1 = require("molstar/lib/mol-task");
|
|
6
|
+
const objects_1 = require("molstar/lib/mol-plugin-state/objects");
|
|
7
|
+
const helpers_1 = require("molstar/lib/mol-plugin-state/transforms/helpers");
|
|
8
|
+
const contact_1 = require("./contact");
|
|
9
|
+
const StructureSelectionsContact3D = objects_1.PluginStateTransform.BuiltIn({
|
|
11
10
|
name: 'structure-selections-contact-3d',
|
|
12
11
|
display: '3D Contact',
|
|
13
12
|
from: objects_1.PluginStateObject.Molecule.Structure.Selections,
|
|
14
13
|
to: objects_1.PluginStateObject.Shape.Representation3D,
|
|
15
|
-
params:
|
|
14
|
+
params: () => ({
|
|
15
|
+
...contact_1.ContactParams,
|
|
16
|
+
})
|
|
16
17
|
})({
|
|
17
|
-
canAutoUpdate
|
|
18
|
-
var oldParams = _a.oldParams, newParams = _a.newParams;
|
|
18
|
+
canAutoUpdate({ oldParams, newParams }) {
|
|
19
19
|
return true;
|
|
20
20
|
},
|
|
21
|
-
apply
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
switch (_b.label) {
|
|
29
|
-
case 0:
|
|
30
|
-
data = (0, helpers_1.getDistanceDataFromStructureSelections)(a.data);
|
|
31
|
-
repr = (0, contact_1.ContactRepresentation)(tslib_1.__assign({ webgl: (_a = plugin.canvas3d) === null || _a === void 0 ? void 0 : _a.webgl }, plugin.representation.structure.themes), function () { return contact_1.ContactParams; });
|
|
32
|
-
return [4 /*yield*/, repr.createOrUpdate(params, data).runInContext(ctx)];
|
|
33
|
-
case 1:
|
|
34
|
-
_b.sent();
|
|
35
|
-
return [2 /*return*/, new objects_1.PluginStateObject.Shape.Representation3D({ repr: repr, sourceData: data }, { label: "Contact" })];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}); });
|
|
21
|
+
apply({ a, params }, plugin) {
|
|
22
|
+
return mol_task_1.Task.create('Structure Contact', async (ctx) => {
|
|
23
|
+
const data = (0, helpers_1.getDistanceDataFromStructureSelections)(a.data);
|
|
24
|
+
const repr = (0, contact_1.ContactRepresentation)({ webgl: plugin.canvas3d?.webgl, ...plugin.representation.structure.themes }, () => contact_1.ContactParams);
|
|
25
|
+
await repr.createOrUpdate(params, data).runInContext(ctx);
|
|
26
|
+
return new objects_1.PluginStateObject.Shape.Representation3D({ repr, sourceData: data }, { label: `Contact` });
|
|
27
|
+
});
|
|
39
28
|
},
|
|
40
|
-
update
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
props = tslib_1.__assign(tslib_1.__assign({}, b.data.repr.props), newParams);
|
|
49
|
-
data = (0, helpers_1.getDistanceDataFromStructureSelections)(a.data);
|
|
50
|
-
return [4 /*yield*/, b.data.repr.createOrUpdate(props, data).runInContext(ctx)];
|
|
51
|
-
case 1:
|
|
52
|
-
_a.sent();
|
|
53
|
-
b.data.sourceData = data;
|
|
54
|
-
return [2 /*return*/, mol_state_1.StateTransformer.UpdateResult.Updated];
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}); });
|
|
29
|
+
update({ a, b, oldParams, newParams }, plugin) {
|
|
30
|
+
return mol_task_1.Task.create('Structure Contact', async (ctx) => {
|
|
31
|
+
const props = { ...b.data.repr.props, ...newParams };
|
|
32
|
+
const data = (0, helpers_1.getDistanceDataFromStructureSelections)(a.data);
|
|
33
|
+
await b.data.repr.createOrUpdate(props, data).runInContext(ctx);
|
|
34
|
+
b.data.sourceData = data;
|
|
35
|
+
return mol_state_1.StateTransformer.UpdateResult.Updated;
|
|
36
|
+
});
|
|
58
37
|
},
|
|
59
38
|
});
|
|
60
39
|
exports.StructureSelectionsContact3D = StructureSelectionsContact3D;
|
package/lib/subscribe-events.js
CHANGED
|
@@ -4,14 +4,14 @@ exports.subscribeToComponentEvents = void 0;
|
|
|
4
4
|
function subscribeToComponentEvents(wrapperCtx) {
|
|
5
5
|
document.addEventListener('PDB.interactions.click', function (e) {
|
|
6
6
|
if (typeof e.detail !== 'undefined') {
|
|
7
|
-
|
|
7
|
+
const data = e.detail.interacting_nodes ? { data: e.detail.interacting_nodes } : { data: [e.detail.selected_node] };
|
|
8
8
|
data.data[0]['focus'] = true;
|
|
9
9
|
wrapperCtx.visual.select(data);
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
document.addEventListener('PDB.interactions.mouseover', function (e) {
|
|
13
13
|
if (typeof e.detail !== 'undefined') {
|
|
14
|
-
|
|
14
|
+
const data = e.detail.interacting_nodes ? { data: e.detail.interacting_nodes } : { data: [e.detail.selected_node] };
|
|
15
15
|
wrapperCtx.visual.highlight(data);
|
|
16
16
|
}
|
|
17
17
|
});
|
|
@@ -21,7 +21,7 @@ function subscribeToComponentEvents(wrapperCtx) {
|
|
|
21
21
|
document.addEventListener('PDB.topologyViewer.click', function (e) {
|
|
22
22
|
if (typeof e.eventData !== 'undefined') {
|
|
23
23
|
// Create query object from event data
|
|
24
|
-
|
|
24
|
+
let highlightQuery = {
|
|
25
25
|
entity_id: e.eventData.entityId,
|
|
26
26
|
struct_asym_id: e.eventData.structAsymId,
|
|
27
27
|
start_residue_number: e.eventData.residueNumber,
|
|
@@ -38,7 +38,7 @@ function subscribeToComponentEvents(wrapperCtx) {
|
|
|
38
38
|
// Abort if entryid do not match or viewer type is unipdb
|
|
39
39
|
// if(e.eventData.entryId != scope.pdbId) return;
|
|
40
40
|
// Create query object from event data
|
|
41
|
-
|
|
41
|
+
let highlightQuery = {
|
|
42
42
|
entity_id: e.eventData.entityId,
|
|
43
43
|
struct_asym_id: e.eventData.structAsymId,
|
|
44
44
|
start_residue_number: e.eventData.residueNumber,
|
|
@@ -53,7 +53,7 @@ function subscribeToComponentEvents(wrapperCtx) {
|
|
|
53
53
|
});
|
|
54
54
|
document.addEventListener('protvista-mouseover', function (e) {
|
|
55
55
|
if (typeof e.detail !== 'undefined') {
|
|
56
|
-
|
|
56
|
+
let highlightQuery = undefined;
|
|
57
57
|
// Create query object from event data
|
|
58
58
|
if (e.detail.start && e.detail.end) {
|
|
59
59
|
highlightQuery = {
|
|
@@ -76,8 +76,8 @@ function subscribeToComponentEvents(wrapperCtx) {
|
|
|
76
76
|
});
|
|
77
77
|
document.addEventListener('protvista-click', function (e) {
|
|
78
78
|
if (typeof e.detail !== 'undefined') {
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
let showInteraction = false;
|
|
80
|
+
let highlightQuery = undefined;
|
|
81
81
|
// Create query object from event data
|
|
82
82
|
if (e.detail.start && e.detail.end) {
|
|
83
83
|
highlightQuery = {
|
|
@@ -101,7 +101,7 @@ function subscribeToComponentEvents(wrapperCtx) {
|
|
|
101
101
|
highlightQuery['sideChain'] = true;
|
|
102
102
|
}
|
|
103
103
|
else {
|
|
104
|
-
|
|
104
|
+
let selColor = undefined;
|
|
105
105
|
if (e.detail.trackIndex > -1 && e.detail.feature.locations && e.detail.feature.locations[0].fragments[e.detail.trackIndex].color)
|
|
106
106
|
selColor = e.detail.feature.locations[0].fragments[e.detail.trackIndex].color;
|
|
107
107
|
if (typeof selColor == 'undefined' && e.detail.feature.color)
|
|
@@ -112,9 +112,9 @@ function subscribeToComponentEvents(wrapperCtx) {
|
|
|
112
112
|
selColor = { r: 65, g: 96, b: 91 };
|
|
113
113
|
}
|
|
114
114
|
else {
|
|
115
|
-
|
|
115
|
+
let isRgb = /rgb/g;
|
|
116
116
|
if (isRgb.test(selColor)) {
|
|
117
|
-
|
|
117
|
+
let rgbArr = selColor.substring(4, selColor.length - 1).split(',');
|
|
118
118
|
selColor = { r: rgbArr[0], g: rgbArr[1], b: rgbArr[2] };
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -125,15 +125,15 @@ function subscribeToComponentEvents(wrapperCtx) {
|
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
const elementTypeArrForRange = ['uniprot', 'pfam', 'cath', 'scop', 'strand', 'helice'];
|
|
129
|
+
const elementTypeArrForSingle = ['chain', 'quality', 'quality_outlier', 'binding site', 'alternate conformer'];
|
|
130
130
|
document.addEventListener('PDB.seqViewer.click', function (e) {
|
|
131
131
|
if (typeof e.eventData !== 'undefined') {
|
|
132
132
|
// Abort if entryid and entityid do not match or viewer type is unipdb
|
|
133
133
|
// if(e.eventData.entryId != scope.pdbId) return;
|
|
134
134
|
if (typeof e.eventData.elementData !== 'undefined' && elementTypeArrForSingle.indexOf(e.eventData.elementData.elementType) > -1) {
|
|
135
135
|
// Create query object from event data
|
|
136
|
-
|
|
136
|
+
const highlightQuery = {
|
|
137
137
|
entity_id: e.eventData.entityId,
|
|
138
138
|
struct_asym_id: e.eventData.elementData.pathData.struct_asym_id,
|
|
139
139
|
start_residue_number: e.eventData.residueNumber,
|
|
@@ -145,9 +145,9 @@ function subscribeToComponentEvents(wrapperCtx) {
|
|
|
145
145
|
wrapperCtx.visual.select({ data: [highlightQuery] });
|
|
146
146
|
}
|
|
147
147
|
else if (typeof e.eventData.elementData !== 'undefined' && elementTypeArrForRange.indexOf(e.eventData.elementData.elementType) > -1) {
|
|
148
|
-
|
|
148
|
+
const seqColorArray = e.eventData.elementData.color;
|
|
149
149
|
// Create query object from event data
|
|
150
|
-
|
|
150
|
+
const highlightQuery = {
|
|
151
151
|
entity_id: e.eventData.entityId,
|
|
152
152
|
struct_asym_id: e.eventData.elementData.pathData.struct_asym_id,
|
|
153
153
|
start_residue_number: e.eventData.elementData.pathData.start.residue_number,
|
|
@@ -165,7 +165,7 @@ function subscribeToComponentEvents(wrapperCtx) {
|
|
|
165
165
|
// if(e.eventData.entryId != scope.pdbId) return;
|
|
166
166
|
if (typeof e.eventData.elementData !== 'undefined' && elementTypeArrForSingle.indexOf(e.eventData.elementData.elementType) > -1) {
|
|
167
167
|
// Create query object from event data
|
|
168
|
-
|
|
168
|
+
let highlightQuery = {
|
|
169
169
|
entity_id: e.eventData.entityId,
|
|
170
170
|
struct_asym_id: e.eventData.elementData.pathData.struct_asym_id,
|
|
171
171
|
start_residue_number: e.eventData.residueNumber,
|
|
@@ -176,7 +176,7 @@ function subscribeToComponentEvents(wrapperCtx) {
|
|
|
176
176
|
}
|
|
177
177
|
else if (typeof e.eventData.elementData !== 'undefined' && elementTypeArrForRange.indexOf(e.eventData.elementData.elementType) > -1) {
|
|
178
178
|
// Create query object from event data
|
|
179
|
-
|
|
179
|
+
let highlightQuery = {
|
|
180
180
|
entity_id: e.eventData.entityId,
|
|
181
181
|
struct_asym_id: e.eventData.elementData.pathData.struct_asym_id,
|
|
182
182
|
start_residue_number: e.eventData.elementData.pathData.start.residue_number,
|
|
@@ -1,152 +1,108 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.superpositionExportHierarchy = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return [4 /*yield*/, plugin.runTask(_superpositionExportHierarchy(plugin, options), { useOverlay: true })];
|
|
20
|
-
case 1:
|
|
21
|
-
_a.sent();
|
|
22
|
-
return [3 /*break*/, 3];
|
|
23
|
-
case 2:
|
|
24
|
-
e_1 = _a.sent();
|
|
25
|
-
console.error(e_1);
|
|
26
|
-
plugin.log.error("Model export failed. See console for details.");
|
|
27
|
-
return [3 /*break*/, 3];
|
|
28
|
-
case 3: return [2 /*return*/];
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
4
|
+
const utf8_1 = require("Molstar/mol-io/common/utf8");
|
|
5
|
+
const structure_1 = require("Molstar/mol-model/structure");
|
|
6
|
+
const mol_task_1 = require("Molstar/mol-task");
|
|
7
|
+
const date_1 = require("Molstar/mol-util/date");
|
|
8
|
+
const download_1 = require("Molstar/mol-util/download");
|
|
9
|
+
const zip_1 = require("Molstar/mol-util/zip/zip");
|
|
10
|
+
const commands_1 = require("Molstar/mol-plugin/commands");
|
|
11
|
+
async function superpositionExportHierarchy(plugin, options) {
|
|
12
|
+
try {
|
|
13
|
+
await plugin.runTask(_superpositionExportHierarchy(plugin, options), { useOverlay: true });
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
console.error(e);
|
|
17
|
+
plugin.log.error(`Model export failed. See console for details.`);
|
|
18
|
+
}
|
|
32
19
|
}
|
|
33
20
|
exports.superpositionExportHierarchy = superpositionExportHierarchy;
|
|
34
21
|
function _superpositionExportHierarchy(plugin, options) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
plugin.log.warn("[Export] Skipping ".concat((_l = _s.cell.obj) === null || _l === void 0 ? void 0 : _l.label, ": Non-atomic model exports not supported."));
|
|
81
|
-
return [3 /*break*/, 6];
|
|
82
|
-
}
|
|
83
|
-
name_1 = entryMap.has(s.model.entryId)
|
|
84
|
-
? "".concat(s.model.entryId, "_").concat(entryMap.get(s.model.entryId) + 1, ".").concat(format)
|
|
85
|
-
: "".concat(s.model.entryId, ".").concat(format);
|
|
86
|
-
entryMap.set(s.model.entryId, ((_m = entryMap.get(s.model.entryId)) !== null && _m !== void 0 ? _m : 0) + 1);
|
|
87
|
-
return [4 /*yield*/, ctx.update({ message: "Exporting ".concat(s.model.entryId, "..."), isIndeterminate: true, canAbort: false })];
|
|
88
|
-
case 3:
|
|
89
|
-
_o.sent();
|
|
90
|
-
if (!(s.elementCount > 100000)) return [3 /*break*/, 5];
|
|
91
|
-
// Give UI chance to update, only needed for larger structures.
|
|
92
|
-
return [4 /*yield*/, new Promise(function (res) { return setTimeout(res, 50); })];
|
|
93
|
-
case 4:
|
|
94
|
-
// Give UI chance to update, only needed for larger structures.
|
|
95
|
-
_o.sent();
|
|
96
|
-
_o.label = 5;
|
|
97
|
-
case 5:
|
|
98
|
-
try {
|
|
99
|
-
files.push([name_1, (0, structure_1.to_mmCIF)(s.model.entryId, s, format === 'bcif', { copyAllCategories: true })]);
|
|
100
|
-
}
|
|
101
|
-
catch (e) {
|
|
102
|
-
if (format === 'cif' && s.elementCount > 2000000) {
|
|
103
|
-
plugin.log.warn("[Export] The structure might be too big to be exported as Text CIF, consider using the BinaryCIF format instead.");
|
|
104
|
-
}
|
|
105
|
-
throw e;
|
|
106
|
-
}
|
|
107
|
-
_o.label = 6;
|
|
108
|
-
case 6:
|
|
109
|
-
_i++;
|
|
110
|
-
return [3 /*break*/, 2];
|
|
111
|
-
case 7:
|
|
112
|
-
if (files.length === 0) {
|
|
113
|
-
commands_1.PluginCommands.Toast.Show(plugin, {
|
|
114
|
-
title: 'Export Models',
|
|
115
|
-
message: 'No visible structure in the 3D view to export!',
|
|
116
|
-
key: 'superposition-toast-1',
|
|
117
|
-
timeoutMs: 7000
|
|
118
|
-
});
|
|
119
|
-
return [2 /*return*/];
|
|
120
|
-
}
|
|
121
|
-
if (!(files.length === 1)) return [3 /*break*/, 8];
|
|
122
|
-
(0, download_1.download)(new Blob([files[0][1]]), files[0][0]);
|
|
123
|
-
return [3 /*break*/, 11];
|
|
124
|
-
case 8:
|
|
125
|
-
if (!(files.length > 1)) return [3 /*break*/, 11];
|
|
126
|
-
zipData = {};
|
|
127
|
-
for (_c = 0, files_1 = files; _c < files_1.length; _c++) {
|
|
128
|
-
_d = files_1[_c], fn = _d[0], data = _d[1];
|
|
129
|
-
if (data instanceof Uint8Array) {
|
|
130
|
-
zipData[fn] = data;
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
bytes = new Uint8Array((0, utf8_1.utf8ByteCount)(data));
|
|
134
|
-
(0, utf8_1.utf8Write)(bytes, 0, data);
|
|
135
|
-
zipData[fn] = bytes;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
return [4 /*yield*/, ctx.update({ message: "Compressing Data...", isIndeterminate: true, canAbort: false })];
|
|
139
|
-
case 9:
|
|
140
|
-
_o.sent();
|
|
141
|
-
return [4 /*yield*/, (0, zip_1.zip)(ctx, zipData)];
|
|
142
|
-
case 10:
|
|
143
|
-
buffer = _o.sent();
|
|
144
|
-
(0, download_1.download)(new Blob([new Uint8Array(buffer, 0, buffer.byteLength)]), "structures_".concat((0, date_1.getFormattedTime)(), ".zip"));
|
|
145
|
-
_o.label = 11;
|
|
146
|
-
case 11:
|
|
147
|
-
plugin.log.info("[Export] Done.");
|
|
148
|
-
return [2 /*return*/];
|
|
22
|
+
return mol_task_1.Task.create('Export', async (ctx) => {
|
|
23
|
+
await ctx.update({ message: 'Exporting...', isIndeterminate: true, canAbort: false });
|
|
24
|
+
const format = options?.format ?? 'cif';
|
|
25
|
+
// const { structures } = plugin.managers.structure.hierarchy.current;
|
|
26
|
+
const customState = plugin.customState;
|
|
27
|
+
const superpositionState = customState.superpositionState;
|
|
28
|
+
const segmentIndex = superpositionState.activeSegment - 1;
|
|
29
|
+
const files = [];
|
|
30
|
+
const entryMap = new Map();
|
|
31
|
+
const structures = superpositionState.loadedStructs[segmentIndex].slice();
|
|
32
|
+
if (superpositionState.alphafold.ref)
|
|
33
|
+
structures.push(`AF-${customState.initParams.moleculeId}`);
|
|
34
|
+
for (const molId of structures) {
|
|
35
|
+
const modelRef = superpositionState.models[molId];
|
|
36
|
+
if (!modelRef)
|
|
37
|
+
continue;
|
|
38
|
+
let isStrHidden = false;
|
|
39
|
+
const _s = plugin.managers.structure.hierarchy.current.refs.get(modelRef);
|
|
40
|
+
if (_s.cell.state.isHidden)
|
|
41
|
+
isStrHidden = true;
|
|
42
|
+
for (const strComp of _s.components) {
|
|
43
|
+
if (strComp.cell.state.isHidden)
|
|
44
|
+
isStrHidden = true;
|
|
45
|
+
}
|
|
46
|
+
if (isStrHidden)
|
|
47
|
+
continue;
|
|
48
|
+
const s = _s.transform?.cell.obj?.data ?? _s.cell.obj?.data;
|
|
49
|
+
if (!s)
|
|
50
|
+
continue;
|
|
51
|
+
if (s.models.length > 1) {
|
|
52
|
+
plugin.log.warn(`[Export] Skipping ${_s.cell.obj?.label}: Multimodel exports not supported.`);
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (s.units.some((u) => !structure_1.Unit.isAtomic(u))) {
|
|
56
|
+
plugin.log.warn(`[Export] Skipping ${_s.cell.obj?.label}: Non-atomic model exports not supported.`);
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const name = entryMap.has(s.model.entryId)
|
|
60
|
+
? `${s.model.entryId}_${entryMap.get(s.model.entryId) + 1}.${format}`
|
|
61
|
+
: `${s.model.entryId}.${format}`;
|
|
62
|
+
entryMap.set(s.model.entryId, (entryMap.get(s.model.entryId) ?? 0) + 1);
|
|
63
|
+
await ctx.update({ message: `Exporting ${s.model.entryId}...`, isIndeterminate: true, canAbort: false });
|
|
64
|
+
if (s.elementCount > 100000) {
|
|
65
|
+
// Give UI chance to update, only needed for larger structures.
|
|
66
|
+
await new Promise(res => setTimeout(res, 50));
|
|
149
67
|
}
|
|
150
|
-
|
|
151
|
-
|
|
68
|
+
try {
|
|
69
|
+
files.push([name, (0, structure_1.to_mmCIF)(s.model.entryId, s, format === 'bcif', { copyAllCategories: true })]);
|
|
70
|
+
}
|
|
71
|
+
catch (e) {
|
|
72
|
+
if (format === 'cif' && s.elementCount > 2000000) {
|
|
73
|
+
plugin.log.warn(`[Export] The structure might be too big to be exported as Text CIF, consider using the BinaryCIF format instead.`);
|
|
74
|
+
}
|
|
75
|
+
throw e;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (files.length === 0) {
|
|
79
|
+
commands_1.PluginCommands.Toast.Show(plugin, {
|
|
80
|
+
title: 'Export Models',
|
|
81
|
+
message: 'No visible structure in the 3D view to export!',
|
|
82
|
+
key: 'superposition-toast-1',
|
|
83
|
+
timeoutMs: 7000
|
|
84
|
+
});
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (files.length === 1) {
|
|
88
|
+
(0, download_1.download)(new Blob([files[0][1]]), files[0][0]);
|
|
89
|
+
}
|
|
90
|
+
else if (files.length > 1) {
|
|
91
|
+
const zipData = {};
|
|
92
|
+
for (const [fn, data] of files) {
|
|
93
|
+
if (data instanceof Uint8Array) {
|
|
94
|
+
zipData[fn] = data;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
const bytes = new Uint8Array((0, utf8_1.utf8ByteCount)(data));
|
|
98
|
+
(0, utf8_1.utf8Write)(bytes, 0, data);
|
|
99
|
+
zipData[fn] = bytes;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
await ctx.update({ message: `Compressing Data...`, isIndeterminate: true, canAbort: false });
|
|
103
|
+
const buffer = await (0, zip_1.zip)(ctx, zipData);
|
|
104
|
+
(0, download_1.download)(new Blob([new Uint8Array(buffer, 0, buffer.byteLength)]), `structures_${(0, date_1.getFormattedTime)()}.zip`);
|
|
105
|
+
}
|
|
106
|
+
plugin.log.info(`[Export] Done.`);
|
|
107
|
+
});
|
|
152
108
|
}
|
|
@@ -7,7 +7,7 @@ declare const SuperpositionFocusRepresentationParams: (plugin: PluginContext) =>
|
|
|
7
7
|
[x: string]: any;
|
|
8
8
|
}>>;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
type SuperpositionFocusRepresentationProps = PD.ValuesFor<ReturnType<typeof SuperpositionFocusRepresentationParams>>;
|
|
11
11
|
export declare enum SuperpositionFocusRepresentationTags {
|
|
12
12
|
SurrSel = "superposition-focus-surr-sel",
|
|
13
13
|
SurrRepr = "superposition-focus-surr-repr"
|