@datagrok/peptides 1.13.0 → 1.13.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@datagrok/peptides",
3
3
  "friendlyName": "Peptides",
4
- "version": "1.13.0",
4
+ "version": "1.13.2",
5
5
  "author": {
6
6
  "name": "Volodymyr Dyma",
7
7
  "email": "vdyma@datagrok.ai"
@@ -19,7 +19,7 @@
19
19
  "@datagrok-libraries/utils": "^4.1.13",
20
20
  "@datagrok-libraries/tutorials": "^1.3.7",
21
21
  "cash-dom": "^8.1.5",
22
- "datagrok-api": "^1.16.5",
22
+ "datagrok-api": "^1.16.4",
23
23
  "file-loader": "^6.2.0",
24
24
  "rxjs": "^6.5.5",
25
25
  "wu": "latest",
@@ -253,12 +253,18 @@ export class MostPotentResidues extends DG.JsViewer {
253
253
  filteredMonomerStats.push([monomer, monomerStats as Stats]);
254
254
  }
255
255
 
256
- let maxEntry: [string, Stats];
256
+ if (filteredMonomerStats.length === 0)
257
+ continue;
258
+
259
+ let maxEntry: [string, Stats] | null = null;
257
260
  for (const [monomer, monomerStats] of filteredMonomerStats) {
258
- if (typeof maxEntry! === 'undefined' || maxEntry[1].meanDifference < monomerStats.meanDifference)
261
+ if (maxEntry === null || maxEntry[1].meanDifference < monomerStats.meanDifference)
259
262
  maxEntry = [monomer, monomerStats];
260
263
  }
261
264
 
265
+ if (maxEntry === null)
266
+ continue;
267
+
262
268
  posData[i] = parseInt(position);
263
269
  monomerData[i] = maxEntry![0];
264
270
  mdData[i] = maxEntry![1].meanDifference;