protvista-uniprot 2.7.6 → 2.8.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "protvista-uniprot",
3
3
  "description": "ProtVista tool for the UniProt website",
4
- "version": "2.7.6",
4
+ "version": "2.8.3",
5
5
  "files": [
6
6
  "dist",
7
7
  "src"
@@ -29,23 +29,23 @@
29
29
  "data-loader": "^2.9.1",
30
30
  "file-saver": "^2.0.2",
31
31
  "lit-element": "^2.2.0",
32
- "protvista-datatable": "^2.18.0",
33
- "protvista-feature-adapter": "^2.18.0",
34
- "protvista-filter": "^2.12.0",
35
- "protvista-interpro-adapter": "^2.18.0",
36
- "protvista-interpro-track": "^2.18.2",
37
- "protvista-manager": "^2.16.3",
38
- "protvista-navigation": "^2.16.0",
39
- "protvista-proteomics-adapter": "^2.18.0",
40
- "protvista-sequence": "^2.18.0",
41
- "protvista-structure": "3.3.1",
42
- "protvista-structure-adapter": "^2.18.0",
43
- "protvista-tooltip": "^2.18.3",
44
- "protvista-track": "^2.18.2",
45
- "protvista-variation": "^2.18.2",
46
- "protvista-variation-adapter": "^3.2.6",
47
- "protvista-variation-graph": "^2.18.2",
48
- "protvista-zoomable": "^2.18.0",
32
+ "protvista-datatable": "^3.4.2",
33
+ "protvista-feature-adapter": "^3.4.5",
34
+ "protvista-filter": "^3.1.2",
35
+ "protvista-interpro-adapter": "^3.4.0",
36
+ "protvista-interpro-track": "^3.4.0",
37
+ "protvista-manager": "^3.4.0",
38
+ "protvista-navigation": "^3.4.0",
39
+ "protvista-proteomics-adapter": "^3.4.5",
40
+ "protvista-sequence": "^3.4.0",
41
+ "protvista-structure": "3.4.0",
42
+ "protvista-structure-adapter": "^3.4.5",
43
+ "protvista-tooltip": "^3.1.2",
44
+ "protvista-track": "^3.4.0",
45
+ "protvista-variation": "^3.4.4",
46
+ "protvista-variation-adapter": "^3.4.5",
47
+ "protvista-variation-graph": "^3.4.0",
48
+ "protvista-zoomable": "^3.4.0",
49
49
  "timing-functions": "^2.0.1",
50
50
  "url-join": "^4.0.1"
51
51
  },
package/src/config.json CHANGED
@@ -567,7 +567,10 @@
567
567
  "label": "Proteomics",
568
568
  "trackType": "protvista-track",
569
569
  "adapter": "protvista-proteomics-adapter",
570
- "url": "https://www.ebi.ac.uk/proteins/api/proteomics/{accession}",
570
+ "urls": [
571
+ "https://www.ebi.ac.uk/proteins/api/proteomics/{accession}",
572
+ "https://www.ebi.ac.uk/proteins/api/proteomics-ptm/{accession}"
573
+ ],
571
574
  "tracks": [
572
575
  {
573
576
  "name": "unique",
@@ -594,6 +597,18 @@
594
597
  }
595
598
  ],
596
599
  "tooltip": ""
600
+ },
601
+ {
602
+ "name": "proteomics-ptm",
603
+ "label": "PTM",
604
+ "trackType": "protvista-track",
605
+ "data": [
606
+ {
607
+ "adapter": "protvista-proteomics-adapter",
608
+ "url": "https://www.ebi.ac.uk/proteins/api/proteomics-ptm/{accession}"
609
+ }
610
+ ],
611
+ "tooltip": ""
597
612
  }
598
613
  ]
599
614
  },
@@ -6,6 +6,7 @@ import ProtvistaDatatable from 'protvista-datatable';
6
6
  import { loadComponent } from './loadComponents';
7
7
 
8
8
  import loaderIcon from './icons/spinner.svg';
9
+ import downloadIcon from './icons/download.svg';
9
10
  import loaderStyles from './styles/loader-styles';
10
11
 
11
12
  import {
@@ -28,6 +29,7 @@ type ProcessedStructureData = {
28
29
  resolution?: string;
29
30
  chain?: string;
30
31
  positions?: string;
32
+ downloadLink?: string;
31
33
  protvistaFeatureId: string;
32
34
  };
33
35
 
@@ -54,6 +56,7 @@ const processPDBData = (data: StructureData): ProcessedStructureData[] =>
54
56
  source: 'PDB',
55
57
  method,
56
58
  resolution: !resolution || resolution === '-' ? undefined : resolution,
59
+ downloadLink: `https://www.ebi.ac.uk/pdbe/entry-files/download/pdb${id.toLowerCase()}.ent`,
57
60
  chain,
58
61
  positions,
59
62
  protvistaFeatureId: id,
@@ -74,51 +77,9 @@ const processAFData = (data: PredictionData[]): ProcessedStructureData[] =>
74
77
  method: 'Predicted',
75
78
  positions: `${d.uniprotStart}-${d.uniprotEnd}`,
76
79
  protvistaFeatureId: d.entryId,
80
+ downloadLink: d.pdbUrl,
77
81
  }));
78
82
 
