drugflow-molstar 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +15 -15
  3. package/build/{drugflow-molstar-component-0.2.1.js → drugflow-molstar-component-0.2.2.js} +4 -4
  4. package/build/drugflow-molstar-light.css +1 -1
  5. package/build/{drugflow-molstar-plugin-0.2.1.js → drugflow-molstar-plugin-0.2.2.js} +2 -2
  6. package/lib/alphafold-transparency.d.ts +6 -6
  7. package/lib/alphafold-transparency.js +153 -153
  8. package/lib/app/molstar/lib/apps/docking-viewer/index.html +37 -0
  9. package/lib/app/molstar/lib/apps/viewer/embedded.html +44 -0
  10. package/lib/app/molstar/lib/apps/viewer/favicon.ico +0 -0
  11. package/lib/app/molstar/lib/apps/viewer/index.html +110 -0
  12. package/lib/app/molstar/lib/examples/alpha-orbitals/index.html +73 -0
  13. package/lib/app/molstar/lib/examples/basic-wrapper/index.html +138 -0
  14. package/lib/app/molstar/lib/examples/lighting/index.html +89 -0
  15. package/lib/app/molstar/lib/examples/proteopedia-wrapper/index.html +237 -0
  16. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/base.scss +33 -0
  17. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/controls-base.scss +334 -0
  18. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/controls.scss +419 -0
  19. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/help.scss +27 -0
  20. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/line-graph.scss +68 -0
  21. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/log.scss +100 -0
  22. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/misc.scss +644 -0
  23. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/sequence.scss +126 -0
  24. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/slider.scss +166 -0
  25. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/tasks.scss +99 -0
  26. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/toast.scss +84 -0
  27. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/transformer.scss +164 -0
  28. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/viewport.scss +128 -0
  29. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/layout/common.scss +72 -0
  30. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/layout/controls-landscape.scss +90 -0
  31. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/layout/controls-outside.scss +99 -0
  32. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/layout/controls-portrait.scss +109 -0
  33. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/layout.scss +41 -0
  34. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/logo.scss +13 -0
  35. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/normalize.scss +210 -0
  36. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/ui.scss +41 -0
  37. package/lib/app/molstar/lib/mol-plugin-ui/skin/base/variables.scss +86 -0
  38. package/lib/app/molstar/lib/mol-plugin-ui/skin/blue.scss +2 -0
  39. package/lib/app/molstar/lib/mol-plugin-ui/skin/colors/blue.scss +24 -0
  40. package/lib/app/molstar/lib/mol-plugin-ui/skin/colors/dark.scss +24 -0
  41. package/lib/app/molstar/lib/mol-plugin-ui/skin/colors/light.scss +30 -0
  42. package/lib/app/molstar/lib/mol-plugin-ui/skin/dark.scss +2 -0
  43. package/lib/app/molstar/lib/mol-plugin-ui/skin/light.scss +2 -0
  44. package/lib/custom-events.d.ts +4 -4
  45. package/lib/custom-events.js +56 -56
  46. package/lib/domain-annotations/behavior.d.ts +5 -5
  47. package/lib/domain-annotations/behavior.js +49 -49
  48. package/lib/domain-annotations/color.d.ts +10 -10
  49. package/lib/domain-annotations/color.js +78 -78
  50. package/lib/domain-annotations/prop.d.ts +35 -35
  51. package/lib/domain-annotations/prop.js +160 -160
  52. package/lib/drugflow-molstar-component-build-0.1.2.js +4268 -0
  53. package/lib/drugflow-molstar-component-build-0.1.2.js.LICENSE.txt +24 -0
  54. package/lib/drugflow-molstar-component-build-0.1.2.js.map +1 -0
  55. package/lib/drugflow-molstar-component-build-0.1.3.js +2 -0
  56. package/lib/drugflow-molstar-component-build-0.1.3.js.LICENSE.txt +24 -0
  57. package/lib/drugflow-molstar-component-build-0.1.4.js +2 -0
  58. package/lib/drugflow-molstar-component-build-0.1.4.js.LICENSE.txt +24 -0
  59. package/lib/drugflow-molstar-component-build-0.1.6.js +2 -0
  60. package/lib/drugflow-molstar-component-build-0.1.6.js.LICENSE.txt +24 -0
  61. package/lib/drugflow-molstar-component-build-0.2.2.js +2 -0
  62. package/lib/drugflow-molstar-component-build-0.2.2.js.LICENSE.txt +24 -0
  63. package/lib/helpers.d.ts +82 -81
  64. package/lib/helpers.js +278 -278
  65. package/lib/index.d.ts +1 -1
  66. package/lib/index.js +1274 -1239
  67. package/lib/labels.d.ts +2 -2
  68. package/lib/labels.js +42 -42
  69. package/lib/loci-details.d.ts +27 -27
  70. package/lib/loci-details.js +128 -128
  71. package/lib/pdbe-molstar-component-build-3.1.2.js +2 -0
  72. package/lib/pdbe-molstar-component-build-3.1.2.js.LICENSE.txt +24 -0
  73. package/lib/sifts-mapping.d.ts +16 -16
  74. package/lib/sifts-mapping.js +83 -83
  75. package/lib/sifts-mappings-behaviour.d.ts +5 -5
  76. package/lib/sifts-mappings-behaviour.js +64 -64
  77. package/lib/spec.d.ts +76 -76
  78. package/lib/spec.js +105 -105
  79. package/lib/subscribe-events.d.ts +1 -1
  80. package/lib/subscribe-events.js +194 -194
  81. package/lib/superposition-export.d.ts +4 -4
  82. package/lib/superposition-export.js +152 -152
  83. package/lib/superposition-focus-representation.d.ts +16 -16
  84. package/lib/superposition-focus-representation.js +153 -153
  85. package/lib/superposition-sifts-mapping.d.ts +22 -22
  86. package/lib/superposition-sifts-mapping.js +159 -159
  87. package/lib/superposition.d.ts +18 -18
  88. package/lib/superposition.js +794 -794
  89. package/lib/ui/alphafold-superposition.d.ts +56 -56
  90. package/lib/ui/alphafold-superposition.js +178 -178
  91. package/lib/ui/alphafold-tranparency.d.ts +22 -22
  92. package/lib/ui/alphafold-tranparency.js +65 -65
  93. package/lib/ui/annotation-controls.d.ts +24 -24
  94. package/lib/ui/annotation-controls.js +166 -166
  95. package/lib/ui/export-superposition.d.ts +6 -6
  96. package/lib/ui/export-superposition.js +71 -71
  97. package/lib/ui/pdbe-left-panel.d.ts +18 -18
  98. package/lib/ui/pdbe-left-panel.js +167 -167
  99. package/lib/ui/pdbe-screenshot-controls.d.ts +20 -20
  100. package/lib/ui/pdbe-screenshot-controls.js +101 -101
  101. package/lib/ui/pdbe-structure-controls.d.ts +17 -17
  102. package/lib/ui/pdbe-structure-controls.js +70 -70
  103. package/lib/ui/pdbe-viewport-controls.d.ts +6 -6
  104. package/lib/ui/pdbe-viewport-controls.js +56 -56
  105. package/lib/ui/segment-tree.d.ts +18 -18
  106. package/lib/ui/segment-tree.js +804 -804
  107. package/lib/ui/superposition-components.d.ts +10 -10
  108. package/lib/ui/superposition-components.js +435 -435
  109. package/lib/ui/superposition-viewport.d.ts +5 -5
  110. package/lib/ui/superposition-viewport.js +23 -23
  111. package/package.json +79 -79
  112. /package/build/{drugflow-molstar-0.2.1.css → drugflow-molstar-0.2.2.css} +0 -0
  113. /package/build/{drugflow-molstar-plugin-0.2.1.js.LICENSE.txt → drugflow-molstar-plugin-0.2.2.js.LICENSE.txt} +0 -0
