protvista-uniprot 2.10.13 → 2.11.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/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.10.13",
4
+ "version": "2.11.0",
5
5
  "files": [
6
6
  "dist",
7
7
  "src"
@@ -33,7 +33,7 @@
33
33
  "protvista-datatable": "3.8.10",
34
34
  "protvista-feature-adapter": "3.8.13",
35
35
  "protvista-filter": "3.8.4",
36
- "protvista-interpro-adapter": "3.8.13",
36
+ "protvista-interpro-adapter": "3.8.14",
37
37
  "protvista-interpro-track": "3.8.13",
38
38
  "protvista-manager": "3.8.4",
39
39
  "protvista-navigation": "3.8.10",
@@ -37,14 +37,16 @@ const loadConfidence = async (
37
37
  ): Promise<AlphafoldConfidencePayload> => {
38
38
  try {
39
39
  const payload = await fetch(url);
40
- return payload.ok ? payload.json() : null;
40
+ return payload.json();
41
41
  } catch (e) {
42
- console.error(`Couldn't load AlphaFold confidence`, e);
42
+ console.error('Could not load AlphaFold confidence', e);
43
43
  }
44
44
  };
45
45
 
46
46
  export const transformData = async (data: AlphafoldPayload) => {
47
47
  const confidenceUrl = getConfidenceURLFromPayload(data);
48
- const confidenceData = await loadConfidence(confidenceUrl);
49
- return confidenceData?.confidenceCategory.join('');
48
+ if (confidenceUrl) {
49
+ const confidenceData = await loadConfidence(confidenceUrl);
50
+ return confidenceData?.confidenceCategory.join('');
51
+ }
50
52
  };
@@ -230,22 +230,20 @@ class ProtvistaUniprot extends LitElement {
230
230
 
231
231
  if (adapter === 'protvista-interpro-adapter') {
232
232
  const representativeDomains = [];
233
- if (transformedData) {
234
- for (const feature of transformedData) {
235
- for (const location of feature.locations) {
236
- for (const fragment of location.fragments) {
237
- if (fragment.representative) {
238
- representativeDomains.push({
239
- ...feature,
240
- type: 'InterPro Representative Domain',
241
- start: fragment.start,
242
- end: fragment.end,
243
- });
244
- }
233
+ transformedData?.forEach(feature => {
234
+ feature.locations?.forEach(location => {
235
+ location.fragments?.forEach(fragment => {
236
+ if (fragment.representative) {
237
+ representativeDomains.push({
238
+ ...feature,
239
+ type: 'InterPro Representative Domain',
240
+ start: fragment.start,
241
+ end: fragment.end,
242
+ });
245
243
  }
246
- }
247
- }
248
- }
244
+ });
245
+ });
246
+ });
249
247
  transformedData = representativeDomains;
250
248
  }
251
249
 
@@ -714,7 +712,6 @@ class ProtvistaUniprot extends LitElement {
714
712
  displayend="${this.displayCoordinates?.end}"
715
713
  id="track-${id}"
716
714
  no-scroll
717
-
718
715
  >
719
716
  </protvista-interpro-track>
720
717
  `;