pdbe-molstar 3.4.0 → 3.6.0
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/pdbe-molstar-component.js +2 -2
- package/build/pdbe-molstar-light.css +2 -2
- package/build/pdbe-molstar-plugin.js +2 -2
- package/build/pdbe-molstar-plugin.js.LICENSE.txt +26 -1
- package/build/pdbe-molstar.css +2 -2
- package/lib/alphafold-transparency.js +5 -6
- package/lib/custom-events.js +1 -1
- package/lib/domain-annotations/behavior.d.ts +1 -1
- package/lib/domain-annotations/color.js +2 -2
- package/lib/domain-annotations/prop.js +1 -2
- package/lib/extensions/complexes/coloring.d.ts +40 -0
- package/lib/extensions/complexes/coloring.js +118 -0
- package/lib/extensions/complexes/index.d.ts +55 -0
- package/lib/extensions/complexes/index.js +123 -0
- package/lib/extensions/complexes/superpose-by-biggest-chain.d.ts +17 -0
- package/lib/extensions/complexes/superpose-by-biggest-chain.js +135 -0
- package/lib/extensions/foldseek/index.d.ts +1 -1
- package/lib/extensions/foldseek/index.js +7 -7
- package/lib/extensions/interactions/index.d.ts +36 -0
- package/lib/extensions/interactions/index.js +112 -0
- package/lib/extensions/state-gallery/behavior.d.ts +1 -1
- package/lib/extensions/state-gallery/config.js +2 -2
- package/lib/extensions/state-gallery/manager.js +5 -4
- package/lib/extensions/state-gallery/ui.js +12 -12
- package/lib/helpers.d.ts +8 -0
- package/lib/helpers.js +175 -81
- package/lib/labels.d.ts +1 -1
- package/lib/loci-details.js +4 -5
- package/lib/plugin-custom-state.js +2 -2
- package/lib/sifts-mapping.js +1 -2
- package/lib/sifts-mappings-behaviour.d.ts +1 -1
- package/lib/spec-from-html.js +1 -2
- package/lib/spec.d.ts +1 -1
- package/lib/spec.js +3 -3
- package/lib/styles/pdbe-molstar/_index.scss +7 -7
- package/lib/styles/pdbe-molstar-dark.scss +2 -2
- package/lib/styles/pdbe-molstar-light.scss +2 -2
- package/lib/subscribe-events.js +1 -2
- package/lib/superposition-export.js +1 -2
- package/lib/superposition-focus-representation.d.ts +2 -2
- package/lib/superposition-focus-representation.js +1 -1
- package/lib/superposition-sifts-mapping.js +1 -2
- package/lib/superposition.d.ts +1 -1
- package/lib/superposition.js +34 -39
- package/lib/ui/alphafold-superposition.js +6 -6
- package/lib/ui/annotation-controls.d.ts +1 -1
- package/lib/ui/annotation-controls.js +2 -2
- package/lib/ui/annotation-row-controls.js +3 -3
- package/lib/ui/custom-controls.js +1 -1
- package/lib/ui/export-superposition.d.ts +0 -1
- package/lib/ui/export-superposition.js +1 -1
- package/lib/ui/icons.js +1 -1
- package/lib/ui/left-panel/core.d.ts +0 -1
- package/lib/ui/left-panel/core.js +5 -6
- package/lib/ui/left-panel/pdbe-left-panel.d.ts +0 -1
- package/lib/ui/left-panel/tabs.d.ts +1 -1
- package/lib/ui/left-panel/tabs.js +2 -2
- package/lib/ui/overlay.js +3 -4
- package/lib/ui/pdbe-screenshot-controls.js +4 -4
- package/lib/ui/pdbe-structure-controls.js +3 -3
- package/lib/ui/pdbe-viewport-controls.js +3 -4
- package/lib/ui/pdbe-viewport.d.ts +5 -2
- package/lib/ui/pdbe-viewport.js +24 -3
- package/lib/ui/segment-tree.js +40 -45
- package/lib/ui/split-ui/components.d.ts +1 -2
- package/lib/ui/split-ui/components.js +2 -2
- package/lib/ui/split-ui/split-ui.js +6 -7
- package/lib/ui/superposition-components.js +16 -21
- package/lib/ui/symmetry-annotation-controls.d.ts +4 -4
- package/lib/ui/symmetry-annotation-controls.js +18 -25
- package/lib/viewer.d.ts +31 -3
- package/lib/viewer.js +54 -40
- package/package.json +4 -4
|
@@ -19,7 +19,7 @@ export interface StateGalleryParams {
|
|
|
19
19
|
showTitleBox: boolean;
|
|
20
20
|
}
|
|
21
21
|
/** `StateGallery` extension allows browsing pre-computed 3D states for a PDB entry */
|
|
22
|
-
export declare const StateGallery: import("molstar/lib/mol-state
|
|
22
|
+
export declare const StateGallery: import("molstar/lib/mol-state").StateTransformer<PluginBehavior.Category, PluginBehavior.Behavior, StateGalleryParams>;
|
|
23
23
|
/** Public functions provided by the `StateGallery` extension */
|
|
24
24
|
export declare const StateGalleryExtensionFunctions: {
|
|
25
25
|
StateGalleryManager: typeof StateGalleryManager;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.StateGalleryConfig = exports.StateGalleryConfigDefaults = void 0;
|
|
4
|
+
exports.getStateGalleryConfig = getStateGalleryConfig;
|
|
4
5
|
const config_1 = require("molstar/lib/mol-plugin/config");
|
|
5
6
|
const helpers_1 = require("../../helpers");
|
|
6
7
|
/** Default values of plugin config items for the `StateGallery` extension */
|
|
@@ -28,4 +29,3 @@ exports.StateGalleryConfig = {
|
|
|
28
29
|
function getStateGalleryConfig(plugin) {
|
|
29
30
|
return helpers_1.PluginConfigUtils.getConfigValues(plugin, exports.StateGalleryConfig, exports.StateGalleryConfigDefaults);
|
|
30
31
|
}
|
|
31
|
-
exports.getStateGalleryConfig = getStateGalleryConfig;
|
|
@@ -12,6 +12,7 @@ const helpers_1 = require("../../helpers");
|
|
|
12
12
|
const behavior_1 = require("./behavior");
|
|
13
13
|
const config_1 = require("./config");
|
|
14
14
|
const titles_1 = require("./titles");
|
|
15
|
+
const string_like_1 = require("molstar/lib/mol-io/common/string-like");
|
|
15
16
|
/** Categories of images/states */
|
|
16
17
|
exports.ImageCategory = ['Entry', 'Assemblies', 'Entities', 'Ligands', 'Modified residues', 'Domains', 'Miscellaneous'];
|
|
17
18
|
/** Provides functionality to get list of images (3D states) for an entry, load individual images, keeps track of the currently loaded image.
|
|
@@ -99,8 +100,8 @@ class StateGalleryManager {
|
|
|
99
100
|
}
|
|
100
101
|
/** Request to load an image (3D state). When there are multiple concurrent requests, some requests may be skipped (will resolve to `{ status: 'cancelled' }` or `{ status: 'skipped' }`) as only the last request is really important. */
|
|
101
102
|
load(img) {
|
|
102
|
-
var _a;
|
|
103
103
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
var _a;
|
|
104
105
|
if (typeof img === 'string') {
|
|
105
106
|
img = (_a = this.getImageByFilename(img)) !== null && _a !== void 0 ? _a : { filename: img };
|
|
106
107
|
}
|
|
@@ -151,14 +152,14 @@ class StateGalleryManager {
|
|
|
151
152
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
152
153
|
const url = (0, helpers_1.combineUrl)(this.options.ServerUrl, `${filename}.molj`);
|
|
153
154
|
const data = yield this.plugin.runTask(this.plugin.fetch({ url, type: 'string' }));
|
|
154
|
-
return data;
|
|
155
|
+
return string_like_1.StringLike.toString(data);
|
|
155
156
|
});
|
|
156
157
|
}
|
|
157
158
|
/** Get MOLJ state for the image (get from cache or fetch from API) */
|
|
158
159
|
getSnapshot(filename) {
|
|
159
|
-
var _a;
|
|
160
|
-
var _b;
|
|
161
160
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
161
|
+
var _a;
|
|
162
|
+
var _b;
|
|
162
163
|
return (_a = (_b = this.cache)[filename]) !== null && _a !== void 0 ? _a : (_b[filename] = yield this.fetchSnapshot(filename));
|
|
163
164
|
});
|
|
164
165
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.StateGalleryControls = void 0;
|
|
4
|
+
exports.StateGalleryManagerControls = StateGalleryManagerControls;
|
|
5
|
+
exports.StateGalleryTitleBox = StateGalleryTitleBox;
|
|
4
6
|
const tslib_1 = require("tslib");
|
|
5
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
8
|
const base_1 = require("molstar/lib/mol-plugin-ui/base");
|
|
@@ -69,7 +71,7 @@ class StateGalleryControls extends base_1.CollapsableControls {
|
|
|
69
71
|
}
|
|
70
72
|
renderControls() {
|
|
71
73
|
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: Params, values: this.values, onChangeValues: this.onChangeValues, onEnter: this.load }), (!this.state.manager || this.state.manager.entryId !== this.state.entryId) &&
|
|
72
|
-
(0, jsx_runtime_1.jsx)(common_1.Button,
|
|
74
|
+
(0, jsx_runtime_1.jsx)(common_1.Button, { icon: this.state.isLoading ? undefined : icons_1.CheckSvg, title: 'Load', disabled: this.loadDisabled(), onClick: this.load, className: 'msp-btn-block', children: this.state.isLoading ? 'Loading...' : 'Load' }), this.state.manager &&
|
|
73
75
|
(0, jsx_runtime_1.jsx)(StateGalleryManagerControls, { manager: this.state.manager })] });
|
|
74
76
|
}
|
|
75
77
|
}
|
|
@@ -102,21 +104,20 @@ function StateGalleryManagerControls(props) {
|
|
|
102
104
|
return () => subs.forEach(sub => sub.unsubscribe());
|
|
103
105
|
}, [props.manager]);
|
|
104
106
|
if (nImages === 0) {
|
|
105
|
-
return (0, jsx_runtime_1.jsxs)("div",
|
|
107
|
+
return (0, jsx_runtime_1.jsxs)("div", { style: { margin: 8 }, children: ["No data available for ", props.manager.entryId, "."] });
|
|
106
108
|
}
|
|
107
|
-
return (0, jsx_runtime_1.jsxs)("div",
|
|
109
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: 'pdbemolstar-state-gallery-controls', onKeyDown: handleKeyDown, tabIndex: -1, ref: keyDownTargetRef, children: [(0, jsx_runtime_1.jsx)(common_1.ExpandGroup, { header: 'States', initiallyExpanded: true, children: (0, jsx_runtime_1.jsx)("div", { style: { marginBottom: 8 }, children: categories.groups.map(cat => {
|
|
108
110
|
var _a;
|
|
109
|
-
return (0, jsx_runtime_1.jsx)(common_1.ExpandGroup,
|
|
110
|
-
}) })
|
|
111
|
+
return (0, jsx_runtime_1.jsx)(common_1.ExpandGroup, { header: cat, initiallyExpanded: true, children: (_a = categories.members.get(cat)) === null || _a === void 0 ? void 0 : _a.map(img => (0, jsx_runtime_1.jsx)(ImageButton, { img: img, isSelected: img === selected, status: status, onClick: () => props.manager.load(img) }, img.filename)) }, cat);
|
|
112
|
+
}) }) }, 'states'), (0, jsx_runtime_1.jsx)(common_1.ExpandGroup, { header: 'Description', initiallyExpanded: true, children: (0, jsx_runtime_1.jsx)("div", { className: 'pdbemolstar-state-gallery-legend', children: (0, jsx_runtime_1.jsx)("div", { dangerouslySetInnerHTML: { __html: (_a = selected === null || selected === void 0 ? void 0 : selected.description) !== null && _a !== void 0 ? _a : '' } }) }) }, 'description')] });
|
|
111
113
|
}
|
|
112
|
-
exports.StateGalleryManagerControls = StateGalleryManagerControls;
|
|
113
114
|
/** Button with image title */
|
|
114
115
|
function ImageButton(props) {
|
|
115
116
|
var _a;
|
|
116
117
|
const { img, isSelected, status, onClick } = props;
|
|
117
118
|
const icon = !isSelected ? icons_2.EmptyIconSvg : (status === 'loading') ? icons_2.HourglassBottomSvg : (status === 'error') ? icons_1.ErrorSvg : icons_1.CheckSvg;
|
|
118
119
|
const tooltip = imageTooltip(img, isSelected ? status : 'ready');
|
|
119
|
-
return (0, jsx_runtime_1.jsxs)(common_1.Button,
|
|
120
|
+
return (0, jsx_runtime_1.jsxs)(common_1.Button, { className: 'msp-action-menu-button pdbemolstar-state-gallery-state-button', icon: icon, onClick: onClick, title: tooltip, style: { fontWeight: isSelected ? 'bold' : undefined }, children: [(_a = img.title) !== null && _a !== void 0 ? _a : img.filename, img.subtitle && (0, jsx_runtime_1.jsxs)("small", { children: ["\u2002 ", img.subtitle] })] });
|
|
120
121
|
}
|
|
121
122
|
/** Box in viewport with image title and arrows to move between images (3D states) */
|
|
122
123
|
function StateGalleryTitleBox() {
|
|
@@ -147,11 +148,10 @@ function StateGalleryTitleBox() {
|
|
|
147
148
|
}, [plugin]);
|
|
148
149
|
if (image === undefined)
|
|
149
150
|
return null;
|
|
150
|
-
return (0, jsx_runtime_1.jsxs)("div",
|
|
151
|
-
(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(common_1.Button, { className: 'msp-btn-icon', title: 'Previous state', icon: icons_2.ChevronLeftSvg, onClick: () => manager.loadPrevious() }) }), (0, jsx_runtime_1.jsxs)("div",
|
|
152
|
-
(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(common_1.Button, { className: 'msp-btn-icon', title: 'Next state', icon: icons_2.ChevronRightSvg, onClick: () => manager === null || manager === void 0 ? void 0 : manager.loadNext() }) })] })
|
|
151
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: 'pdbemolstar-state-gallery-title-box', children: [manager &&
|
|
152
|
+
(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(common_1.Button, { className: 'msp-btn-icon', title: 'Previous state', icon: icons_2.ChevronLeftSvg, onClick: () => manager.loadPrevious() }) }), (0, jsx_runtime_1.jsxs)("div", { className: 'pdbemolstar-state-gallery-title', title: imageTooltip(image, status), children: [(0, jsx_runtime_1.jsx)("div", { className: 'pdbemolstar-state-gallery-title-icon', children: (0, jsx_runtime_1.jsx)(icons_1.Icon, { svg: status === 'error' ? icons_1.ErrorSvg : status === 'loading' ? icons_2.HourglassBottomSvg : icons_2.EmptyIconSvg }) }), (0, jsx_runtime_1.jsxs)("div", { className: 'pdbemolstar-state-gallery-title-text', children: [(_a = image.title) !== null && _a !== void 0 ? _a : image.filename, (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("small", { children: image.subtitle })] })] }), manager &&
|
|
153
|
+
(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(common_1.Button, { className: 'msp-btn-icon', title: 'Next state', icon: icons_2.ChevronRightSvg, onClick: () => manager === null || manager === void 0 ? void 0 : manager.loadNext() }) })] });
|
|
153
154
|
}
|
|
154
|
-
exports.StateGalleryTitleBox = StateGalleryTitleBox;
|
|
155
155
|
/** Return tooltip text for an image */
|
|
156
156
|
function imageTooltip(img, status) {
|
|
157
157
|
var _a;
|
package/lib/helpers.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { ComponentExpressionT } from 'molstar/lib/extensions/mvs/tree/mvs/param-types';
|
|
2
|
+
import { Mat3, Mat4 } from 'molstar/lib/mol-math/linear-algebra';
|
|
1
3
|
import { Model, Structure } from 'molstar/lib/mol-model/structure';
|
|
2
4
|
import { BuiltInTrajectoryFormat } from 'molstar/lib/mol-plugin-state/formats/trajectory';
|
|
3
5
|
import { StructureRef } from 'molstar/lib/mol-plugin-state/manager/structure/hierarchy-state';
|
|
4
6
|
import { PluginConfigItem } from 'molstar/lib/mol-plugin/config';
|
|
5
7
|
import { PluginContext } from 'molstar/lib/mol-plugin/context';
|
|
8
|
+
import { PluginLayoutStateProps } from 'molstar/lib/mol-plugin/layout';
|
|
6
9
|
import { Expression } from 'molstar/lib/mol-script/language/expression';
|
|
7
10
|
import { Overpaint } from 'molstar/lib/mol-theme/overpaint';
|
|
8
11
|
import { Color } from 'molstar/lib/mol-util/color';
|
|
@@ -76,7 +79,9 @@ export interface QueryParam {
|
|
|
76
79
|
representationColor?: any;
|
|
77
80
|
focus?: boolean;
|
|
78
81
|
tooltip?: string;
|
|
82
|
+
/** @deprecated I don't know what this is */
|
|
79
83
|
start?: any;
|
|
84
|
+
/** @deprecated I don't know what this is */
|
|
80
85
|
end?: any;
|
|
81
86
|
atom_id?: number[];
|
|
82
87
|
uniprot_accession?: string;
|
|
@@ -84,6 +89,7 @@ export interface QueryParam {
|
|
|
84
89
|
start_uniprot_residue_number?: number;
|
|
85
90
|
end_uniprot_residue_number?: number;
|
|
86
91
|
}
|
|
92
|
+
export declare function queryParamsToMvsComponentExpressions(params: QueryParam[]): ComponentExpressionT[];
|
|
87
93
|
export declare namespace QueryHelper {
|
|
88
94
|
function getQueryObject(params: QueryParam[], contextData: Structure): Expression;
|
|
89
95
|
function getInteractivityLoci(params: QueryParam[], contextData: Structure): import("molstar/lib/mol-model/structure/structure/element/loci").Loci;
|
|
@@ -188,4 +194,6 @@ export declare namespace PluginConfigUtils {
|
|
|
188
194
|
/** Retrieve config values for items in `configItems` from the current plugin config */
|
|
189
195
|
function getConfigValues<T extends object>(plugin: PluginContext | undefined, configItems: ConfigFor<T>, defaults: T): T;
|
|
190
196
|
}
|
|
197
|
+
export declare function pluginLayoutStateFromInitParams(initParams: InitParams): PluginLayoutStateProps;
|
|
198
|
+
export declare function getRotationMat4(view: 'front' | 'back' | 'right' | 'left' | 'top' | 'bottom' | Mat3): Mat4;
|
|
191
199
|
export {};
|
package/lib/helpers.js
CHANGED
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PluginConfigUtils = exports.PreemptiveQueue = exports.
|
|
3
|
+
exports.PluginConfigUtils = exports.PreemptiveQueue = exports.StructureComponentTags = exports.Tags = exports.ModelInfo = exports.QueryHelper = exports.LigandView = exports.AlphafoldView = exports.PDBeVolumes = void 0;
|
|
4
|
+
exports.queryParamsToMvsComponentExpressions = queryParamsToMvsComponentExpressions;
|
|
5
|
+
exports.runWithProgressMessage = runWithProgressMessage;
|
|
6
|
+
exports.getStructureUrl = getStructureUrl;
|
|
7
|
+
exports.combineUrl = combineUrl;
|
|
8
|
+
exports.addDefaults = addDefaults;
|
|
9
|
+
exports.normalizeColor = normalizeColor;
|
|
10
|
+
exports.applyOverpaint = applyOverpaint;
|
|
11
|
+
exports.getComponentTypeFromTags = getComponentTypeFromTags;
|
|
12
|
+
exports.distinct = distinct;
|
|
13
|
+
exports.groupElements = groupElements;
|
|
14
|
+
exports.createIndex = createIndex;
|
|
15
|
+
exports.nonnegativeModulo = nonnegativeModulo;
|
|
16
|
+
exports.pluginLayoutStateFromInitParams = pluginLayoutStateFromInitParams;
|
|
17
|
+
exports.getRotationMat4 = getRotationMat4;
|
|
4
18
|
const tslib_1 = require("tslib");
|
|
5
19
|
const prop_1 = require("molstar/lib/extensions/model-archive/quality-assessment/prop");
|
|
20
|
+
const linear_algebra_1 = require("molstar/lib/mol-math/linear-algebra");
|
|
6
21
|
const structure_1 = require("molstar/lib/mol-model/structure");
|
|
7
22
|
const query_1 = require("molstar/lib/mol-model/structure/query/query");
|
|
8
23
|
const transforms_1 = require("molstar/lib/mol-plugin-state/transforms");
|
|
9
24
|
const transformers_1 = require("molstar/lib/mol-plugin/behavior/dynamic/volume-streaming/transformers");
|
|
10
25
|
const commands_1 = require("molstar/lib/mol-plugin/commands");
|
|
26
|
+
const layout_1 = require("molstar/lib/mol-plugin/layout");
|
|
11
27
|
const builder_1 = require("molstar/lib/mol-script/language/builder");
|
|
12
28
|
const compiler_1 = require("molstar/lib/mol-script/runtime/query/compiler");
|
|
13
29
|
const mol_state_1 = require("molstar/lib/mol-state");
|
|
@@ -50,7 +66,7 @@ var PDBeVolumes;
|
|
|
50
66
|
}
|
|
51
67
|
}
|
|
52
68
|
PDBeVolumes.toggle = toggle;
|
|
53
|
-
})(PDBeVolumes
|
|
69
|
+
})(PDBeVolumes || (exports.PDBeVolumes = PDBeVolumes = {}));
|
|
54
70
|
var AlphafoldView;
|
|
55
71
|
(function (AlphafoldView) {
|
|
56
72
|
function getLociByPLDDT(score, contextData) {
|
|
@@ -69,7 +85,7 @@ var AlphafoldView;
|
|
|
69
85
|
return structure_1.StructureSelection.toLociWithSourceUnits(sel);
|
|
70
86
|
}
|
|
71
87
|
AlphafoldView.getLociByPLDDT = getLociByPLDDT;
|
|
72
|
-
})(AlphafoldView
|
|
88
|
+
})(AlphafoldView || (exports.AlphafoldView = AlphafoldView = {}));
|
|
73
89
|
var LigandView;
|
|
74
90
|
(function (LigandView) {
|
|
75
91
|
function query(ligandViewParams) {
|
|
@@ -134,95 +150,156 @@ var LigandView;
|
|
|
134
150
|
};
|
|
135
151
|
}
|
|
136
152
|
LigandView.branchedQuery = branchedQuery;
|
|
137
|
-
})(LigandView
|
|
153
|
+
})(LigandView || (exports.LigandView = LigandView = {}));
|
|
154
|
+
function queryParamsToMvsComponentExpressions(params) {
|
|
155
|
+
const broadcasted = broadcast(params, ['atoms', 'atom_id']);
|
|
156
|
+
return broadcasted.map(item => {
|
|
157
|
+
var _a;
|
|
158
|
+
return ({
|
|
159
|
+
label_entity_id: item.entity_id,
|
|
160
|
+
label_asym_id: item.struct_asym_id,
|
|
161
|
+
auth_asym_id: item.auth_asym_id,
|
|
162
|
+
label_seq_id: item.residue_number,
|
|
163
|
+
auth_seq_id: (_a = item.auth_seq_id) !== null && _a !== void 0 ? _a : item.auth_residue_number,
|
|
164
|
+
pdbx_PDB_ins_code: item.auth_ins_code_id,
|
|
165
|
+
beg_label_seq_id: item.start_residue_number,
|
|
166
|
+
end_label_seq_id: item.end_residue_number,
|
|
167
|
+
beg_auth_seq_id: item.start_auth_residue_number,
|
|
168
|
+
end_auth_seq_id: item.end_auth_residue_number,
|
|
169
|
+
label_atom_id: item.atoms,
|
|
170
|
+
auth_atom_id: undefined,
|
|
171
|
+
type_symbol: undefined,
|
|
172
|
+
atom_id: item.atom_id,
|
|
173
|
+
atom_index: undefined,
|
|
174
|
+
label_comp_id: item.label_comp_id,
|
|
175
|
+
auth_comp_id: undefined,
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
/** `broadcastSingleKey([{chain: 'A', residue: 5, atom: ['C', 'O']}], 'atom')`
|
|
180
|
+
* -> `[{chain: 'A', residue: 5, atom: 'C'}], {chain: 'A', residue: 5, atom: 'O'}` */
|
|
181
|
+
function broadcastSingleKey(objs, key) {
|
|
182
|
+
const out = [];
|
|
183
|
+
for (const obj of objs) {
|
|
184
|
+
if (obj[key] === undefined) {
|
|
185
|
+
out.push(obj);
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
for (const value of obj[key]) {
|
|
189
|
+
out.push(Object.assign(Object.assign({}, obj), { [key]: value }));
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return out;
|
|
194
|
+
}
|
|
195
|
+
/** `broadcast([{chain: 'A', residue: [5, 6], atom: ['C', 'O']}], ['residue', 'atom'])`
|
|
196
|
+
* -> `[{chain: 'A', residue: 5, atom: 'C'}], {chain: 'A', residue: 5, atom: 'O', {chain: 'A', residue: 6, atom: 'C'}], {chain: 'A', residue: 6, atom: 'O'}` */
|
|
197
|
+
function broadcast(objs, keys) {
|
|
198
|
+
return keys.reduce((list, key) => broadcastSingleKey(list, key), objs);
|
|
199
|
+
}
|
|
138
200
|
var QueryHelper;
|
|
139
201
|
(function (QueryHelper) {
|
|
140
202
|
function getQueryObject(params, contextData) {
|
|
141
203
|
const selections = [];
|
|
142
|
-
|
|
143
|
-
let
|
|
144
|
-
|
|
145
|
-
|
|
204
|
+
/** `undefined` means SIFTSMappingMapping has not been retrieved yet. `null` means SIFTSMappingMapping has been retrieved unsuccessfully. */
|
|
205
|
+
let _siftMappings;
|
|
206
|
+
function getSiftsMappings() {
|
|
207
|
+
var _a;
|
|
208
|
+
if (_siftMappings === undefined)
|
|
209
|
+
_siftMappings = (_a = sifts_mapping_1.SIFTSMapping.Provider.get(contextData.models[0]).value) !== null && _a !== void 0 ? _a : null;
|
|
210
|
+
return _siftMappings;
|
|
211
|
+
}
|
|
212
|
+
for (const param of params) {
|
|
213
|
+
const predicates = {
|
|
214
|
+
entity: [],
|
|
215
|
+
chain: [],
|
|
216
|
+
residue: [],
|
|
217
|
+
atom: [],
|
|
218
|
+
};
|
|
146
219
|
// entity
|
|
147
|
-
if (param.entity_id)
|
|
148
|
-
|
|
220
|
+
if (param.entity_id !== undefined) {
|
|
221
|
+
predicates.entity.push(l => structure_1.StructureProperties.entity.id(l.element) === param.entity_id);
|
|
222
|
+
}
|
|
149
223
|
// chain
|
|
150
|
-
if (param.struct_asym_id) {
|
|
151
|
-
|
|
224
|
+
if (param.struct_asym_id !== undefined) {
|
|
225
|
+
predicates.chain.push(l => structure_1.StructureProperties.chain.label_asym_id(l.element) === param.struct_asym_id);
|
|
152
226
|
}
|
|
153
|
-
|
|
154
|
-
|
|
227
|
+
if (param.auth_asym_id !== undefined) {
|
|
228
|
+
predicates.chain.push(l => structure_1.StructureProperties.chain.auth_asym_id(l.element) === param.auth_asym_id);
|
|
155
229
|
}
|
|
156
|
-
//
|
|
157
|
-
if (param.label_comp_id) {
|
|
158
|
-
|
|
230
|
+
// residue
|
|
231
|
+
if (param.label_comp_id !== undefined) {
|
|
232
|
+
predicates.residue.push(l => structure_1.StructureProperties.atom.label_comp_id(l.element) === param.label_comp_id);
|
|
159
233
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
if (!siftMappings || currentAccession !== param.uniprot_accession) {
|
|
163
|
-
siftMappings = sifts_mapping_1.SIFTSMapping.Provider.get(contextData.models[0]).value;
|
|
164
|
-
currentAccession = param.uniprot_accession;
|
|
165
|
-
}
|
|
166
|
-
const rI = structure_1.StructureProperties.residue.key(l.element);
|
|
167
|
-
return !!siftMappings && param.uniprot_accession === siftMappings.accession[rI] && param.uniprot_residue_number === +siftMappings.num[rI];
|
|
168
|
-
};
|
|
234
|
+
if (param.residue_number !== undefined) {
|
|
235
|
+
predicates.residue.push(l => structure_1.StructureProperties.residue.label_seq_id(l.element) === param.residue_number);
|
|
169
236
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
if (!siftMappings || currentAccession !== param.uniprot_accession) {
|
|
173
|
-
siftMappings = sifts_mapping_1.SIFTSMapping.Provider.get(contextData.models[0]).value;
|
|
174
|
-
currentAccession = param.uniprot_accession;
|
|
175
|
-
}
|
|
176
|
-
const rI = structure_1.StructureProperties.residue.key(l.element);
|
|
177
|
-
return !!siftMappings && param.uniprot_accession === siftMappings.accession[rI] && (param.start_uniprot_residue_number <= +siftMappings.num[rI] && param.end_uniprot_residue_number >= +siftMappings.num[rI]);
|
|
178
|
-
};
|
|
237
|
+
if (param.start_residue_number !== undefined) {
|
|
238
|
+
predicates.residue.push(l => structure_1.StructureProperties.residue.label_seq_id(l.element) >= param.start_residue_number);
|
|
179
239
|
}
|
|
180
|
-
|
|
181
|
-
|
|
240
|
+
if (param.end_residue_number !== undefined) {
|
|
241
|
+
predicates.residue.push(l => structure_1.StructureProperties.residue.label_seq_id(l.element) <= param.end_residue_number);
|
|
182
242
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
const labelSeqId = structure_1.StructureProperties.residue.label_seq_id(l.element);
|
|
186
|
-
return labelSeqId >= param.start_residue_number && labelSeqId <= param.end_residue_number;
|
|
187
|
-
};
|
|
243
|
+
if (param.auth_seq_id !== undefined) {
|
|
244
|
+
predicates.residue.push(l => structure_1.StructureProperties.residue.auth_seq_id(l.element) === param.auth_seq_id);
|
|
188
245
|
}
|
|
189
|
-
|
|
190
|
-
|
|
246
|
+
if (param.auth_residue_number !== undefined) {
|
|
247
|
+
predicates.residue.push(l => structure_1.StructureProperties.residue.auth_seq_id(l.element) === param.auth_residue_number);
|
|
191
248
|
}
|
|
192
|
-
|
|
193
|
-
|
|
249
|
+
if (param.auth_ins_code_id !== undefined) {
|
|
250
|
+
predicates.residue.push(l => structure_1.StructureProperties.residue.pdbx_PDB_ins_code(l.element) === param.auth_ins_code_id);
|
|
194
251
|
}
|
|
195
|
-
|
|
196
|
-
|
|
252
|
+
if (param.start_auth_residue_number !== undefined) {
|
|
253
|
+
predicates.residue.push(l => structure_1.StructureProperties.residue.auth_seq_id(l.element) >= param.start_auth_residue_number);
|
|
254
|
+
if (param.start_auth_ins_code_id !== undefined) {
|
|
255
|
+
// This assumes insertion code come in alphabetical order, which is not always true (e.g. 1ucy chain A [auth L]). However, authors of such monstrosities do not deserve their structures to be displayed correctly.
|
|
256
|
+
predicates.residue.push(l => structure_1.StructureProperties.residue.auth_seq_id(l.element) > param.start_auth_residue_number || structure_1.StructureProperties.residue.pdbx_PDB_ins_code(l.element) >= param.start_auth_ins_code_id);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
if (param.end_auth_residue_number !== undefined) {
|
|
260
|
+
predicates.residue.push(l => structure_1.StructureProperties.residue.auth_seq_id(l.element) <= param.end_auth_residue_number);
|
|
261
|
+
if (param.end_auth_ins_code_id !== undefined) {
|
|
262
|
+
// This assumes insertion code come in alphabetical order, which is not always true (e.g. 1ucy chain A [auth L]). However, authors of such monstrosities do not deserve their structures to be displayed correctly.
|
|
263
|
+
predicates.residue.push(l => structure_1.StructureProperties.residue.auth_seq_id(l.element) < param.end_auth_residue_number || structure_1.StructureProperties.residue.pdbx_PDB_ins_code(l.element) <= param.end_auth_ins_code_id);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
if (param.uniprot_accession !== undefined) {
|
|
267
|
+
predicates.residue.push(l => { var _a; return ((_a = getSiftsMappings()) === null || _a === void 0 ? void 0 : _a.accession[structure_1.StructureProperties.residue.key(l.element)]) === param.uniprot_accession; });
|
|
197
268
|
}
|
|
198
|
-
|
|
199
|
-
|
|
269
|
+
if (param.uniprot_residue_number !== undefined) {
|
|
270
|
+
predicates.residue.push(l => { var _a; return Number((_a = getSiftsMappings()) === null || _a === void 0 ? void 0 : _a.num[structure_1.StructureProperties.residue.key(l.element)]) === param.uniprot_residue_number; });
|
|
200
271
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
const authSeqId = structure_1.StructureProperties.residue.auth_seq_id(l.element);
|
|
204
|
-
return authSeqId >= param.start_auth_residue_number && authSeqId <= param.end_auth_residue_number;
|
|
205
|
-
};
|
|
272
|
+
if (param.start_uniprot_residue_number !== undefined) {
|
|
273
|
+
predicates.residue.push(l => { var _a; return Number((_a = getSiftsMappings()) === null || _a === void 0 ? void 0 : _a.num[structure_1.StructureProperties.residue.key(l.element)]) >= param.start_uniprot_residue_number; });
|
|
206
274
|
}
|
|
207
|
-
|
|
208
|
-
|
|
275
|
+
if (param.end_uniprot_residue_number !== undefined) {
|
|
276
|
+
predicates.residue.push(l => { var _a; return Number((_a = getSiftsMappings()) === null || _a === void 0 ? void 0 : _a.num[structure_1.StructureProperties.residue.key(l.element)]) <= param.end_uniprot_residue_number; });
|
|
209
277
|
}
|
|
210
|
-
//
|
|
278
|
+
// atom
|
|
211
279
|
if (param.atoms) {
|
|
212
|
-
|
|
280
|
+
predicates.atom.push(l => param.atoms.includes(structure_1.StructureProperties.atom.label_atom_id(l.element)));
|
|
213
281
|
}
|
|
214
282
|
if (param.atom_id) {
|
|
215
|
-
|
|
283
|
+
predicates.atom.push(l => param.atom_id.includes(structure_1.StructureProperties.atom.id(l.element)));
|
|
216
284
|
}
|
|
217
|
-
selections.push(
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
285
|
+
selections.push({
|
|
286
|
+
entityTest: predicateConjunction(predicates.entity),
|
|
287
|
+
chainTest: predicateConjunction(predicates.chain),
|
|
288
|
+
residueTest: predicateConjunction(predicates.residue),
|
|
289
|
+
atomTest: predicateConjunction(predicates.atom),
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
const atmGroupsQueries = selections.map(selection => structure_1.Queries.generators.atoms(selection));
|
|
223
293
|
return structure_1.Queries.combinators.merge(atmGroupsQueries);
|
|
224
294
|
}
|
|
225
295
|
QueryHelper.getQueryObject = getQueryObject;
|
|
296
|
+
function predicateConjunction(predicates) {
|
|
297
|
+
if (predicates.length === 0)
|
|
298
|
+
return undefined;
|
|
299
|
+
if (predicates.length === 1)
|
|
300
|
+
return predicates[0];
|
|
301
|
+
return (x => predicates.every(pred => pred(x)));
|
|
302
|
+
}
|
|
226
303
|
function getInteractivityLoci(params, contextData) {
|
|
227
304
|
const sel = query_1.StructureQuery.run(QueryHelper.getQueryObject(params, contextData), contextData);
|
|
228
305
|
return structure_1.StructureSelection.toLociWithSourceUnits(sel);
|
|
@@ -234,7 +311,7 @@ var QueryHelper;
|
|
|
234
311
|
return structure_1.StructureSelection.toLociWithSourceUnits(sel);
|
|
235
312
|
}
|
|
236
313
|
QueryHelper.getHetLoci = getHetLoci;
|
|
237
|
-
})(QueryHelper
|
|
314
|
+
})(QueryHelper || (exports.QueryHelper = QueryHelper = {}));
|
|
238
315
|
var ModelInfo;
|
|
239
316
|
(function (ModelInfo) {
|
|
240
317
|
function get(model, structures) {
|
|
@@ -267,7 +344,7 @@ var ModelInfo;
|
|
|
267
344
|
});
|
|
268
345
|
}
|
|
269
346
|
ModelInfo.get = get;
|
|
270
|
-
})(ModelInfo
|
|
347
|
+
})(ModelInfo || (exports.ModelInfo = ModelInfo = {}));
|
|
271
348
|
/** Run `action` with showing a message in the bottom-left corner of the plugin UI */
|
|
272
349
|
function runWithProgressMessage(plugin, progressMessage, action) {
|
|
273
350
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -287,7 +364,6 @@ function runWithProgressMessage(plugin, progressMessage, action) {
|
|
|
287
364
|
yield plugin.runTask(task);
|
|
288
365
|
});
|
|
289
366
|
}
|
|
290
|
-
exports.runWithProgressMessage = runWithProgressMessage;
|
|
291
367
|
/** Return URL for a ModelServer request.
|
|
292
368
|
* If `queryType` is 'full' and `lowPrecisionCoords` is false, return URL of the static file instead (updated mmCIF or bCIF). */
|
|
293
369
|
function getStructureUrl(initParams, request) {
|
|
@@ -304,7 +380,6 @@ function getStructureUrl(initParams, request) {
|
|
|
304
380
|
return (queryString !== '') ? `${url}?${queryString}` : url;
|
|
305
381
|
}
|
|
306
382
|
}
|
|
307
|
-
exports.getStructureUrl = getStructureUrl;
|
|
308
383
|
/** Combine URL parts into one URL while avoiding double slashes. Examples:
|
|
309
384
|
* combineUrl('https://example.org', '1tqn') -> 'https://example.org/1tqn';
|
|
310
385
|
* combineUrl('https://example.org/', '1tqn') -> 'https://example.org/1tqn'; */
|
|
@@ -315,7 +390,6 @@ function combineUrl(firstPart, ...moreParts) {
|
|
|
315
390
|
}
|
|
316
391
|
return result;
|
|
317
392
|
}
|
|
318
|
-
exports.combineUrl = combineUrl;
|
|
319
393
|
/** Create a copy of object `object`, fill in missing/undefined keys using `defaults`.
|
|
320
394
|
* This is similar to {...defaults,...object} but `undefined` in `object` will not override a value from `defaults`. */
|
|
321
395
|
function addDefaults(object, defaults) {
|
|
@@ -326,7 +400,6 @@ function addDefaults(object, defaults) {
|
|
|
326
400
|
}
|
|
327
401
|
return result;
|
|
328
402
|
}
|
|
329
|
-
exports.addDefaults = addDefaults;
|
|
330
403
|
/** Convert `colorVal` from any of supported color formats (e.g. 'yellow', '#ffff00', {r:255,g:255,b:0}) to `Color`.
|
|
331
404
|
* Return default color (gray) if `colorVal` is undefined or null.
|
|
332
405
|
*/
|
|
@@ -349,12 +422,11 @@ function normalizeColor(colorVal, defaultColor = color_1.Color.fromRgb(170, 170,
|
|
|
349
422
|
}
|
|
350
423
|
return defaultColor;
|
|
351
424
|
}
|
|
352
|
-
exports.normalizeColor = normalizeColor;
|
|
353
425
|
/** Apply overpaint to every representation of every component in a structure.
|
|
354
426
|
* Excludes representations created as "added representations" by `PDBeMolstarPlugin.visual.select`. */
|
|
355
427
|
function applyOverpaint(plugin, structRef, overpaintLayers) {
|
|
356
|
-
var _a;
|
|
357
428
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
429
|
+
var _a;
|
|
358
430
|
if (overpaintLayers.length === 0)
|
|
359
431
|
return;
|
|
360
432
|
const update = plugin.build();
|
|
@@ -378,7 +450,6 @@ function applyOverpaint(plugin, structRef, overpaintLayers) {
|
|
|
378
450
|
yield update.commit();
|
|
379
451
|
});
|
|
380
452
|
}
|
|
381
|
-
exports.applyOverpaint = applyOverpaint;
|
|
382
453
|
exports.Tags = {
|
|
383
454
|
/** Tag needed for `clearStructureOverpaint`; defined in src/mol-plugin-state/helpers/structure-overpaint.ts but private */
|
|
384
455
|
Overpaint: 'overpaint-controls',
|
|
@@ -405,7 +476,6 @@ function getComponentTypeFromTags(tags) {
|
|
|
405
476
|
}
|
|
406
477
|
return undefined;
|
|
407
478
|
}
|
|
408
|
-
exports.getComponentTypeFromTags = getComponentTypeFromTags;
|
|
409
479
|
/** Return a new array containing `values` without duplicates (only first occurrence will be kept).
|
|
410
480
|
* Values v1, v2 are considered duplicates when `key(v1)===key(v2)`. */
|
|
411
481
|
function distinct(values, key = (value => value)) {
|
|
@@ -420,7 +490,6 @@ function distinct(values, key = (value => value)) {
|
|
|
420
490
|
}
|
|
421
491
|
return out;
|
|
422
492
|
}
|
|
423
|
-
exports.distinct = distinct;
|
|
424
493
|
/** Group elements by result of `groupFunction` applied to them */
|
|
425
494
|
function groupElements(elements, groupFunction) {
|
|
426
495
|
const groups = [];
|
|
@@ -442,20 +511,17 @@ function groupElements(elements, groupFunction) {
|
|
|
442
511
|
members,
|
|
443
512
|
};
|
|
444
513
|
}
|
|
445
|
-
exports.groupElements = groupElements;
|
|
446
514
|
/** Return a mapping of elements to their index in the `elements` array */
|
|
447
515
|
function createIndex(elements) {
|
|
448
516
|
const index = new Map();
|
|
449
517
|
elements.forEach((elem, i) => index.set(elem, i));
|
|
450
518
|
return index;
|
|
451
519
|
}
|
|
452
|
-
exports.createIndex = createIndex;
|
|
453
520
|
/** Return modulo of two numbers (a % b) within range [0, b) */
|
|
454
521
|
function nonnegativeModulo(a, b) {
|
|
455
522
|
const modulo = a % b;
|
|
456
523
|
return (modulo < 0) ? modulo + b : modulo;
|
|
457
524
|
}
|
|
458
|
-
exports.nonnegativeModulo = nonnegativeModulo;
|
|
459
525
|
/** Queue for running jobs where enqueued jobs get discarded when a new job is enqueued.
|
|
460
526
|
* (Discarded jobs may or may not actually be executed, but their result is not accessible anyway.) */
|
|
461
527
|
class PreemptiveQueue {
|
|
@@ -520,4 +586,32 @@ var PluginConfigUtils;
|
|
|
520
586
|
return values;
|
|
521
587
|
}
|
|
522
588
|
PluginConfigUtils.getConfigValues = getConfigValues;
|
|
523
|
-
})(PluginConfigUtils
|
|
589
|
+
})(PluginConfigUtils || (exports.PluginConfigUtils = PluginConfigUtils = {}));
|
|
590
|
+
function pluginLayoutStateFromInitParams(initParams) {
|
|
591
|
+
return {
|
|
592
|
+
isExpanded: initParams.expanded,
|
|
593
|
+
showControls: !initParams.hideControls,
|
|
594
|
+
regionState: {
|
|
595
|
+
left: initParams.leftPanel ? 'full' : 'hidden',
|
|
596
|
+
right: initParams.rightPanel ? 'full' : 'hidden',
|
|
597
|
+
top: initParams.sequencePanel ? 'full' : 'hidden',
|
|
598
|
+
bottom: initParams.logPanel ? 'full' : 'hidden',
|
|
599
|
+
},
|
|
600
|
+
controlsDisplay: initParams.reactive ? 'reactive' : initParams.landscape ? 'landscape' : layout_1.PluginLayoutStateParams.controlsDisplay.defaultValue,
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
function getRotationMat4(view) {
|
|
604
|
+
switch (view) {
|
|
605
|
+
case 'front': return linear_algebra_1.Mat4.identity();
|
|
606
|
+
case 'back': return [-1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1];
|
|
607
|
+
case 'right': return [0, 0, -1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1];
|
|
608
|
+
case 'left': return [0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1];
|
|
609
|
+
case 'top': return [1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1];
|
|
610
|
+
case 'bottom': return [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1];
|
|
611
|
+
default: {
|
|
612
|
+
const out = linear_algebra_1.Mat4.fromMat3((0, linear_algebra_1.Mat4)(), view);
|
|
613
|
+
out[15] = 1;
|
|
614
|
+
return out;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
}
|
package/lib/labels.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { PluginBehavior } from 'molstar/lib/mol-plugin/behavior';
|
|
2
|
-
export declare const PDBeLociLabelProvider: import("molstar/lib/mol-state
|
|
2
|
+
export declare const PDBeLociLabelProvider: import("molstar/lib/mol-state").StateTransformer<PluginBehavior.Category, PluginBehavior.Behavior, {}>;
|
package/lib/loci-details.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.lociDetails = lociDetails;
|
|
4
|
+
exports.bondLabel = bondLabel;
|
|
5
|
+
exports._bundleLabel = _bundleLabel;
|
|
4
6
|
const int_1 = require("molstar/lib/mol-data/int");
|
|
5
7
|
const sifts_mapping_1 = require("molstar/lib/mol-model-props/sequence/sifts-mapping");
|
|
6
8
|
const structure_1 = require("molstar/lib/mol-model/structure");
|
|
@@ -12,13 +14,12 @@ function lociDetails(loci) {
|
|
|
12
14
|
return structureElementStatsDetail(structure_1.StructureElement.Stats.ofLoci(loci));
|
|
13
15
|
case 'bond-loci': {
|
|
14
16
|
const bond = loci.bonds[0];
|
|
15
|
-
return bond ? bondLabel(bond, 'element') :
|
|
17
|
+
return bond ? bondLabel(bond, 'element') : {};
|
|
16
18
|
}
|
|
17
19
|
default:
|
|
18
20
|
return undefined;
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
|
-
exports.lociDetails = lociDetails;
|
|
22
23
|
function structureElementStatsDetail(stats) {
|
|
23
24
|
const { chainCount, residueCount, elementCount } = stats;
|
|
24
25
|
if (elementCount === 1 && residueCount === 0 && chainCount === 0) {
|
|
@@ -100,7 +101,6 @@ function bondLabel(bond, granularity) {
|
|
|
100
101
|
],
|
|
101
102
|
}, granularity);
|
|
102
103
|
}
|
|
103
|
-
exports.bondLabel = bondLabel;
|
|
104
104
|
function _bundleLabel(bundle, granularity) {
|
|
105
105
|
let isSingleElements = true;
|
|
106
106
|
for (const l of bundle.loci) {
|
|
@@ -125,4 +125,3 @@ function _bundleLabel(bundle, granularity) {
|
|
|
125
125
|
return elementDetails;
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
exports._bundleLabel = _bundleLabel;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PluginCustomControls = exports.ExtensionCustomState =
|
|
3
|
+
exports.PluginCustomControls = exports.ExtensionCustomState = void 0;
|
|
4
|
+
exports.PluginCustomState = PluginCustomState;
|
|
4
5
|
;
|
|
5
6
|
;
|
|
6
7
|
/** Access `plugin.customState` only through this function to get proper typing.
|
|
@@ -9,7 +10,6 @@ function PluginCustomState(plugin) {
|
|
|
9
10
|
var _a;
|
|
10
11
|
return (_a = plugin.customState) !== null && _a !== void 0 ? _a : (plugin.customState = {});
|
|
11
12
|
}
|
|
12
|
-
exports.PluginCustomState = PluginCustomState;
|
|
13
13
|
/** Functions for accessing plugin-bound custom state for extensions. */
|
|
14
14
|
exports.ExtensionCustomState = {
|
|
15
15
|
/** Get plugin-bound custom state for a specific extension. If not present, initialize with empty object. */
|