package/lib/labels.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { PluginBehavior } from 'Molstar/mol-plugin/behavior';
2
- export declare const PDBeLociLabelProvider: import("molstar/lib/mol-state/transformer").StateTransformer<PluginBehavior.Category, PluginBehavior.Behavior, unknown>;
1
+ import { PluginBehavior } from 'Molstar/mol-plugin/behavior';
2
+ export declare const PDBeLociLabelProvider: import("molstar/lib/mol-state/transformer").StateTransformer<PluginBehavior.Category, PluginBehavior.Behavior, unknown>;
package/lib/labels.js CHANGED
@@ -1,42 +1,42 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PDBeLociLabelProvider = void 0;
4
- var behavior_1 = require("Molstar/mol-plugin/behavior");
5
- var structure_1 = require("Molstar/mol-model/structure");
6
- var label_1 = require("Molstar/mol-theme/label");
7
- exports.PDBeLociLabelProvider = behavior_1.PluginBehavior.create({
8
- name: 'pdbe-loci-label-provider',
9
- category: 'interaction',
10
- ctor: /** @class */ (function () {
11
- function class_1(ctx) {
12
- var _this = this;
13
- this.ctx = ctx;
14
- this.f = {
15
- label: function (loci) {
16
- var customState = (_this.ctx.customState);
17
- var superpositionView = (customState && customState.initParams.superposition) ? true : false;
18
- var label = [];
19
- if (!superpositionView && structure_1.StructureElement.Loci.is(loci) && loci.elements.length === 1) {
20
- var entityNames = new Set();
21
- for (var _i = 0, _a = loci.elements; _i < _a.length; _i++) {
22
- var u = _a[_i].unit;
23
- var l = structure_1.StructureElement.Location.create(loci.structure, u, u.elements[0]);
24
- var name_1 = structure_1.StructureProperties.entity.pdbx_description(l).join(', ');
25
- entityNames.add(name_1);
26
- }
27
- if (entityNames.size === 1)
28
- entityNames.forEach(function (name) { return label.push(name); });
29
- }
30
- label.push((0, label_1.lociLabel)(loci));
31
- return label.filter(function (l) { return !!l; }).join('</br>');
32
- },
33
- group: function (label) { return label.toString().replace(/Model [0-9]+/g, 'Models'); },
34
- priority: 100
35
- };
36
- }
37
- class_1.prototype.register = function () { this.ctx.managers.lociLabels.addProvider(this.f); };
38
- class_1.prototype.unregister = function () { this.ctx.managers.lociLabels.removeProvider(this.f); };
39
- return class_1;
40
- }()),
41
- display: { name: 'Provide PDBe Loci Label' }
42
- });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PDBeLociLabelProvider = void 0;
4
+ var behavior_1 = require("Molstar/mol-plugin/behavior");
5
+ var structure_1 = require("Molstar/mol-model/structure");
6
+ var label_1 = require("Molstar/mol-theme/label");
7
+ exports.PDBeLociLabelProvider = behavior_1.PluginBehavior.create({
8
+ name: 'pdbe-loci-label-provider',
9
+ category: 'interaction',
10
+ ctor: /** @class */ (function () {
11
+ function class_1(ctx) {
12
+ var _this = this;
13
+ this.ctx = ctx;
14
+ this.f = {
15
+ label: function (loci) {
16
+ var customState = (_this.ctx.customState);
17
+ var superpositionView = (customState && customState.initParams.superposition) ? true : false;
18
+ var label = [];
19
+ if (!superpositionView && structure_1.StructureElement.Loci.is(loci) && loci.elements.length === 1) {
20
+ var entityNames = new Set();
21
+ for (var _i = 0, _a = loci.elements; _i < _a.length; _i++) {
22
+ var u = _a[_i].unit;
23
+ var l = structure_1.StructureElement.Location.create(loci.structure, u, u.elements[0]);
24
+ var name_1 = structure_1.StructureProperties.entity.pdbx_description(l).join(', ');
25
+ entityNames.add(name_1);
26
+ }
27
+ if (entityNames.size === 1)
28
+ entityNames.forEach(function (name) { return label.push(name); });
29
+ }
30
+ label.push((0, label_1.lociLabel)(loci));
31
+ return label.filter(function (l) { return !!l; }).join('</br>');
32
+ },
33
+ group: function (label) { return label.toString().replace(/Model [0-9]+/g, 'Models'); },
34
+ priority: 100
35
+ };
36
+ }
37
+ class_1.prototype.register = function () { this.ctx.managers.lociLabels.addProvider(this.f); };
38
+ class_1.prototype.unregister = function () { this.ctx.managers.lociLabels.removeProvider(this.f); };
39
+ return class_1;
40
+ }()),
41
+ display: { name: 'Provide PDBe Loci Label' }
42
+ });
@@ -1,27 +1,27 @@
1
- import { Bond } from 'Molstar/mol-model/structure';
2
- import { Loci } from 'Molstar/mol-model/loci';
3
- export declare type EventDetail = {
4
- models?: string[];
5
- entity_id?: string;
6
- label_asym_id?: string;
7
- asym_id?: string;
8
- auth_asym_id?: string;
9
- unp_accession?: string;
10
- unp_seq_id?: number;
11
- seq_id?: number;
12
- auth_seq_id?: number;
13
- ins_code?: string;
14
- comp_id?: string;
15
- atom_id?: string[];
16
- alt_id?: string;
17
- micro_het_comp_ids?: string[];
18
- seq_id_begin?: number;
19
- seq_id_end?: number;
20
- button?: number;
21
- modifiers?: any;
22
- };
23
- declare type LabelGranularity = 'element' | 'conformation' | 'residue' | 'chain' | 'structure';
24
- export declare function lociDetails(loci: Loci): EventDetail | undefined;
25
- export declare function bondLabel(bond: Bond.Location, granularity: LabelGranularity): any;
26
- export declare function _bundleLabel(bundle: Loci.Bundle<any>, granularity: LabelGranularity): EventDetail | (EventDetail | undefined)[];
27
- export {};
1
+ import { Bond } from 'Molstar/mol-model/structure';
2
+ import { Loci } from 'Molstar/mol-model/loci';
3
+ export declare type EventDetail = {
4
+ models?: string[];
5
+ entity_id?: string;
6
+ label_asym_id?: string;
7
+ asym_id?: string;
8
+ auth_asym_id?: string;
9
+ unp_accession?: string;
10
+ unp_seq_id?: number;
11
+ seq_id?: number;
12
+ auth_seq_id?: number;
13
+ ins_code?: string;
14
+ comp_id?: string;
15
+ atom_id?: string[];
16
+ alt_id?: string;
17
+ micro_het_comp_ids?: string[];
18
+ seq_id_begin?: number;
19
+ seq_id_end?: number;
20
+ button?: number;
21
+ modifiers?: any;
22
+ };
23
+ declare type LabelGranularity = 'element' | 'conformation' | 'residue' | 'chain' | 'structure';
24
+ export declare function lociDetails(loci: Loci): EventDetail | undefined;
25
+ export declare function bondLabel(bond: Bond.Location, granularity: LabelGranularity): any;
26
+ export declare function _bundleLabel(bundle: Loci.Bundle<any>, granularity: LabelGranularity): EventDetail | (EventDetail | undefined)[];
27
+ export {};
@@ -1,128 +1,128 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._bundleLabel = exports.bondLabel = exports.lociDetails = void 0;
4
- var tslib_1 = require("tslib");
5
- var structure_1 = require("Molstar/mol-model/structure");
6
- var int_1 = require("Molstar/mol-data/int");
7
- var sifts_mapping_1 = require("Molstar/mol-model-props/sequence/sifts-mapping");
8
- function lociDetails(loci) {
9
- switch (loci.kind) {
10
- case 'structure-loci':
11
- return { models: loci.structure.models.map(function (m) { return m.entry; }).filter(function (l) { return !!l; }) };
12
- case 'element-loci':
13
- return structureElementStatsDetail(structure_1.StructureElement.Stats.ofLoci(loci));
14
- case 'bond-loci':
15
- var bond = loci.bonds[0];
16
- return bond ? bondLabel(bond, 'element') : '';
17
- default:
18
- return void 0;
19
- }
20
- }
21
- exports.lociDetails = lociDetails;
22
- function structureElementStatsDetail(stats) {
23
- var chainCount = stats.chainCount, residueCount = stats.residueCount, elementCount = stats.elementCount;
24
- if (elementCount === 1 && residueCount === 0 && chainCount === 0) {
25
- return getElementDetails(stats.firstElementLoc, 'element');
26
- }
27
- else if (elementCount === 0 && residueCount === 1 && chainCount === 0) {
28
- return getElementDetails(stats.firstResidueLoc, 'residue');
29
- }
30
- else {
31
- return void 0;
32
- }
33
- }
34
- function getElementDetails(location, granularity) {
35
- if (granularity === void 0) { granularity = 'element'; }
36
- var basicDetails = {};
37
- var entry = location.unit.model.entry;
38
- if (entry.length > 30)
39
- entry = entry.substr(0, 27) + '\u2026'; // ellipsis
40
- basicDetails['entry_id'] = entry; // entry
41
- if (granularity !== 'structure') {
42
- basicDetails['model'] = location.unit.model.modelNum; // model
43
- basicDetails['instance'] = location.unit.conformation.operator.name; // instance
44
- }
45
- var elementDetails;
46
- if (structure_1.Unit.isAtomic(location.unit)) {
47
- elementDetails = atomicElementDetails(location, granularity);
48
- }
49
- else if (structure_1.Unit.isCoarse(location.unit)) {
50
- elementDetails = coarseElementDetails(location, granularity);
51
- }
52
- return tslib_1.__assign(tslib_1.__assign({}, basicDetails), elementDetails);
53
- }
54
- function atomicElementDetails(location, granularity) {
55
- var elementDetails = {
56
- entity_id: structure_1.StructureProperties.chain.label_entity_id(location),
57
- label_asym_id: structure_1.StructureProperties.chain.label_asym_id(location),
58
- auth_asym_id: structure_1.StructureProperties.chain.auth_asym_id(location),
59
- unp_accession: undefined,
60
- unp_seq_id: undefined,
61
- seq_id: structure_1.StructureProperties.residue.label_seq_id(location),
62
- auth_seq_id: structure_1.StructureProperties.residue.auth_seq_id(location),
63
- ins_code: structure_1.StructureProperties.residue.pdbx_PDB_ins_code(location),
64
- comp_id: structure_1.StructureProperties.atom.label_comp_id(location),
65
- atom_id: [structure_1.StructureProperties.atom.label_atom_id(location)],
66
- alt_id: structure_1.StructureProperties.atom.label_alt_id(location)
67
- };
68
- var unpLabel = sifts_mapping_1.SIFTSMapping.getLabel(location);
69
- if (unpLabel) {
70
- var unpLabelDetails = unpLabel.split(' ');
71
- if (unpLabelDetails[0] === 'UNP') {
72
- elementDetails.unp_accession = unpLabelDetails[1];
73
- elementDetails.unp_seq_id = +unpLabelDetails[2];
74
- }
75
- }
76
- var microHetCompIds = structure_1.StructureProperties.residue.microheterogeneityCompIds(location);
77
- elementDetails['micro_het_comp_ids'] = granularity === 'residue' && microHetCompIds.length > 1 ?
78
- microHetCompIds : [elementDetails['comp_id']];
79
- return elementDetails;
80
- }
81
- function coarseElementDetails(location, granularity) {
82
- var elementDetails = {
83
- asym_id: structure_1.StructureProperties.coarse.asym_id(location),
84
- seq_id_begin: structure_1.StructureProperties.coarse.seq_id_begin(location),
85
- seq_id_end: structure_1.StructureProperties.coarse.seq_id_end(location)
86
- };
87
- if (granularity === 'residue') {
88
- if (elementDetails.seq_id_begin === elementDetails.seq_id_end) {
89
- var entityIndex = structure_1.StructureProperties.coarse.entityKey(location);
90
- var seq = location.unit.model.sequence.byEntityKey[entityIndex];
91
- elementDetails['comp_id'] = seq.sequence.compId.value(elementDetails.seq_id_begin - 1); // 1-indexed
92
- }
93
- }
94
- return elementDetails;
95
- }
96
- function bondLabel(bond, granularity) {
97
- return _bundleLabel({ loci: [
98
- structure_1.StructureElement.Loci(bond.aStructure, [{ unit: bond.aUnit, indices: int_1.OrderedSet.ofSingleton(bond.aIndex) }]),
99
- structure_1.StructureElement.Loci(bond.bStructure, [{ unit: bond.bUnit, indices: int_1.OrderedSet.ofSingleton(bond.bIndex) }])
100
- ] }, granularity);
101
- }
102
- exports.bondLabel = bondLabel;
103
- function _bundleLabel(bundle, granularity) {
104
- var isSingleElements = true;
105
- for (var _i = 0, _a = bundle.loci; _i < _a.length; _i++) {
106
- var l = _a[_i];
107
- if (!structure_1.StructureElement.Loci.is(l) || structure_1.StructureElement.Loci.size(l) !== 1) {
108
- isSingleElements = false;
109
- break;
110
- }
111
- }
112
- if (isSingleElements) {
113
- var locations = bundle.loci.map(function (l) {
114
- var _a = l.elements[0], unit = _a.unit, indices = _a.indices;
115
- return structure_1.StructureElement.Location.create(l.structure, unit, unit.elements[int_1.OrderedSet.start(indices)]);
116
- });
117
- var elementDetailsArr = locations.map(function (l) { return getElementDetails(l, granularity); });
118
- var atomIds = [elementDetailsArr[0].atom_id[0], elementDetailsArr[1].atom_id[0]];
119
- var elementDetails = elementDetailsArr[0];
120
- elementDetails['atom_id'] = atomIds;
121
- return elementDetails;
122
- }
123
- else {
124
- var elementDetails = bundle.loci.map(function (l) { return lociDetails(l); });
125
- return elementDetails;
126
- }
127
- }
128
- exports._bundleLabel = _bundleLabel;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports._bundleLabel = exports.bondLabel = exports.lociDetails = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var structure_1 = require("Molstar/mol-model/structure");
6
+ var int_1 = require("Molstar/mol-data/int");
7
+ var sifts_mapping_1 = require("Molstar/mol-model-props/sequence/sifts-mapping");
8
+ function lociDetails(loci) {
9
+ switch (loci.kind) {
10
+ case 'structure-loci':
11
+ return { models: loci.structure.models.map(function (m) { return m.entry; }).filter(function (l) { return !!l; }) };
12
+ case 'element-loci':
13
+ return structureElementStatsDetail(structure_1.StructureElement.Stats.ofLoci(loci));
14
+ case 'bond-loci':
15
+ var bond = loci.bonds[0];
16
+ return bond ? bondLabel(bond, 'element') : '';
17
+ default:
18
+ return void 0;
19
+ }
20
+ }
21
+ exports.lociDetails = lociDetails;
22
+ function structureElementStatsDetail(stats) {
23
+ var chainCount = stats.chainCount, residueCount = stats.residueCount, elementCount = stats.elementCount;
24
+ if (elementCount === 1 && residueCount === 0 && chainCount === 0) {
25
+ return getElementDetails(stats.firstElementLoc, 'element');
26
+ }
27
+ else if (elementCount === 0 && residueCount === 1 && chainCount === 0) {
28
+ return getElementDetails(stats.firstResidueLoc, 'residue');
29
+ }
30
+ else {
31
+ return void 0;
32
+ }
33
+ }
34
+ function getElementDetails(location, granularity) {
35
+ if (granularity === void 0) { granularity = 'element'; }
36
+ var basicDetails = {};
37
+ var entry = location.unit.model.entry;
38
+ if (entry.length > 30)
39
+ entry = entry.substr(0, 27) + '\u2026'; // ellipsis
40
+ basicDetails['entry_id'] = entry; // entry
41
+ if (granularity !== 'structure') {
42
+ basicDetails['model'] = location.unit.model.modelNum; // model
43
+ basicDetails['instance'] = location.unit.conformation.operator.name; // instance
44
+ }
45
+ var elementDetails;
46
+ if (structure_1.Unit.isAtomic(location.unit)) {
47
+ elementDetails = atomicElementDetails(location, granularity);
48
+ }
49
+ else if (structure_1.Unit.isCoarse(location.unit)) {
50
+ elementDetails = coarseElementDetails(location, granularity);
51
+ }
52
+ return tslib_1.__assign(tslib_1.__assign({}, basicDetails), elementDetails);
53
+ }
54
+ function atomicElementDetails(location, granularity) {
55
+ var elementDetails = {
56
+ entity_id: structure_1.StructureProperties.chain.label_entity_id(location),
57
+ label_asym_id: structure_1.StructureProperties.chain.label_asym_id(location),
58
+ auth_asym_id: structure_1.StructureProperties.chain.auth_asym_id(location),
59
+ unp_accession: undefined,
60
+ unp_seq_id: undefined,
61
+ seq_id: structure_1.StructureProperties.residue.label_seq_id(location),
62
+ auth_seq_id: structure_1.StructureProperties.residue.auth_seq_id(location),
63
+ ins_code: structure_1.StructureProperties.residue.pdbx_PDB_ins_code(location),
64
+ comp_id: structure_1.StructureProperties.atom.label_comp_id(location),
65
+ atom_id: [structure_1.StructureProperties.atom.label_atom_id(location)],
66
+ alt_id: structure_1.StructureProperties.atom.label_alt_id(location)
67
+ };
68
+ var unpLabel = sifts_mapping_1.SIFTSMapping.getLabel(location);
69
+ if (unpLabel) {
70
+ var unpLabelDetails = unpLabel.split(' ');
71
+ if (unpLabelDetails[0] === 'UNP') {
72
+ elementDetails.unp_accession = unpLabelDetails[1];
73
+ elementDetails.unp_seq_id = +unpLabelDetails[2];
74
+ }
75
+ }
76
+ var microHetCompIds = structure_1.StructureProperties.residue.microheterogeneityCompIds(location);
77
+ elementDetails['micro_het_comp_ids'] = granularity === 'residue' && microHetCompIds.length > 1 ?
78
+ microHetCompIds : [elementDetails['comp_id']];
79
+ return elementDetails;
80
+ }
81
+ function coarseElementDetails(location, granularity) {
82
+ var elementDetails = {
83
+ asym_id: structure_1.StructureProperties.coarse.asym_id(location),
84
+ seq_id_begin: structure_1.StructureProperties.coarse.seq_id_begin(location),
85
+ seq_id_end: structure_1.StructureProperties.coarse.seq_id_end(location)
86
+ };
87
+ if (granularity === 'residue') {
88
+ if (elementDetails.seq_id_begin === elementDetails.seq_id_end) {
89
+ var entityIndex = structure_1.StructureProperties.coarse.entityKey(location);
90
+ var seq = location.unit.model.sequence.byEntityKey[entityIndex];
91
+ elementDetails['comp_id'] = seq.sequence.compId.value(elementDetails.seq_id_begin - 1); // 1-indexed
92
+ }
93
+ }
94
+ return elementDetails;
95
+ }
96
+ function bondLabel(bond, granularity) {
97
+ return _bundleLabel({ loci: [
98
+ structure_1.StructureElement.Loci(bond.aStructure, [{ unit: bond.aUnit, indices: int_1.OrderedSet.ofSingleton(bond.aIndex) }]),
99
+ structure_1.StructureElement.Loci(bond.bStructure, [{ unit: bond.bUnit, indices: int_1.OrderedSet.ofSingleton(bond.bIndex) }])
100
+ ] }, granularity);
101
+ }
102
+ exports.bondLabel = bondLabel;
103
+ function _bundleLabel(bundle, granularity) {
104
+ var isSingleElements = true;
105
+ for (var _i = 0, _a = bundle.loci; _i < _a.length; _i++) {
106
+ var l = _a[_i];
107
+ if (!structure_1.StructureElement.Loci.is(l) || structure_1.StructureElement.Loci.size(l) !== 1) {
108
+ isSingleElements = false;
109
+ break;
110
+ }
111
+ }
112
+ if (isSingleElements) {
113
+ var locations = bundle.loci.map(function (l) {
114
+ var _a = l.elements[0], unit = _a.unit, indices = _a.indices;
115
+ return structure_1.StructureElement.Location.create(l.structure, unit, unit.elements[int_1.OrderedSet.start(indices)]);
116
+ });
117
+ var elementDetailsArr = locations.map(function (l) { return getElementDetails(l, granularity); });
118
+ var atomIds = [elementDetailsArr[0].atom_id[0], elementDetailsArr[1].atom_id[0]];
119
+ var elementDetails = elementDetailsArr[0];
120
+ elementDetails['atom_id'] = atomIds;
121
+ return elementDetails;
122
+ }
123
+ else {
124
+ var elementDetails = bundle.loci.map(function (l) { return lociDetails(l); });
125
+ return elementDetails;
126
+ }
127
+ }
128
+ exports._bundleLabel = _bundleLabel;
@@ -0,0 +1,2 @@
1
+ /*! For license information please see pdbe-molstar-component-build-3.1.2.js.LICENSE.txt */
2
+ (()=>{"use strict";const t="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,e=(t,e,i=null)=>{for(;e!==i;){const i=e.nextSibling;t.removeChild(e),e=i}},i=`{{lit-${String(Math.random()).slice(2)}}}`,s=`\x3c!--${i}--\x3e`,o=new RegExp(`${i}|${s}`),r="$lit$";class n{constructor(t,e){this.parts=[],this.element=e;const s=[],n=[],l=document.createTreeWalker(e.content,133,null,!1);let c=0,p=-1,u=0;const{strings:m,values:{length:g}}=t;for(;u<g;){const t=l.nextNode();if(null!==t){if(p++,1===t.nodeType){if(t.hasAttributes()){const e=t.attributes,{length:i}=e;let s=0;for(let t=0;t<i;t++)a(e[t].name,r)&&s++;for(;s-- >0;){const e=m[u],i=d.exec(e)[2],s=i.toLowerCase()+r,n=t.getAttribute(s);t.removeAttribute(s);const a=n.split(o);this.parts.push({type:"attribute",index:p,name:i,strings:a}),u+=a.length-1}}"TEMPLATE"===t.tagName&&(n.push(t),l.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(i)>=0){const i=t.parentNode,n=e.split(o),l=n.length-1;for(let e=0;e<l;e++){let s,o=n[e];if(""===o)s=h();else{const t=d.exec(o);null!==t&&a(t[2],r)&&(o=o.slice(0,t.index)+t[1]+t[2].slice(0,-r.length)+t[3]),s=document.createTextNode(o)}i.insertBefore(s,t),this.parts.push({type:"node",index:++p})}""===n[l]?(i.insertBefore(h(),t),s.push(t)):t.data=n[l],u+=l}}else if(8===t.nodeType)if(t.data===i){const e=t.parentNode;null!==t.previousSibling&&p!==c||(p++,e.insertBefore(h(),t)),c=p,this.parts.push({type:"node",index:p}),null===t.nextSibling?t.data="":(s.push(t),p--),u++}else{let e=-1;for(;-1!==(e=t.data.indexOf(i,e+1));)this.parts.push({type:"node",index:-1}),u++}}else l.currentNode=n.pop()}for(const t of s)t.parentNode.removeChild(t)}}const a=(t,e)=>{const i=t.length-e.length;return i>=0&&t.slice(i)===e},l=t=>-1!==t.index,h=()=>document.createComment(""),d=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function c(t,e){const{element:{content:i},parts:s}=t,o=document.createTreeWalker(i,133,null,!1);let r=u(s),n=s[r],a=-1,l=0;const h=[];let d=null;for(;o.nextNode();){a++;const t=o.currentNode;for(t.previousSibling===d&&(d=null),e.has(t)&&(h.push(t),null===d&&(d=t)),null!==d&&l++;void 0!==n&&n.index===a;)n.index=null!==d?-1:n.index-l,r=u(s,r),n=s[r]}h.forEach((t=>t.parentNode.removeChild(t)))}const p=t=>{let e=11===t.nodeType?0:1;const i=document.createTreeWalker(t,133,null,!1);for(;i.nextNode();)e++;return e},u=(t,e=-1)=>{for(let i=e+1;i<t.length;i++){const e=t[i];if(l(e))return i}return-1},m=new WeakMap,g=t=>"function"==typeof t&&m.has(t),y={},_={};class f{constructor(t,e,i){this.__parts=[],this.template=t,this.processor=e,this.options=i}update(t){let e=0;for(const i of this.__parts)void 0!==i&&i.setValue(t[e]),e++;for(const t of this.__parts)void 0!==t&&t.commit()}_clone(){const e=t?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),i=[],s=this.template.parts,o=document.createTreeWalker(e,133,null,!1);let r,n=0,a=0,h=o.nextNode();for(;n<s.length;)if(r=s[n],l(r)){for(;a<r.index;)a++,"TEMPLATE"===h.nodeName&&(i.push(h),o.currentNode=h.content),null===(h=o.nextNode())&&(o.currentNode=i.pop(),h=o.nextNode());if("node"===r.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(h.previousSibling),this.__parts.push(t)}else this.__parts.push(...this.processor.handleAttributeExpressions(h,r.name,r.strings,this.options));n++}else this.__parts.push(void 0),n++;return t&&(document.adoptNode(e),customElements.upgrade(e)),e}}const b=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),S=` ${i} `;const v=t=>null===t||!("object"==typeof t||"function"==typeof t),C=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class w{constructor(t,e,i){this.dirty=!0,this.element=t,this.name=e,this.strings=i,this.parts=[];for(let t=0;t<i.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new P(this)}_getValue(){const t=this.strings,e=t.length-1,i=this.parts;if(1===e&&""===t[0]&&""===t[1]){const t=i[0].value;if("symbol"==typeof t)return String(t);if("string"==typeof t||!C(t))return t}let s="";for(let o=0;o<e;o++){s+=t[o];const e=i[o];if(void 0!==e){const t=e.value;if(v(t)||!C(t))s+="string"==typeof t?t:String(t);else for(const e of t)s+="string"==typeof e?e:String(e)}}return s+=t[e],s}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class P{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===y||v(t)&&t===this.value||(this.value=t,g(t)||(this.committer.dirty=!0))}commit(){for(;g(this.value);){const t=this.value;this.value=y,t(this)}this.value!==y&&this.committer.commit()}}class x{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(h()),this.endNode=t.appendChild(h())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=h()),t.__insert(this.endNode=h())}insertAfterPart(t){t.__insert(this.startNode=h()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){if(null===this.startNode.parentNode)return;for(;g(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=y,t(this)}const t=this.__pendingValue;t!==y&&(v(t)?t!==this.value&&this.__commitText(t):t instanceof class{constructor(t,e,i,s){this.strings=t,this.values=e,this.type=i,this.processor=s}getHTML(){const t=this.strings.length-1;let e="",o=!1;for(let n=0;n<t;n++){const t=this.strings[n],a=t.lastIndexOf("\x3c!--");o=(a>-1||o)&&-1===t.indexOf("--\x3e",a+1);const l=d.exec(t);e+=null===l?t+(o?S:s):t.substr(0,l.index)+l[1]+l[2]+r+l[3]+i}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");let e=this.getHTML();return void 0!==b&&(e=b.createHTML(e)),t.innerHTML=e,t}}?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):C(t)?this.__commitIterable(t):t===_?(this.value=_,this.clear()):this.__commitText(t))}__insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}__commitNode(t){this.value!==t&&(this.clear(),this.__insert(t),this.value=t)}__commitText(t){const e=this.startNode.nextSibling,i="string"==typeof(t=null==t?"":t)?t:String(t);e===this.endNode.previousSibling&&3===e.nodeType?e.data=i:this.__commitNode(document.createTextNode(i)),this.value=t}__commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof f&&this.value.template===e)this.value.update(t.values);else{const i=new f(e,t.processor,this.options),s=i._clone();i.update(t.values),this.__commitNode(s),this.value=i}}__commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let i,s=0;for(const o of t)i=e[s],void 0===i&&(i=new x(this.options),e.push(i),0===s?i.appendIntoPart(this):i.insertAfterPart(e[s-1])),i.setValue(o),i.commit(),s++;s<e.length&&(e.length=s,this.clear(i&&i.endNode))}clear(t=this.startNode){e(this.startNode.parentNode,t.nextSibling,this.endNode)}}class N{constructor(t,e,i){if(this.value=void 0,this.__pendingValue=void 0,2!==i.length||""!==i[0]||""!==i[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=i}setValue(t){this.__pendingValue=t}commit(){for(;g(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=y,t(this)}if(this.__pendingValue===y)return;const t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=y}}class A extends w{constructor(t,e,i){super(t,e,i),this.single=2===i.length&&""===i[0]&&""===i[1]}_createPart(){return new T(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class T extends P{}let E=!1;(()=>{try{const t={get capture(){return E=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class B{constructor(t,e,i){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=i,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;g(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=y,t(this)}if(this.__pendingValue===y)return;const t=this.__pendingValue,e=this.value,i=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),s=null!=t&&(null==e||i);i&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),s&&(this.__options=I(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=y}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const I=t=>t&&(E?{capture:t.capture,passive:t.passive,once:t.once}:t.capture);function V(t){let e=O.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},O.set(t.type,e));let s=e.stringsArray.get(t.strings);if(void 0!==s)return s;const o=t.strings.join(i);return s=e.keyString.get(o),void 0===s&&(s=new n(t,t.getTemplateElement()),e.keyString.set(o,s)),e.stringsArray.set(t.strings,s),s}const O=new Map,R=new WeakMap;new class{handleAttributeExpressions(t,e,i,s){const o=e[0];return"."===o?new A(t,e.slice(1),i).parts:"@"===o?[new B(t,e.slice(1),s.eventContext)]:"?"===o?[new N(t,e.slice(1),i)]:new w(t,e,i).parts}handleTextExpression(t){return new x(t)}},"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const U=(t,e)=>`${t}--${e}`;let k=!0;void 0===window.ShadyCSS?k=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),k=!1);const M=t=>e=>{const s=U(e.type,t);let o=O.get(s);void 0===o&&(o={stringsArray:new WeakMap,keyString:new Map},O.set(s,o));let r=o.stringsArray.get(e.strings);if(void 0!==r)return r;const a=e.strings.join(i);if(r=o.keyString.get(a),void 0===r){const i=e.getTemplateElement();k&&window.ShadyCSS.prepareTemplateDom(i,t),r=new n(e,i),o.keyString.set(a,r)}return o.stringsArray.set(e.strings,r),r},q=["html","svg"],D=new Set;window.JSCompiler_renameProperty=(t,e)=>t;const j={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},H=(t,e)=>e!==t&&(e==e||t==t),F={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:H};class L extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach(((e,i)=>{const s=this._attributeNameForProperty(i,e);void 0!==s&&(this._attributeToPropertyMap.set(s,i),t.push(s))})),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach(((t,e)=>this._classProperties.set(e,t)))}}static createProperty(t,e=F){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const i="symbol"==typeof t?Symbol():`__${t}`,s=this.getPropertyDescriptor(t,i,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){const o=this[t];this[e]=s,this.requestUpdateInternal(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this._classProperties&&this._classProperties.get(t)||F}static finalize(){const t=Object.getPrototypeOf(this);if(t.hasOwnProperty("finalized")||t.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const i of e)this.createProperty(i,t[i])}}static _attributeNameForProperty(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,i=H){return i(t,e)}static _propertyValueFromAttribute(t,e){const i=e.type,s=e.converter||j,o="function"==typeof s?s:s.fromAttribute;return o?o(t,i):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const i=e.type,s=e.converter;return(s&&s.toAttribute||j.toAttribute)(t,i)}initialize(){this._updateState=0,this._updatePromise=new Promise((t=>this._enableUpdatingResolver=t)),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach(((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}}))}_applyInstanceProperties(){this._instanceProperties.forEach(((t,e)=>this[e]=t)),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,i){e!==i&&this._attributeToProperty(t,i)}_propertyToAttribute(t,e,i=F){const s=this.constructor,o=s._attributeNameForProperty(t,i);if(void 0!==o){const t=s._propertyValueToAttribute(e,i);if(void 0===t)return;this._updateState=8|this._updateState,null==t?this.removeAttribute(o):this.setAttribute(o,t),this._updateState=-9&this._updateState}}_attributeToProperty(t,e){if(8&this._updateState)return;const i=this.constructor,s=i._attributeToPropertyMap.get(t);if(void 0!==s){const t=i.getPropertyOptions(s);this._updateState=16|this._updateState,this[s]=i._propertyValueFromAttribute(e,t),this._updateState=-17&this._updateState}}requestUpdateInternal(t,e,i){let s=!0;if(void 0!==t){const o=this.constructor;i=i||o.getPropertyOptions(t),o._valueHasChanged(this[t],e,i.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==i.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,i))):s=!1}!this._hasRequestedUpdate&&s&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(t,e){return this.requestUpdateInternal(t,e),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(t){}const t=this.performUpdate();return null!=t&&await t,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{t=this.shouldUpdate(e),t?this.update(e):this._markUpdated()}catch(e){throw t=!1,this._markUpdated(),e}t&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach(((t,e)=>this._propertyToAttribute(e,this[e],t))),this._reflectingProperties=void 0),this._markUpdated()}updated(t){}firstUpdated(t){}}L.finalized=!0;const G=Element.prototype;G.msMatchesSelector||G.webkitMatchesSelector;const W=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,z=Symbol();class ${constructor(t,e){if(e!==z)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return void 0===this._styleSheet&&(W?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");const J={};class K extends L{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const t=this.getStyles();if(Array.isArray(t)){const e=(t,i)=>t.reduceRight(((t,i)=>Array.isArray(i)?e(i,t):(t.add(i),t)),i),i=e(t,new Set),s=[];i.forEach((t=>s.unshift(t))),this._styles=s}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map((t=>{if(t instanceof CSSStyleSheet&&!W){const e=Array.prototype.slice.call(t.cssRules).reduce(((t,e)=>t+e.cssText),"");return new $(String(e),z)}return t}))}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow(this.constructor.shadowRootOptions)}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?W?this.renderRoot.adoptedStyleSheets=t.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map((t=>t.cssText)),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){const e=this.render();super.update(t),e!==J&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)})))}render(){return J}}K.finalized=!0,K.render=(t,i,s)=>{if(!s||"object"!=typeof s||!s.scopeName)throw new Error("The `scopeName` option is required.");const o=s.scopeName,r=R.has(i),n=k&&11===i.nodeType&&!!i.host,a=n&&!D.has(o),l=a?document.createDocumentFragment():i;if(((t,i,s)=>{let o=R.get(i);void 0===o&&(e(i,i.firstChild),R.set(i,o=new x(Object.assign({templateFactory:V},s))),o.appendInto(i)),o.setValue(t),o.commit()})(t,l,Object.assign({templateFactory:M(o)},s)),a){const t=R.get(l);R.delete(l);((t,e,i)=>{D.add(t);const s=i?i.element:document.createElement("template"),o=e.querySelectorAll("style"),{length:r}=o;if(0===r)return void window.ShadyCSS.prepareTemplateStyles(s,t);const n=document.createElement("style");for(let t=0;t<r;t++){const e=o[t];e.parentNode.removeChild(e),n.textContent+=e.textContent}(t=>{q.forEach((e=>{const i=O.get(U(e,t));void 0!==i&&i.keyString.forEach((t=>{const{element:{content:e}}=t,i=new Set;Array.from(e.querySelectorAll("style")).forEach((t=>{i.add(t)})),c(t,i)}))}))})(t);const a=s.content;i?function(t,e,i=null){const{element:{content:s},parts:o}=t;if(null==i)return void s.appendChild(e);const r=document.createTreeWalker(s,133,null,!1);let n=u(o),a=0,l=-1;for(;r.nextNode();)for(l++,r.currentNode===i&&(a=p(e),i.parentNode.insertBefore(e,i));-1!==n&&o[n].index===l;){if(a>0){for(;-1!==n;)o[n].index+=a,n=u(o,n);return}n=u(o,n)}}(i,n,a.firstChild):a.insertBefore(n,a.firstChild),window.ShadyCSS.prepareTemplateStyles(s,t);const l=a.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(i){a.insertBefore(n,a.firstChild);const t=new Set;t.add(n),c(i,t)}})(o,l,t.value instanceof f?t.value.template:void 0),e(i,i.firstChild),i.appendChild(l),R.set(i,t)}!r&&n&&window.ShadyCSS.styleElement(i.host)},K.shadowRootOptions={mode:"open"};customElements.define("pdbe-molstar",class extends K{static get properties(){return{moleculeId:{type:String,attribute:"molecule-id"},assemblyId:{type:String,attribute:"assembly-id"},customDataUrl:{type:String,attribute:"custom-data-url"},customDataFormat:{type:String,attribute:"custom-data-format"},customDataBinary:{type:Boolean,attribute:"custom-data-binary"},ligandLabelCompId:{type:String,attribute:"ligand-label-comp-id"},ligandAuthAsymId:{type:String,attribute:"ligand-auth-asym-Id"},ligandAuthSeqId:{type:String,attribute:"ligand-auth-seq-id"},ligandHydrogens:{type:Boolean,attribute:"ligand-hydrogens"},pdbeUrl:{type:String,attribute:"pdbe-url"},bgColorR:{type:Number,attribute:"bg-color-r"},bgColorG:{type:Number,attribute:"bg-color-g"},bgColorB:{type:Number,attribute:"bg-color-b"},loadMaps:{type:Boolean,attribute:"load-maps"},validationAnnotation:{type:Boolean,attribute:"validation-annotation"},domainAnnotation:{type:Boolean,attribute:"domain-annotation"},lowPrecisionCoords:{type:Boolean,attribute:"low-precision"},expanded:{type:Boolean,attribute:"expanded"},hideControls:{type:Boolean,attribute:"hide-controls"},subscribeEvents:{type:Boolean,attribute:"subscribe-events"},pdbeLink:{type:Boolean,attribute:"pdbe-link"},loadCartoonsOnly:{type:Boolean,attribute:"load-cartoons-only"},selectInteraction:{type:Boolean,attribute:"select-interaction"},landscape:{type:Boolean,attribute:"landscape"},highlightColorR:{type:Number,attribute:"highlight-color-r"},highlightColorG:{type:Number,attribute:"highlight-color-g"},highlightColorB:{type:Number,attribute:"highlight-color-b"},selectColorR:{type:Number,attribute:"select-color-r"},selectColorG:{type:Number,attribute:"select-color-g"},selectColorB:{type:Number,attribute:"select-color-b"},hidePolymer:{type:Boolean,attribute:"hide-polymer"},hideWater:{type:Boolean,attribute:"hide-water"},hideHet:{type:Boolean,attribute:"hide-het"},hideCarbs:{type:Boolean,attribute:"hide-carbs"},hideNonStandard:{type:Boolean,attribute:"hide-non-standard"},hideCoarse:{type:Boolean,attribute:"hide-coarse"},visualStyle:{type:String,attribute:"visual-style"},hideExpandIcon:{type:Boolean,attribute:"hide-expand-icon"},hideSelectionIcon:{type:Boolean,attribute:"hide-selection-icon"},hideAnimationIcon:{type:Boolean,attribute:"hide-animation-icon"},hideControlToggleIcon:{type:Boolean,attribute:"hide-control-toggle-icon"},hideControlInfoIcon:{type:Boolean,attribute:"hide-control-info-icon"},alphafoldView:{type:Boolean,attribute:"alphafold-view"},lighting:{type:String,attribute:"lighting"},defaultPreset:{type:String,attribute:"default-preset"},sequencePanel:{type:Boolean,attribute:"sequence-panel"}}}validateParams(){return!(!this.moleculeId&&!this.customDataUrl||this.customDataUrl&&!this.customDataFormat)}formatParam(t){const e={ligandLabelCompId:"label_comp_id",ligandAuthAsymId:"auth_asym_id",ligandAuthSeqId:"auth_seq_id",ligandHydrogens:"hydrogens"},i=Object.keys(e),s={hidePolymer:"polymer",hideWater:"water",hideHet:"het",hideCarbs:"carbs",hideNonStandard:"nonStandard",hideCoarse:"coarse"},o=Object.keys(s),r={hideExpandIcon:"expand",hideSelectionIcon:"selection",hideAnimationIcon:"animation",hideControlToggleIcon:"controlToggle",hideControlInfoIcon:"controlInfo"},n=Object.keys(r);if("customDataUrl"==t||"customDataFormat"==t){if(this.initParams.customData)return;this.initParams.customData={url:this.customDataUrl,format:this.customDataFormat}}else if(i.indexOf(t)>-1){if(this.initParams.ligandView)return;this.initParams.ligandView=Object.assign({},{}),i.forEach((t=>{this[t]&&(this.initParams.ligandView[e[t]]=this[t])}))}else if(["highlightColorR","highlightColorG","highlightColorB"].indexOf(t)>-1&&this.highlightColorR&&this.highlightColorG&&this.highlightColorB)this.initParams.highlightColor={r:this.highlightColorR,g:this.highlightColorG,b:this.highlightColorB};else if(["selectColorR","selectColorG","selectColorB"].indexOf(t)>-1&&this.selectColorR&&this.selectColorG&&this.selectColorB)this.initParams.selectColor={r:this.selectColorR,g:this.selectColorG,b:this.selectColorB};else if(["bgColorR","bgColorG","bgColorB"].indexOf(t)>-1&&this.bgColorR&&this.bgColorG&&this.bgColorB)this.initParams.bgColor={r:this.bgColorR,g:this.bgColorG,b:this.bgColorB};else if(o.indexOf(t)>-1){if(this.initParams.hideStructure)return;this.initParams.hideStructure=[],o.forEach((t=>{this[t]&&this.initParams.hideStructure.push(s[t])}))}else if(n.indexOf(t)>-1){if(this.initParams.hideCanvasControls)return;this.initParams.hideCanvasControls=[],n.forEach((t=>{this[t]&&this.initParams.hideCanvasControls.push(r[t])}))}}createParamModel(){const t=["customDataUrl","customDataFormat","ligandLabelCompId","bgColorR","bgColorG","bgColorB","ligandAuthAsymId","ligandAuthSeqId","ligandHydrogens","highlightColorR","highlightColorG","highlightColorB","selectColorR","selectColorG","selectColorB","hidePolymer","hideWater","hideHet","hideCarbs","hideNonStandard","hideCoarse","hideExpandIcon","hideSelectionIcon","hideAnimationIcon","hideControlToggleIcon","hideControlInfoIcon"],e=this.constructor.properties;if(e)for(let i in e)this[i]&&(this.initParams||(this.initParams=Object.assign({},{})),-1==t.indexOf(i)?this.initParams[i]=this[i]:this.formatParam(i))}connectedCallback(){super.connectedCallback(),this.createParamModel(),this.viewerInstance=new PDBeMolstarPlugin,this.validateParams()&&this.initParams&&this.viewerInstance.render(this,this.initParams)}createRenderRoot(){return this}})})();
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
4
+ * This code may only be used under the BSD style license found at
5
+ * http://polymer.github.io/LICENSE.txt
6
+ * The complete set of authors may be found at
7
+ * http://polymer.github.io/AUTHORS.txt
8
+ * The complete set of contributors may be found at
9
+ * http://polymer.github.io/CONTRIBUTORS.txt
10
+ * Code distributed by Google as part of the polymer project is also
11
+ * subject to an additional IP rights grant found at
12
+ * http://polymer.github.io/PATENTS.txt
13
+ */
14
+
15
+ /**
16
+ @license
17
+ Copyright (c) 2019 The Polymer Project Authors. All rights reserved.
18
+ This code may only be used under the BSD style license found at
19
+ http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
20
+ http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
21
+ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
22
+ part of the polymer project is also subject to an additional IP rights grant
23
+ found at http://polymer.github.io/PATENTS.txt
24
+ */
@@ -1,16 +1,16 @@
1
- import { Model } from 'Molstar/mol-model/structure';
2
- import { StructureElement } from 'Molstar/mol-model/structure/structure';
3
- import { CustomModelProperty } from 'Molstar/mol-model-props/common/custom-model-property';
4
- export { SIFTSMapping as SIFTSMapping };
5
- interface SIFTSMappingMapping {
6
- readonly dbName: string[];
7
- readonly accession: string[];
8
- readonly num: string[];
9
- readonly residue: string[];
10
- }
11
- declare namespace SIFTSMapping {
12
- const Provider: CustomModelProperty.Provider<{}, SIFTSMappingMapping>;
13
- function isAvailable(model: Model): boolean;
14
- function getKey(loc: StructureElement.Location): string;
15
- function getLabel(loc: StructureElement.Location): string | undefined;
16
- }
1
+ import { Model } from 'Molstar/mol-model/structure';
2
+ import { StructureElement } from 'Molstar/mol-model/structure/structure';
3
+ import { CustomModelProperty } from 'Molstar/mol-model-props/common/custom-model-property';
4
+ export { SIFTSMapping as SIFTSMapping };
5
+ interface SIFTSMappingMapping {
6
+ readonly dbName: string[];
7
+ readonly accession: string[];
8
+ readonly num: string[];
9
+ readonly residue: string[];
10
+ }
11
+ declare namespace SIFTSMapping {
12
+ const Provider: CustomModelProperty.Provider<{}, SIFTSMappingMapping>;
13
+ function isAvailable(model: Model): boolean;
14
+ function getKey(loc: StructureElement.Location): string;
15
+ function getLabel(loc: StructureElement.Location): string | undefined;
16
+ }