@datagrok/bio 2.10.27 → 2.10.28

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
@@ -5,7 +5,7 @@
5
5
  "name": "Leonid Stolbov",
6
6
  "email": "lstolbov@datagrok.ai"
7
7
  },
8
- "version": "2.10.27",
8
+ "version": "2.10.28",
9
9
  "description": "Bioinformatics support (import/export of sequences, conversion, visualization, analysis). [See more](https://github.com/datagrok-ai/public/blob/master/packages/Bio/README.md) for details.",
10
10
  "repository": {
11
11
  "type": "git",
@@ -36,7 +36,7 @@
36
36
  "@biowasm/aioli": "^3.1.0",
37
37
  "@datagrok-libraries/bio": "^5.38.13",
38
38
  "@datagrok-libraries/chem-meta": "^1.0.1",
39
- "@datagrok-libraries/ml": "^6.3.49",
39
+ "@datagrok-libraries/ml": "^6.3.50",
40
40
  "@datagrok-libraries/tutorials": "^1.3.6",
41
41
  "@datagrok-libraries/utils": "^4.0.17",
42
42
  "cash-dom": "^8.0.0",
@@ -101,5 +101,36 @@
101
101
  "sources": [
102
102
  "css/helm.css"
103
103
  ],
104
- "category": "Bioinformatics"
104
+ "category": "Bioinformatics",
105
+ "meta": {
106
+ "menu": {
107
+ "Bio": {
108
+ "Analyze": {
109
+ "SAR...": null,
110
+ "Sequence Space...": null,
111
+ "Hierarchical Clustering...": null,
112
+ "Activity Cliffs...": null,
113
+ "Sequence Space": null,
114
+ "MSA...": null,
115
+ "Composition": null
116
+ },
117
+ "Search": {
118
+ "Diversity Search": null,
119
+ "Similarity Search": null,
120
+ "Subsequence Search...": null
121
+ },
122
+ "Calculate": {
123
+ "Identity...": null,
124
+ "Similarity...": null
125
+ },
126
+ "Convert": {
127
+ "Split to Monomerts...": null,
128
+ "Get Region...": null,
129
+ "Notation...": null,
130
+ "SDF to JSON Library...": null,
131
+ "To Atomic Level...": null
132
+ }
133
+ }
134
+ }
135
+ }
105
136
  }
package/src/package.ts CHANGED
@@ -74,6 +74,7 @@ import {DIMENSIONALITY_REDUCER_TERMINATE_EVENT}
74
74
  from '@datagrok-libraries/ml/src/workers/dimensionality-reducing-worker-creator';
75
75
  import {Options} from '@datagrok-libraries/utils/src/type-declarations';
76
76
  import {sequenceToMolfile} from './utils/sequence-to-mol';
77
+ import {SHOW_SCATTERPLOT_PROGRESS} from '@datagrok-libraries/ml/src/functionEditors/seq-space-base-editor';
77
78
 
78
79
  export const _package = new BioPackage();
79
80
 
@@ -465,7 +466,7 @@ export async function activityCliffs(df: DG.DataFrame, macroMolecule: DG.Column<
465
466
  //input: string methodName { choices:["UMAP", "t-SNE"] }
466
467
  //input: string similarityMetric { choices:["Hamming", "Levenshtein", "Monomer chemical distance"] }
467
468
  //input: bool plotEmbeddings = true
468
- //input: double sparseMatrixThreshold = 0.8 [Similarity Threshold for sparse matrix calculation]
469
+ //input: double sparseMatrixThreshold = 0 [Similarity Threshold for sparse matrix calculation]
469
470
  //input: object options {optional: true}
470
471
  //output: viewer result
471
472
  //editor: Bio:SequenceSpaceEditor
@@ -498,8 +499,11 @@ export async function sequenceSpaceTopMenu(
498
499
  embedYCol = table.columns.byName(embedColsNames[1]);
499
500
  }
500
501
 
501
- embedXCol.init((i) => embeddings[i] ? embeddings[i][0] : undefined);
502
- embedYCol.init((i) => embeddings[i] ? embeddings[i][1] : undefined);
502
+ if (options?.[SHOW_SCATTERPLOT_PROGRESS]) {
503
+ scatterPlot?.root && ui.setUpdateIndicator(scatterPlot!.root, false);
504
+ embedXCol.init((i) => embeddings[i] ? embeddings[i][0] : undefined);
505
+ embedYCol.init((i) => embeddings[i] ? embeddings[i][1] : undefined);
506
+ }
503
507
  const progress = (_nEpoch / epochsLength * 100);
504
508
  pg.update(progress, `Running sequence space ... ${progress.toFixed(0)}%`);
505
509
  }
