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,18 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SuperpositionFocusRepresentation = exports.SuperpositionFocusRepresentationTags = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
for (
|
|
66
|
-
|
|
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
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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
|
-
|
|
89
|
+
this.clear(mol_state_1.StateTransform.RootRef);
|
|
113
90
|
if (entry)
|
|
114
|
-
|
|
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
|
-
|
|
146
|
-
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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,
|
|
14
|
+
buildIndex(structures[i], indexMap, i, options?.traceOnly ?? true, includeResidueTest);
|
|
16
15
|
}
|
|
17
|
-
|
|
16
|
+
const index = Array.from(indexMap.values());
|
|
18
17
|
// TODO: support non-first structure pivots
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
for (
|
|
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
|
-
|
|
30
|
-
|
|
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
|
|
33
|
+
entries.push({ transform, pivot: p.i, other: p.j });
|
|
36
34
|
}
|
|
37
35
|
}
|
|
38
36
|
}
|
|
39
|
-
return { entries
|
|
37
|
+
return { entries, zeroOverlapPairs, failedPairs };
|
|
40
38
|
}
|
|
41
39
|
exports.alignAndSuperposeWithSIFTSMapping = alignAndSuperposeWithSIFTSMapping;
|
|
42
40
|
function getPositionTables(index, pivot, other, N) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
for (
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
49
|
+
const l = Math.min(a[2] - a[1], b[2] - b[1]);
|
|
53
50
|
// TODO: check if residue types match?
|
|
54
|
-
for (
|
|
55
|
-
|
|
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
|
-
|
|
70
|
-
for (
|
|
66
|
+
const pairwiseCounts = [];
|
|
67
|
+
for (let i = 0; i < N; i++) {
|
|
71
68
|
pairwiseCounts[i] = [];
|
|
72
|
-
for (
|
|
69
|
+
for (let j = 0; j < N; j++)
|
|
73
70
|
pairwiseCounts[i][j] = 0;
|
|
74
71
|
}
|
|
75
|
-
for (
|
|
76
|
-
|
|
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
|
-
|
|
81
|
-
for (
|
|
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
|
-
|
|
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
|
-
|
|
90
|
-
for (
|
|
91
|
-
ret[j - 1] = { i: 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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
|
|
108
|
+
const { elements, model } = unit;
|
|
115
109
|
loc.unit = unit;
|
|
116
|
-
|
|
110
|
+
const map = sifts_mapping_1.SIFTSMapping.Provider.get(model).value;
|
|
117
111
|
if (!map)
|
|
118
112
|
return;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
-
|
|
118
|
+
const chainSegment = chainsIt.move();
|
|
125
119
|
residuesIt.setSegment(chainSegment);
|
|
126
120
|
while (residuesIt.hasNext) {
|
|
127
|
-
|
|
128
|
-
|
|
121
|
+
const residueSegment = residuesIt.move();
|
|
122
|
+
const rI = residueSegment.index;
|
|
129
123
|
if (!dbName[rI])
|
|
130
124
|
continue;
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
|
|
140
|
+
const key = `${dbName[rI]}-${accession[rI].split('-')[0]}-${num[rI]}`;
|
|
147
141
|
if (!index.has(key)) {
|
|
148
|
-
index.set(key, { key
|
|
142
|
+
index.set(key, { key, pivots: { [sI]: [unit, start, end] } });
|
|
149
143
|
}
|
|
150
144
|
else {
|
|
151
|
-
|
|
145
|
+
const entry = index.get(key);
|
|
152
146
|
if (!entry.pivots[sI]) {
|
|
153
147
|
entry.pivots[sI] = [unit, start, end];
|
|
154
148
|
}
|
package/lib/superposition.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Mat4 } from 'Molstar/mol-math/linear-algebra';
|
|
2
2
|
import { PluginContext } from 'Molstar/mol-plugin/context';
|
|
3
|
-
|
|
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
|
|
10
|
+
export type SuperpositionData = {
|
|
11
11
|
data: ClusterRec[];
|
|
12
12
|
matrix: Mat4[];
|
|
13
13
|
};
|