@datagrok/bio 2.0.6 → 2.0.7

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.6",
8
+ "version": "2.0.7",
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",
@@ -1,10 +1,10 @@
1
- import {after, before, category, test, expect, expectArray} from '@datagrok-libraries/utils/src/test';
1
+ import {after, before, category, test, expect, expectArray, expectObject} from '@datagrok-libraries/utils/src/test';
2
2
 
3
3
  import * as grok from 'datagrok-api/grok';
4
4
  import * as ui from 'datagrok-api/ui';
5
5
  import * as DG from 'datagrok-api/dg';
6
6
  import {WebLogo, SplitterFunc} from '@datagrok-libraries/bio/src/viewers/web-logo';
7
- import {splitToMonomers, _package} from '../package';
7
+ import {splitToMonomers, _package, getHelmMonomers} from '../package';
8
8
  import * as C from '../utils/constants';
9
9
 
10
10
  category('splitters', () => {
@@ -87,6 +87,30 @@ category('splitters', () => {
87
87
  splitToMonomers(seqCol);
88
88
  expect(df.columns.names().includes('17'), true);
89
89
  });
90
+
91
+ test('getHelmMonomers', async () => {
92
+ const df: DG.DataFrame = DG.DataFrame.fromCsv(
93
+ `HELM,Activity
94
+ PEPTIDE1{hHis.N.T}$$$,5.30751
95
+ PEPTIDE1{hHis.Aca.Cys_SEt}$$$,5.72388
96
+ `);
97
+ const expectedMonomerList = ['hHis', 'Aca', 'Cys_SEt', 'N', 'T'];
98
+
99
+ const helmCol: DG.Column = df.getCol('HELM');
100
+ const res = getHelmMonomers(helmCol);
101
+
102
+ const missed = expectedMonomerList.filter((m) => !res.includes(m));
103
+ const unexpected = res.filter((m) => !expectedMonomerList.includes(m));
104
+ if (missed.length > 0 || unexpected.length) {
105
+ const msgs = [];
106
+ if (missed.length > 0)
107
+ msgs.push(`Missed monomers ${JSON.stringify(missed)}.`);
108
+ if (unexpected.length > 0)
109
+ msgs.push(`Unexpected monomers ${JSON.stringify(unexpected)}.`);
110
+
111
+ throw new Error(msgs.join(' '));
112
+ }
113
+ });
90
114
  });
91
115
 