79
- const getColumnConfig = (
80
- accession: string
81
- ): ColumnConfig<ProcessedStructureData> => ({
82
- source: {
83
- label: 'Source',
84
- resolver: ({ source }) => html`<strong>${source}</strong>`,
85
- },
86
- type: {
87
- label: 'Identifier',
88
- resolver: ({ id }) => id,
89
- },
90
- method: {
91
- label: 'Method',
92
- resolver: ({ method }) => method,
93
- },
94
- resolution: {
95
- label: 'Resolution',
96
- resolver: ({ resolution }) =>
97
- resolution ? resolution.replace('A', 'Å') : '',
98
- },
99
- chain: {
100
- label: 'Chain',
101
- resolver: ({ chain }) => chain || '',
102
- },
103
- positions: {
104
- label: 'Positions',
105
- resolver: ({ positions }) => positions || '',
106
- },
107
- links: {
108
- label: 'Links',
109
- resolver: ({ source, id }) => {
110
- if (source === 'PDB') {
111
- return html`
112
- ${PDBLinks.map((pdbLink) => {
113
- return html` <a href="${pdbLink.link}${id}">${pdbLink.name}</a> `;
114
- }).reduce((prev, curr) => html` ${prev} · ${curr} `)}
115
- `;
116
- }
117
- return html`<a href="${alphaFoldLink}${accession}">AlphaFold</a>`;
118
- },
119
- },
120
- });
121
-
122
83
  const AFMetaInfo = html`
123
84
  <strong>Model Confidence:</strong>
124
85
  <ul class="no-bullet">
@@ -203,21 +164,23 @@ class ProtvistaUniprotStructure extends LitElement {
203
164
  if (!data || !data.length) return;
204
165
 
205
166
  this.data = data;
206
- const protvistaDatatableElt = this.querySelector(
207
- 'protvista-datatable'
208
- ) as ProtvistaDatatable;
209
- // Select the first element in the table
210
- this.onTableRowClick({ id: this.data[0].id });
211
- protvistaDatatableElt.columns = getColumnConfig(this.accession);
212
- protvistaDatatableElt.data = this.data;
213
- protvistaDatatableElt.rowClickEvent = this.onTableRowClick;
214
- protvistaDatatableElt.selectedid = this.structureId;
215
167
  }
216
168
 
217
169
  disconnectedCallback() {
218
170
  this.removeStyles();
219
171
  }
220
172
 
173
+ updated() {
174
+ const protvistaDatatableElt = this.querySelector(
175
+ 'protvista-datatable'
176
+ ) as ProtvistaDatatable;
177
+ if (!protvistaDatatableElt.selectedid && this.data?.[0]) {
178
+ // Select the first element in the table
179
+ this.onTableRowClick({ id: this.data[0].id });
180
+ protvistaDatatableElt.selectedid = this.structureId;
181
+ }
182
+ }
183
+
221
184
  addStyles() {
222
185
  // We are not using static get styles()
223
186
  // as we are not using the shadowDOM
@@ -282,6 +245,9 @@ class ProtvistaUniprotStructure extends LitElement {
282
245
  width: 20px;
283
246
  height: 16px;
284
247
  }
248
+ .download-link svg {
249
+ width: 1rem;
250
+ }
285
251
  `;
286
252
  }
287
253
 
@@ -309,11 +275,69 @@ class ProtvistaUniprotStructure extends LitElement {
309
275
  : html``}
310
276
  </div>
311
277
  <div class="class="protvista-uniprot-structure__table">
312
- <protvista-datatable
313
- noScrollToRow
314
- noDeselect
315
- filter-scroll
316
- ></protvista-datatable>
278
+ <protvista-datatable noScrollToRow noDeselect filter-scroll>
279
+ <table>
280
+ <thead>
281
+ <tr>
282
+ <th data-filter="source">Source</th>
283
+ <th>Identifier</th>
284
+ <th data-filter="method">Method</th>
285
+ <th>Resolution</th>
286
+ <th>Chain</th>
287
+ <th>Positions</th>
288
+ <th>Links</th>
289
+ <th><!--Download--></th>
290
+ </tr>
291
+ </thead>
292
+ <tbody>
293
+ ${this.data?.map(
294
+ ({
295
+ source,
296
+ id,
297
+ method,
298
+ resolution,
299
+ chain,
300
+ positions,
301
+ downloadLink,
302
+ }) => html`<tr
303
+ data-id="${id}"
304
+ @click="${() => this.onTableRowClick({ id })}"
305
+ >
306
+ <td data-filter="source" data-filter-value="${source}">
307
+ <strong>${source}</strong>
308
+ </td>
309
+ <td>${id}</td>
310
+ <td data-filter="method" data-filter-value="${method}">
311
+ ${method}
312
+ </td>
313
+ <td>${resolution ? resolution.replace('A', 'Å') : ''}</td>
314
+ <td>${chain || ''}</td>
315
+ <td>${positions || ''}</td>
316
+ <td>
317
+ ${source === 'PDB'
318
+ ? html`
319
+ ${PDBLinks.map((pdbLink) => {
320
+ return html`
321
+ <a href="${pdbLink.link}${id}">${pdbLink.name}</a>
322
+ `;
323
+ }).reduce((prev, curr) => html` ${prev} · ${curr} `)}
324
+ `
325
+ : html`<a href="${alphaFoldLink}${this.accession}"
326
+ >AlphaFold</a
327
+ >`}
328
+ </td>
329
+ <td>
330
+ ${downloadLink
331
+ ? html`<a href="${downloadLink}" class="download-link"
332
+ >${svg`${unsafeHTML(downloadIcon)}`}</a
333
+ >`
334
+ : ''}
335
+ </td>
336
+ </tr>`
337
+ )}
338
+ </tbody>
339
+ </table>
340
+ </protvista-datatable>
317
341
  ${this.loading
318
342
  ? html`<div class="protvista-loader">
319
343
  ${svg`${unsafeHTML(loaderIcon)}`}
package/src/.DS_Store DELETED
Binary file