@datagrok/helm 2.0.0 → 2.0.3

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.
@@ -1,13 +1,13 @@
1
- import {before, category, expect, test} from '@datagrok-libraries/utils/src/test';
2
- import {helmToFasta, helmToPeptide, helmToRNA} from '../package';
1
+ import {after, before, category, delay, expect, test} from '@datagrok-libraries/utils/src/test';
2
+ //import {findMonomers, helmToFasta, helmToPeptide, helmToRNA, initHelm} from '../package';
3
3
  import {_package} from '../package-test';
4
+ import {loadDialog, manageFiles, monomerManager} from '../package';
4
5
  import * as DG from 'datagrok-api/dg';
5
6
  import * as grok from 'datagrok-api/grok';
6
7
 
7
8
 
8
9
  category('Helm', () => {
9
-
10
- // These tests require webservice that is not present on test stand
10
+ //These tests require webservice that is not present on test stand
11
11
  // test('helmToFasta', async () => {
12
12
  // expect(await helmToFasta('RNA1{R(U)P.R(T)P.R(G)P.R(C)P.R(A)}$$$$'), '>RNA1UTGCA');
13
13
  // expect(await helmToFasta('RNA1{P.R(U).P.R(T)}$$$$'), '>RNA1UT');
@@ -28,19 +28,49 @@ category('Helm', () => {
28
28
  // expect(await helmToPeptide('PEPTIDE1{A.R.C.A.A.K.T.C.D.A}$PEPTIDE1,PEPTIDE1,8:R3-3:R3$$$'), 'ARCAAKTCDA');
29
29
  // });
30
30
 
31
- test('detectMacromolecule', async () => {
32
- const file = await _package.files.readAsText('tests/test.csv');
33
- const df = DG.DataFrame.fromCsv(file);
34
- const col = df.columns.byName('HELM string');
35
- await grok.data.detectSemanticTypes(df);
36
- expect(col.semType, DG.SEMTYPE.MACROMOLECULE);
31
+ // detectMacromolecule is a function of Bio package
32
+ // test('detectMacromolecule', async () => {
33
+ // const file = await _package.files.readAsText('tests/test.csv');
34
+ // const df = DG.DataFrame.fromCsv(file);
35
+ // const col = df.columns.byName('HELM string');
36
+ // await grok.data.detectSemanticTypes(df);
37
+ // expect(col.semType, DG.SEMTYPE.MACROMOLECULE);
38
+ // });
39
+
40
+ // semType and units tags are detecting by Bio package function detectMacromolecule
41
+ // test('detectHelm', async () => {
42
+ // const file = await _package.files.readAsText('tests/test.csv');
43
+ // const df = DG.DataFrame.fromCsv(file);
44
+ // const col = df.columns.byName('HELM string');
45
+ // await grok.data.detectSemanticTypes(df);
46
+ // expect(col.tags[DG.TAGS.UNITS], 'HELM');
47
+ // });
48
+
49
+
50
+ test('manageFiles', async () => {
51
+ return await manageFiles();
52
+ });
53
+
54
+ test('loadDialog', async() => {
55
+ return await grok.functions.call('Helm:loadDialog');
37
56
  });
38
57
 
39
- test('detectHelm', async () => {
40
- const file = await _package.files.readAsText('tests/test.csv');
41
- const df = DG.DataFrame.fromCsv(file);
42
- const col = df.columns.byName('HELM string');
43
- await grok.data.detectSemanticTypes(df);
44
- expect(col.tags[DG.TAGS.UNITS], 'HELM');
58
+ test('monomerManager', async() => {
59
+ await grok.functions.call('Helm:monomerManager', {value: 'HELMCoreLibrary.json'});
60
+ const checkName = '2-Chloroadenine';
61
+ let flag = false;
62
+ const types = Object.keys(org.helm.webeditor.monomerTypeList());
63
+ const monomers: any = [];
64
+ for (var i = 0; i < types.length; i++) {
65
+ //@ts-ignore
66
+ monomers.push(new scil.helm.Monomers.getMonomerSet(types[i]));
67
+ Object.keys(monomers[i]).forEach(k => {
68
+ if (monomers[i][k].n == checkName){
69
+ flag = true;
70
+ }
71
+ });
72
+ }
73
+ expect(flag, true);
45
74
  });
75
+
46
76
  });
@@ -1,4 +1,4 @@
1
- <html><head><meta charset="utf-8"/><title>Helm Test Report. Datagrok version datagrok/datagrok:latest SHA=4f0c8bae6479. Commit 529c5bce.</title><style type="text/css">html,
1
+ <html><head><meta charset="utf-8"/><title>Helm Test Report. Datagrok version datagrok/datagrok:latest SHA=4f0c8bae6479. Commit d7a9fa45.</title><style type="text/css">html,
2
2
  body {
3
3
  font-family: Arial, Helvetica, sans-serif;
4
4
  font-size: 1rem;
@@ -229,8 +229,7 @@ header {
229
229
  font-size: 1rem;
230
230
  padding: 0 0.5rem;
231
231
  }
232
- </style></head><body><div id="jesthtml-content"><header><h1 id="title">Helm Test Report. Datagrok version datagrok/datagrok:latest SHA=4f0c8bae6479. Commit 529c5bce.</h1></header><div id="metadata-container"><div id="timestamp">Started: 2022-08-01 16:04:09</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/Helm/src/__jest__/remote.test.ts</div><div class="suite-time warn">15.037s</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">1.207s</div></div><div class="failureMessages"> <pre class="failureMsg">Error: Test result : Helm.Helm.detectMacromolecule : Error: Expected "Macromolecule", got "null"
233
- Test result : Helm.Helm.detectHelm : Error: Expected "HELM", got "null"
232
+ </style></head><body><div id="jesthtml-content"><header><h1 id="title">Helm Test Report. Datagrok version datagrok/datagrok:latest SHA=4f0c8bae6479. Commit d7a9fa45.</h1></header><div id="metadata-container"><div id="timestamp">Started: 2022-08-24 13:52:53</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/Helm/src/__jest__/remote.test.ts</div><div class="suite-time warn">19.938s</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">3.954s</div></div><div class="failureMessages"> <pre class="failureMsg">Error: Test result : Failed : Helm.Helm.manageFiles : TypeError: datagrok_api_ui__WEBPACK_IMPORTED_MODULE_1__.fileBrowser is not a function
234
233
 
235
234
  at /home/runner/work/public/public/packages/Helm/src/__jest__/remote.test.ts:67:20
236
235
  at Generator.next (&lt;anonymous&gt;)
@@ -248,4 +247,6 @@ Test result : Helm.Helm.detectHelm : Error: Expected "HELM", got "null"
248
247
  at new Promise (&lt;anonymous&gt;)</pre><pre class="suite-consolelog-item-message">Testing Helm package</pre></div><div class="suite-consolelog-item"><pre class="suite-consolelog-item-origin"> at /home/runner/work/public/public/packages/Helm/src/__jest__/remote.test.ts:65:11
249
248
  at Generator.next (&lt;anonymous&gt;)
250
249
  at fulfilled (/home/runner/work/public/public/packages/Helm/src/__jest__/remote.test.ts:31:58)
251
- at processTicksAndRejections (internal/process/task_queues.js:97:5)</pre><pre class="suite-consolelog-item-message"/></div></div></div></div></body></html>
250
+ at processTicksAndRejections (internal/process/task_queues.js:97:5)</pre><pre class="suite-consolelog-item-message">Test result : Success : Helm.Helm.loadDialog : OK
251
+ Test result : Success : Helm.Helm.monomerManager : OK
252
+ </pre></div></div></div></div></body></html>
File without changes