@datagrok/bio 2.0.2 → 2.0.4

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.0.2",
8
+ "version": "2.0.4",
9
9
  "description": "Bio is a [package](https://datagrok.ai/help/develop/develop#packages) for the [Datagrok](https://datagrok.ai) platform",
10
10
  "repository": {
11
11
  "type": "git",
package/src/package.ts CHANGED
@@ -32,7 +32,7 @@ import {
32
32
 
33
33
  import {splitAlignedSequences} from '@datagrok-libraries/bio/src/utils/splitter';
34
34
  import * as C from './utils/constants';
35
- import {getFingerprints} from './calculations/fingerprints'
35
+ import {getFingerprints} from './calculations/fingerprints';
36
36
 
37
37
  //tags: init
38
38
  export async function initBio() {
@@ -40,8 +40,8 @@ export async function initBio() {
40
40
 
41
41
  //name: fastaSequenceCellRenderer
42
42
  //tags: cellRenderer
43
- //meta.cellType: Sequence
44
- //meta.columnTags: units=fasta
43
+ //meta.cellType: sequence
44
+ //meta.columnTags: quality=Macromolecule, units=fasta
45
45
  //output: grid_cell_renderer result
46
46
  export function fastaSequenceCellRenderer(): MacromoleculeSequenceCellRenderer {
47
47
  return new MacromoleculeSequenceCellRenderer();
@@ -49,8 +49,8 @@ export function fastaSequenceCellRenderer(): MacromoleculeSequenceCellRenderer {
49
49
 
50
50
  //name: separatorSequenceCellRenderer
51
51
  //tags: cellRenderer
52
- //meta.cellType: Sequence
53
- //meta.columnTags: units=separator
52
+ //meta.cellType: sequence
53
+ //meta.columnTags: quality=Macromolecule, units=fasta
54
54
  //output: grid_cell_renderer result
55
55
  export function separatorSequenceCellRenderer(): MacromoleculeSequenceCellRenderer {
56
56
  return new MacromoleculeSequenceCellRenderer();
@@ -138,7 +138,7 @@ export function vdRegionViewer() {
138
138
  //input: dataframe table [Input data table]
139
139
  //input: column macroMolecule {semType: Macromolecule}
140
140
  //input: column activities
141
- //input: double similarity = 90 [Similarity cutoff]
141
+ //input: double similarity = 80 [Similarity cutoff]
142
142
  //input: string methodName { choices:["UMAP", "t-SNE", "SPE"] }
143
143
  export async function activityCliffs(df: DG.DataFrame, macroMolecule: DG.Column, activities: DG.Column,
144
144
  similarity: number, methodName: string): Promise<DG.Viewer | undefined> {
@@ -379,6 +379,7 @@ export function monomerCellRenderer(): MonomerCellRenderer {
379
379
  //name: MacromoleculeDifferenceCellRenderer
380
380
  //tags: cellRenderer
381
381
  //meta.cellType: MacromoleculeDifference
382
+ //meta.columnTags: quality=MacromoleculeDifference
382
383
  //output: grid_cell_renderer result
383
384
  export function macromoleculeDifferenceCellRenderer(): MacromoleculeDifferenceCellRenderer {
384
385
  return new MacromoleculeDifferenceCellRenderer();
@@ -463,7 +464,7 @@ export function getHelmMonomers(seqCol: DG.Column<string>): string[] {
463
464
  export async function macromoleculesFingerprints(mcol: DG.Column): Promise<Uint8Array[]> {
464
465
  grok.functions.call('Chem:getRdKitModule');
465
466
  const monomers = getHelmMonomers(mcol);
466
- const mols = await grok.functions.call('HELM:getMolFiles', {mcol : mcol});
467
+ const mols = await grok.functions.call('HELM:getMolFiles', {mcol: mcol});
467
468
 
468
469
  return getFingerprints(mols.toList(), monomers);
469
470
  }
@@ -114,7 +114,7 @@ category('renderers', () => {
114
114
  const tw = grok.shell.addTableView(df);
115
115
  await delay(100);
116
116
  const renderer = tw.dataFrame.col('SequencesDiff')?.getTag(DG.TAGS.CELL_RENDERER);
117
- if (renderer !== 'MacromoleculeDifferenceCR')
117
+ if (renderer !== 'MacromoleculeDifference') // this is value of MacromoleculeDifferenceCR.cellType
118
118
  throw new Error(`Units 'separator', separator '/' and semType 'MacromoleculeDifference' have been ` +
119
119
  `manually set on column but after df aws added as table view renderer has been reset to '${renderer}'`);
120
120
  }
@@ -8,6 +8,20 @@ import {splitToMonomers, _package} from '../package';
8
8
  import * as C from '../utils/constants';
9
9
 
10
10
  category('splitters', () => {
11
+ let tvList: DG.TableView[];
12
+ let dfList: DG.DataFrame[];
13
+
14
+ before(async () => {
15
+ await grok.functions.call('Bio:initBio');
16
+ tvList = [];
17
+ dfList = [];
18
+ });
19
+
20
+ after(async () => {
21
+ dfList.forEach((df: DG.DataFrame) => { grok.shell.closeTable(df); });
22
+ tvList.forEach((tv: DG.TableView) => tv.close());
23
+ });
24
+
11
25
  const helm1 = 'PEPTIDE1{meI.hHis.Aca.N.T.dE.Thr_PO3H2.Aca.D-Tyr_Et.Tyr_ab-dehydroMe.dV.E.N.D-Orn.D-aThr.Phe_4Me}$$$';
12
26
 
13
27
  const helm2 = 'PEPTIDE1{meI.hHis.Hcy.Q.T.W.Q.Phe_4NH2.D-Tyr_Et.Tyr_ab-dehydroMe.dV.E.N.N.meK}$$$';
@@ -63,6 +77,13 @@ category('splitters', () => {
63
77
  seqCol.semType = semType;
64
78
  seqCol.setTag(C.TAGS.ALIGNED, C.MSA);
65
79
 
80
+ const tv: DG.TableView = grok.shell.addTableView(df);
81
+ // call to calculate 'cell.renderer' tag
82
+ await grok.data.detectSemanticTypes(df);
83
+
84
+ dfList.push(df);
85
+ tvList.push(tv);
86
+
66
87
  splitToMonomers(seqCol);
67
88
  expect(df.columns.names().includes('17'), true);
68
89
  });
@@ -1,261 +0,0 @@
1
- <html><head><meta charset="utf-8"/><title>Bio Test Report. Datagrok version datagrok/datagrok:latest SHA=c5a05867bf79. Commit 52614433.</title><style type="text/css">html,
2
- body {
3
- font-family: Arial, Helvetica, sans-serif;
4
- font-size: 1rem;
5
- margin: 0;
6
- padding: 0;
7
- color: #333;
8
- }
9
- body {
10
- padding: 2rem 1rem;
11
- font-size: 0.85rem;
12
- }
13
- #jesthtml-content {
14
- margin: 0 auto;
15
- max-width: 70rem;
16
- }
17
- header {
18
- display: flex;
19
- align-items: center;
20
- }
21
- #title {
22
- margin: 0;
23
- flex-grow: 1;
24
- }
25
- #logo {
26
- height: 4rem;
27
- }
28
- #timestamp {
29
- color: #777;
30
- margin-top: 0.5rem;
31
- }
32
-
33
- /** SUMMARY */
34
- #summary {
35
- color: #333;
36
- margin: 2rem 0;
37
- display: flex;
38
- font-family: monospace;
39
- font-size: 1rem;
40
- }
41
- #summary > div {
42
- margin-right: 2rem;
43
- background: #eee;
44
- padding: 1rem;
45
- min-width: 15rem;
46
- }
47
- #summary > div:last-child {
48
- margin-right: 0;
49
- }
50
- @media only screen and (max-width: 720px) {
51
- #summary {
52
- flex-direction: column;
53
- }
54
- #summary > div {
55
- margin-right: 0;
56
- margin-top: 2rem;
57
- }
58
- #summary > div:first-child {
59
- margin-top: 0;
60
- }
61
- }
62
-
63
- .summary-total {
64
- font-weight: bold;
65
- margin-bottom: 0.5rem;
66
- }
67
- .summary-passed {
68
- color: #4f8a10;
69
- border-left: 0.4rem solid #4f8a10;
70
- padding-left: 0.5rem;
71
- }
72
- .summary-failed,
73
- .summary-obsolete-snapshots {
74
- color: #d8000c;
75
- border-left: 0.4rem solid #d8000c;
76
- padding-left: 0.5rem;
77
- }
78
- .summary-pending {
79
- color: #9f6000;
80
- border-left: 0.4rem solid #9f6000;
81
- padding-left: 0.5rem;
82
- }
83
- .summary-empty {
84
- color: #999;
85
- border-left: 0.4rem solid #999;
86
- }
87
-
88
- .test-result {
89
- padding: 1rem;
90
- margin-bottom: 0.25rem;
91
- }
92
- .test-result:last-child {
93
- border: 0;
94
- }
95
- .test-result.passed {
96
- background-color: #dff2bf;
97
- color: #4f8a10;
98
- }
99
- .test-result.failed {
100
- background-color: #ffbaba;
101
- color: #d8000c;
102
- }
103
- .test-result.pending {
104
- background-color: #ffdf61;
105
- color: #9f6000;
106
- }
107
-
108
- .test-info {
109
- display: flex;
110
- justify-content: space-between;
111
- }
112
- .test-suitename {
113
- width: 20%;
114
- text-align: left;
115
- font-weight: bold;
116
- word-break: break-word;
117
- }
118
- .test-title {
119
- width: 40%;
120
- text-align: left;
121
- font-style: italic;
122
- }
123
- .test-status {
124
- width: 20%;
125
- text-align: right;
126
- }
127
- .test-duration {
128
- width: 10%;
129
- text-align: right;
130
- font-size: 0.75rem;
131
- }
132
-
133
- .failureMessages {
134
- padding: 0 1rem;
135
- margin-top: 1rem;
136
- border-top: 1px dashed #d8000c;
137
- }
138
- .failureMessages.suiteFailure {
139
- border-top: none;
140
- }
141
- .failureMsg {
142
- white-space: pre-wrap;
143
- white-space: -moz-pre-wrap;
144
- white-space: -pre-wrap;
145
- white-space: -o-pre-wrap;
146
- word-wrap: break-word;
147
- }
148
-
149
- .suite-container {
150
- margin-bottom: 2rem;
151
- }
152
- .suite-info {
153
- padding: 1rem;
154
- background-color: #eee;
155
- color: #777;
156
- display: flex;
157
- align-items: center;
158
- margin-bottom: 0.25rem;
159
- }
160
- .suite-info .suite-path {
161
- word-break: break-all;
162
- flex-grow: 1;
163
- font-family: monospace;
164
- font-size: 1rem;
165
- }
166
- .suite-info .suite-time {
167
- margin-left: 0.5rem;
168
- padding: 0.2rem 0.3rem;
169
- font-size: 0.75rem;
170
- }
171
- .suite-info .suite-time.warn {
172
- background-color: #d8000c;
173
- color: #fff;
174
- }
175
-
176
- /* CONSOLE LOGS */
177
- .suite-consolelog {
178
- margin-bottom: 0.25rem;
179
- padding: 1rem;
180
- background-color: #efefef;
181
- }
182
- .suite-consolelog-header {
183
- font-weight: bold;
184
- }
185
- .suite-consolelog-item {
186
- padding: 0.5rem;
187
- }
188
- .suite-consolelog-item pre {
189
- margin: 0.5rem 0;
190
- white-space: pre-wrap;
191
- white-space: -moz-pre-wrap;
192
- white-space: -pre-wrap;
193
- white-space: -o-pre-wrap;
194
- word-wrap: break-word;
195
- }
196
- .suite-consolelog-item-origin {
197
- color: #777;
198
- font-weight: bold;
199
- }
200
- .suite-consolelog-item-message {
201
- color: #000;
202
- font-size: 1rem;
203
- padding: 0 0.5rem;
204
- }
205
-
206
- /* OBSOLETE SNAPSHOTS */
207
- .suite-obsolete-snapshots {
208
- margin-bottom: 0.25rem;
209
- padding: 1rem;
210
- background-color: #ffbaba;
211
- color: #d8000c;
212
- }
213
- .suite-obsolete-snapshots-header {
214
- font-weight: bold;
215
- }
216
- .suite-obsolete-snapshots-item {
217
- padding: 0.5rem;
218
- }
219
- .suite-obsolete-snapshots-item pre {
220
- margin: 0.5rem 0;
221
- white-space: pre-wrap;
222
- white-space: -moz-pre-wrap;
223
- white-space: -pre-wrap;
224
- white-space: -o-pre-wrap;
225
- word-wrap: break-word;
226
- }
227
- .suite-obsolete-snapshots-item-message {
228
- color: #000;
229
- font-size: 1rem;
230
- padding: 0 0.5rem;
231
- }
232
- </style></head><body><div id="jesthtml-content"><header><h1 id="title">Bio Test Report. Datagrok version datagrok/datagrok:latest SHA=c5a05867bf79. Commit 52614433.</h1></header><div id="metadata-container"><div id="timestamp">Started: 2022-09-14 15:22:41</div><div id="summary"><div id="suite-summary"><div class="summary-total">Suites (1)</div><div class="summary-passed summary-empty">0 passed</div><div class="summary-failed">1 failed</div><div class="summary-pending summary-empty">0 pending</div></div><div id="test-summary"><div class="summary-total">Tests (1)</div><div class="summary-passed summary-empty">0 passed</div><div class="summary-failed">1 failed</div><div class="summary-pending summary-empty">0 pending</div></div></div></div><div id="suite-1" class="suite-container"><div class="suite-info"><div class="suite-path">/home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts</div><div class="suite-time warn">8.856s</div></div><div class="suite-tests"><div class="test-result failed"><div class="test-info"><div class="test-suitename"> </div><div class="test-title">TEST</div><div class="test-status">failed</div><div class="test-duration">0s</div></div><div class="failureMessages"> <pre class="failureMsg">Error: Unknown server alias. Please add it to /home/runner/.grok/config.yaml
233
- at getDevKey (/home/runner/work/public/public/packages/Bio/src/__jest__/test-node.ts:48:13)
234
- at Object.&lt;anonymous&gt; (/home/runner/work/public/public/packages/Bio/src/__jest__/test-node.ts:57:15)
235
- at Generator.next (&lt;anonymous&gt;)
236
- at /home/runner/work/public/public/packages/Bio/src/__jest__/test-node.ts:31:71
237
- at new Promise (&lt;anonymous&gt;)
238
- at Object.&lt;anonymous&gt;.__awaiter (/home/runner/work/public/public/packages/Bio/src/__jest__/test-node.ts:27:12)
239
- at Object.getBrowserPage (/home/runner/work/public/public/packages/Bio/src/__jest__/test-node.ts:94:12)
240
- at /home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:13:27
241
- at Generator.next (&lt;anonymous&gt;)
242
- at /home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:34:71
243
- at new Promise (&lt;anonymous&gt;)
244
- at Object.&lt;anonymous&gt;.__awaiter (/home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:30:12)
245
- at /home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:12:22
246
- at Promise.then.completed (/home/runner/work/public/public/packages/Bio/node_modules/jest-circus/build/utils.js:391:28)
247
- at new Promise (&lt;anonymous&gt;)
248
- at callAsyncCircusFn (/home/runner/work/public/public/packages/Bio/node_modules/jest-circus/build/utils.js:316:10)
249
- at _callCircusHook (/home/runner/work/public/public/packages/Bio/node_modules/jest-circus/build/run.js:181:40)
250
- at _runTestsForDescribeBlock (/home/runner/work/public/public/packages/Bio/node_modules/jest-circus/build/run.js:47:7)
251
- at run (/home/runner/work/public/public/packages/Bio/node_modules/jest-circus/build/run.js:25:3)
252
- at runAndTransformResultsToJestFormat (/home/runner/work/public/public/packages/Bio/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21)
253
- at jestAdapter (/home/runner/work/public/public/packages/Bio/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19)
254
- at runTestInternal (/home/runner/work/public/public/packages/Bio/node_modules/jest-runner/build/runTest.js:389:16)
255
- at runTest (/home/runner/work/public/public/packages/Bio/node_modules/jest-runner/build/runTest.js:475:34)
256
- at TestRunner.runTests (/home/runner/work/public/public/packages/Bio/node_modules/jest-runner/build/index.js:101:12)
257
- at TestScheduler.scheduleTests (/home/runner/work/public/public/packages/Bio/node_modules/@jest/core/build/TestScheduler.js:333:13)
258
- at runJest (/home/runner/work/public/public/packages/Bio/node_modules/@jest/core/build/runJest.js:404:19)
259
- at _run10000 (/home/runner/work/public/public/packages/Bio/node_modules/@jest/core/build/cli/index.js:320:7)
260
- at runCLI (/home/runner/work/public/public/packages/Bio/node_modules/@jest/core/build/cli/index.js:173:3)
261
- at Object.run (/home/runner/work/public/public/packages/Bio/node_modules/jest-cli/build/cli/index.js:155:37)</pre></div></div></div></div></div></body></html>