@datagrok/peptides 1.17.7 → 1.17.9

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.17.7",
4
+ "version": "1.17.9",
5
5
  "author": {
6
6
  "name": "Davit Rizhinashvili",
7
7
  "email": "drizhinashvili@datagrok.ai"
package/src/model.ts CHANGED
@@ -825,7 +825,8 @@ export class PeptidesModel {
825
825
  }
826
826
  const lstViewer = this.findViewer(VIEWER_TYPE.LOGO_SUMMARY_TABLE) as LogoSummaryTable | null;
827
827
  if (lstViewer !== null && typeof lstViewer.model !== 'undefined') {
828
- lstViewer.createLogoSummaryTableGrid();
828
+ lstViewer._logoSummaryTable = lstViewer.createLogoSummaryTable() ?? lstViewer._logoSummaryTable;
829
+ lstViewer._viewerGrid = lstViewer.createLogoSummaryTableGrid() ?? lstViewer._viewerGrid;
829
830
  lstViewer.render();
830
831
  }
831
832
  } catch (e) {
@@ -1178,7 +1179,7 @@ export class PeptidesModel {
1178
1179
  const epsilon = this.settings!.sequenceSpaceParams!.epsilon ?? 0.01;
1179
1180
  const minPts = this.settings!.sequenceSpaceParams!.minPts ?? 4;
1180
1181
  const clusterRes = await getDbscanWorker(embed1, embed2, epsilon, minPts);
1181
- const newClusterName = this.df.columns.getUnusedName('Cluster');
1182
+ const newClusterName = this.df.columns.getUnusedName('Cluster (DBSCAN)');
1182
1183
  const clusterCol = this.df.columns.addNewString(newClusterName);
1183
1184
  clusterCol.init((i) => clusterRes[i].toString());
1184
1185
  if (this._sequenceSpaceViewer !== null)
@@ -375,6 +375,8 @@ export class LogoSummaryTable extends DG.JsViewer implements ILogoSummaryTable {
375
375
  this._logoSummaryTable = null;
376
376
  doRender = true;
377
377
  break;
378
+ case LST_PROPERTIES.WEB_LOGO_MODE:
379
+ this.viewerGrid.invalidate();
378
380
  }
379
381
  if (doRender)
380
382
  this.render();
@@ -495,10 +497,12 @@ export class LogoSummaryTable extends DG.JsViewer implements ILogoSummaryTable {
495
497
  const origLST = origLSTBuilder.aggregate();
496
498
  const origLSTLen = origLST.rowCount;
497
499
  const origLSTCols = origLST.columns;
498
- const origLSTClustCol: DG.Column<string> = origLST.getCol(clustersColName);
500
+ let origLSTClustCol: DG.Column<string> = origLST.getCol(clustersColName);
499
501
  origLSTClustCol.name = C.LST_COLUMN_NAMES.CLUSTER;
500
- if (origLSTClustCol.type !== DG.COLUMN_TYPE.STRING)
502
+ if (origLSTClustCol.type !== DG.COLUMN_TYPE.STRING) {
501
503
  origLST.columns.replace(origLSTClustCol, origLSTClustCol.convertTo(DG.COLUMN_TYPE.STRING));
504
+ origLSTClustCol = origLST.getCol(origLSTClustCol.name);
505
+ }
502
506
 
503
507
 
504
508
  const origLSTClustColCat = origLSTClustCol.categories;
@@ -515,15 +519,14 @@ export class LogoSummaryTable extends DG.JsViewer implements ILogoSummaryTable {
515
519
  for (let rowIdx = 0; rowIdx < filteredDfRowCount; ++rowIdx) {
516
520
  const filteredClustName = filteredDfClustColCat[filteredDfClustColData[rowIdx]];
517
521
  const origClustIdx = origLSTClustColCat.indexOf(filteredClustName);
518
- origClustMasks[origClustIdx].setTrue(rowIdx);
522
+ origClustMasks[origClustIdx]?.setTrue(rowIdx);
519
523
  }
520
524
 
521
525
  for (let rowIdx = 0; rowIdx < origLSTLen; ++rowIdx) {
522
526
  const mask = origClustMasks[rowIdx];
523
- if (mask.allFalse || mask.allTrue)
527
+ if (mask.allFalse)
524
528
  continue;
525
529
 
526
-
527
530
  const bsMask = DG.BitSet.fromBytes(mask.buffer.buffer, filteredDfRowCount);
528
531
  const stats = isDfFiltered ? getStats(activityColData, mask) :
529
532
  this.clusterStats[CLUSTER_TYPE.ORIGINAL][origLSTClustColCat[rowIdx]];
@@ -94,7 +94,7 @@ export function analyzePeptidesUI(df: DG.DataFrame, col?: DG.Column<string>): Di
94
94
  grok.shell.info('Activity column contains missing values. They will be ignored during analysis');
95
95
  };
96
96
  const activityColumnChoice = ui.columnInput('Activity', df, defaultActivityColumn, activityScalingMethodState,
97
- {filter: (col: DG.Column) => col.type === DG.TYPE.INT || col.type === DG.TYPE.FLOAT});
97
+ {filter: (col: DG.Column) => col.type === DG.TYPE.INT || col.type === DG.TYPE.FLOAT || col.type === DG.TYPE.QNUM});
98
98
  activityColumnChoice.setTooltip('Numerical activity column');
99
99
  const clustersColumnChoice = ui.columnInput('Clusters', df, null, () => {
100
100
  if (clustersColumnChoice.value) {
@@ -185,7 +185,9 @@ export async function startAnalysis(activityColumn: DG.Column<number>, peptidesC
185
185
  clustersColumn: DG.Column | null, sourceDf: DG.DataFrame, scaledCol: DG.Column<number>, scaling: C.SCALING_METHODS,
186
186
  options: AnalysisOptions = {}): Promise<PeptidesModel | null> {
187
187
  let model: PeptidesModel | null = null;
188
- if (activityColumn.type !== DG.COLUMN_TYPE.FLOAT && activityColumn.type !== DG.COLUMN_TYPE.INT && activityColumn.type !== DG.COLUMN_TYPE.QNUM) {
188
+ if (activityColumn.type !== DG.COLUMN_TYPE.FLOAT && activityColumn.type !== DG.COLUMN_TYPE.INT &&
189
+ activityColumn.type !== DG.COLUMN_TYPE.QNUM
190
+ ) {
189
191
  grok.shell.error('The activity column must be of numeric type!');
190
192
  return model;
191
193
  }