protvista-uniprot 2.12.2 → 2.13.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/README.md +2 -2
- package/dist/es/commonTypes.d.ts +1 -1
- package/dist/es/config.json +94 -67
- package/dist/es/filterConfig.d.ts +4 -3
- package/dist/es/filterConfig.js +48 -32
- package/dist/es/filterConfig.js.map +1 -1
- package/dist/es/index.d.ts +0 -2
- package/dist/es/index.js +0 -3
- package/dist/es/index.js.map +1 -1
- package/dist/es/protvista-alphafold-confidence.d.ts +1 -1
- package/dist/es/protvista-alphamissense-heatmap.d.ts +8 -0
- package/dist/es/protvista-alphamissense-heatmap.js +35 -0
- package/dist/es/protvista-alphamissense-heatmap.js.map +1 -0
- package/dist/es/protvista-alphamissense-pathogenicity.d.ts +3 -1
- package/dist/es/protvista-alphamissense-pathogenicity.js +2 -2
- package/dist/es/protvista-alphamissense-pathogenicity.js.map +1 -1
- package/dist/es/protvista-ptm-exchange.d.ts +7 -7
- package/dist/es/protvista-ptm-exchange.js +6 -4
- package/dist/es/protvista-ptm-exchange.js.map +1 -1
- package/dist/es/protvista-uniprot-structure.d.ts +6 -1
- package/dist/es/protvista-uniprot-structure.js +137 -66
- package/dist/es/protvista-uniprot-structure.js.map +1 -1
- package/dist/es/protvista-uniprot.d.ts +27 -16
- package/dist/es/protvista-uniprot.js +166 -145
- package/dist/es/protvista-uniprot.js.map +1 -1
- package/dist/es/protvista-variation-graph-adapter.d.ts +9 -0
- package/dist/es/protvista-variation-graph-adapter.js +46 -0
- package/dist/es/protvista-variation-graph-adapter.js.map +1 -0
- package/dist/es/styles/protvista-styles.js +8 -13
- package/dist/es/styles/protvista-styles.js.map +1 -1
- package/dist/protvista-uniprot.js +217 -217
- package/dist/protvista-uniprot.js.LICENSE.txt +24 -57
- package/dist/protvista-uniprot.js.map +1 -1
- package/package.json +15 -16
- package/src/config.json +94 -67
- package/src/filterConfig.ts +58 -55
- package/src/index.ts +0 -3
- package/src/protvista-alphamissense-heatmap.ts +52 -0
- package/src/protvista-alphamissense-pathogenicity.ts +2 -2
- package/src/protvista-ptm-exchange.ts +21 -19
- package/src/protvista-uniprot-structure.ts +168 -94
- package/src/protvista-uniprot.ts +226 -168
- package/src/protvista-variation-graph-adapter.ts +47 -0
- package/src/styles/protvista-styles.ts +8 -13
- package/src/types/nightingale-components.d.ts +1 -1
- package/src/types/nightingale-sequence-heatmap.d.ts +1 -0
- package/dist/es/download-panel.d.ts +0 -29
- package/dist/es/download-panel.js +0 -137
- package/dist/es/download-panel.js.map +0 -1
- package/src/download-panel.ts +0 -164
- package/src/types/protvista-filter.d.ts +0 -16
- package/src/types/protvista-interpro-track.d.ts +0 -1
- package/src/types/protvista-manager.d.ts +0 -1
- package/src/types/protvista-navigation.d.ts +0 -1
- package/src/types/protvista-sequence.d.ts +0 -1
- package/src/types/protvista-tooltip.d.ts +0 -8
- package/src/types/protvista-track.d.ts +0 -5
- package/src/types/protvista-variation-graph.d.ts +0 -1
package/src/protvista-uniprot.ts
CHANGED
|
@@ -1,32 +1,37 @@
|
|
|
1
1
|
import { LitElement, html, svg } from 'lit-element';
|
|
2
2
|
import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
|
|
3
3
|
import { frame } from 'timing-functions';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
4
|
+
|
|
5
|
+
// Nightingale
|
|
6
|
+
import NightingaleManager from '@nightingale-elements/nightingale-manager';
|
|
7
|
+
import NightingaleNavigation from '@nightingale-elements/nightingale-navigation';
|
|
8
|
+
import NightingaleSequence from '@nightingale-elements/nightingale-sequence';
|
|
9
|
+
import NightingaleColoredSequence from '@nightingale-elements/nightingale-colored-sequence';
|
|
10
|
+
import NightingaleTrack from '@nightingale-elements/nightingale-track';
|
|
11
|
+
import NightingaleInterproTrack from '@nightingale-elements/nightingale-interpro-track';
|
|
12
|
+
import NightingaleVariation from '@nightingale-elements/nightingale-variation';
|
|
13
|
+
import NightingaleLinegraphTrack from '@nightingale-elements/nightingale-linegraph-track';
|
|
14
|
+
import NightingaleSequenceHeatmap from '@nightingale-elements/nightingale-sequence-heatmap';
|
|
15
|
+
import NightingaleFilter from '@nightingale-elements/nightingale-filter';
|
|
15
16
|
|
|
16
17
|
import { load } from 'data-loader';
|
|
17
18
|
// adapters
|
|
18
19
|
import { transformData as _transformDataFeatureAdapter } from 'protvista-feature-adapter';
|
|
19
20
|
import { transformData as _transformDataProteomicsAdapter } from 'protvista-proteomics-adapter';
|
|
20
21
|
import { transformData as _transformDataStructureAdapter } from 'protvista-structure-adapter';
|
|
21
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
transformData as _transformDataVariationAdapter,
|
|
24
|
+
TransformedVariant,
|
|
25
|
+
} from 'protvista-variation-adapter';
|
|
26
|
+
import { transformData as _transformDataVariationGraphAdapter } from './protvista-variation-graph-adapter';
|
|
22
27
|
import { transformData as _transformDataInterproAdapter } from 'protvista-interpro-adapter';
|
|
23
28
|
import { transformData as _transformDataProteomicsPTMApdapter } from './protvista-ptm-exchange';
|
|
24
29
|
import { transformData as _transformDataAlphaFoldConfidenceAdapter } from './protvista-alphafold-confidence';
|
|
25
30
|
import { transformData as _transformDataAlphaMissensePathogenicityAdapter } from './protvista-alphamissense-pathogenicity';
|
|
31
|
+
import { transformData as _transformDataAlphaMissenseHeatmapAdapter } from './protvista-alphamissense-heatmap';
|
|
26
32
|
|
|
27
33
|
import defaultConfig from './config.json';
|
|
28
34
|
import _ProtvistaUniprotStructure from './protvista-uniprot-structure';
|
|
29
|
-
import _DownloadPanel from './download-panel';
|
|
30
35
|
import { loadComponent } from './loadComponents';
|
|
31
36
|
import _filterConfig, { colorConfig as _colorConfig } from './filterConfig';
|
|
32
37
|
import { NightingaleEvent } from './types/nightingale-components';
|
|
@@ -39,6 +44,8 @@ export const transformDataFeatureAdapter = _transformDataFeatureAdapter;
|
|
|
39
44
|
export const transformDataProteomicsAdapter = _transformDataProteomicsAdapter;
|
|
40
45
|
export const transformDataStructureAdapter = _transformDataStructureAdapter;
|
|
41
46
|
export const transformDataVariationAdapter = _transformDataVariationAdapter;
|
|
47
|
+
export const transformDataVariationGraphAdapter =
|
|
48
|
+
_transformDataVariationGraphAdapter;
|
|
42
49
|
export const transformDataInterproAdapter = _transformDataInterproAdapter;
|
|
43
50
|
export const transformDataProteomicsPTMApdapter =
|
|
44
51
|
_transformDataProteomicsPTMApdapter;
|
|
@@ -48,10 +55,12 @@ export const transformDataAlphaFoldConfidenceAdapter =
|
|
|
48
55
|
export const transformDataAlphaMissensePathogenicityAdapter =
|
|
49
56
|
_transformDataAlphaMissensePathogenicityAdapter;
|
|
50
57
|
|
|
58
|
+
export const transformDataAlphaMissenseHeatmapAdapter =
|
|
59
|
+
_transformDataAlphaMissenseHeatmapAdapter;
|
|
60
|
+
|
|
51
61
|
export const filterConfig = _filterConfig;
|
|
52
62
|
export const colorConfig = _colorConfig;
|
|
53
63
|
export const ProtvistaUniprotStructure = _ProtvistaUniprotStructure;
|
|
54
|
-
export const DownloadPanel = _DownloadPanel;
|
|
55
64
|
|
|
56
65
|
const adapters = {
|
|
57
66
|
'protvista-feature-adapter': transformDataFeatureAdapter,
|
|
@@ -59,19 +68,23 @@ const adapters = {
|
|
|
59
68
|
'protvista-proteomics-adapter': transformDataProteomicsAdapter,
|
|
60
69
|
'protvista-structure-adapter': transformDataStructureAdapter,
|
|
61
70
|
'protvista-variation-adapter': transformDataVariationAdapter,
|
|
71
|
+
'protvista-variation-graph-adapter': transformDataVariationGraphAdapter,
|
|
62
72
|
'protvista-proteomics-ptm-adapter': transformDataProteomicsPTMApdapter,
|
|
63
73
|
'protvista-alphafold-confidence-adapter':
|
|
64
74
|
transformDataAlphaFoldConfidenceAdapter,
|
|
65
75
|
'protvista-alphamissense-pathogenicity-adapter':
|
|
66
76
|
transformDataAlphaMissensePathogenicityAdapter,
|
|
77
|
+
'protvista-alphamissense-heatmap-adapter':
|
|
78
|
+
transformDataAlphaMissenseHeatmapAdapter,
|
|
67
79
|
};
|
|
68
80
|
|
|
69
81
|
type TrackType =
|
|
70
|
-
| '
|
|
71
|
-
| '
|
|
72
|
-
| '
|
|
73
|
-
| '
|
|
74
|
-
| '
|
|
82
|
+
| 'nightingale-track'
|
|
83
|
+
| 'nightingale-interpro-track'
|
|
84
|
+
| 'nightingale-colored-sequence'
|
|
85
|
+
| 'nightingale-variation'
|
|
86
|
+
| 'nightingale-linegraph-track'
|
|
87
|
+
| 'nightingale-sequence-heatmap';
|
|
75
88
|
|
|
76
89
|
type ProtvistaTrackConfig = {
|
|
77
90
|
name: string;
|
|
@@ -86,13 +99,17 @@ type ProtvistaTrackConfig = {
|
|
|
86
99
|
| 'protvista-structure-adapter'
|
|
87
100
|
| 'protvista-proteomics-adapter'
|
|
88
101
|
| 'protvista-variation-adapter'
|
|
89
|
-
| 'protvista-
|
|
102
|
+
| 'protvista-variation-graph-adapter'
|
|
103
|
+
| 'protvista-interpro-adapter'
|
|
104
|
+
| 'protvista-alphafold-confidence-adapter'
|
|
105
|
+
| 'protvista-alphamissense-pathogenicity-adapter'
|
|
106
|
+
| 'protvista-alphamissense-heatmap-adapter';
|
|
90
107
|
}[];
|
|
91
108
|
tooltip: string;
|
|
92
109
|
color?: string;
|
|
93
110
|
shape?: string; //TODO: eventually replace with list
|
|
94
111
|
scale?: string;
|
|
95
|
-
filterComponent?: '
|
|
112
|
+
filterComponent?: 'nightingale-filter';
|
|
96
113
|
'color-range'?: string;
|
|
97
114
|
};
|
|
98
115
|
|
|
@@ -119,7 +136,6 @@ type ProtvistaConfig = {
|
|
|
119
136
|
|
|
120
137
|
class ProtvistaUniprot extends LitElement {
|
|
121
138
|
private openCategories: string[];
|
|
122
|
-
private notooltip: boolean;
|
|
123
139
|
private nostructure: boolean;
|
|
124
140
|
private hasData: boolean;
|
|
125
141
|
private loading: boolean;
|
|
@@ -129,19 +145,23 @@ class ProtvistaUniprot extends LitElement {
|
|
|
129
145
|
private suspend?: boolean;
|
|
130
146
|
private accession?: string;
|
|
131
147
|
private sequence?: string;
|
|
148
|
+
private transformedVariants?: {
|
|
149
|
+
sequence: string;
|
|
150
|
+
variants: TransformedVariant[];
|
|
151
|
+
};
|
|
132
152
|
private config?: ProtvistaConfig;
|
|
133
153
|
|
|
134
154
|
constructor() {
|
|
135
155
|
super();
|
|
136
156
|
this.openCategories = [];
|
|
137
|
-
this.notooltip = false;
|
|
138
157
|
this.nostructure = false;
|
|
139
158
|
this.hasData = false;
|
|
140
159
|
this.loading = true;
|
|
141
160
|
this.data = {};
|
|
142
161
|
this.rawData = {};
|
|
143
162
|
this.displayCoordinates = {};
|
|
144
|
-
this.
|
|
163
|
+
(this.transformedVariants = { sequence: '', variants: [] }),
|
|
164
|
+
this.addStyles();
|
|
145
165
|
}
|
|
146
166
|
|
|
147
167
|
static get properties() {
|
|
@@ -167,20 +187,17 @@ class ProtvistaUniprot extends LitElement {
|
|
|
167
187
|
}
|
|
168
188
|
|
|
169
189
|
registerWebComponents() {
|
|
170
|
-
loadComponent('
|
|
171
|
-
loadComponent('
|
|
172
|
-
loadComponent('
|
|
173
|
-
loadComponent(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
);
|
|
177
|
-
loadComponent('
|
|
178
|
-
loadComponent('
|
|
179
|
-
loadComponent('protvista-variation', ProtvistaVariation);
|
|
180
|
-
loadComponent('protvista-variation-graph', ProtvistaVariationGraph);
|
|
181
|
-
loadComponent('protvista-filter', ProtvistaFilter);
|
|
182
|
-
loadComponent('protvista-manager', ProtvistaManager);
|
|
190
|
+
loadComponent('nightingale-navigation', NightingaleNavigation);
|
|
191
|
+
loadComponent('nightingale-track', NightingaleTrack);
|
|
192
|
+
loadComponent('nightingale-colored-sequence', NightingaleColoredSequence);
|
|
193
|
+
loadComponent('nightingale-interpro-track', NightingaleInterproTrack);
|
|
194
|
+
loadComponent('nightingale-sequence', NightingaleSequence);
|
|
195
|
+
loadComponent('nightingale-variation', NightingaleVariation);
|
|
196
|
+
loadComponent('nightingale-linegraph-track', NightingaleLinegraphTrack);
|
|
197
|
+
loadComponent('nightingale-filter', NightingaleFilter);
|
|
198
|
+
loadComponent('nightingale-manager', NightingaleManager);
|
|
183
199
|
loadComponent('protvista-uniprot-structure', _ProtvistaUniprotStructure);
|
|
200
|
+
loadComponent('nightingale-sequence-heatmap', NightingaleSequenceHeatmap);
|
|
184
201
|
}
|
|
185
202
|
|
|
186
203
|
async _loadData() {
|
|
@@ -269,12 +286,16 @@ class ProtvistaUniprot extends LitElement {
|
|
|
269
286
|
// 3. Assign track data
|
|
270
287
|
this.data[`${categoryName}-${trackName}`] = filteredData;
|
|
271
288
|
|
|
289
|
+
if (trackName === 'variation') {
|
|
290
|
+
this.transformedVariants = filteredData;
|
|
291
|
+
}
|
|
272
292
|
return filteredData;
|
|
273
293
|
})
|
|
274
294
|
);
|
|
295
|
+
|
|
275
296
|
this.data[categoryName] =
|
|
276
|
-
trackType === '
|
|
277
|
-
trackType === '
|
|
297
|
+
trackType === 'nightingale-linegraph-track' ||
|
|
298
|
+
trackType === 'nightingale-colored-sequence'
|
|
278
299
|
? categoryData[0]
|
|
279
300
|
: categoryData.flat();
|
|
280
301
|
}
|
|
@@ -286,9 +307,9 @@ class ProtvistaUniprot extends LitElement {
|
|
|
286
307
|
async _loadDataInComponents() {
|
|
287
308
|
await frame();
|
|
288
309
|
Object.entries(this.data).forEach(([id, data]) => {
|
|
289
|
-
const element:
|
|
310
|
+
const element: NightingaleTrack | null = document.getElementById(
|
|
290
311
|
`track-${id}`
|
|
291
|
-
);
|
|
312
|
+
) as NightingaleTrack;
|
|
292
313
|
// set data if it hasn't changed
|
|
293
314
|
if (element && element.data !== data) {
|
|
294
315
|
element.data = data;
|
|
@@ -314,14 +335,38 @@ class ProtvistaUniprot extends LitElement {
|
|
|
314
335
|
categoryElt.style.display = 'flex';
|
|
315
336
|
}
|
|
316
337
|
for (const track of currentCategory.tracks) {
|
|
317
|
-
const elementTrack
|
|
338
|
+
const elementTrack = document.getElementById(
|
|
318
339
|
`track-${id}-${track.name}`
|
|
319
|
-
);
|
|
340
|
+
) as NightingaleTrack | null;
|
|
320
341
|
if (elementTrack) {
|
|
321
342
|
elementTrack.data = this.data[`${id}-${track.name}`];
|
|
322
343
|
}
|
|
323
344
|
}
|
|
324
345
|
}
|
|
346
|
+
|
|
347
|
+
if (
|
|
348
|
+
currentCategory?.name === 'ALPHAMISSENSE_PATHOGENICITY' &&
|
|
349
|
+
currentCategory.tracks
|
|
350
|
+
) {
|
|
351
|
+
for (const track of currentCategory.tracks) {
|
|
352
|
+
if (track.trackType === 'nightingale-sequence-heatmap') {
|
|
353
|
+
const heatmapComponent = this.querySelector<
|
|
354
|
+
typeof NightingaleSequenceHeatmap
|
|
355
|
+
>('nightingale-sequence-heatmap');
|
|
356
|
+
if (heatmapComponent) {
|
|
357
|
+
const heatmapData = this.data[`${id}-${track.name}`];
|
|
358
|
+
const xDomain = Array.from(
|
|
359
|
+
{ length: this.sequence.length },
|
|
360
|
+
(_, i) => i + 1
|
|
361
|
+
);
|
|
362
|
+
const yDomain = [
|
|
363
|
+
...new Set(heatmapData.map((hotMapItem) => hotMapItem.yValue)),
|
|
364
|
+
];
|
|
365
|
+
heatmapComponent.setHeatmapData(xDomain, yDomain, heatmapData);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
325
370
|
});
|
|
326
371
|
}
|
|
327
372
|
|
|
@@ -329,15 +374,16 @@ class ProtvistaUniprot extends LitElement {
|
|
|
329
374
|
super.updated(changedProperties);
|
|
330
375
|
|
|
331
376
|
const filterComponent =
|
|
332
|
-
this.querySelector<
|
|
377
|
+
this.querySelector<NightingaleFilter>('nightingale-filter');
|
|
333
378
|
if (filterComponent && filterComponent.filters !== filterConfig) {
|
|
334
379
|
filterComponent.filters = filterConfig;
|
|
335
380
|
}
|
|
336
381
|
|
|
337
|
-
const variationComponent = this.querySelector<
|
|
338
|
-
'
|
|
382
|
+
const variationComponent = this.querySelector<NightingaleVariation>(
|
|
383
|
+
'nightingale-variation'
|
|
339
384
|
);
|
|
340
|
-
|
|
385
|
+
|
|
386
|
+
if (variationComponent && variationComponent?.colorConfig !== colorConfig) {
|
|
341
387
|
variationComponent.colorConfig = colorConfig;
|
|
342
388
|
}
|
|
343
389
|
|
|
@@ -376,33 +422,8 @@ class ProtvistaUniprot extends LitElement {
|
|
|
376
422
|
if (e.detail?.displayend) {
|
|
377
423
|
this.displayCoordinates.end = e.detail.displayend;
|
|
378
424
|
}
|
|
379
|
-
|
|
380
|
-
if (!this.notooltip) {
|
|
381
|
-
if (!e.detail?.eventtype) {
|
|
382
|
-
this._resetTooltip();
|
|
383
|
-
} else if (e.detail.eventtype === 'click') {
|
|
384
|
-
this.updateTooltip(e);
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
425
|
});
|
|
388
426
|
|
|
389
|
-
if (!this.notooltip) {
|
|
390
|
-
this.addEventListener('click', (e) => {
|
|
391
|
-
const target = e.target as Element;
|
|
392
|
-
if (
|
|
393
|
-
!target.closest('.feature') &&
|
|
394
|
-
!target.closest('protvista-tooltip')
|
|
395
|
-
) {
|
|
396
|
-
const tooltip =
|
|
397
|
-
this.querySelector<ProtvistaTooltip>('protvista-tooltip');
|
|
398
|
-
if (tooltip) {
|
|
399
|
-
tooltip.visible = false;
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
});
|
|
403
|
-
document.addEventListener('click', this._resetTooltip);
|
|
404
|
-
}
|
|
405
|
-
|
|
406
427
|
// Note: this doesn't seem to work
|
|
407
428
|
this.addEventListener('load', () => {
|
|
408
429
|
if (!this.hasData) {
|
|
@@ -419,21 +440,6 @@ class ProtvistaUniprot extends LitElement {
|
|
|
419
440
|
});
|
|
420
441
|
}
|
|
421
442
|
|
|
422
|
-
disconnectedCallback() {
|
|
423
|
-
if (!this.notooltip) {
|
|
424
|
-
document.removeEventListener('click', this._resetTooltip);
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
_resetTooltip(e?: MouseEvent) {
|
|
429
|
-
if (this && (!e || !(e.target as Element)?.closest('protvista-uniprot'))) {
|
|
430
|
-
const tooltip = this.querySelector<ProtvistaTooltip>('protvista-tooltip');
|
|
431
|
-
if (tooltip) {
|
|
432
|
-
tooltip.visible = false;
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
|
|
437
443
|
async loadEntry(accession: string) {
|
|
438
444
|
try {
|
|
439
445
|
return await (
|
|
@@ -467,28 +473,25 @@ class ProtvistaUniprot extends LitElement {
|
|
|
467
473
|
</div>`;
|
|
468
474
|
}
|
|
469
475
|
return html`
|
|
470
|
-
<
|
|
471
|
-
attributes="length
|
|
472
|
-
additionalsubscribers="protvista-structure"
|
|
476
|
+
<nightingale-manager
|
|
477
|
+
reflected-attributes="length display-start display-end highlight activefilters filters"
|
|
473
478
|
>
|
|
474
479
|
<div class="nav-container">
|
|
475
|
-
<div class="
|
|
476
|
-
<download-panel
|
|
477
|
-
accession="${this.accession}"
|
|
478
|
-
config="${JSON.stringify(this.config.download)}"
|
|
479
|
-
/>
|
|
480
|
-
</div>
|
|
480
|
+
<div class="nav-track-label"></div>
|
|
481
481
|
<div class="track-content">
|
|
482
|
-
<
|
|
482
|
+
<nightingale-navigation
|
|
483
483
|
length="${this.sequence.length}"
|
|
484
|
-
|
|
485
|
-
|
|
484
|
+
height="40"
|
|
485
|
+
></nightingale-navigation>
|
|
486
|
+
<nightingale-sequence
|
|
486
487
|
length="${this.sequence.length}"
|
|
488
|
+
height="40"
|
|
487
489
|
sequence="${this.sequence}"
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
490
|
+
display-start=${this.displayCoordinates?.start}
|
|
491
|
+
display-end="${this.displayCoordinates?.end}"
|
|
492
|
+
highlight-event="onclick"
|
|
493
|
+
use-ctrl-to-zoom
|
|
494
|
+
></nightingale-sequence>
|
|
492
495
|
</div>
|
|
493
496
|
</div>
|
|
494
497
|
${this.config.categories.map(
|
|
@@ -506,7 +509,7 @@ class ProtvistaUniprot extends LitElement {
|
|
|
506
509
|
<div
|
|
507
510
|
data-id="category_${category.name}"
|
|
508
511
|
class="aggregate-track-content track-content ${category.trackType ===
|
|
509
|
-
'
|
|
512
|
+
'nightingale-colored-sequence'
|
|
510
513
|
? 'track-content__coloured-sequence'
|
|
511
514
|
: ''}"
|
|
512
515
|
.style="${this.openCategories.includes(category.name)
|
|
@@ -555,7 +558,7 @@ class ProtvistaUniprot extends LitElement {
|
|
|
555
558
|
<div
|
|
556
559
|
class="track-content"
|
|
557
560
|
class="track-content ${category.trackType ===
|
|
558
|
-
'
|
|
561
|
+
'nightingale-colored-sequence'
|
|
559
562
|
? 'track-content__coloured-sequence'
|
|
560
563
|
: ''}"
|
|
561
564
|
data-id="track_${track.name}"
|
|
@@ -613,13 +616,15 @@ class ProtvistaUniprot extends LitElement {
|
|
|
613
616
|
<div class="nav-container">
|
|
614
617
|
<div class="credits"></div>
|
|
615
618
|
<div class="track-content">
|
|
616
|
-
<
|
|
619
|
+
<nightingale-sequence
|
|
617
620
|
length="${this.sequence.length}"
|
|
621
|
+
height="40"
|
|
618
622
|
sequence="${this.sequence}"
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
+
display-start=${this.displayCoordinates.start}
|
|
624
|
+
display-end="${this.displayCoordinates.end}"
|
|
625
|
+
highlight-event="onclick"
|
|
626
|
+
use-ctrl-to-zoom
|
|
627
|
+
></nightingale-sequence>
|
|
623
628
|
</div>
|
|
624
629
|
</div>
|
|
625
630
|
${!this.nostructure
|
|
@@ -629,34 +634,10 @@ class ProtvistaUniprot extends LitElement {
|
|
|
629
634
|
></protvista-uniprot-structure>
|
|
630
635
|
`
|
|
631
636
|
: ''}
|
|
632
|
-
|
|
633
|
-
</protvista-manager>
|
|
637
|
+
</nightingale-manager>
|
|
634
638
|
`;
|
|
635
639
|
}
|
|
636
640
|
|
|
637
|
-
async updateTooltip(e: NightingaleEvent) {
|
|
638
|
-
const d = e.detail?.feature;
|
|
639
|
-
|
|
640
|
-
if (!d.tooltipContent) {
|
|
641
|
-
return;
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
const tooltip = this.querySelector<ProtvistaTooltip>('protvista-tooltip');
|
|
645
|
-
if (!tooltip) {
|
|
646
|
-
return;
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
tooltip.title = `${d.type} ${d.start}-${d.end}`;
|
|
650
|
-
tooltip.innerHTML = d.tooltipContent;
|
|
651
|
-
tooltip.visible = true;
|
|
652
|
-
|
|
653
|
-
if (e.detail?.coords) {
|
|
654
|
-
const [x, y] = e.detail.coords;
|
|
655
|
-
tooltip.x = x;
|
|
656
|
-
tooltip.y = y;
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
|
|
660
641
|
handleCategoryClick(e: MouseEvent) {
|
|
661
642
|
const target = e.target as Element;
|
|
662
643
|
const toggle = target.getAttribute('data-category-toggle');
|
|
@@ -671,16 +652,67 @@ class ProtvistaUniprot extends LitElement {
|
|
|
671
652
|
}
|
|
672
653
|
}
|
|
673
654
|
|
|
655
|
+
groupByCategory(filters, category) {
|
|
656
|
+
return filters?.filter((f) => f.type.name === category);
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
getFilter(filters, filterName) {
|
|
660
|
+
return filters?.filter((f) => f.name === filterName)?.[0];
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
handleFilterClick(e: CustomEvent) {
|
|
664
|
+
const target = e.target as Element as NightingaleFilter;
|
|
665
|
+
const consequenceFilters = this.groupByCategory(
|
|
666
|
+
target.filters,
|
|
667
|
+
'consequence'
|
|
668
|
+
);
|
|
669
|
+
const provenanceFilters = this.groupByCategory(
|
|
670
|
+
target.filters,
|
|
671
|
+
'provenance'
|
|
672
|
+
);
|
|
673
|
+
|
|
674
|
+
const selectedFilters = e.detail?.value;
|
|
675
|
+
|
|
676
|
+
if (selectedFilters) {
|
|
677
|
+
const selectedConsequenceFilters = selectedFilters
|
|
678
|
+
.map((f) => this.getFilter(consequenceFilters, f))
|
|
679
|
+
.filter(Boolean);
|
|
680
|
+
const selectedProvenanceFilters = selectedFilters
|
|
681
|
+
.map((f) => this.getFilter(provenanceFilters, f))
|
|
682
|
+
.filter(Boolean);
|
|
683
|
+
|
|
684
|
+
const filteredVariants = this.transformedVariants.variants
|
|
685
|
+
?.filter((variant) =>
|
|
686
|
+
selectedConsequenceFilters.some((filter) =>
|
|
687
|
+
filter.filterPredicate(variant)
|
|
688
|
+
)
|
|
689
|
+
)
|
|
690
|
+
.filter((variant) =>
|
|
691
|
+
selectedProvenanceFilters.some((filter) =>
|
|
692
|
+
filter.filterPredicate(variant)
|
|
693
|
+
)
|
|
694
|
+
);
|
|
695
|
+
|
|
696
|
+
this.data['VARIATION-variation'] = {
|
|
697
|
+
...this.data['VARIATION-variation'],
|
|
698
|
+
variants: filteredVariants,
|
|
699
|
+
};
|
|
700
|
+
|
|
701
|
+
this._loadDataInComponents();
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
|
|
674
705
|
getCategoryTypesAsString(tracks: ProtvistaTrackConfig[]) {
|
|
675
706
|
return tracks.map((t) => t.filter).join(',');
|
|
676
707
|
}
|
|
677
708
|
|
|
678
709
|
getFilterComponent(forId: string) {
|
|
679
710
|
return html`
|
|
680
|
-
<
|
|
711
|
+
<nightingale-filter
|
|
681
712
|
style="minWidth: 20%"
|
|
682
713
|
for="track-${forId}"
|
|
683
|
-
|
|
714
|
+
@change="${this.handleFilterClick}"
|
|
715
|
+
></nightingale-filter>
|
|
684
716
|
`;
|
|
685
717
|
}
|
|
686
718
|
|
|
@@ -696,68 +728,94 @@ class ProtvistaUniprot extends LitElement {
|
|
|
696
728
|
// lit-html doesn't allow to have dynamic tag names, hence the switch/case
|
|
697
729
|
// with repeated code
|
|
698
730
|
switch (trackType) {
|
|
699
|
-
case '
|
|
731
|
+
case 'nightingale-track':
|
|
700
732
|
return html`
|
|
701
|
-
<
|
|
733
|
+
<nightingale-track
|
|
702
734
|
length="${this.sequence?.length}"
|
|
735
|
+
height="40"
|
|
703
736
|
layout="${layout}"
|
|
704
737
|
color="${color}"
|
|
705
738
|
shape="${shape}"
|
|
706
|
-
|
|
707
|
-
|
|
739
|
+
display-start="${this.displayCoordinates?.start}"
|
|
740
|
+
display-end="${this.displayCoordinates?.end}"
|
|
708
741
|
id="track-${id}"
|
|
709
|
-
|
|
742
|
+
highlight-event="onclick"
|
|
743
|
+
use-ctrl-to-zoom
|
|
710
744
|
>
|
|
711
|
-
</
|
|
745
|
+
</nightingale-track>
|
|
712
746
|
`;
|
|
713
|
-
case '
|
|
747
|
+
case 'nightingale-interpro-track':
|
|
714
748
|
return html`
|
|
715
|
-
<
|
|
749
|
+
<nightingale-interpro-track
|
|
716
750
|
length="${this.sequence?.length}"
|
|
751
|
+
height="40"
|
|
717
752
|
color="${color}"
|
|
718
753
|
shape="${shape}"
|
|
719
|
-
|
|
720
|
-
|
|
754
|
+
display-start="${this.displayCoordinates?.start}"
|
|
755
|
+
display-end="${this.displayCoordinates?.end}"
|
|
721
756
|
id="track-${id}"
|
|
722
|
-
|
|
757
|
+
highlight-event="onclick"
|
|
758
|
+
use-ctrl-to-zoom
|
|
723
759
|
>
|
|
724
|
-
</
|
|
760
|
+
</nightingale-interpro-track>
|
|
725
761
|
`;
|
|
726
|
-
case '
|
|
762
|
+
case 'nightingale-variation':
|
|
727
763
|
return html`
|
|
728
|
-
<
|
|
764
|
+
<nightingale-variation
|
|
729
765
|
length="${this.sequence?.length}"
|
|
730
|
-
|
|
731
|
-
|
|
766
|
+
height="500"
|
|
767
|
+
display-start="${this.displayCoordinates?.start}"
|
|
768
|
+
display-end="${this.displayCoordinates?.end}"
|
|
732
769
|
id="track-${id}"
|
|
733
|
-
|
|
770
|
+
highlight-event="onclick"
|
|
771
|
+
use-ctrl-to-zoom
|
|
734
772
|
>
|
|
735
|
-
</
|
|
773
|
+
</nightingale-variation>
|
|
736
774
|
`;
|
|
737
|
-
case '
|
|
775
|
+
case 'nightingale-linegraph-track':
|
|
738
776
|
return html`
|
|
739
|
-
<
|
|
777
|
+
<nightingale-linegraph-track
|
|
740
778
|
length="${this.sequence?.length}"
|
|
741
|
-
|
|
742
|
-
|
|
779
|
+
height="50"
|
|
780
|
+
display-start="${this.displayCoordinates?.start}"
|
|
781
|
+
display-end="${this.displayCoordinates?.end}"
|
|
743
782
|
id="track-${id}"
|
|
744
|
-
|
|
783
|
+
show-label-name
|
|
784
|
+
highlight-on-click
|
|
785
|
+
use-ctrl-to-zoom
|
|
745
786
|
>
|
|
746
|
-
</
|
|
787
|
+
</nightingale-linegraph-track>
|
|
747
788
|
`;
|
|
748
|
-
case '
|
|
789
|
+
case 'nightingale-colored-sequence':
|
|
749
790
|
return html`
|
|
750
|
-
<
|
|
791
|
+
<nightingale-colored-sequence
|
|
751
792
|
length="${this.sequence?.length}"
|
|
752
|
-
|
|
753
|
-
|
|
793
|
+
display-start="${this.displayCoordinates?.start}"
|
|
794
|
+
display-end="${this.displayCoordinates?.end}"
|
|
754
795
|
id="track-${id}"
|
|
755
796
|
scale="${scale}"
|
|
756
|
-
|
|
797
|
+
color-range="${colorRange}"
|
|
757
798
|
height="13"
|
|
758
|
-
|
|
799
|
+
highlight-event="onclick"
|
|
800
|
+
use-ctrl-to-zoom
|
|
801
|
+
>
|
|
802
|
+
</nightingale-colored-sequence>
|
|
803
|
+
`;
|
|
804
|
+
|
|
805
|
+
case 'nightingale-sequence-heatmap':
|
|
806
|
+
return html`
|
|
807
|
+
<nightingale-sequence-heatmap
|
|
808
|
+
id="track-${id}"
|
|
809
|
+
heatmap-id="seq-heatmap"
|
|
810
|
+
length="${this.sequence?.length}"
|
|
811
|
+
display-start="${this.displayCoordinates?.start}"
|
|
812
|
+
display-end="${this.displayCoordinates?.end}"
|
|
813
|
+
highlight-event="onclick"
|
|
814
|
+
highlight-color="#EB3BFF66"
|
|
815
|
+
height="300"
|
|
816
|
+
use-ctrl-to-zoom
|
|
759
817
|
>
|
|
760
|
-
</
|
|
818
|
+
</nightingale-sequence-heatmap>
|
|
761
819
|
`;
|
|
762
820
|
default:
|
|
763
821
|
console.warn('No Matching ProtvistaTrack Found.');
|