@@ -525,6 +529,14 @@ export async function sequenceSpaceTopMenu(
525
529
  }
526
530
 
527
531
  async function getSeqSpace() {
532
+ table.columns.add(DG.Column.float(embedColsNames[0], table.rowCount));
533
+ table.columns.add(DG.Column.float(embedColsNames[1], table.rowCount));
534
+ if (plotEmbeddings) {
535
+ scatterPlot = grok.shell
536
+ .tableView(table.name)
537
+ .scatterPlot({x: embedColsNames[0], y: embedColsNames[1], title: 'Sequence space'});
538
+ ui.setUpdateIndicator(scatterPlot.root, true);
539
+ }
528
540
  let resolveF: Function | null = null;
529
541
 
530
542
  const sub = grok.events.onViewerClosed.subscribe((args) => {
@@ -580,6 +592,7 @@ export async function sequenceSpaceTopMenu(
580
592
  .tableView(table.name)
581
593
  .scatterPlot({x: embedColsNames[0], y: embedColsNames[1], title: 'Sequence space'});
582
594
  }
595
+ ui.setUpdateIndicator(scatterPlot.root, false);
583
596
  return scatterPlot;
584
597
  }
585
598
  }
@@ -32,7 +32,7 @@ ATC-G-TTGC--
32
32
  const wlViewer: WebLogoViewer = (await df.plot.fromType('WebLogo')) as WebLogoViewer;
33
33
  await testEvent(wlViewer.onLayoutCalculated, () => {}, () => {
34
34
  tv.dockManager.dock(wlViewer.root, DG.DOCK_TYPE.DOWN);
35
- }, 300);
35
+ }, 500);
36
36
  const positions: PI[] = wlViewer['positions'];
37
37
 
38
38
  const resAllDf1: PI[] = [
@@ -122,7 +122,7 @@ ATC-G-TTGC--
122
122
  {'skipEmptyPositions': true})) as WebLogoViewer;
123
123
  await testEvent(wlViewer.onLayoutCalculated, () => {}, () => {
124
124
  tv.dockManager.dock(wlViewer.root, DG.DOCK_TYPE.DOWN);
125
- }, 300);
125
+ }, 500);
126
126
  const resPosList: PI[] = wlViewer['positions'];
127
127
 
128
128
  const tgtPosList: PI[] = [
@@ -158,7 +158,7 @@ ATC-G-TTGC--
158
158
  })) as WebLogoViewer;
159
159
  await testEvent(wlViewer.onLayoutCalculated, () => {}, () => {
160
160
  tv.dockManager.dock(wlViewer.root, DG.DOCK_TYPE.DOWN);
161
- }, 300);
161
+ }, 500);
162
162
  const resPosList: PI[] = wlViewer['positions'];
163
163
  const tgtPosList: PI[] = [
164
164
  new PI(2, '3', {'C': new PMI(5)}),
@@ -194,7 +194,7 @@ ATC-G-TTGC--
194
194
  const wlViewer: WebLogoViewer = (await df.plot.fromType('WebLogo')) as WebLogoViewer;
195
195
  await testEvent(wlViewer.onLayoutCalculated, () => {}, () => {
196
196
  tv.dockManager.dock(wlViewer.root, DG.DOCK_TYPE.DOWN);
197
- }, 300);
197
+ }, 500);
198
198
  const resPosList: PI[] = wlViewer['positions'];
199
199
  });
200
200
  });