drugflow-molstar 0.2.1 → 0.2.2
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/LICENSE +201 -201
- package/README.md +15 -15
- package/build/{drugflow-molstar-component-0.2.1.js → drugflow-molstar-component-0.2.2.js} +4 -4
- package/build/drugflow-molstar-light.css +1 -1
- package/build/{drugflow-molstar-plugin-0.2.1.js → drugflow-molstar-plugin-0.2.2.js} +2 -2
- package/lib/alphafold-transparency.d.ts +6 -6
- package/lib/alphafold-transparency.js +153 -153
- package/lib/app/molstar/lib/apps/docking-viewer/index.html +37 -0
- package/lib/app/molstar/lib/apps/viewer/embedded.html +44 -0
- package/lib/app/molstar/lib/apps/viewer/favicon.ico +0 -0
- package/lib/app/molstar/lib/apps/viewer/index.html +110 -0
- package/lib/app/molstar/lib/examples/alpha-orbitals/index.html +73 -0
- package/lib/app/molstar/lib/examples/basic-wrapper/index.html +138 -0
- package/lib/app/molstar/lib/examples/lighting/index.html +89 -0
- package/lib/app/molstar/lib/examples/proteopedia-wrapper/index.html +237 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/base.scss +33 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/controls-base.scss +334 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/controls.scss +419 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/help.scss +27 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/line-graph.scss +68 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/log.scss +100 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/misc.scss +644 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/sequence.scss +126 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/slider.scss +166 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/tasks.scss +99 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/toast.scss +84 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/transformer.scss +164 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/viewport.scss +128 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/layout/common.scss +72 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/layout/controls-landscape.scss +90 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/layout/controls-outside.scss +99 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/layout/controls-portrait.scss +109 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/layout.scss +41 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/logo.scss +13 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/normalize.scss +210 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/ui.scss +41 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/variables.scss +86 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/blue.scss +2 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/colors/blue.scss +24 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/colors/dark.scss +24 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/colors/light.scss +30 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/dark.scss +2 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/light.scss +2 -0
- package/lib/custom-events.d.ts +4 -4
- package/lib/custom-events.js +56 -56
- package/lib/domain-annotations/behavior.d.ts +5 -5
- package/lib/domain-annotations/behavior.js +49 -49
- package/lib/domain-annotations/color.d.ts +10 -10
- package/lib/domain-annotations/color.js +78 -78
- package/lib/domain-annotations/prop.d.ts +35 -35
- package/lib/domain-annotations/prop.js +160 -160
- package/lib/drugflow-molstar-component-build-0.1.2.js +4268 -0
- package/lib/drugflow-molstar-component-build-0.1.2.js.LICENSE.txt +24 -0
- package/lib/drugflow-molstar-component-build-0.1.2.js.map +1 -0
- package/lib/drugflow-molstar-component-build-0.1.3.js +2 -0
- package/lib/drugflow-molstar-component-build-0.1.3.js.LICENSE.txt +24 -0
- package/lib/drugflow-molstar-component-build-0.1.4.js +2 -0
- package/lib/drugflow-molstar-component-build-0.1.4.js.LICENSE.txt +24 -0
- package/lib/drugflow-molstar-component-build-0.1.6.js +2 -0
- package/lib/drugflow-molstar-component-build-0.1.6.js.LICENSE.txt +24 -0
- package/lib/drugflow-molstar-component-build-0.2.2.js +2 -0
- package/lib/drugflow-molstar-component-build-0.2.2.js.LICENSE.txt +24 -0
- package/lib/helpers.d.ts +82 -81
- package/lib/helpers.js +278 -278
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1274 -1239
- package/lib/labels.d.ts +2 -2
- package/lib/labels.js +42 -42
- package/lib/loci-details.d.ts +27 -27
- package/lib/loci-details.js +128 -128
- package/lib/pdbe-molstar-component-build-3.1.2.js +2 -0
- package/lib/pdbe-molstar-component-build-3.1.2.js.LICENSE.txt +24 -0
- package/lib/sifts-mapping.d.ts +16 -16
- package/lib/sifts-mapping.js +83 -83
- package/lib/sifts-mappings-behaviour.d.ts +5 -5
- package/lib/sifts-mappings-behaviour.js +64 -64
- package/lib/spec.d.ts +76 -76
- package/lib/spec.js +105 -105
- package/lib/subscribe-events.d.ts +1 -1
- package/lib/subscribe-events.js +194 -194
- package/lib/superposition-export.d.ts +4 -4
- package/lib/superposition-export.js +152 -152
- package/lib/superposition-focus-representation.d.ts +16 -16
- package/lib/superposition-focus-representation.js +153 -153
- package/lib/superposition-sifts-mapping.d.ts +22 -22
- package/lib/superposition-sifts-mapping.js +159 -159
- package/lib/superposition.d.ts +18 -18
- package/lib/superposition.js +794 -794
- package/lib/ui/alphafold-superposition.d.ts +56 -56
- package/lib/ui/alphafold-superposition.js +178 -178
- package/lib/ui/alphafold-tranparency.d.ts +22 -22
- package/lib/ui/alphafold-tranparency.js +65 -65
- package/lib/ui/annotation-controls.d.ts +24 -24
- package/lib/ui/annotation-controls.js +166 -166
- package/lib/ui/export-superposition.d.ts +6 -6
- package/lib/ui/export-superposition.js +71 -71
- package/lib/ui/pdbe-left-panel.d.ts +18 -18
- package/lib/ui/pdbe-left-panel.js +167 -167
- package/lib/ui/pdbe-screenshot-controls.d.ts +20 -20
- package/lib/ui/pdbe-screenshot-controls.js +101 -101
- package/lib/ui/pdbe-structure-controls.d.ts +17 -17
- package/lib/ui/pdbe-structure-controls.js +70 -70
- package/lib/ui/pdbe-viewport-controls.d.ts +6 -6
- package/lib/ui/pdbe-viewport-controls.js +56 -56
- package/lib/ui/segment-tree.d.ts +18 -18
- package/lib/ui/segment-tree.js +804 -804
- package/lib/ui/superposition-components.d.ts +10 -10
- package/lib/ui/superposition-components.js +435 -435
- package/lib/ui/superposition-viewport.d.ts +5 -5
- package/lib/ui/superposition-viewport.js +23 -23
- package/package.json +79 -79
- /package/build/{drugflow-molstar-0.2.1.css → drugflow-molstar-0.2.2.css} +0 -0
- /package/build/{drugflow-molstar-plugin-0.2.1.js.LICENSE.txt → drugflow-molstar-plugin-0.2.2.js.LICENSE.txt} +0 -0
|
@@ -1,153 +1,153 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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);
|
|
16
|
-
return {
|
|
17
|
-
expandRadius: param_definition_1.ParamDefinition.Numeric(5, { min: 1, max: 10, step: 1 }),
|
|
18
|
-
surroundingsParams: param_definition_1.ParamDefinition.Group(reprParams, {
|
|
19
|
-
label: 'Surroundings',
|
|
20
|
-
customDefault: (0, structure_representation_params_1.createStructureRepresentationParams)(plugin, void 0, { type: 'ball-and-stick', size: 'physical', typeParams: { sizeFactor: 0.16 }, sizeParams: { scale: 0.3 } })
|
|
21
|
-
})
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
var SuperpositionFocusRepresentationTags;
|
|
25
|
-
(function (SuperpositionFocusRepresentationTags) {
|
|
26
|
-
SuperpositionFocusRepresentationTags["SurrSel"] = "superposition-focus-surr-sel";
|
|
27
|
-
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);
|
|
44
|
-
// Selections
|
|
45
|
-
if (!refs[SuperpositionFocusRepresentationTags.SurrSel]) {
|
|
46
|
-
refs[SuperpositionFocusRepresentationTags.SurrSel] = builder
|
|
47
|
-
.to(cell)
|
|
48
|
-
.apply(transforms_1.StateTransforms.Model.StructureSelectionFromExpression, { expression: builder_1.MolScriptBuilder.struct.generator.empty(), label: this.surrLabel }, { tags: SuperpositionFocusRepresentationTags.SurrSel }).ref;
|
|
49
|
-
}
|
|
50
|
-
// Representations
|
|
51
|
-
if (!refs[SuperpositionFocusRepresentationTags.SurrRepr]) {
|
|
52
|
-
refs[SuperpositionFocusRepresentationTags.SurrRepr] = builder
|
|
53
|
-
.to(refs[SuperpositionFocusRepresentationTags.SurrSel])
|
|
54
|
-
.apply(transforms_1.StateTransforms.Representation.StructureRepresentation3D, this.params.surroundingsParams, { tags: SuperpositionFocusRepresentationTags.SurrRepr }).ref;
|
|
55
|
-
}
|
|
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));
|
|
61
|
-
if (surrs.length === 0)
|
|
62
|
-
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 })); });
|
|
68
|
-
}
|
|
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
|
-
});
|
|
105
|
-
});
|
|
106
|
-
};
|
|
107
|
-
SuperpositionFocusRepresentationBehavior.prototype.register = function (ref) {
|
|
108
|
-
var _this = this;
|
|
109
|
-
this.subscribeObservable(this.plugin.managers.structure.focus.behaviors.current, function (entry) {
|
|
110
|
-
// if (entry) this.focus(entry.loci);
|
|
111
|
-
// else this.clear(StateTransform.RootRef);
|
|
112
|
-
_this.clear(mol_state_1.StateTransform.RootRef);
|
|
113
|
-
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
|
-
});
|
|
143
|
-
});
|
|
144
|
-
};
|
|
145
|
-
return SuperpositionFocusRepresentationBehavior;
|
|
146
|
-
}(behavior_1.PluginBehavior.WithSubscribers));
|
|
147
|
-
exports.SuperpositionFocusRepresentation = behavior_1.PluginBehavior.create({
|
|
148
|
-
name: 'create-superposition-focus-representation',
|
|
149
|
-
display: { name: 'Superposition Focus Representation' },
|
|
150
|
-
category: 'interaction',
|
|
151
|
-
ctor: SuperpositionFocusRepresentationBehavior,
|
|
152
|
-
params: function (_, plugin) { return SuperpositionFocusRepresentationParams(plugin); }
|
|
153
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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);
|
|
16
|
+
return {
|
|
17
|
+
expandRadius: param_definition_1.ParamDefinition.Numeric(5, { min: 1, max: 10, step: 1 }),
|
|
18
|
+
surroundingsParams: param_definition_1.ParamDefinition.Group(reprParams, {
|
|
19
|
+
label: 'Surroundings',
|
|
20
|
+
customDefault: (0, structure_representation_params_1.createStructureRepresentationParams)(plugin, void 0, { type: 'ball-and-stick', size: 'physical', typeParams: { sizeFactor: 0.16 }, sizeParams: { scale: 0.3 } })
|
|
21
|
+
})
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
var SuperpositionFocusRepresentationTags;
|
|
25
|
+
(function (SuperpositionFocusRepresentationTags) {
|
|
26
|
+
SuperpositionFocusRepresentationTags["SurrSel"] = "superposition-focus-surr-sel";
|
|
27
|
+
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);
|
|
44
|
+
// Selections
|
|
45
|
+
if (!refs[SuperpositionFocusRepresentationTags.SurrSel]) {
|
|
46
|
+
refs[SuperpositionFocusRepresentationTags.SurrSel] = builder
|
|
47
|
+
.to(cell)
|
|
48
|
+
.apply(transforms_1.StateTransforms.Model.StructureSelectionFromExpression, { expression: builder_1.MolScriptBuilder.struct.generator.empty(), label: this.surrLabel }, { tags: SuperpositionFocusRepresentationTags.SurrSel }).ref;
|
|
49
|
+
}
|
|
50
|
+
// Representations
|
|
51
|
+
if (!refs[SuperpositionFocusRepresentationTags.SurrRepr]) {
|
|
52
|
+
refs[SuperpositionFocusRepresentationTags.SurrRepr] = builder
|
|
53
|
+
.to(refs[SuperpositionFocusRepresentationTags.SurrSel])
|
|
54
|
+
.apply(transforms_1.StateTransforms.Representation.StructureRepresentation3D, this.params.surroundingsParams, { tags: SuperpositionFocusRepresentationTags.SurrRepr }).ref;
|
|
55
|
+
}
|
|
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));
|
|
61
|
+
if (surrs.length === 0)
|
|
62
|
+
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 })); });
|
|
68
|
+
}
|
|
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
|
+
});
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
SuperpositionFocusRepresentationBehavior.prototype.register = function (ref) {
|
|
108
|
+
var _this = this;
|
|
109
|
+
this.subscribeObservable(this.plugin.managers.structure.focus.behaviors.current, function (entry) {
|
|
110
|
+
// if (entry) this.focus(entry.loci);
|
|
111
|
+
// else this.clear(StateTransform.RootRef);
|
|
112
|
+
_this.clear(mol_state_1.StateTransform.RootRef);
|
|
113
|
+
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
|
+
});
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
return SuperpositionFocusRepresentationBehavior;
|
|
146
|
+
}(behavior_1.PluginBehavior.WithSubscribers));
|
|
147
|
+
exports.SuperpositionFocusRepresentation = behavior_1.PluginBehavior.create({
|
|
148
|
+
name: 'create-superposition-focus-representation',
|
|
149
|
+
display: { name: 'Superposition Focus Representation' },
|
|
150
|
+
category: 'interaction',
|
|
151
|
+
ctor: SuperpositionFocusRepresentationBehavior,
|
|
152
|
+
params: function (_, plugin) { return SuperpositionFocusRepresentationParams(plugin); }
|
|
153
|
+
});
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { MinimizeRmsd } from 'Molstar/mol-math/linear-algebra/3d/minimize-rmsd';
|
|
2
|
-
import { ElementIndex, ResidueIndex } from 'Molstar/mol-model/structure/model/indexing';
|
|
3
|
-
import { StructureElement } from 'Molstar/mol-model/structure/structure/element';
|
|
4
|
-
import { Structure } from 'Molstar/mol-model/structure';
|
|
5
|
-
import { Unit } from 'Molstar/mol-model/structure/structure/unit';
|
|
6
|
-
export interface AlignmentResultEntry {
|
|
7
|
-
transform: MinimizeRmsd.Result;
|
|
8
|
-
pivot: number;
|
|
9
|
-
other: number;
|
|
10
|
-
}
|
|
11
|
-
export interface AlignmentResult {
|
|
12
|
-
entries: AlignmentResultEntry[];
|
|
13
|
-
zeroOverlapPairs: [number, number][];
|
|
14
|
-
failedPairs: [number, number][];
|
|
15
|
-
}
|
|
16
|
-
declare type IncludeResidueTest = (traceElementOrFirstAtom: StructureElement.Location<Unit.Atomic>, residueIndex: ResidueIndex, startIndex: ElementIndex, endIndex: ElementIndex) => boolean;
|
|
17
|
-
export declare function alignAndSuperposeWithSIFTSMapping(structures: Structure[], options?: {
|
|
18
|
-
traceOnly?: boolean;
|
|
19
|
-
includeResidueTest?: IncludeResidueTest;
|
|
20
|
-
applyTestIndex?: number[];
|
|
21
|
-
}): AlignmentResult;
|
|
22
|
-
export {};
|
|
1
|
+
import { MinimizeRmsd } from 'Molstar/mol-math/linear-algebra/3d/minimize-rmsd';
|
|
2
|
+
import { ElementIndex, ResidueIndex } from 'Molstar/mol-model/structure/model/indexing';
|
|
3
|
+
import { StructureElement } from 'Molstar/mol-model/structure/structure/element';
|
|
4
|
+
import { Structure } from 'Molstar/mol-model/structure';
|
|
5
|
+
import { Unit } from 'Molstar/mol-model/structure/structure/unit';
|
|
6
|
+
export interface AlignmentResultEntry {
|
|
7
|
+
transform: MinimizeRmsd.Result;
|
|
8
|
+
pivot: number;
|
|
9
|
+
other: number;
|
|
10
|
+
}
|
|
11
|
+
export interface AlignmentResult {
|
|
12
|
+
entries: AlignmentResultEntry[];
|
|
13
|
+
zeroOverlapPairs: [number, number][];
|
|
14
|
+
failedPairs: [number, number][];
|
|
15
|
+
}
|
|
16
|
+
declare type IncludeResidueTest = (traceElementOrFirstAtom: StructureElement.Location<Unit.Atomic>, residueIndex: ResidueIndex, startIndex: ElementIndex, endIndex: ElementIndex) => boolean;
|
|
17
|
+
export declare function alignAndSuperposeWithSIFTSMapping(structures: Structure[], options?: {
|
|
18
|
+
traceOnly?: boolean;
|
|
19
|
+
includeResidueTest?: IncludeResidueTest;
|
|
20
|
+
applyTestIndex?: number[];
|
|
21
|
+
}): AlignmentResult;
|
|
22
|
+
export {};
|