pdbe-molstar 3.2.1-beta.1 → 3.2.1-beta.3
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/README.md +1 -1
- 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 +1 -1
- package/build/pdbe-molstar.css +2 -2
- package/lib/alphafold-transparency.d.ts +3 -3
- package/lib/alphafold-transparency.js +10 -11
- package/lib/custom-events.d.ts +1 -1
- package/lib/custom-events.js +1 -1
- package/lib/domain-annotations/behavior.d.ts +1 -1
- package/lib/domain-annotations/behavior.js +3 -3
- package/lib/domain-annotations/color.d.ts +3 -3
- package/lib/domain-annotations/color.js +4 -4
- package/lib/domain-annotations/prop.d.ts +6 -6
- package/lib/domain-annotations/prop.js +7 -7
- package/lib/extensions/foldseek.d.ts +1 -1
- package/lib/extensions/foldseek.js +2 -2
- package/lib/helpers.d.ts +20 -13
- package/lib/helpers.js +49 -11
- package/lib/index(light).d.ts +4 -179
- package/lib/index(light).js +6 -1234
- package/lib/index.d.ts +4 -179
- package/lib/index.js +6 -1234
- package/lib/labels.d.ts +1 -1
- package/lib/labels.js +3 -3
- package/lib/loci-details.d.ts +2 -2
- package/lib/loci-details.js +3 -3
- package/lib/plugin-custom-state.d.ts +6 -9
- package/lib/sifts-mapping.d.ts +3 -3
- package/lib/sifts-mapping.js +4 -4
- package/lib/sifts-mappings-behaviour.d.ts +1 -1
- package/lib/sifts-mappings-behaviour.js +10 -10
- package/lib/spec.d.ts +36 -11
- package/lib/spec.js +38 -7
- package/lib/{overlay.scss → styles/index.scss} +11 -0
- package/lib/superposition-export.d.ts +1 -1
- package/lib/superposition-export.js +7 -7
- package/lib/superposition-focus-representation.d.ts +3 -3
- package/lib/superposition-focus-representation.js +8 -8
- package/lib/superposition-sifts-mapping.d.ts +5 -5
- package/lib/superposition-sifts-mapping.js +3 -3
- package/lib/superposition.d.ts +7 -4
- package/lib/superposition.js +147 -184
- package/lib/ui/alphafold-superposition.d.ts +4 -4
- package/lib/ui/alphafold-superposition.js +8 -8
- package/lib/ui/alphafold-tranparency.d.ts +2 -2
- package/lib/ui/alphafold-tranparency.js +4 -4
- package/lib/ui/annotation-controls.d.ts +1 -1
- package/lib/ui/annotation-controls.js +7 -7
- package/lib/ui/annotation-row-controls.d.ts +2 -2
- package/lib/ui/annotation-row-controls.js +3 -3
- package/lib/ui/export-superposition.d.ts +1 -1
- package/lib/ui/export-superposition.js +9 -9
- package/lib/ui/pdbe-left-panel.d.ts +8 -8
- package/lib/ui/pdbe-left-panel.js +26 -47
- package/lib/ui/pdbe-screenshot-controls.d.ts +2 -2
- package/lib/ui/pdbe-screenshot-controls.js +7 -7
- package/lib/ui/pdbe-structure-controls.d.ts +1 -1
- package/lib/ui/pdbe-structure-controls.js +8 -8
- package/lib/ui/pdbe-viewport-controls.d.ts +1 -1
- package/lib/ui/pdbe-viewport-controls.js +4 -2
- package/lib/ui/segment-tree.d.ts +4 -4
- package/lib/ui/segment-tree.js +12 -32
- package/lib/ui/superposition-components.d.ts +1 -1
- package/lib/ui/superposition-components.js +8 -8
- package/lib/ui/superposition-viewport.d.ts +1 -1
- package/lib/ui/superposition-viewport.js +5 -5
- package/lib/ui/symmetry-annotation-controls.d.ts +6 -6
- package/lib/ui/symmetry-annotation-controls.js +6 -6
- package/lib/viewer.d.ts +178 -0
- package/lib/viewer.js +1286 -0
- package/package.json +4 -4
package/lib/superposition.js
CHANGED
|
@@ -1,40 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transform = exports.renderSuperposition = exports.superposeAf = exports.loadAfStructure = exports.initSuperposition = void 0;
|
|
3
|
+
exports.transform = exports.renderSuperposition = exports.superposeAf = exports.loadAfStructure = exports.initSuperposition = exports.getNextColor = exports.SuperpositionColorPalette = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
|
-
var linear_algebra_1 = require("
|
|
6
|
-
var structure_1 = require("
|
|
7
|
-
var transforms_1 = require("
|
|
8
|
-
var builder_1 = require("
|
|
9
|
-
var script_1 = require("
|
|
10
|
-
var mol_state_1 = require("
|
|
11
|
-
var mol_task_1 = require("
|
|
12
|
-
var assets_1 = require("
|
|
13
|
-
var color_1 = require("
|
|
14
|
-
var lists_1 = require("
|
|
5
|
+
var linear_algebra_1 = require("molstar/lib/mol-math/linear-algebra");
|
|
6
|
+
var structure_1 = require("molstar/lib/mol-model/structure");
|
|
7
|
+
var transforms_1 = require("molstar/lib/mol-plugin-state/transforms");
|
|
8
|
+
var builder_1 = require("molstar/lib/mol-script/language/builder");
|
|
9
|
+
var script_1 = require("molstar/lib/mol-script/script");
|
|
10
|
+
var mol_state_1 = require("molstar/lib/mol-state");
|
|
11
|
+
var mol_task_1 = require("molstar/lib/mol-task");
|
|
12
|
+
var assets_1 = require("molstar/lib/mol-util/assets");
|
|
13
|
+
var color_1 = require("molstar/lib/mol-util/color/color");
|
|
14
|
+
var lists_1 = require("molstar/lib/mol-util/color/lists");
|
|
15
15
|
var alphafold_transparency_1 = require("./alphafold-transparency");
|
|
16
16
|
var helpers_1 = require("./helpers");
|
|
17
17
|
var plugin_custom_state_1 = require("./plugin-custom-state");
|
|
18
18
|
var superposition_sifts_mapping_1 = require("./superposition-sifts-mapping");
|
|
19
|
-
function
|
|
20
|
-
|
|
19
|
+
function combinedColorPalette(palettes) {
|
|
20
|
+
return palettes.flatMap(function (paletteName) { return lists_1.ColorLists[paletteName].list; });
|
|
21
|
+
}
|
|
22
|
+
exports.SuperpositionColorPalette = combinedColorPalette(['dark-2', 'red-yellow-green', 'paired', 'set-1', 'accent', 'set-2', 'rainbow']);
|
|
23
|
+
var DefaultLigandColor = color_1.Color.fromRgb(253, 3, 253);
|
|
24
|
+
function getNextColor(plugin, segmentIndex) {
|
|
21
25
|
var spState = (0, plugin_custom_state_1.PluginCustomState)(plugin).superpositionState;
|
|
22
26
|
if (!spState)
|
|
23
27
|
throw new Error('customState.superpositionState has not been initialized');
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
colorIndex += 1;
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
colorIndex = 0;
|
|
31
|
-
palleteIndex = spState.colorPalette[palleteIndex + 1] ? palleteIndex + 1 : 0;
|
|
32
|
-
}
|
|
33
|
-
var palleteName = spState.colorPalette[palleteIndex];
|
|
34
|
-
spState.colorState[segmentIndex].palleteIndex = palleteIndex;
|
|
35
|
-
spState.colorState[segmentIndex].colorIndex = colorIndex;
|
|
36
|
-
return clList[palleteName].list[colorIndex];
|
|
28
|
+
var nextColor = exports.SuperpositionColorPalette[spState.colorCounters[segmentIndex]];
|
|
29
|
+
spState.colorCounters[segmentIndex] = (spState.colorCounters[segmentIndex] + 1) % exports.SuperpositionColorPalette.length;
|
|
30
|
+
return nextColor;
|
|
37
31
|
}
|
|
32
|
+
exports.getNextColor = getNextColor;
|
|
38
33
|
function initSuperposition(plugin, completeSubject) {
|
|
39
34
|
var _a;
|
|
40
35
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
@@ -62,8 +57,7 @@ function initSuperposition(plugin, completeSubject) {
|
|
|
62
57
|
invalidStruct: [],
|
|
63
58
|
noMatrixStruct: [],
|
|
64
59
|
hets: {},
|
|
65
|
-
|
|
66
|
-
colorState: [],
|
|
60
|
+
colorCounters: [],
|
|
67
61
|
alphafold: {
|
|
68
62
|
apiData: {
|
|
69
63
|
cif: '',
|
|
@@ -104,7 +98,7 @@ function initSuperposition(plugin, completeSubject) {
|
|
|
104
98
|
segmentData.forEach(function () {
|
|
105
99
|
customState_1.superpositionState.loadedStructs.push([]);
|
|
106
100
|
customState_1.superpositionState.visibleRefs.push([]);
|
|
107
|
-
customState_1.superpositionState.
|
|
101
|
+
customState_1.superpositionState.colorCounters.push(0);
|
|
108
102
|
});
|
|
109
103
|
superpositionParams_1 = customState_1.initParams.superpositionParams;
|
|
110
104
|
segmentIndex = (superpositionParams_1 === null || superpositionParams_1 === void 0 ? void 0 : superpositionParams_1.segment) ? superpositionParams_1.segment - 1 : 0;
|
|
@@ -120,7 +114,7 @@ function initSuperposition(plugin, completeSubject) {
|
|
|
120
114
|
return;
|
|
121
115
|
// Add respresentative structure to the list
|
|
122
116
|
if (superpositionParams_1 === null || superpositionParams_1 === void 0 ? void 0 : superpositionParams_1.superposeAll) {
|
|
123
|
-
entryList_1
|
|
117
|
+
entryList_1.push.apply(entryList_1, cluster);
|
|
124
118
|
}
|
|
125
119
|
else {
|
|
126
120
|
entryList_1.push(cluster[0]);
|
|
@@ -321,36 +315,27 @@ function renderSuperposition(plugin, segmentIndex, entryList) {
|
|
|
321
315
|
}
|
|
322
316
|
// Load Coordinates and render respresentations
|
|
323
317
|
return [2 /*return*/, plugin.dataTransaction(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
324
|
-
var spState,
|
|
325
|
-
var
|
|
326
|
-
var
|
|
327
|
-
return tslib_1.__generator(this, function (
|
|
328
|
-
switch (
|
|
318
|
+
var spState, _i, entryList_2, s, request, strUrl, strInstance, modelRef, clearOnFail, polymerInstance, modelInstance, isBinary, _a, model, structure, matrix, chainSel, uniformColor1, uniformColor2, invalidStruct, state, hetInfo, hets, _b, hets_1, hets_1_1, het, ligand, labelTagParams, hetColor, ligandExp, e_2_1, carbEntityCount, allCarbPolymers, polymerChainWithSurroundings, i, _c, _d, carbEntityChainId, carbEntityChain, carbEntityChainInVicinity, data, carbChainSel, carbLigands, carbLigNamesAndCount, carbLigList, _e, _f, carbLigs, ligResDetails, carbVisLabel, branchedEntity, labelTagParams, ligandExp, loadedStructIndex;
|
|
319
|
+
var _g, e_2, _h, _j;
|
|
320
|
+
var _k;
|
|
321
|
+
return tslib_1.__generator(this, function (_l) {
|
|
322
|
+
switch (_l.label) {
|
|
329
323
|
case 0:
|
|
330
324
|
if (!customState.initParams)
|
|
331
325
|
throw new Error('customState.initParams has not been initialized');
|
|
332
326
|
if (!customState.superpositionState)
|
|
333
327
|
throw new Error('customState.superpositionState has not been initialized');
|
|
334
328
|
spState = customState.superpositionState;
|
|
335
|
-
|
|
329
|
+
_i = 0, entryList_2 = entryList;
|
|
330
|
+
_l.label = 1;
|
|
336
331
|
case 1:
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
_q.label = 2;
|
|
340
|
-
case 2: return [4 /*yield*/, entryList_2.next()];
|
|
341
|
-
case 3:
|
|
342
|
-
if (!(entryList_2_1 = _q.sent(), _h = entryList_2_1.done, !_h)) return [3 /*break*/, 46];
|
|
343
|
-
_k = entryList_2_1.value;
|
|
344
|
-
_a = false;
|
|
345
|
-
_q.label = 4;
|
|
346
|
-
case 4:
|
|
347
|
-
_q.trys.push([4, , 44, 45]);
|
|
348
|
-
s = _k;
|
|
332
|
+
if (!(_i < entryList_2.length)) return [3 /*break*/, 41];
|
|
333
|
+
s = entryList_2[_i];
|
|
349
334
|
// validate matrix availability
|
|
350
335
|
if (!spState.matrixData["".concat(s.pdb_id, "_").concat(s.auth_asym_id)]) {
|
|
351
336
|
spState.noMatrixStruct.push("".concat(s.pdb_id, "_").concat(s.struct_asym_id));
|
|
352
337
|
spState.invalidStruct.push("".concat(s.pdb_id, "_").concat(s.struct_asym_id));
|
|
353
|
-
return [3 /*break*/,
|
|
338
|
+
return [3 /*break*/, 40];
|
|
354
339
|
}
|
|
355
340
|
spState.loadedStructs[segmentIndex].push("".concat(s.pdb_id, "_").concat(s.struct_asym_id));
|
|
356
341
|
request = (superpositionParams && superpositionParams.ligandView) ?
|
|
@@ -360,26 +345,26 @@ function renderSuperposition(plugin, segmentIndex, entryList) {
|
|
|
360
345
|
strInstance = void 0;
|
|
361
346
|
modelRef = void 0;
|
|
362
347
|
clearOnFail = true;
|
|
363
|
-
if (!(superpositionParams && superpositionParams.ligandView && spState.entries[s.pdb_id])) return [3 /*break*/,
|
|
348
|
+
if (!(superpositionParams && superpositionParams.ligandView && spState.entries[s.pdb_id])) return [3 /*break*/, 3];
|
|
364
349
|
polymerInstance = plugin.state.data.select(spState.entries[s.pdb_id])[0];
|
|
365
350
|
modelRef = polymerInstance.transform.parent;
|
|
366
351
|
modelInstance = plugin.state.data.select(modelRef)[0];
|
|
367
352
|
return [4 /*yield*/, plugin.builders.structure.createStructure(modelInstance, { name: 'model', params: {} })];
|
|
368
|
-
case
|
|
369
|
-
strInstance =
|
|
353
|
+
case 2:
|
|
354
|
+
strInstance = _l.sent();
|
|
370
355
|
clearOnFail = false;
|
|
371
|
-
return [3 /*break*/,
|
|
372
|
-
case
|
|
356
|
+
return [3 /*break*/, 5];
|
|
357
|
+
case 3:
|
|
373
358
|
isBinary = customState.initParams.encoding === 'bcif' ? true : false;
|
|
374
359
|
return [4 /*yield*/, loadStructure(plugin, strUrl, 'mmcif', isBinary)];
|
|
375
|
-
case
|
|
376
|
-
|
|
360
|
+
case 4:
|
|
361
|
+
_a = _l.sent(), model = _a.model, structure = _a.structure;
|
|
377
362
|
strInstance = structure;
|
|
378
363
|
modelRef = model.ref;
|
|
379
|
-
|
|
380
|
-
case
|
|
364
|
+
_l.label = 5;
|
|
365
|
+
case 5:
|
|
381
366
|
if (!strInstance)
|
|
382
|
-
return [3 /*break*/,
|
|
367
|
+
return [3 /*break*/, 40];
|
|
383
368
|
// Store Refs in state
|
|
384
369
|
if (!spState.models["".concat(s.pdb_id, "_").concat(s.struct_asym_id)])
|
|
385
370
|
spState.models["".concat(s.pdb_id, "_").concat(s.struct_asym_id)] = strInstance === null || strInstance === void 0 ? void 0 : strInstance.ref;
|
|
@@ -387,107 +372,103 @@ function renderSuperposition(plugin, segmentIndex, entryList) {
|
|
|
387
372
|
spState.entries[s.pdb_id] = strInstance === null || strInstance === void 0 ? void 0 : strInstance.ref;
|
|
388
373
|
matrix = linear_algebra_1.Mat4.ofRows(customState.superpositionState.matrixData["".concat(s.pdb_id, "_").concat(s.auth_asym_id)].matrix);
|
|
389
374
|
return [4 /*yield*/, transform(plugin, strInstance, matrix)];
|
|
390
|
-
case
|
|
391
|
-
|
|
375
|
+
case 6:
|
|
376
|
+
_l.sent();
|
|
392
377
|
chainSel = void 0;
|
|
393
|
-
if (!((superpositionParams && superpositionParams.ligandView) && s.is_representative)) return [3 /*break*/,
|
|
394
|
-
uniformColor1 =
|
|
378
|
+
if (!((superpositionParams && superpositionParams.ligandView) && s.is_representative)) return [3 /*break*/, 10];
|
|
379
|
+
uniformColor1 = getNextColor(plugin, segmentIndex);
|
|
395
380
|
return [4 /*yield*/, plugin.builders.structure.tryCreateComponentFromExpression(strInstance, chainSelection(s.struct_asym_id), "Chain-".concat(segmentIndex), { label: "Chain", tags: ["superposition-sel"] })];
|
|
396
|
-
case
|
|
397
|
-
chainSel =
|
|
398
|
-
if (!chainSel) return [3 /*break*/,
|
|
381
|
+
case 7:
|
|
382
|
+
chainSel = _l.sent();
|
|
383
|
+
if (!chainSel) return [3 /*break*/, 9];
|
|
399
384
|
return [4 /*yield*/, plugin.builders.structure.representation.addRepresentation(chainSel, { type: 'putty', color: 'uniform', colorParams: { value: uniformColor1 }, size: 'uniform' }, { tag: "superposition-visual" })];
|
|
400
|
-
case
|
|
401
|
-
|
|
385
|
+
case 8:
|
|
386
|
+
_l.sent();
|
|
402
387
|
spState.refMaps[chainSel.ref] = "".concat(s.pdb_id, "_").concat(s.struct_asym_id);
|
|
403
|
-
|
|
404
|
-
case
|
|
405
|
-
case
|
|
406
|
-
if (!((superpositionParams && superpositionParams.ligandView) && !s.is_representative)) return [3 /*break*/,
|
|
407
|
-
return [3 /*break*/,
|
|
408
|
-
case
|
|
409
|
-
uniformColor2 =
|
|
388
|
+
_l.label = 9;
|
|
389
|
+
case 9: return [3 /*break*/, 14];
|
|
390
|
+
case 10:
|
|
391
|
+
if (!((superpositionParams && superpositionParams.ligandView) && !s.is_representative)) return [3 /*break*/, 11];
|
|
392
|
+
return [3 /*break*/, 14];
|
|
393
|
+
case 11:
|
|
394
|
+
uniformColor2 = getNextColor(plugin, segmentIndex);
|
|
410
395
|
return [4 /*yield*/, plugin.builders.structure.tryCreateComponentStatic(strInstance, 'polymer', { label: "Chain", tags: ["Chain-".concat(segmentIndex), "superposition-sel"] })];
|
|
411
|
-
case
|
|
412
|
-
chainSel =
|
|
413
|
-
if (!chainSel) return [3 /*break*/,
|
|
396
|
+
case 12:
|
|
397
|
+
chainSel = _l.sent();
|
|
398
|
+
if (!chainSel) return [3 /*break*/, 14];
|
|
414
399
|
return [4 /*yield*/, plugin.builders.structure.representation.addRepresentation(chainSel, { type: 'putty', color: 'uniform', colorParams: { value: uniformColor2 }, size: 'uniform' }, { tag: "superposition-visual" })];
|
|
415
|
-
case
|
|
416
|
-
|
|
400
|
+
case 13:
|
|
401
|
+
_l.sent();
|
|
417
402
|
spState.refMaps[chainSel.ref] = "".concat(s.pdb_id, "_").concat(s.struct_asym_id);
|
|
418
|
-
|
|
419
|
-
case
|
|
403
|
+
_l.label = 14;
|
|
404
|
+
case 14:
|
|
420
405
|
invalidStruct = chainSel ? false : true;
|
|
421
|
-
if (!(superpositionParams && superpositionParams.ligandView)) return [3 /*break*/,
|
|
406
|
+
if (!(superpositionParams && superpositionParams.ligandView)) return [3 /*break*/, 40];
|
|
422
407
|
state = plugin.state.data;
|
|
423
408
|
return [4 /*yield*/, getLigandNamesFromModelData(plugin, state, modelRef)];
|
|
424
|
-
case
|
|
425
|
-
hetInfo =
|
|
409
|
+
case 15:
|
|
410
|
+
hetInfo = _l.sent();
|
|
426
411
|
hets = hetInfo ? hetInfo.hetNames : [];
|
|
427
|
-
if (!(hets && hets.length > 0)) return [3 /*break*/,
|
|
428
|
-
|
|
412
|
+
if (!(hets && hets.length > 0)) return [3 /*break*/, 32];
|
|
413
|
+
_l.label = 16;
|
|
414
|
+
case 16:
|
|
415
|
+
_l.trys.push([16, 26, 27, 32]);
|
|
416
|
+
_b = true, hets_1 = (e_2 = void 0, tslib_1.__asyncValues(hets));
|
|
417
|
+
_l.label = 17;
|
|
418
|
+
case 17: return [4 /*yield*/, hets_1.next()];
|
|
419
|
+
case 18:
|
|
420
|
+
if (!(hets_1_1 = _l.sent(), _g = hets_1_1.done, !_g)) return [3 /*break*/, 25];
|
|
421
|
+
_j = hets_1_1.value;
|
|
422
|
+
_b = false;
|
|
423
|
+
_l.label = 19;
|
|
429
424
|
case 19:
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
_q.label = 20;
|
|
433
|
-
case 20: return [4 /*yield*/, hets_1.next()];
|
|
434
|
-
case 21:
|
|
435
|
-
if (!(hets_1_1 = _q.sent(), _l = hets_1_1.done, !_l)) return [3 /*break*/, 28];
|
|
436
|
-
_o = hets_1_1.value;
|
|
437
|
-
_c = false;
|
|
438
|
-
_q.label = 22;
|
|
439
|
-
case 22:
|
|
440
|
-
_q.trys.push([22, , 26, 27]);
|
|
441
|
-
het = _o;
|
|
425
|
+
_l.trys.push([19, , 23, 24]);
|
|
426
|
+
het = _j;
|
|
442
427
|
ligand = builder_1.MolScriptBuilder.struct.generator.atomGroups({
|
|
443
428
|
'chain-test': builder_1.MolScriptBuilder.core.rel.eq([builder_1.MolScriptBuilder.struct.atomProperty.macromolecular.auth_asym_id(), s.auth_asym_id]),
|
|
444
429
|
'residue-test': builder_1.MolScriptBuilder.core.rel.eq([builder_1.MolScriptBuilder.struct.atomProperty.macromolecular.label_comp_id(), het]),
|
|
445
430
|
'group-by': builder_1.MolScriptBuilder.core.str.concat([builder_1.MolScriptBuilder.struct.atomProperty.core.operatorName(), builder_1.MolScriptBuilder.struct.atomProperty.macromolecular.residueKey()])
|
|
446
431
|
});
|
|
447
432
|
labelTagParams = { label: "".concat(het), tags: ["superposition-ligand-sel"] };
|
|
448
|
-
hetColor =
|
|
449
|
-
if (superpositionParams === null || superpositionParams === void 0 ? void 0 : superpositionParams.ligandColor) {
|
|
450
|
-
_d = superpositionParams.ligandColor, r = _d.r, g = _d.g, b = _d.b;
|
|
451
|
-
hetColor = color_1.Color.fromRgb(r, g, b);
|
|
452
|
-
}
|
|
433
|
+
hetColor = (0, helpers_1.normalizeColor)(superpositionParams.ligandColor, DefaultLigandColor);
|
|
453
434
|
return [4 /*yield*/, plugin.builders.structure.tryCreateComponentFromExpression(strInstance, ligand, "".concat(het, "-").concat(segmentIndex), labelTagParams)];
|
|
454
|
-
case
|
|
455
|
-
ligandExp =
|
|
456
|
-
if (!ligandExp) return [3 /*break*/,
|
|
435
|
+
case 20:
|
|
436
|
+
ligandExp = _l.sent();
|
|
437
|
+
if (!ligandExp) return [3 /*break*/, 22];
|
|
457
438
|
return [4 /*yield*/, plugin.builders.structure.representation.addRepresentation(ligandExp, { type: 'ball-and-stick', color: 'uniform', colorParams: { value: hetColor } }, { tag: "superposition-ligand-visual" })];
|
|
458
|
-
case
|
|
459
|
-
|
|
439
|
+
case 21:
|
|
440
|
+
_l.sent();
|
|
460
441
|
spState.refMaps[ligandExp.ref] = "".concat(s.pdb_id, "_").concat(s.struct_asym_id);
|
|
461
442
|
invalidStruct = false;
|
|
462
|
-
|
|
463
|
-
case
|
|
464
|
-
case
|
|
465
|
-
|
|
443
|
+
_l.label = 22;
|
|
444
|
+
case 22: return [3 /*break*/, 24];
|
|
445
|
+
case 23:
|
|
446
|
+
_b = true;
|
|
466
447
|
return [7 /*endfinally*/];
|
|
467
|
-
case
|
|
468
|
-
case
|
|
469
|
-
case
|
|
470
|
-
e_2_1 =
|
|
448
|
+
case 24: return [3 /*break*/, 17];
|
|
449
|
+
case 25: return [3 /*break*/, 32];
|
|
450
|
+
case 26:
|
|
451
|
+
e_2_1 = _l.sent();
|
|
471
452
|
e_2 = { error: e_2_1 };
|
|
472
|
-
return [3 /*break*/,
|
|
453
|
+
return [3 /*break*/, 32];
|
|
454
|
+
case 27:
|
|
455
|
+
_l.trys.push([27, , 30, 31]);
|
|
456
|
+
if (!(!_b && !_g && (_h = hets_1.return))) return [3 /*break*/, 29];
|
|
457
|
+
return [4 /*yield*/, _h.call(hets_1)];
|
|
458
|
+
case 28:
|
|
459
|
+
_l.sent();
|
|
460
|
+
_l.label = 29;
|
|
461
|
+
case 29: return [3 /*break*/, 31];
|
|
473
462
|
case 30:
|
|
474
|
-
_q.trys.push([30, , 33, 34]);
|
|
475
|
-
if (!(!_c && !_l && (_m = hets_1.return))) return [3 /*break*/, 32];
|
|
476
|
-
return [4 /*yield*/, _m.call(hets_1)];
|
|
477
|
-
case 31:
|
|
478
|
-
_q.sent();
|
|
479
|
-
_q.label = 32;
|
|
480
|
-
case 32: return [3 /*break*/, 34];
|
|
481
|
-
case 33:
|
|
482
463
|
if (e_2) throw e_2.error;
|
|
483
464
|
return [7 /*endfinally*/];
|
|
484
|
-
case
|
|
485
|
-
case
|
|
465
|
+
case 31: return [7 /*endfinally*/];
|
|
466
|
+
case 32:
|
|
486
467
|
carbEntityCount = hetInfo ? hetInfo.carbEntityCount : 0;
|
|
487
|
-
if (!(carbEntityCount > 0)) return [3 /*break*/,
|
|
468
|
+
if (!(carbEntityCount > 0)) return [3 /*break*/, 39];
|
|
488
469
|
return [4 /*yield*/, getCarbPolymerDetailsFromApi(plugin, s.pdb_id)];
|
|
489
|
-
case
|
|
490
|
-
allCarbPolymers =
|
|
470
|
+
case 33:
|
|
471
|
+
allCarbPolymers = _l.sent();
|
|
491
472
|
polymerChainWithSurroundings = builder_1.MolScriptBuilder.struct.modifier.includeSurroundings({
|
|
492
473
|
0: builder_1.MolScriptBuilder.struct.generator.atomGroups({
|
|
493
474
|
'entity-test': builder_1.MolScriptBuilder.core.rel.eq([builder_1.MolScriptBuilder.ammp('entityType'), 'polymer']),
|
|
@@ -498,11 +479,11 @@ function renderSuperposition(plugin, segmentIndex, entryList) {
|
|
|
498
479
|
'as-whole-residues': true
|
|
499
480
|
});
|
|
500
481
|
i = 0;
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
case
|
|
504
|
-
if (!(
|
|
505
|
-
carbEntityChainId =
|
|
482
|
+
_c = 0, _d = allCarbPolymers.branchedChains;
|
|
483
|
+
_l.label = 34;
|
|
484
|
+
case 34:
|
|
485
|
+
if (!(_c < _d.length)) return [3 /*break*/, 39];
|
|
486
|
+
carbEntityChainId = _d[_c];
|
|
506
487
|
carbEntityChain = builder_1.MolScriptBuilder.struct.generator.atomGroups({
|
|
507
488
|
'entity-test': builder_1.MolScriptBuilder.core.rel.eq([builder_1.MolScriptBuilder.ammp('entityType'), 'branched']),
|
|
508
489
|
'chain-test': builder_1.MolScriptBuilder.core.rel.eq([builder_1.MolScriptBuilder.struct.atomProperty.macromolecular.auth_asym_id(), carbEntityChainId]),
|
|
@@ -514,12 +495,12 @@ function renderSuperposition(plugin, segmentIndex, entryList) {
|
|
|
514
495
|
});
|
|
515
496
|
data = (plugin.state.data.select(strInstance.ref)[0].obj).data;
|
|
516
497
|
carbChainSel = script_1.Script.getStructureSelection(carbEntityChainInVicinity, data);
|
|
517
|
-
if (!(carbChainSel && carbChainSel.kind === 'sequence')) return [3 /*break*/,
|
|
498
|
+
if (!(carbChainSel && carbChainSel.kind === 'sequence')) return [3 /*break*/, 37];
|
|
518
499
|
carbLigands = [];
|
|
519
500
|
carbLigNamesAndCount = {};
|
|
520
501
|
carbLigList = [];
|
|
521
|
-
for (
|
|
522
|
-
carbLigs =
|
|
502
|
+
for (_e = 0, _f = allCarbPolymers.branchedLigands[i]; _e < _f.length; _e++) {
|
|
503
|
+
carbLigs = _f[_e];
|
|
523
504
|
ligResDetails = carbLigs.split('-');
|
|
524
505
|
carbLigands.push(builder_1.MolScriptBuilder.core.rel.eq([builder_1.MolScriptBuilder.struct.atomProperty.macromolecular.auth_seq_id(), +ligResDetails[1]]));
|
|
525
506
|
if (carbLigNamesAndCount[ligResDetails[0]]) {
|
|
@@ -539,22 +520,22 @@ function renderSuperposition(plugin, segmentIndex, entryList) {
|
|
|
539
520
|
});
|
|
540
521
|
labelTagParams = { label: "".concat(carbVisLabel), tags: ["superposition-carb-sel"] };
|
|
541
522
|
return [4 /*yield*/, plugin.builders.structure.tryCreateComponentFromExpression(strInstance, branchedEntity, "".concat(carbLigList.join('-'), "-").concat(segmentIndex), labelTagParams)];
|
|
542
|
-
case
|
|
543
|
-
ligandExp =
|
|
544
|
-
if (!ligandExp) return [3 /*break*/,
|
|
523
|
+
case 35:
|
|
524
|
+
ligandExp = _l.sent();
|
|
525
|
+
if (!ligandExp) return [3 /*break*/, 37];
|
|
545
526
|
return [4 /*yield*/, plugin.builders.structure.representation.addRepresentation(ligandExp, { type: 'carbohydrate' }, { tag: "superposition-carb-visual" })];
|
|
546
|
-
case
|
|
547
|
-
|
|
527
|
+
case 36:
|
|
528
|
+
_l.sent();
|
|
548
529
|
spState.refMaps[ligandExp.ref] = "".concat(s.pdb_id, "_").concat(s.struct_asym_id);
|
|
549
530
|
invalidStruct = false;
|
|
550
|
-
|
|
551
|
-
case
|
|
531
|
+
_l.label = 37;
|
|
532
|
+
case 37:
|
|
552
533
|
i++;
|
|
553
|
-
|
|
554
|
-
case
|
|
555
|
-
|
|
556
|
-
return [3 /*break*/,
|
|
557
|
-
case
|
|
534
|
+
_l.label = 38;
|
|
535
|
+
case 38:
|
|
536
|
+
_c++;
|
|
537
|
+
return [3 /*break*/, 34];
|
|
538
|
+
case 39:
|
|
558
539
|
if (invalidStruct) {
|
|
559
540
|
spState.invalidStruct.push("".concat(s.pdb_id, "_").concat(s.struct_asym_id));
|
|
560
541
|
loadedStructIndex = spState.loadedStructs[segmentIndex].indexOf("".concat(s.pdb_id, "_").concat(s.struct_asym_id));
|
|
@@ -571,33 +552,14 @@ function renderSuperposition(plugin, segmentIndex, entryList) {
|
|
|
571
552
|
else {
|
|
572
553
|
// if(interactingHets.length > 0) spState.hets[`${s.pdb_id}_${s.struct_asym_id}`] = interactingHets;
|
|
573
554
|
}
|
|
574
|
-
|
|
575
|
-
case
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
case 45: return [3 /*break*/, 2];
|
|
580
|
-
case 46: return [3 /*break*/, 53];
|
|
581
|
-
case 47:
|
|
582
|
-
e_3_1 = _q.sent();
|
|
583
|
-
e_3 = { error: e_3_1 };
|
|
584
|
-
return [3 /*break*/, 53];
|
|
585
|
-
case 48:
|
|
586
|
-
_q.trys.push([48, , 51, 52]);
|
|
587
|
-
if (!(!_a && !_h && (_j = entryList_2.return))) return [3 /*break*/, 50];
|
|
588
|
-
return [4 /*yield*/, _j.call(entryList_2)];
|
|
589
|
-
case 49:
|
|
590
|
-
_q.sent();
|
|
591
|
-
_q.label = 50;
|
|
592
|
-
case 50: return [3 /*break*/, 52];
|
|
593
|
-
case 51:
|
|
594
|
-
if (e_3) throw e_3.error;
|
|
595
|
-
return [7 /*endfinally*/];
|
|
596
|
-
case 52: return [7 /*endfinally*/];
|
|
597
|
-
case 53:
|
|
555
|
+
_l.label = 40;
|
|
556
|
+
case 40:
|
|
557
|
+
_i++;
|
|
558
|
+
return [3 /*break*/, 1];
|
|
559
|
+
case 41:
|
|
598
560
|
if (busyFlagOn) {
|
|
599
561
|
busyFlagOn = false;
|
|
600
|
-
(
|
|
562
|
+
(_k = customState.events) === null || _k === void 0 ? void 0 : _k.isBusy.next(false);
|
|
601
563
|
}
|
|
602
564
|
return [2 /*return*/];
|
|
603
565
|
}
|
|
@@ -637,7 +599,7 @@ function getLigandNamesFromModelData(plugin, state, modelRef) {
|
|
|
637
599
|
}
|
|
638
600
|
function loadStructure(plugin, url, format, isBinary) {
|
|
639
601
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
640
|
-
var data, trajectory, model, modelProperties, structure,
|
|
602
|
+
var data, trajectory, model, modelProperties, structure, e_3;
|
|
641
603
|
return tslib_1.__generator(this, function (_a) {
|
|
642
604
|
switch (_a.label) {
|
|
643
605
|
case 0:
|
|
@@ -662,7 +624,7 @@ function loadStructure(plugin, url, format, isBinary) {
|
|
|
662
624
|
_a.sent();
|
|
663
625
|
return [2 /*return*/, { data: data, trajectory: trajectory, model: model, structure: structure }];
|
|
664
626
|
case 7:
|
|
665
|
-
|
|
627
|
+
e_3 = _a.sent();
|
|
666
628
|
return [2 /*return*/, { structure: void 0 }];
|
|
667
629
|
case 8: return [2 /*return*/];
|
|
668
630
|
}
|
|
@@ -715,7 +677,7 @@ function afTransform(plugin, s, matrix, coordinateSystem) {
|
|
|
715
677
|
function getMatrixData(plugin) {
|
|
716
678
|
var _a, _b, _c;
|
|
717
679
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
718
|
-
var customState, matrixAccession, clusterRecUrlStr, assetManager, clusterRecUrl, clusterRecData,
|
|
680
|
+
var customState, matrixAccession, clusterRecUrlStr, assetManager, clusterRecUrl, clusterRecData, e_4;
|
|
719
681
|
return tslib_1.__generator(this, function (_d) {
|
|
720
682
|
switch (_d.label) {
|
|
721
683
|
case 0:
|
|
@@ -739,7 +701,7 @@ function getMatrixData(plugin) {
|
|
|
739
701
|
}
|
|
740
702
|
return [3 /*break*/, 4];
|
|
741
703
|
case 3:
|
|
742
|
-
|
|
704
|
+
e_4 = _d.sent();
|
|
743
705
|
customState.superpositionError = "Matrix data not available for ".concat(matrixAccession);
|
|
744
706
|
(_c = customState.events) === null || _c === void 0 ? void 0 : _c.superpositionInit.next(true); // Emit segment API data load event
|
|
745
707
|
return [3 /*break*/, 4];
|
|
@@ -748,10 +710,11 @@ function getMatrixData(plugin) {
|
|
|
748
710
|
});
|
|
749
711
|
});
|
|
750
712
|
}
|
|
713
|
+
/** Download data about segment clustering and save in plugin custom state */
|
|
751
714
|
function getSegmentData(plugin) {
|
|
752
715
|
var _a;
|
|
753
716
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
754
|
-
var customState, segmentsUrl, assetManager, url, result,
|
|
717
|
+
var customState, segmentsUrl, assetManager, url, result, e_5;
|
|
755
718
|
return tslib_1.__generator(this, function (_b) {
|
|
756
719
|
switch (_b.label) {
|
|
757
720
|
case 0:
|
|
@@ -774,7 +737,7 @@ function getSegmentData(plugin) {
|
|
|
774
737
|
}
|
|
775
738
|
return [3 /*break*/, 4];
|
|
776
739
|
case 3:
|
|
777
|
-
|
|
740
|
+
e_5 = _b.sent();
|
|
778
741
|
customState.superpositionError = "Superposition data not available for ".concat(customState.initParams.moleculeId);
|
|
779
742
|
(_a = customState.events) === null || _a === void 0 ? void 0 : _a.superpositionInit.next(true); // Emit segment API data load event
|
|
780
743
|
return [3 /*break*/, 4];
|
|
@@ -813,7 +776,7 @@ function getChainLigands(carbEntity) {
|
|
|
813
776
|
}
|
|
814
777
|
function getCarbPolymerDetailsFromApi(plugin, pdb_id) {
|
|
815
778
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
816
|
-
var customState, apiUrl, assetManager, url, branchedLigands, branchedChains, branchedlabels, result, carbEntities, _i, carbEntities_1, carbEntity, carbLigData,
|
|
779
|
+
var customState, apiUrl, assetManager, url, branchedLigands, branchedChains, branchedlabels, result, carbEntities, _i, carbEntities_1, carbEntity, carbLigData, e_6;
|
|
817
780
|
return tslib_1.__generator(this, function (_a) {
|
|
818
781
|
switch (_a.label) {
|
|
819
782
|
case 0:
|
|
@@ -844,7 +807,7 @@ function getCarbPolymerDetailsFromApi(plugin, pdb_id) {
|
|
|
844
807
|
}
|
|
845
808
|
return [3 /*break*/, 4];
|
|
846
809
|
case 3:
|
|
847
|
-
|
|
810
|
+
e_6 = _a.sent();
|
|
848
811
|
return [3 /*break*/, 4];
|
|
849
812
|
case 4: return [2 /*return*/, {
|
|
850
813
|
branchedChains: branchedChains,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CollapsableControls, PurePluginUIComponent } from '
|
|
2
|
-
import { ParamDefinition as PD } from '
|
|
1
|
+
import { CollapsableControls, PurePluginUIComponent } from 'molstar/lib/mol-plugin-ui/base';
|
|
2
|
+
import { ParamDefinition as PD } from 'molstar/lib/mol-util/param-definition';
|
|
3
3
|
import { PluginCustomState } from '../plugin-custom-state';
|
|
4
4
|
export declare function InfoIconSvg(): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export declare class AlphafoldPaeControls extends CollapsableControls {
|
|
@@ -9,7 +9,7 @@ export declare class AlphafoldPaeControls extends CollapsableControls {
|
|
|
9
9
|
header: string;
|
|
10
10
|
brand: {
|
|
11
11
|
accent: "gray";
|
|
12
|
-
svg: typeof import("
|
|
12
|
+
svg: typeof import("molstar/lib/mol-plugin-ui/controls/icons").FlipToFrontSvg;
|
|
13
13
|
};
|
|
14
14
|
isHidden: boolean;
|
|
15
15
|
};
|
|
@@ -24,7 +24,7 @@ export declare class AlphafoldSuperpositionControls extends CollapsableControls
|
|
|
24
24
|
header: string;
|
|
25
25
|
brand: {
|
|
26
26
|
accent: "gray";
|
|
27
|
-
svg: typeof import("
|
|
27
|
+
svg: typeof import("molstar/lib/mol-plugin-ui/controls/icons").FlipToFrontSvg;
|
|
28
28
|
};
|
|
29
29
|
isHidden: boolean;
|
|
30
30
|
};
|
|
@@ -3,17 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AfSuperpositionControls = exports.AlphafoldSuperpositionParams = exports.AlphafoldSuperpositionControls = exports.AlphafoldPaeControls = exports.InfoIconSvg = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
var react_1 = tslib_1.__importDefault(require("react"));
|
|
7
|
-
var base_1 = require("Molstar/mol-plugin-ui/base");
|
|
8
|
-
var icons_1 = require("Molstar/mol-plugin-ui/controls/icons");
|
|
9
|
-
var common_1 = require("Molstar/mol-plugin-ui/controls/common");
|
|
10
|
-
var param_definition_1 = require("Molstar/mol-util/param-definition");
|
|
11
|
-
var parameters_1 = require("Molstar/mol-plugin-ui/controls/parameters");
|
|
12
|
-
var superposition_1 = require("../superposition");
|
|
13
|
-
var d3_scale_1 = require("d3-scale");
|
|
14
6
|
var d3_axis_1 = require("d3-axis");
|
|
7
|
+
var d3_scale_1 = require("d3-scale");
|
|
15
8
|
var d3_selection_1 = require("d3-selection");
|
|
9
|
+
var base_1 = require("molstar/lib/mol-plugin-ui/base");
|
|
10
|
+
var common_1 = require("molstar/lib/mol-plugin-ui/controls/common");
|
|
11
|
+
var icons_1 = require("molstar/lib/mol-plugin-ui/controls/icons");
|
|
12
|
+
var parameters_1 = require("molstar/lib/mol-plugin-ui/controls/parameters");
|
|
13
|
+
var param_definition_1 = require("molstar/lib/mol-util/param-definition");
|
|
14
|
+
var react_1 = tslib_1.__importDefault(require("react"));
|
|
16
15
|
var plugin_custom_state_1 = require("../plugin-custom-state");
|
|
16
|
+
var superposition_1 = require("../superposition");
|
|
17
17
|
var _InfoIcon = (0, jsx_runtime_1.jsx)("svg", tslib_1.__assign({ 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
18
|
function InfoIconSvg() { return _InfoIcon; }
|
|
19
19
|
exports.InfoIconSvg = InfoIconSvg;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CollapsableControls } from '
|
|
1
|
+
import { CollapsableControls } from 'molstar/lib/mol-plugin-ui/base';
|
|
2
2
|
export declare class AlphafoldTransparencyControls extends CollapsableControls<{}, {
|
|
3
3
|
transpareny: any;
|
|
4
4
|
}> {
|
|
@@ -7,7 +7,7 @@ export declare class AlphafoldTransparencyControls extends CollapsableControls<{
|
|
|
7
7
|
header: string;
|
|
8
8
|
brand: {
|
|
9
9
|
accent: "gray";
|
|
10
|
-
svg: typeof import("
|
|
10
|
+
svg: typeof import("molstar/lib/mol-plugin-ui/controls/icons").FlipToFrontSvg;
|
|
11
11
|
};
|
|
12
12
|
isHidden: boolean;
|
|
13
13
|
transpareny: {
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AlphafoldTransparencyControls = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
var base_1 = require("
|
|
7
|
-
var icons_1 = require("
|
|
8
|
-
var parameters_1 = require("
|
|
9
|
-
var param_definition_1 = require("
|
|
6
|
+
var base_1 = require("molstar/lib/mol-plugin-ui/base");
|
|
7
|
+
var icons_1 = require("molstar/lib/mol-plugin-ui/controls/icons");
|
|
8
|
+
var parameters_1 = require("molstar/lib/mol-plugin-ui/controls/parameters");
|
|
9
|
+
var param_definition_1 = require("molstar/lib/mol-util/param-definition");
|
|
10
10
|
var alphafold_transparency_1 = require("../alphafold-transparency");
|
|
11
11
|
var plugin_custom_state_1 = require("../plugin-custom-state");
|
|
12
12
|
var TransparencyParams = {
|