92
116
  export async function _testHelmSplitter(src: string, tgt: string[]) {
@@ -1,372 +0,0 @@
1
- <html><head><meta charset="utf-8"/><title>Bio Test Report. Datagrok version datagrok/datagrok:latest SHA=7770371320b2. Commit 046cde35.</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=7770371320b2. Commit 046cde35.</h1></header><div id="metadata-container"><div id="timestamp">Started: 2022-09-16 12:11:55</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">46.232s</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">28.972s</div></div><div class="failureMessages"> <pre class="failureMsg">Error: Test result : Failed : 197 : Bio.renderers.setRendererManually : Error: Tag 'cell.renderer' has been manually set to 'MacromoleculeDifference' for column but after df was added as table, tag 'cell.renderer' has reset to 'sequence' instead of manual 'MacromoleculeDifference'.
233
-
234
- at /home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:68:20
235
- at Generator.next (&lt;anonymous&gt;)
236
- at fulfilled (/home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:31:58)
237
- at runMicrotasks (&lt;anonymous&gt;)
238
- at processTicksAndRejections (internal/process/task_queues.js:97:5)</pre></div></div></div><div class="suite-consolelog"><div class="suite-consolelog-header">Console Log</div><div class="suite-consolelog-item"><pre class="suite-consolelog-item-origin"> at Object.&lt;anonymous&gt; (/home/runner/work/public/public/packages/Bio/src/__jest__/test-node.ts:63:11)
239
- at Generator.next (&lt;anonymous&gt;)
240
- at fulfilled (/home/runner/work/public/public/packages/Bio/src/__jest__/test-node.ts:28:58)
241
- at processTicksAndRejections (internal/process/task_queues.js:97:5)</pre><pre class="suite-consolelog-item-message">Using web root: http://localhost:8080</pre></div><div class="suite-consolelog-item"><pre class="suite-consolelog-item-origin"> at /home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:40:11
242
- at Generator.next (&lt;anonymous&gt;)
243
- at /home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:34:71
244
- at new Promise (&lt;anonymous&gt;)
245
- at Object.&lt;anonymous&gt;.__awaiter (/home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:30:12)
246
- at Object.&lt;anonymous&gt; (/home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:38:23)
247
- at Promise.then.completed (/home/runner/work/public/public/packages/Bio/node_modules/jest-circus/build/utils.js:391:28)
248
- at new Promise (&lt;anonymous&gt;)</pre><pre class="suite-consolelog-item-message">Testing Bio package</pre></div><div class="suite-consolelog-item"><pre class="suite-consolelog-item-origin"> at /home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:66:11
249
- at Generator.next (&lt;anonymous&gt;)
250
- at fulfilled (/home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:31:58)
251
- at runMicrotasks (&lt;anonymous&gt;)
252
- at processTicksAndRejections (internal/process/task_queues.js:97:5)</pre><pre class="suite-consolelog-item-message">Test result : Success : 6 : Bio.WebLogo.testGetStats : OK
253
- Test result : Success : 0 : Bio.WebLogo.testGetAlphabetSimilarity : OK
254
- Test result : Success : 3 : Bio.WebLogo.testPickupPaletteN1 : OK
255
- Test result : Success : 1 : Bio.WebLogo.testPickupPaletteN1e : OK
256
- Test result : Success : 2 : Bio.WebLogo.testPickupPaletteAA1 : OK
257
- Test result : Success : 1 : Bio.WebLogo.testPickupPaletteX : OK
258
- Test result : Success : 0 : Bio.WebLogo.monomerToText.longMonomerSingle : OK
259
- Test result : Success : 0 : Bio.WebLogo.monomerToText.longMonomerShort : OK
260
- Test result : Success : 0 : Bio.WebLogo.monomerToText.longMonomerLong56 : OK
261
- Test result : Success : 0 : Bio.WebLogo.monomerToText.longMonomerComplexFirstPartShort : OK
262
- Test result : Success : 0 : Bio.WebLogo.monomerToText.longMonomerComplexFirstPartLong56 : OK
263
- Test result : Success : 1 : Bio.Palettes.testPaletteN : OK
264
- Test result : Success : 0 : Bio.Palettes.testPaletteAA : OK
265
- Test result : Success : 54 : Bio.detectors.NegativeEmpty : OK
266
- Test result : Success : 18 : Bio.detectors.Negative1 : OK
267
- Test result : Success : 31 : Bio.detectors.Negative2 : OK
268
- Test result : Success : 18 : Bio.detectors.Negative3 : OK
269
- Test result : Success : 15 : Bio.detectors.NegativeSmiles : OK
270
- Test result : Success : 10 : Bio.detectors.Dna1 : OK
271
- Test result : Success : 26 : Bio.detectors.Rna1 : OK
272
- Test result : Success : 48 : Bio.detectors.AA1 : OK
273
- Test result : Success : 16 : Bio.detectors.MsaDna1 : OK
274
- Test result : Success : 9 : Bio.detectors.MsaAA1 : OK
275
- Test result : Success : 34 : Bio.detectors.SepDna : OK
276
- Test result : Success : 12 : Bio.detectors.SepRna : OK
277
- Test result : Success : 14 : Bio.detectors.SepPt : OK
278
- Test result : Success : 8 : Bio.detectors.SepUn1 : OK
279
- Test result : Success : 13 : Bio.detectors.SepUn2 : OK
280
- Test result : Success : 6 : Bio.detectors.SepMsaN1 : OK
281
- Test result : Success : 383 : Bio.detectors.SamplesFastaCsvPt : OK
282
- Test result : Success : 7 : Bio.detectors.SamplesFastaCsvNegativeEntry : OK
283
- Test result : Success : 14 : Bio.detectors.SamplesFastaCsvNegativeLength : OK
284
- Test result : Success : 48 : Bio.detectors.SamplesFastaCsvNegativeUniProtKB : OK
285
- Test result : Success : 117 : Bio.detectors.SamplesFastaFastaPt : OK
286
- Test result : Success : 707 : Bio.detectors.samplesPeptidesComplexNegativeID : OK
287
- Test result : Success : 17 : Bio.detectors.SamplesPeptidesComplexNegativeMeasured : OK
288
- Test result : Success : 137 : Bio.detectors.SamplesPeptidesComplexNegativeValue : OK
289
- Test result : Success : 162 : Bio.detectors.samplesMsaComplexUn : OK
290
- Test result : Success : 24 : Bio.detectors.samplesMsaComplexNegativeActivity : OK
291
- Test result : Success : 83 : Bio.detectors.samplesIdCsvNegativeID : OK
292
- Test result : Success : 165 : Bio.detectors.samplesSarSmallCsvNegativeSmiles : OK
293
- Test result : Success : 235 : Bio.detectors.samplesHelmCsvHELM : OK
294
- Test result : Success : 16 : Bio.detectors.samplesHelmCsvNegativeActivity : OK
295
- Test result : Success : 139 : Bio.detectors.samplesTestHelmNegativeID : OK
296
- Test result : Success : 19 : Bio.detectors.samplesTestHelmNegativeTestType : OK
297
- Test result : Success : 5 : Bio.detectors.samplesTestHelmPositiveHelmString : OK
298
- Test result : Success : 8 : Bio.detectors.samplesTestHelmNegativeValid : OK
299
- Test result : Success : 7 : Bio.detectors.samplesTestHelmNegativeMolWeight : OK
300
- Test result : Success : 6 : Bio.detectors.samplesTestHelmNegativeMolFormula : OK
301
- Test result : Success : 6 : Bio.detectors.samplesTestHelmNegativeSmiles : OK
302
- Test result : Success : 733 : Bio.detectors.samplesTestDemogNegativeAll : OK
303
- Test result : Success : 380 : Bio.detectors.samplesTestSmiles2NegativeSmiles : OK
304
- Test result : Success : 113 : Bio.detectors.samplesTestActivityCliffsNegativeSmiles : OK
305
- Test result : Success : 126 : Bio.detectors.samplesFastaPtPosSequence : OK
306
- Test result : Success : 158 : Bio.detectors.samplesTestCerealNegativeCerealName : OK
307
- Test result : Success : 229 : Bio.detectors.samplesTestSpgi100NegativeStereoCategory : OK
308
- Test result : Success : 5 : Bio.detectors.samplesTestSpgi100NegativeScaffoldNames : OK
309
- Test result : Success : 14 : Bio.detectors.samplesTestSpgi100NegativePrimaryScaffoldName : OK
310
- Test result : Success : 6 : Bio.detectors.samplesTestSpgi100NegativeSampleName : OK
311
- Test result : Success : 160 : Bio.detectors.samplesTestUnichemSourcesNegativeSrcUrl : OK
312
- Test result : Success : 8 : Bio.detectors.samplesTestUnichemSourcesNegativeBaseIdUrl : OK
313
- Test result : Success : 136 : Bio.detectors.samplesTestDmvOfficesNegativeOfficeName : OK
314
- Test result : Success : 7 : Bio.detectors.samplesTestDmvOfficesNegativeCity : OK
315
- Test result : Success : 184 : Bio.detectors.samplesTestAlertCollectionNegativeSmarts : OK
316
- Test result : Success : 932 : Bio.MSA.isCorrect : OK
317
- Test result : Success : 293 : Bio.MSA.isCorrectLong : OK
318
- Test result : Success : 1441 : Bio.sequenceSpace.sequenceSpaceOpens : OK
319
- Test result : Success : 7627 : Bio.sequenceSpace.sequenceSpaceOpensWithEmptyRows : OK
320
- Test result : Success : 1467 : Bio.activityCliffs.activityCliffsOpen : OK
321
- Test result : Success : 1356 : Bio.activityCliffs.activityCliffsOpenWithEmptyRows : OK
322
- Test result : Success : 1 : Bio.splitters.helm1 : OK
323
- Test result : Success : 1 : Bio.splitters.helm2 : OK
324
- Test result : Success : 0 : Bio.splitters.helm3-multichar : OK
325
- Test result : Success : 0 : Bio.splitters.testHelm1 : OK
326
- Test result : Success : 0 : Bio.splitters.testHelm2 : OK
327
- Test result : Success : 0 : Bio.splitters.testHelm3 : OK
328
- Test result : Success : 518 : Bio.splitters.splitToMonomers : OK
329
- Test result : Success : 157 : Bio.renderers.long sequence performance : OK
330
- Test result : Success : 1230 : Bio.renderers.many sequence performance : OK
331
- Test result : Success : 372 : Bio.renderers.rendererMacromoleculeFasta : OK
332
- Test result : Success : 289 : Bio.renderers.rendererMacromoleculeSeparator : OK
333
- Test result : Success : 126 : Bio.renderers.rendererMacromoleculeDifference : OK
334
- Test result : Success : 812 : Bio.renderers.afterMsa : OK
335
- Test result : Success : 351 : Bio.renderers.afterConvert : OK
336
- Test result : Success : 178 : Bio.renderers.selectRendererBySemType : OK
337
- Test result : Success : 5 : Bio.converters.testFastaPtToSeparator : OK
338
- Test result : Success : 5 : Bio.converters.testFastaDnaToSeparator : OK
339
- Test result : Success : 13 : Bio.converters.testFastaRnaToSeparator : OK
340
- Test result : Success : 5 : Bio.converters.testFastaGapsToSeparator : OK
341
- Test result : Success : 3 : Bio.converters.testFastaPtToHelm : OK
342
- Test result : Success : 2 : Bio.converters.testFastaDnaToHelm : OK
343
- Test result : Success : 11 : Bio.converters.testFastaRnaToHelm : OK
344
- Test result : Success : 2 : Bio.converters.testFastaGapsToHelm : OK
345
- Test result : Success : 1 : Bio.converters.testSeparatorPtToFasta : OK
346
- Test result : Success : 1 : Bio.converters.testSeparatorDnaToFasta : OK
347
- Test result : Success : 0 : Bio.converters.testSeparatorRnaToFasta : OK
348
- Test result : Success : 0 : Bio.converters.testSeparatorGapsToFasta : OK
349
- Test result : Success : 1 : Bio.converters.testSeparatorPtToHelm : OK
350
- Test result : Success : 0 : Bio.converters.testSeparatorDnaToHelm : OK
351
- Test result : Success : 1 : Bio.converters.testSeparatorRnaToHelm : OK
352
- Test result : Success : 0 : Bio.converters.testSeparatorGapsToHelm : OK
353
- Test result : Success : 1 : Bio.converters.testHelmDnaToFasta : OK
354
- Test result : Success : 0 : Bio.converters.testHelmRnaToFasta : OK
355
- Test result : Success : 0 : Bio.converters.testHelmPtToFasta : OK
356
- Test result : Success : 1 : Bio.converters.testHelmDnaToSeparator : OK
357
- Test result : Success : 0 : Bio.converters.testHelmRnaToSeparator : OK
358
- Test result : Success : 0 : Bio.converters.testHelmPtToSeparator : OK
359
- Test result : Success : 3 : Bio.converters.testHelmLoneRibose : OK
360
- Test result : Success : 3 : Bio.converters.testHelmLoneDeoxyribose : OK
361
- Test result : Success : 2 : Bio.converters.testHelmLonePhosphorus : OK
362
- Test result : Success : 0 : Bio.fastaFileHandler.testNormalFormatting : OK
363
- Test result : Success : 0 : Bio.fastaFileHandler.testExtraSpaces : OK
364
- Test result : Success : 0 : Bio.fastaFileHandler.testExtraNewlines : OK
365
- Test result : Success : 116 : Bio.WebLogo-positions.allPositions : OK
366
- Test result : Success : 126 : Bio.WebLogo-positions.positions with shrinkEmptyTail option true (filterd) : OK
367
- Test result : Success : 100 : Bio.WebLogo-positions.positions with skipEmptyPositions option : OK
368
- Test result : Success : 4 : Bio.checkInputColumn.testMsaPos : OK
369
- Test result : Success : 1 : Bio.checkInputColumn.testMsaNegHelm : OK
370
- Test result : Success : 2 : Bio.checkInputColumn.testMsaNegUN : OK
371
- Test result : Success : 1 : Bio.checkInputColumn.testGetActionFunctionMeta : OK
372
- </pre></div></div></div></div></body></html>