drugflow-molstar 0.4.6 → 0.4.8
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.8.css +1 -0
- package/build/drugflow-molstar-component-0.4.8.js +25 -0
- package/build/drugflow-molstar-plugin-0.4.8.js +2 -0
- package/build/drugflow-molstar-plugin-0.4.8.js.LICENSE.txt +39 -0
- package/lib/alphafold-transparency.js +157 -62
- package/lib/contact.d.ts +7 -14
- package/lib/contact.js +68 -72
- package/lib/custom-events.js +15 -15
- package/lib/domain-annotations/behavior.d.ts +1 -1
- package/lib/domain-annotations/behavior.js +24 -20
- package/lib/domain-annotations/color.js +22 -22
- package/lib/domain-annotations/prop.js +111 -62
- package/lib/drugflow-molstar-component-build-0.4.7.js +2 -0
- package/lib/drugflow-molstar-component-build-0.4.7.js.LICENSE.txt +24 -0
- package/lib/drugflow-molstar-component-build-0.4.8.js +2 -0
- package/lib/drugflow-molstar-component-build-0.4.8.js.LICENSE.txt +24 -0
- package/lib/helpers.d.ts +3 -3
- package/lib/helpers.js +94 -89
- package/lib/index.d.ts +902 -1
- package/lib/index.js +2836 -1806
- package/lib/labels.d.ts +1 -1
- package/lib/labels.js +34 -20
- package/lib/loci-details.js +46 -34
- package/lib/sifts-mapping.js +32 -28
- package/lib/sifts-mappings-behaviour.d.ts +1 -1
- package/lib/sifts-mappings-behaviour.js +30 -26
- package/lib/spec.js +40 -52
- package/lib/structure_contact3d.d.ts +14 -21
- package/lib/structure_contact3d.js +46 -25
- package/lib/subscribe-events.js +18 -19
- package/lib/superposition-export.js +178 -102
- package/lib/superposition-focus-representation.d.ts +2 -2
- package/lib/superposition-focus-representation.js +131 -73
- package/lib/superposition-sifts-mapping.js +150 -105
- package/lib/superposition.js +810 -495
- package/lib/ui/alphafold-superposition.d.ts +1 -1
- package/lib/ui/alphafold-superposition.js +118 -94
- package/lib/ui/alphafold-tranparency.js +43 -27
- package/lib/ui/annotation-controls.js +89 -83
- package/lib/ui/export-superposition.d.ts +0 -1
- package/lib/ui/export-superposition.js +50 -32
- package/lib/ui/pdbe-left-panel.d.ts +0 -1
- package/lib/ui/pdbe-left-panel.js +105 -82
- package/lib/ui/pdbe-screenshot-controls.js +83 -54
- package/lib/ui/pdbe-structure-controls.js +57 -34
- package/lib/ui/pdbe-viewport-controls.js +29 -23
- package/lib/ui/segment-tree.js +663 -440
- package/lib/ui/superposition-components.js +312 -208
- package/lib/ui/superposition-viewport.js +18 -11
- package/package.json +3 -3
- package/build/drugflow-molstar-0.4.6.css +0 -1
- package/build/drugflow-molstar-component-0.4.6.js +0 -25
- package/build/drugflow-molstar-plugin-0.4.6.js +0 -2
- package/build/drugflow-molstar-plugin-0.4.6.js.LICENSE.txt +0 -64
|
@@ -44,7 +44,7 @@ type AfSuperpositionControlsState = {
|
|
|
44
44
|
export declare class AfSuperpositionControls extends PurePluginUIComponent<{}, AfSuperpositionControlsState> {
|
|
45
45
|
state: AfSuperpositionControlsState;
|
|
46
46
|
componentDidMount(): void;
|
|
47
|
-
get selection(): import("
|
|
47
|
+
get selection(): import("Molstar/mol-plugin-state/manager/structure/selection").StructureSelectionManager;
|
|
48
48
|
get customState(): any;
|
|
49
49
|
superposeDb: () => Promise<void>;
|
|
50
50
|
toggleOptions: () => void;
|
|
@@ -1,55 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.AfSuperpositionControls = exports.AlphafoldSuperpositionParams = exports.AlphafoldSuperpositionControls = exports.AlphafoldPaeControls =
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const base_1 = require("Molstar/mol-plugin-ui/base");
|
|
10
|
-
const icons_1 = require("Molstar/mol-plugin-ui/controls/icons");
|
|
11
|
-
const common_1 = require("Molstar/mol-plugin-ui/controls/common");
|
|
12
|
-
const param_definition_1 = require("Molstar/mol-util/param-definition");
|
|
13
|
-
const parameters_1 = require("Molstar/mol-plugin-ui/controls/parameters");
|
|
14
|
-
const superposition_1 = require("../superposition");
|
|
15
|
-
const d3_scale_1 = require("d3-scale");
|
|
16
|
-
const d3_axis_1 = require("d3-axis");
|
|
17
|
-
const d3_selection_1 = require("d3-selection");
|
|
18
|
-
const _InfoIcon = (0, jsx_runtime_1.jsx)("svg", { width: '24px', height: '24px', viewBox: '0 0 24 24', strokeWidth: '0.1px', children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z" }) });
|
|
19
|
-
function InfoIconSvg() { return _InfoIcon; }
|
|
3
|
+
exports.AfSuperpositionControls = exports.AlphafoldSuperpositionParams = exports.AlphafoldSuperpositionControls = exports.AlphafoldPaeControls = void 0;
|
|
20
4
|
exports.InfoIconSvg = InfoIconSvg;
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
var tslib_1 = require("tslib");
|
|
6
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
var react_1 = tslib_1.__importDefault(require("react"));
|
|
8
|
+
var base_1 = require("Molstar/mol-plugin-ui/base");
|
|
9
|
+
var icons_1 = require("Molstar/mol-plugin-ui/controls/icons");
|
|
10
|
+
var common_1 = require("Molstar/mol-plugin-ui/controls/common");
|
|
11
|
+
var param_definition_1 = require("Molstar/mol-util/param-definition");
|
|
12
|
+
var parameters_1 = require("Molstar/mol-plugin-ui/controls/parameters");
|
|
13
|
+
var superposition_1 = require("../superposition");
|
|
14
|
+
var d3_scale_1 = require("d3-scale");
|
|
15
|
+
var d3_axis_1 = require("d3-axis");
|
|
16
|
+
var d3_selection_1 = require("d3-selection");
|
|
17
|
+
var _InfoIcon = (0, jsx_runtime_1.jsx)("svg", { width: '24px', height: '24px', viewBox: '0 0 24 24', strokeWidth: '0.1px', children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z" }) });
|
|
18
|
+
function InfoIconSvg() { return _InfoIcon; }
|
|
19
|
+
var AlphafoldPaeControls = /** @class */ (function (_super) {
|
|
20
|
+
tslib_1.__extends(AlphafoldPaeControls, _super);
|
|
21
|
+
function AlphafoldPaeControls(props, context) {
|
|
22
|
+
var _this = _super.call(this, props, context) || this;
|
|
23
|
+
_this.axisBoxRef = react_1.default.createRef();
|
|
24
|
+
return _this;
|
|
25
|
+
}
|
|
26
|
+
AlphafoldPaeControls.prototype.defaultState = function () {
|
|
23
27
|
return {
|
|
24
28
|
isCollapsed: false,
|
|
25
29
|
header: 'AlphaFold PAE',
|
|
26
30
|
brand: { accent: 'gray', svg: icons_1.SuperpositionSvg },
|
|
27
31
|
isHidden: true
|
|
28
32
|
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
this.
|
|
33
|
-
|
|
34
|
-
componentDidMount() {
|
|
35
|
-
this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection, sel => {
|
|
36
|
-
const superpositionState = this.plugin.customState.superpositionState;
|
|
33
|
+
};
|
|
34
|
+
AlphafoldPaeControls.prototype.componentDidMount = function () {
|
|
35
|
+
var _this = this;
|
|
36
|
+
this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection, function (sel) {
|
|
37
|
+
var superpositionState = _this.plugin.customState.superpositionState;
|
|
37
38
|
if (superpositionState && superpositionState.alphafold.ref && superpositionState.alphafold.apiData.pae && superpositionState.alphafold.apiData.pae !== '' && superpositionState.alphafold.apiData.pae !== '') {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
_this.setState({ isHidden: false });
|
|
40
|
+
var domainMax = superpositionState.alphafold.apiData.length;
|
|
41
|
+
var x = (0, d3_scale_1.scaleLinear)().domain([0, domainMax]).range([0, 200]);
|
|
42
|
+
var xAxis = (0, d3_axis_1.axisBottom)(x).ticks(6).tickFormat(_this.formatTicks).tickSizeOuter(0);
|
|
43
|
+
var yAxis = (0, d3_axis_1.axisLeft)(x).ticks(6).tickFormat(_this.formatTicks).tickSizeOuter(0);
|
|
44
|
+
var axisContainer = (0, d3_selection_1.select)(_this.axisBoxRef.current);
|
|
44
45
|
axisContainer.append('svg:svg')
|
|
45
46
|
.attr('width', 220)
|
|
46
47
|
.attr('height', 30)
|
|
47
48
|
.attr('class', 'pae-x-axis')
|
|
48
49
|
.style('z-index', '1')
|
|
49
50
|
.style('position', 'absolute')
|
|
50
|
-
.attr('transform',
|
|
51
|
+
.attr('transform', "translate(-93,202)")
|
|
51
52
|
.append('g')
|
|
52
|
-
.attr('transform',
|
|
53
|
+
.attr('transform', "translate(6,0)")
|
|
53
54
|
.call(xAxis);
|
|
54
55
|
axisContainer.append('svg:svg')
|
|
55
56
|
.attr('width', 50)
|
|
@@ -57,98 +58,121 @@ class AlphafoldPaeControls extends base_1.CollapsableControls {
|
|
|
57
58
|
.attr('class', 'pae-y-axis')
|
|
58
59
|
.style('z-index', '1')
|
|
59
60
|
.style('position', 'absolute')
|
|
60
|
-
.attr('transform',
|
|
61
|
+
.attr('transform', "translate(-123,0)")
|
|
61
62
|
.append('g')
|
|
62
|
-
.attr('transform',
|
|
63
|
+
.attr('transform', "translate(36,4)")
|
|
63
64
|
.call(yAxis);
|
|
64
65
|
}
|
|
65
66
|
});
|
|
66
|
-
}
|
|
67
|
-
formatTicks(d) {
|
|
67
|
+
};
|
|
68
|
+
AlphafoldPaeControls.prototype.formatTicks = function (d) {
|
|
68
69
|
return d > 999 ? d / 1000 + 'k' : d;
|
|
69
|
-
}
|
|
70
|
-
renderControls() {
|
|
71
|
-
|
|
70
|
+
};
|
|
71
|
+
AlphafoldPaeControls.prototype.renderControls = function () {
|
|
72
|
+
var superpositionState = this.plugin.customState.superpositionState;
|
|
72
73
|
if (!superpositionState || !superpositionState.alphafold)
|
|
73
74
|
return null;
|
|
74
|
-
|
|
75
|
-
return (0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', style: { height: 'auto', textAlign: 'center', justifyContent: 'center', padding: '15px 0', position: 'relative', fontSize: '12px' }, children: [(0, jsx_runtime_1.jsx)("div", { ref: this.axisBoxRef, className: 'pae-axis-box', style: { position: 'absolute', width: '100%', height: '100%' } }), (0, jsx_runtime_1.jsx)("span", { style: { transform: 'rotate(270deg)', position: 'absolute', transformOrigin: '0 0', left: '10px', top: '165px', fontWeight: 500 }, children: "Aligned residue" }), (0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', style: { height: 'auto', flexDirection: 'column' }, children: [(0, jsx_runtime_1.jsx)("div", { style: { width: '200px', height: '200px', border: '1px solid #6a635a', margin: '2px 0 25px 25px', position: 'relative' }, children: (0, jsx_runtime_1.jsx)("img", { style: { width: '100%', height: '100%', position: 'absolute', left: 0, top: 0 }, src:
|
|
76
|
-
}
|
|
77
|
-
|
|
75
|
+
var errorScale = [0, 5, 10, 15, 20, 25, 30];
|
|
76
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', style: { height: 'auto', textAlign: 'center', justifyContent: 'center', padding: '15px 0', position: 'relative', fontSize: '12px' }, children: [(0, jsx_runtime_1.jsx)("div", { ref: this.axisBoxRef, className: 'pae-axis-box', style: { position: 'absolute', width: '100%', height: '100%' } }), (0, jsx_runtime_1.jsx)("span", { style: { transform: 'rotate(270deg)', position: 'absolute', transformOrigin: '0 0', left: '10px', top: '165px', fontWeight: 500 }, children: "Aligned residue" }), (0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', style: { height: 'auto', flexDirection: 'column' }, children: [(0, jsx_runtime_1.jsx)("div", { style: { width: '200px', height: '200px', border: '1px solid #6a635a', margin: '2px 0 25px 25px', position: 'relative' }, children: (0, jsx_runtime_1.jsx)("img", { style: { width: '100%', height: '100%', position: 'absolute', left: 0, top: 0 }, src: "".concat(superpositionState.alphafold.apiData.pae), alt: "PAE" }) }), (0, jsx_runtime_1.jsx)("div", { style: { textAlign: 'center', paddingLeft: '30px', marginBottom: '20px', fontWeight: 500 }, children: "Scored residue" }), (0, jsx_runtime_1.jsx)("img", { style: { width: '200px', height: '10px', border: '1px solid #6a635a', margin: '2px 0 25px 25px', transform: 'rotate(180deg)' }, src: 'https://alphafold.ebi.ac.uk/assets/img/horizontal_colorbar.png', alt: "PAE Scale" }), (0, jsx_runtime_1.jsx)("ul", { style: { listStyleType: 'none', fontWeight: 500, margin: 0, display: 'inline-block', position: 'absolute', top: '292px', marginLeft: '24px' }, children: errorScale.map(function (errValue) { return (0, jsx_runtime_1.jsx)("li", { style: { float: 'left', marginRight: '18px' }, children: errValue }, errValue); }) }), (0, jsx_runtime_1.jsx)("div", { style: { textAlign: 'center', paddingLeft: '20px', fontWeight: 500 }, children: "Expected position error (\u00C5ngstr\u00F6ms)" })] })] });
|
|
77
|
+
};
|
|
78
|
+
return AlphafoldPaeControls;
|
|
79
|
+
}(base_1.CollapsableControls));
|
|
78
80
|
exports.AlphafoldPaeControls = AlphafoldPaeControls;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
var AlphafoldSuperpositionControls = /** @class */ (function (_super) {
|
|
82
|
+
tslib_1.__extends(AlphafoldSuperpositionControls, _super);
|
|
83
|
+
function AlphafoldSuperpositionControls() {
|
|
84
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
85
|
+
}
|
|
86
|
+
AlphafoldSuperpositionControls.prototype.defaultState = function () {
|
|
81
87
|
return {
|
|
82
88
|
isCollapsed: false,
|
|
83
89
|
header: 'AlphaFold Superposition',
|
|
84
90
|
brand: { accent: 'gray', svg: icons_1.SuperpositionSvg },
|
|
85
91
|
isHidden: true
|
|
86
92
|
};
|
|
87
|
-
}
|
|
88
|
-
componentDidMount() {
|
|
89
|
-
|
|
90
|
-
|
|
93
|
+
};
|
|
94
|
+
AlphafoldSuperpositionControls.prototype.componentDidMount = function () {
|
|
95
|
+
var _this = this;
|
|
96
|
+
this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection, function (sel) {
|
|
97
|
+
var superpositionState = _this.plugin.customState.superpositionState;
|
|
91
98
|
if (superpositionState && superpositionState.alphafold.apiData.cif && superpositionState.alphafold.apiData.cif !== '') {
|
|
92
|
-
|
|
99
|
+
_this.setState({ isHidden: false });
|
|
93
100
|
}
|
|
94
101
|
});
|
|
95
|
-
}
|
|
96
|
-
rmsdTable() {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return (0, jsx_runtime_1.jsxs)("div", { className: 'msp-control-offset', children: [(rmsds.length == 0 || !rmsds[activeSegment - 1]) && (0, jsx_runtime_1.jsx)("div", { className: 'msp-flex-row', style: { padding: '5px 0 0 10px' }, children: (0, jsx_runtime_1.jsx)("strong", { children: "No overlap found!" }) }), rmsds[activeSegment - 1] && (0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', children: [(0, jsx_runtime_1.jsx)("div", { style: { width: '40%', borderRight: '1px solid rgb(213 206 196)', padding: '5px 0 0 5px' }, children: (0, jsx_runtime_1.jsx)("strong", { children: "Entry" }) }), (0, jsx_runtime_1.jsx)("div", { style: { padding: '5px 0 0 5px' }, children: (0, jsx_runtime_1.jsx)("strong", { children: "RMSD (\u212B)" }) })] }), rmsds[activeSegment - 1] && rmsds[activeSegment - 1].map((d)
|
|
101
|
-
|
|
102
|
+
};
|
|
103
|
+
AlphafoldSuperpositionControls.prototype.rmsdTable = function () {
|
|
104
|
+
var spData = this.plugin.customState.superpositionState;
|
|
105
|
+
var activeSegment = spData.activeSegment;
|
|
106
|
+
var rmsds = spData.alphafold.rmsds;
|
|
107
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: 'msp-control-offset', children: [(rmsds.length == 0 || !rmsds[activeSegment - 1]) && (0, jsx_runtime_1.jsx)("div", { className: 'msp-flex-row', style: { padding: '5px 0 0 10px' }, children: (0, jsx_runtime_1.jsx)("strong", { children: "No overlap found!" }) }), rmsds[activeSegment - 1] && (0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', children: [(0, jsx_runtime_1.jsx)("div", { style: { width: '40%', borderRight: '1px solid rgb(213 206 196)', padding: '5px 0 0 5px' }, children: (0, jsx_runtime_1.jsx)("strong", { children: "Entry" }) }), (0, jsx_runtime_1.jsx)("div", { style: { padding: '5px 0 0 5px' }, children: (0, jsx_runtime_1.jsx)("strong", { children: "RMSD (\u212B)" }) })] }), rmsds[activeSegment - 1] && rmsds[activeSegment - 1].map(function (d) {
|
|
108
|
+
var details = d.split(':');
|
|
102
109
|
return details[1] !== '-' ? (0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', children: [(0, jsx_runtime_1.jsx)("div", { className: 'msp-control-row-label', style: { width: '40%', borderRight: '1px solid rgb(213 206 196)', padding: '5px 0 0 5px' }, children: details[0] }), (0, jsx_runtime_1.jsx)("div", { style: { padding: '5px 0 0 5px' }, children: details[1] })] }, d) : null;
|
|
103
110
|
})] });
|
|
104
|
-
}
|
|
105
|
-
renderControls() {
|
|
106
|
-
|
|
111
|
+
};
|
|
112
|
+
AlphafoldSuperpositionControls.prototype.renderControls = function () {
|
|
113
|
+
var superpositionState = this.plugin.customState.superpositionState;
|
|
107
114
|
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [superpositionState.alphafold.ref !== '' && this.rmsdTable(), superpositionState.alphafold.ref === '' && (0, jsx_runtime_1.jsx)(AfSuperpositionControls, {})] });
|
|
108
|
-
}
|
|
109
|
-
|
|
115
|
+
};
|
|
116
|
+
return AlphafoldSuperpositionControls;
|
|
117
|
+
}(base_1.CollapsableControls));
|
|
110
118
|
exports.AlphafoldSuperpositionControls = AlphafoldSuperpositionControls;
|
|
111
119
|
exports.AlphafoldSuperpositionParams = {
|
|
112
120
|
// alignSequences: PD.Boolean(true, { isEssential: true, description: 'For Chain-based 3D superposition, perform a sequence alignment and use the aligned residue pairs to guide the 3D superposition.' }),
|
|
113
121
|
traceOnly: param_definition_1.ParamDefinition.Boolean(true, { description: 'For Chain- and Uniprot-based 3D superposition, base superposition only on CA (and equivalent) atoms.' })
|
|
114
122
|
};
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
this.
|
|
123
|
+
var DefaultAlphafoldSuperpositionOptions = param_definition_1.ParamDefinition.getDefaultValues(exports.AlphafoldSuperpositionParams);
|
|
124
|
+
var AfSuperpositionControls = /** @class */ (function (_super) {
|
|
125
|
+
tslib_1.__extends(AfSuperpositionControls, _super);
|
|
126
|
+
function AfSuperpositionControls() {
|
|
127
|
+
var _this = _super.apply(this, tslib_1.__spreadArray([], tslib_1.__read(arguments), false)) || this;
|
|
128
|
+
_this.state = {
|
|
120
129
|
isBusy: false,
|
|
121
130
|
canUseDb: true,
|
|
122
131
|
action: undefined,
|
|
123
132
|
options: DefaultAlphafoldSuperpositionOptions
|
|
124
133
|
};
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
+
_this.superposeDb = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
135
|
+
var spData;
|
|
136
|
+
return tslib_1.__generator(this, function (_a) {
|
|
137
|
+
this.setState({ isBusy: true });
|
|
138
|
+
spData = this.plugin.customState.superpositionState;
|
|
139
|
+
spData.alphafold.traceOnly = this.state.options.traceOnly;
|
|
140
|
+
(0, superposition_1.superposeAf)(this.plugin, this.state.options.traceOnly);
|
|
141
|
+
return [2 /*return*/];
|
|
142
|
+
});
|
|
143
|
+
}); };
|
|
144
|
+
_this.toggleOptions = function () { return _this.setState({ action: _this.state.action === 'options' ? void 0 : 'options' }); };
|
|
145
|
+
_this.setOptions = function (values) {
|
|
146
|
+
_this.setState({ options: values });
|
|
134
147
|
};
|
|
148
|
+
return _this;
|
|
135
149
|
}
|
|
136
|
-
componentDidMount() {
|
|
137
|
-
|
|
138
|
-
|
|
150
|
+
AfSuperpositionControls.prototype.componentDidMount = function () {
|
|
151
|
+
var _this = this;
|
|
152
|
+
this.subscribe(this.plugin.behaviors.state.isBusy, function (v) {
|
|
153
|
+
_this.setState({ isBusy: v });
|
|
139
154
|
});
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
155
|
+
};
|
|
156
|
+
Object.defineProperty(AfSuperpositionControls.prototype, "selection", {
|
|
157
|
+
get: function () {
|
|
158
|
+
return this.plugin.managers.structure.selection;
|
|
159
|
+
},
|
|
160
|
+
enumerable: false,
|
|
161
|
+
configurable: true
|
|
162
|
+
});
|
|
163
|
+
Object.defineProperty(AfSuperpositionControls.prototype, "customState", {
|
|
164
|
+
get: function () {
|
|
165
|
+
return this.plugin.customState;
|
|
166
|
+
},
|
|
167
|
+
enumerable: false,
|
|
168
|
+
configurable: true
|
|
169
|
+
});
|
|
170
|
+
AfSuperpositionControls.prototype.superposeByDbMapping = function () {
|
|
148
171
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(common_1.Button, { icon: icons_1.SuperposeChainsSvg, title: 'Superpose AlphaFold structure using intersection of residues from SIFTS UNIPROT mapping.', className: 'msp-btn msp-btn-block', onClick: this.superposeDb, style: { marginTop: '1px', textAlign: 'left' }, disabled: this.state.isBusy, children: "Load AlphaFold structure" }) });
|
|
149
|
-
}
|
|
150
|
-
render() {
|
|
172
|
+
};
|
|
173
|
+
AfSuperpositionControls.prototype.render = function () {
|
|
151
174
|
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: { backgroundColor: '#dce54e', fontWeight: 500, padding: '5px 12px' }, children: "New Feature!" }), (0, jsx_runtime_1.jsx)("div", { className: 'msp-help-text', style: { margin: '2px 0' }, children: (0, jsx_runtime_1.jsxs)("div", { className: 'msp-help-description', children: [(0, jsx_runtime_1.jsx)(icons_1.Icon, { svg: InfoIconSvg, inline: true }), "Load and superpose AlphaFold structure against representative chains."] }) }), (0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', children: [this.state.canUseDb && this.superposeByDbMapping(), (0, jsx_runtime_1.jsx)(common_1.ToggleButton, { icon: icons_1.TuneSvg, label: '', title: 'Options', toggle: this.toggleOptions, isSelected: this.state.action === 'options', disabled: this.state.isBusy, style: { flex: '0 0 40px', padding: 0 } })] }), this.state.action === 'options' && (0, jsx_runtime_1.jsx)("div", { className: 'msp-control-offset', children: (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: exports.AlphafoldSuperpositionParams, values: this.state.options, onChangeValues: this.setOptions, isDisabled: this.state.isBusy }) })] });
|
|
152
|
-
}
|
|
153
|
-
|
|
175
|
+
};
|
|
176
|
+
return AfSuperpositionControls;
|
|
177
|
+
}(base_1.PurePluginUIComponent));
|
|
154
178
|
exports.AfSuperpositionControls = AfSuperpositionControls;
|
|
@@ -1,28 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AlphafoldTransparencyControls = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var base_1 = require("Molstar/mol-plugin-ui/base");
|
|
7
|
+
var icons_1 = require("Molstar/mol-plugin-ui/controls/icons");
|
|
8
|
+
var param_definition_1 = require("Molstar/mol-util/param-definition");
|
|
9
|
+
var parameters_1 = require("Molstar/mol-plugin-ui/controls/parameters");
|
|
10
|
+
var alphafold_transparency_1 = require("../alphafold-transparency");
|
|
11
|
+
var TransparencyParams = {
|
|
11
12
|
score: param_definition_1.ParamDefinition.Numeric(70, { min: 0, max: 100, step: 1 }, { label: 'pLDDT less than', description: 'pLDDT score value in the range of 0 to 100' }),
|
|
12
13
|
opacity: param_definition_1.ParamDefinition.Numeric(0.2, { min: 0, max: 1, step: 0.01 }, { description: 'Opacity value in the range 0 to 1' })
|
|
13
14
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
var AlphafoldTransparencyControls = /** @class */ (function (_super) {
|
|
16
|
+
tslib_1.__extends(AlphafoldTransparencyControls, _super);
|
|
17
|
+
function AlphafoldTransparencyControls() {
|
|
18
|
+
var _this = _super.apply(this, tslib_1.__spreadArray([], tslib_1.__read(arguments), false)) || this;
|
|
19
|
+
_this.updateTransparency = function (val) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
20
|
+
var superpositionState, afStr;
|
|
21
|
+
return tslib_1.__generator(this, function (_a) {
|
|
22
|
+
switch (_a.label) {
|
|
23
|
+
case 0:
|
|
24
|
+
this.setState({ transpareny: val });
|
|
25
|
+
superpositionState = this.plugin.customState.superpositionState;
|
|
26
|
+
afStr = this.plugin.managers.structure.hierarchy.current.refs.get(superpositionState.alphafold.ref);
|
|
27
|
+
return [4 /*yield*/, (0, alphafold_transparency_1.clearStructureTransparency)(this.plugin, afStr.components)];
|
|
28
|
+
case 1:
|
|
29
|
+
_a.sent();
|
|
30
|
+
return [4 /*yield*/, (0, alphafold_transparency_1.applyAFTransparency)(this.plugin, afStr, 1 - val.opacity, val.score)];
|
|
31
|
+
case 2:
|
|
32
|
+
_a.sent();
|
|
33
|
+
return [2 /*return*/];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}); };
|
|
37
|
+
return _this;
|
|
24
38
|
}
|
|
25
|
-
defaultState() {
|
|
39
|
+
AlphafoldTransparencyControls.prototype.defaultState = function () {
|
|
26
40
|
return {
|
|
27
41
|
isCollapsed: false,
|
|
28
42
|
header: 'AlphaFold Structure Opacity',
|
|
@@ -33,17 +47,19 @@ class AlphafoldTransparencyControls extends base_1.CollapsableControls {
|
|
|
33
47
|
opacity: 0.2
|
|
34
48
|
}
|
|
35
49
|
};
|
|
36
|
-
}
|
|
37
|
-
componentDidMount() {
|
|
38
|
-
|
|
39
|
-
|
|
50
|
+
};
|
|
51
|
+
AlphafoldTransparencyControls.prototype.componentDidMount = function () {
|
|
52
|
+
var _this = this;
|
|
53
|
+
this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection, function (sel) {
|
|
54
|
+
var superpositionState = _this.plugin.customState.superpositionState;
|
|
40
55
|
if (superpositionState && superpositionState.alphafold.ref && superpositionState.alphafold.ref !== '') {
|
|
41
|
-
|
|
56
|
+
_this.setState({ isHidden: false });
|
|
42
57
|
}
|
|
43
58
|
});
|
|
44
|
-
}
|
|
45
|
-
renderControls() {
|
|
59
|
+
};
|
|
60
|
+
AlphafoldTransparencyControls.prototype.renderControls = function () {
|
|
46
61
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: TransparencyParams, values: this.state.transpareny, onChangeValues: this.updateTransparency }) });
|
|
47
|
-
}
|
|
48
|
-
|
|
62
|
+
};
|
|
63
|
+
return AlphafoldTransparencyControls;
|
|
64
|
+
}(base_1.CollapsableControls));
|
|
49
65
|
exports.AlphafoldTransparencyControls = AlphafoldTransparencyControls;
|