@datagrok/bio 1.7.13 → 1.7.16

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
@@ -2,7 +2,7 @@
2
2
  "name": "@datagrok/bio",
3
3
  "beta": false,
4
4
  "friendlyName": "Bio",
5
- "version": "1.7.13",
5
+ "version": "1.7.16",
6
6
  "description": "Bio is a [package](https://datagrok.ai/help/develop/develop#packages) for the [Datagrok](https://datagrok.ai) platform",
7
7
  "repository": {
8
8
  "type": "git",
@@ -15,7 +15,7 @@
15
15
  "@datagrok-libraries/ml": "^3.0.0",
16
16
  "@datagrok-libraries/utils": "^1.4.0",
17
17
  "cash-dom": "latest",
18
- "datagrok-api": "^1.5.1",
18
+ "datagrok-api": "^1.5.0",
19
19
  "dayjs": "^1.11.4",
20
20
  "openchemlib": "6.0.1",
21
21
  "rxjs": "^6.5.5",
@@ -40,16 +40,16 @@
40
40
  "link-bio": "npm link @datagrok-libraries/bio",
41
41
  "link-ml": "npm link @datagrok-libraries/ml",
42
42
  "link-all": "npm link datagrok-api @datagrok-libraries/utils @datagrok-libraries/bio @datagrok-libraries/ml",
43
- "debug-sequences1": "grok publish --rebuild",
44
- "release-sequences1": "grok publish --rebuild --release",
43
+ "debug-sequences1": "grok publish",
44
+ "release-sequences1": "grok publish --release",
45
45
  "build-sequences1": "webpack",
46
46
  "debug-local": "grok publish local",
47
47
  "release-local": "grok publish local --release",
48
48
  "build": "webpack",
49
- "debug-sequences1-public": "grok publish public --rebuild",
50
- "release-sequences1-public": "grok publish public --rebuild --release",
51
- "debug-sequences1-local": "grok publish local --rebuild",
52
- "release-sequences1-local": "grok publish local --rebuild --release",
49
+ "debug-sequences1-public": "grok publish public",
50
+ "release-sequences1-public": "grok publish public --release",
51
+ "debug-sequences1-local": "grok publish local",
52
+ "release-sequences1-local": "grok publish local --release",
53
53
  "lint": "eslint \"./src/**/*.ts\"",
54
54
  "lint-fix": "eslint \"./src/**/*.ts\" --fix",
55
55
  "test": "jest",
@@ -0,0 +1,15 @@
1
+ set package_dir=%cd%
2
+
3
+ set dirs=^
4
+ \..\..\js-api\ ^
5
+ \..\..\libraries\utils\ ^
6
+ \..\..\libraries\ml\ ^
7
+ \..\..\libraries\bio\ ^
8
+ \
9
+
10
+ call npm uninstall -g datagrok-api @datagrok-libraries/utils @datagrok-libraries/ml @datagrok-libraries/bio
11
+
12
+ for %%p in (%dirs%) do cd %package_dir%\%%p & rmdir /s /q node_modules
13
+ for %%p in (%dirs%) do cd %package_dir%\%%p & rmdir /s /q dist
14
+
15
+ rem for %%p in (%dirs%) do cd %package_dir%\%%p & del "package-lock.json"
package/setup.cmd CHANGED
@@ -1,19 +1,15 @@
1
- cd ../../js-api
2
- call npm install
3
- call npm link
4
- cd ../libraries/utils
5
- call npm install
6
- call npm link
7
- call npm link datagrok-api
8
- cd ../libraries/ml
9
- call npm install
10
- call npm link
11
- call npm link @datagrok-libraries/utils
12
- cd ../libraries/bio
13
- call npm install
14
- call npm link
15
- call npm link @datagrok-libraries/utils
16
- cd ../../packages/Bio
17
- call npm install
18
- call npm link datagrok-api @datagrok-libraries/bio @datagrok-libraries/utils @datagrok-libraries/ml
19
- webpack
1
+ call setup-unlink-clean.cmd
2
+
3
+ set package_dir=%cd%
4
+
5
+ set dirs=^
6
+ \..\..\js-api\ ^
7
+ \..\..\libraries\utils\ ^
8
+ \..\..\libraries\ml\ ^
9
+ \..\..\libraries\bio\ ^
10
+ \
11
+
12
+ for %%p in (%dirs%) do cd %package_dir%\%%p & call npm install
13
+ for %%p in (%dirs%) do cd %package_dir%\%%p & call npm link
14
+ for %%p in (%dirs%) do cd %package_dir%\%%p & call npm run link-all
15
+ for %%p in (%dirs%) do cd %package_dir%\%%p & call npm run build
package/src/package.ts CHANGED
@@ -22,6 +22,7 @@ import {MacromoleculeSequenceCellRenderer} from './utils/cell-renderer';
22
22
  import {convert} from './utils/convert';
23
23
  import {lru} from './utils/cell-renderer';
24
24
  import {representationsWidget} from './widgets/representations';
25
+ import {UnitsHandler} from '@datagrok-libraries/bio/src/utils/units-handler';
25
26
 
26
27
  //tags: init
27
28
  export async function initBio(): Promise<void> {
@@ -241,25 +242,52 @@ export async function compositionAnalysis(): Promise<void> {
241
242
  const tv = grok.shell.tv;
242
243
  const df = tv.dataFrame;
243
244
 
244
- const col: DG.Column | null = WebLogo.pickUpSeqCol2(df);
245
- if (!col) {
245
+ const colList: DG.Column[] = df.columns.toList().filter((col) => {
246
+ if (col.semType != DG.SEMTYPE.MACROMOLECULE)
247
+ return false;
248
+
249
+ const colUH = new UnitsHandler(col);
250
+ // TODO: prevent for cyclic, branched or multiple chains in Helm
251
+ return true;
252
+ });
253
+
254
+ const handler = async (col: DG.Column) => {
255
+ if (!checkInputColumn(col, 'Composition'))
256
+ return;
257
+
258
+ const wlViewer = tv.addViewer('WebLogo', {sequenceColumnName: col.name});
259
+ grok.shell.tv.dockManager.dock(wlViewer, DG.DOCK_TYPE.DOWN, null, 'Composition analysis', 0.25);
260
+ };
261
+
262
+ let col: DG.Column | null = null;
263
+ if (colList.length == 0) {
246
264
  grok.shell.error('Current table does not contain sequences');
247
265
  return;
266
+ } else if (colList.length > 1) {
267
+ const colListNames: string [] = colList.map((col) => col.name);
268
+ const colInput: DG.InputBase = ui.choiceInput('Column', colListNames[0], colListNames);
269
+ ui.dialog({
270
+ title: 'R-Groups Analysis',
271
+ helpUrl: '/help/domains/bio/macromolecules.md#composition-analysis'
272
+ })
273
+ .add(ui.div([
274
+ colInput,
275
+ ]))
276
+ .onOK(async () => {
277
+ const col: DG.Column | null = colList.find((col) => col.name == colInput.value) ?? null;
278
+
279
+ if (col)
280
+ await handler(col);
281
+ })
282
+ .show();
283
+ } else {
284
+ col = colList[0];
248
285
  }
249
286
 
250
- if (!checkInputColumn(col, 'Composition'))
287
+ if (!col)
251
288
  return;
252
289
 
253
- const allowedNotations: string[] = ['fasta', 'separator'];
254
- const units = col.getTag(DG.TAGS.UNITS);
255
- if (!allowedNotations.some((n) => units.toUpperCase().startsWith(n.toUpperCase()))) {
256
- grok.shell.warning('Composition analysis is allowed for ' +
257
- `notation${allowedNotations.length > 1 ? 's' : ''} ${allowedNotations.map((n) => `"${n}"`).join(', ')}.`);
258
- return;
259
- }
260
-
261
- const wlViewer = tv.addViewer('WebLogo', {sequenceColumnName: col.name});
262
- grok.shell.tv.dockManager.dock(wlViewer, DG.DOCK_TYPE.DOWN, null, 'Composition analysis', 0.25);
290
+ await handler(col);
263
291
  }
264
292
 
265
293
  //top-menu: Bio | Sdf to Json lib...
@@ -287,7 +315,7 @@ function parseMacromolecule(
287
315
  export async function peptideMolecule(macroMolecule: DG.Cell): Promise<DG.Widget> {
288
316
  const monomersLibFile = await _package.files.readAsText(HELM_CORE_LIB_FILENAME);
289
317
  const monomersLibObject: any[] = JSON.parse(monomersLibFile);
290
-
318
+
291
319
  return representationsWidget(macroMolecule, monomersLibObject);
292
320
  }
293
321
 
@@ -14,6 +14,13 @@ category('detectors', () => {
14
14
  2
15
15
  3`;
16
16
 
17
+ const csvDfEmpty: string = `id,col1
18
+ 1,
19
+ 2,
20
+ 3,
21
+ 4,
22
+ 5,`;
23
+
17
24
  const csvDf2: string = `col1
18
25
  4
19
26
  5
@@ -179,6 +186,7 @@ MWRSWY-CKHP
179
186
  };
180
187
  };
181
188
 
189
+ test('NegativeEmpty', async () => {await _testNeg(readCsv('csvDfEmpty', csvDfEmpty), 'col1'); });
182
190
  test('Negative1', async () => { await _testNeg(readCsv('csvDf1', csvDf1), 'col1'); });
183
191
  test('Negative2', async () => { await _testNeg(readCsv('csvDf2', csvDf2), 'col1'); });
184
192
  test('Negative3', async () => { await _testNeg(readCsv('csvDf3', csvDf3), 'col1'); });
@@ -1,4 +1,4 @@
1
- <html><head><meta charset="utf-8"/><title>Bio Test Report. Datagrok version datagrok/datagrok:latest SHA=34f75e5127b8. Commit 781e9df9.</title><style type="text/css">html,
1
+ <html><head><meta charset="utf-8"/><title>Bio Test Report. Datagrok version datagrok/datagrok:latest SHA=4f0c8bae6479. Commit dda97945.</title><style type="text/css">html,
2
2
  body {
3
3
  font-family: Arial, Helvetica, sans-serif;
4
4
  font-size: 1rem;
@@ -229,7 +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">Bio Test Report. Datagrok version datagrok/datagrok:latest SHA=34f75e5127b8. Commit 781e9df9.</h1></header><div id="metadata-container"><div id="timestamp">Started: 2022-07-27 13:06:16</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">213.765s</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">199.116s</div></div><div class="failureMessages"> <pre class="failureMsg">Error: Test result : Bio.MSA.is_correct : TypeError: Cannot read properties of undefined (reading 'split')
232
+ </style></head><body><div id="jesthtml-content"><header><h1 id="title">Bio Test Report. Datagrok version datagrok/datagrok:latest SHA=4f0c8bae6479. Commit dda97945.</h1></header><div id="metadata-container"><div id="timestamp">Started: 2022-07-28 11:23:15</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">220.921s</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">200.288s</div></div><div class="failureMessages"> <pre class="failureMsg">Error: Test result : Bio.MSA.is_correct : TypeError: Cannot read properties of undefined (reading 'split')
233
233
  Test result : Bio.activityCliffs.activityCliffsOpen : Error: Expected "105 cliffs", got "2362 cliffs"
234
234
 
235
235
  at /home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:67:20
@@ -263,6 +263,7 @@ Test result : Bio.WebLogo.monomerToText.longMonomerComplexFirstPartShort : OK
263
263
  Test result : Bio.WebLogo.monomerToText.longMonomerComplexFirstPartLong56 : OK
264
264
  Test result : Bio.Palettes.testPaletteN : OK
265
265
  Test result : Bio.Palettes.testPaletteAA : OK
266
+ Test result : Bio.detectors.NegativeEmpty : OK
266
267
  Test result : Bio.detectors.Negative1 : OK
267
268
  Test result : Bio.detectors.Negative2 : OK
268
269
  Test result : Bio.detectors.Negative3 : OK