@datagrok/bio 2.25.13 → 2.25.15
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/CHANGELOG.md +6 -0
- package/dist/package-test.js +3 -3
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +3 -3
- package/dist/package.js.map +1 -1
- package/files/monomer-collections/Canonical AAs.json +27 -0
- package/package.json +2 -2
- package/src/demo/bio03-atomic-level.ts +1 -2
- package/src/substructure-search/substructure-search.ts +1 -2
- package/src/utils/detect-macromolecule-probe.ts +1 -2
- package/src/utils/monomer-lib/lib-manager.ts +36 -3
- package/src/utils/monomer-lib/monomer-manager/monomer-manager.ts +67 -5
- package/src/utils/multiple-sequence-alignment-ui.ts +1 -2
- package/src/utils/seq-helper/seq-handler.ts +14 -4
- package/src/utils/split-to-monomers.ts +1 -2
- package/src/viewers/vd-regions-viewer.ts +1 -1
- package/src/viewers/web-logo-viewer.ts +1 -1
- package/src/widgets/bio-substructure-filter-helm.ts +2 -3
- package/src/widgets/bio-substructure-filter.ts +2 -2
- package/test-console-output-1.log +531 -580
- package/test-record-1.mp4 +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"monomerSymbols": [
|
|
3
|
+
"A",
|
|
4
|
+
"C",
|
|
5
|
+
"D",
|
|
6
|
+
"E",
|
|
7
|
+
"F",
|
|
8
|
+
"G",
|
|
9
|
+
"H",
|
|
10
|
+
"I",
|
|
11
|
+
"K",
|
|
12
|
+
"L",
|
|
13
|
+
"M",
|
|
14
|
+
"N",
|
|
15
|
+
"P",
|
|
16
|
+
"Q",
|
|
17
|
+
"R",
|
|
18
|
+
"S",
|
|
19
|
+
"T",
|
|
20
|
+
"V",
|
|
21
|
+
"W",
|
|
22
|
+
"Y"
|
|
23
|
+
],
|
|
24
|
+
"description": "Canonical amino acids collection",
|
|
25
|
+
"updatedBy": "rizhi",
|
|
26
|
+
"updatedOn": "2026-01-01T12:00:00Z"
|
|
27
|
+
}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "Davit Rizhinashvili",
|
|
6
6
|
"email": "drizhinashvili@datagrok.ai"
|
|
7
7
|
},
|
|
8
|
-
"version": "2.25.
|
|
8
|
+
"version": "2.25.15",
|
|
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",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@biowasm/aioli": "^3.1.0",
|
|
47
|
-
"@datagrok-libraries/bio": "^5.
|
|
47
|
+
"@datagrok-libraries/bio": "^5.62.0",
|
|
48
48
|
"@datagrok-libraries/chem-meta": "^1.2.9",
|
|
49
49
|
"@datagrok-libraries/math": "^1.2.6",
|
|
50
50
|
"@datagrok-libraries/ml": "^6.10.9",
|
|
@@ -4,7 +4,6 @@ import * as DG from 'datagrok-api/dg';
|
|
|
4
4
|
import {_package, PackageFunctions} from '../package';
|
|
5
5
|
import {handleError} from './utils';
|
|
6
6
|
import {DemoScript} from '@datagrok-libraries/tutorials/src/demo-script';
|
|
7
|
-
import {delay} from '@datagrok-libraries/test/src/test';
|
|
8
7
|
import {adjustGridcolAfterRender} from '../utils/ui-utils';
|
|
9
8
|
|
|
10
9
|
export async function demoToAtomicLevel(): Promise<void> {
|
|
@@ -63,7 +62,7 @@ export async function demoBio03UI(): Promise<void> {
|
|
|
63
62
|
dlg = ui.dialog()
|
|
64
63
|
.add(sketcher)
|
|
65
64
|
.show();
|
|
66
|
-
await delay(3000);
|
|
65
|
+
await DG.delay(3000);
|
|
67
66
|
dlg.close();
|
|
68
67
|
}, {
|
|
69
68
|
description: 'Display atomic level structure within a sketcher.',
|
|
@@ -2,7 +2,6 @@ import * as grok from 'datagrok-api/grok';
|
|
|
2
2
|
import * as ui from 'datagrok-api/ui';
|
|
3
3
|
import * as DG from 'datagrok-api/dg';
|
|
4
4
|
|
|
5
|
-
import {delay} from '@datagrok-libraries/test/src/test';
|
|
6
5
|
import {TAGS as bioTAGS, NOTATION} from '@datagrok-libraries/bio/src/utils/macromolecule';
|
|
7
6
|
import {ISeqHelper} from '@datagrok-libraries/bio/src/utils/seq-helper';
|
|
8
7
|
|
|
@@ -154,7 +153,7 @@ export async function helmSubstructureSearch(
|
|
|
154
153
|
export async function invalidateMols(col: DG.Column<string>, seqHelper: ISeqHelper, pattern: boolean): Promise<void> {
|
|
155
154
|
const progressBar = DG.TaskBarProgressIndicator.create(`Invalidating molfiles for ${col.name}`);
|
|
156
155
|
try {
|
|
157
|
-
await delay(10);
|
|
156
|
+
await DG.delay(10);
|
|
158
157
|
const monomersDict = new Map();
|
|
159
158
|
const monomericMolsCol = await getMonomericMols(col, seqHelper, pattern, monomersDict);
|
|
160
159
|
col.temp[MONOMERIC_COL_TAGS.MONOMERIC_MOLS] = monomericMolsCol;
|
|
@@ -4,7 +4,6 @@ import * as DG from 'datagrok-api/dg';
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
import {_package} from '../package';
|
|
7
|
-
import {delay} from '@datagrok-libraries/test/src/test';
|
|
8
7
|
|
|
9
8
|
type IDetectorReport = { categoriesSample: any[], rejectReason: string };
|
|
10
9
|
|
|
@@ -31,7 +30,7 @@ export async function detectMacromoleculeProbeDo(
|
|
|
31
30
|
if ((progress - progressLast) >= 0.1) {
|
|
32
31
|
progressLast = progress;
|
|
33
32
|
pi.update(100 * progress, `detectMacromolecule probe ${failCount}/${i}/${probeCount} ...`);
|
|
34
|
-
await delay(0);
|
|
33
|
+
await DG.delay(0);
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
36
|
if (failCount > 0)
|
|
@@ -4,9 +4,8 @@ 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
|
|
|
7
|
-
import {delay} from '@datagrok-libraries/test/src/test';
|
|
8
7
|
import {ILogger} from '@datagrok-libraries/bio/src/utils/logger';
|
|
9
|
-
import {DEFAULT_FILES_LIB_PROVIDER_NAME, findProviderWithLibraryName, IMonomerLib, IMonomerSet} from '@datagrok-libraries/bio/src/types/monomer-library';
|
|
8
|
+
import {DEFAULT_FILES_LIB_PROVIDER_NAME, findProviderWithLibraryName, IMonomerLib, IMonomerSet, MonomerCollection} from '@datagrok-libraries/bio/src/types/monomer-library';
|
|
10
9
|
import {
|
|
11
10
|
getUserLibSettings, setUserLibSettings,
|
|
12
11
|
} from '@datagrok-libraries/bio/src/monomer-works/lib-settings';
|
|
@@ -20,6 +19,7 @@ import {_package} from '../../package';
|
|
|
20
19
|
import {IMonomerLibHelper, IMonomerLibProvider} from '@datagrok-libraries/bio/src/types/monomer-library';
|
|
21
20
|
import {merge, Observable, Subject} from 'rxjs';
|
|
22
21
|
import {MonomerLibFromFilesProvider} from './library-file-manager/monomers-lib-provider';
|
|
22
|
+
const MONOMER_COLLECTION_STORAGE_PATH = 'System:AppData/Bio/monomer-collections/';
|
|
23
23
|
|
|
24
24
|
type MonomerLibWindowType = Window & { $monomerLibHelperPromise?: Promise<MonomerLibManager> };
|
|
25
25
|
declare const window: MonomerLibWindowType;
|
|
@@ -91,7 +91,7 @@ export class MonomerLibManager implements IMonomerLibHelper {
|
|
|
91
91
|
return true;
|
|
92
92
|
})(),
|
|
93
93
|
(async () => {
|
|
94
|
-
await delay(timeout);
|
|
94
|
+
await DG.delay(timeout);
|
|
95
95
|
return false;
|
|
96
96
|
})(),
|
|
97
97
|
]).then((res) => {
|
|
@@ -410,6 +410,39 @@ export class MonomerLibManager implements IMonomerLibHelper {
|
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
412
|
|
|
413
|
+
async listMonomerCollections(): Promise<string[]> {
|
|
414
|
+
// these are provider less functions. coleections will be in files storage in txt format
|
|
415
|
+
const collections = (await grok.dapi.files.list(MONOMER_COLLECTION_STORAGE_PATH))
|
|
416
|
+
.filter((file) => file.extension === 'json' || file.name.endsWith('.json'));
|
|
417
|
+
return collections.map((file) => file.name);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
async deleteMonomerCollection(collectionName: string): Promise<void> {
|
|
421
|
+
if (!collectionName.endsWith('.json'))
|
|
422
|
+
collectionName += '.json';
|
|
423
|
+
if (await grok.dapi.files.exists(MONOMER_COLLECTION_STORAGE_PATH + collectionName))
|
|
424
|
+
await grok.dapi.files.delete(MONOMER_COLLECTION_STORAGE_PATH + collectionName);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
async readMonomerCollection(collectionName: string): Promise<MonomerCollection> {
|
|
428
|
+
if (!collectionName.endsWith('.json'))
|
|
429
|
+
collectionName += '.json';
|
|
430
|
+
const file = await grok.dapi.files.readAsText(MONOMER_COLLECTION_STORAGE_PATH + collectionName);
|
|
431
|
+
return JSON.parse(file) as MonomerCollection;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
async addOrUpdateMonomerCollection(collectionName: string, monomerSymbols: string[], desc?: string): Promise<void> {
|
|
435
|
+
if (!collectionName.endsWith('.json'))
|
|
436
|
+
collectionName += '.json';
|
|
437
|
+
const content = JSON.stringify({
|
|
438
|
+
description: desc,
|
|
439
|
+
monomerSymbols: monomerSymbols,
|
|
440
|
+
updatedBy: DG.User.current().login,
|
|
441
|
+
updatedOn: new Date().toISOString(),
|
|
442
|
+
} satisfies MonomerCollection, null, 2);
|
|
443
|
+
await grok.dapi.files.writeAsText(MONOMER_COLLECTION_STORAGE_PATH + collectionName, content);
|
|
444
|
+
}
|
|
445
|
+
|
|
413
446
|
// -- Instance singleton --
|
|
414
447
|
public static async getInstance(): Promise<MonomerLibManager> {
|
|
415
448
|
let res = window.$monomerLibHelperPromise;
|
|
@@ -255,6 +255,58 @@ export class MonomerManager implements IMonomerManager {
|
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
+
async createNewMonomersCollectionDialog(monomerSymbols: string[]) {
|
|
259
|
+
const existingCollections = (await this.monomerLibManamger.listMonomerCollections()).map((name) => name.toLowerCase());
|
|
260
|
+
const nameInput = ui.input.string('Collection Name', {tooltipText: 'Name of the monomer collection, should be unique', placeholder: 'Enter collection name', nullable: false});
|
|
261
|
+
const descriptionInput = ui.input.string('Description', {tooltipText: 'Description of the monomer collection', placeholder: 'Enter collection description', nullable: true});
|
|
262
|
+
const d = ui.dialog('Create New Monomer Collection')
|
|
263
|
+
.add(nameInput)
|
|
264
|
+
.add(descriptionInput)
|
|
265
|
+
.addButton('Add', async () => {
|
|
266
|
+
if (!nameInput.value || !nameInput.value.trim()) {
|
|
267
|
+
grok.shell.warning('Collection name cannot be empty');
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
const saveAction = async (symbols: string[]) => {
|
|
271
|
+
await this.monomerLibManamger.addOrUpdateMonomerCollection(nameInput.value!, symbols, descriptionInput.value ?? undefined);
|
|
272
|
+
grok.shell.info(`Collection ${nameInput.value} saved successfully`);
|
|
273
|
+
};
|
|
274
|
+
if (existingCollections.includes(nameInput.value!.toLowerCase()) || existingCollections.includes(nameInput.value!.toLowerCase() + '.json')) {
|
|
275
|
+
const confD = ui.dialog('Collection already exists')
|
|
276
|
+
.add(ui.divText(`A collection with the name ${nameInput.value} already exists. Do you want to merge or overwrite it?`));
|
|
277
|
+
confD.addButton('Merge', async () => {
|
|
278
|
+
const existingCollection = await this.monomerLibManamger.readMonomerCollection(nameInput.value!);
|
|
279
|
+
const mergedSymbols = Array.from(new Set([...(existingCollection.monomerSymbols ?? []), ...monomerSymbols]));
|
|
280
|
+
try {
|
|
281
|
+
await saveAction(mergedSymbols);
|
|
282
|
+
} catch (e) {
|
|
283
|
+
grok.shell.error('Error merging monomer collection');
|
|
284
|
+
console.error(e);
|
|
285
|
+
}
|
|
286
|
+
confD.close();
|
|
287
|
+
});
|
|
288
|
+
confD.addButton('Overwrite', async () => {
|
|
289
|
+
try {
|
|
290
|
+
await saveAction(monomerSymbols);
|
|
291
|
+
} catch (e) {
|
|
292
|
+
grok.shell.error('Error overwriting monomer collection');
|
|
293
|
+
console.error(e);
|
|
294
|
+
}
|
|
295
|
+
confD.close();
|
|
296
|
+
});
|
|
297
|
+
confD.show();
|
|
298
|
+
} else {
|
|
299
|
+
try {
|
|
300
|
+
await saveAction(monomerSymbols);
|
|
301
|
+
} catch (e) {
|
|
302
|
+
grok.shell.error('Error creating monomer collection');
|
|
303
|
+
console.error(e);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
d.close();
|
|
307
|
+
}).show();
|
|
308
|
+
}
|
|
309
|
+
|
|
258
310
|
async createNewLibDialog(monomers?: Monomer[]) {
|
|
259
311
|
const monomerLibs = await this.monomerLibManamger.getAvaliableLibraryNames();
|
|
260
312
|
const libNameInput = ui.input.string('Library Name', {
|
|
@@ -321,26 +373,36 @@ export class MonomerManager implements IMonomerManager {
|
|
|
321
373
|
args.context.tableView.id !== (this.tv!.id ?? '') || !args.item || !args.item.isTableCell || (args.item.tableRowIndex ?? -1) < 0)
|
|
322
374
|
return;
|
|
323
375
|
const rowIdx = args.item.tableRowIndex;
|
|
324
|
-
args.menu
|
|
376
|
+
const menu = args.menu as DG.Menu;
|
|
377
|
+
menu.item('Edit Monomer', async () => {
|
|
325
378
|
await this.editMonomer(this.tv!.dataFrame.rows.get(rowIdx));
|
|
326
379
|
});
|
|
327
380
|
|
|
328
|
-
|
|
381
|
+
menu.item('Fix all monomers', () => {
|
|
329
382
|
this.fixAllMonomers();
|
|
330
383
|
});
|
|
331
384
|
if (this.tv!.dataFrame.selection.trueCount > 0) {
|
|
332
|
-
|
|
385
|
+
const group = menu.group('Selected Monomers');
|
|
386
|
+
group.item('Remove', async () => {
|
|
333
387
|
const monomers = await Promise.all(Array.from(this.tv!.dataFrame.selection.getSelectedIndexes())
|
|
334
388
|
.map((r) => monomerFromDfRow(this.tv!.dataFrame.rows.get(r))));
|
|
335
389
|
this._newMonomerForm.removeMonomers(monomers, this.libInput.value!);
|
|
336
390
|
});
|
|
337
|
-
|
|
391
|
+
group.item('Create Library', async () => {
|
|
338
392
|
const monomers = await Promise.all(Array.from(this.tv!.dataFrame.selection.getSelectedIndexes())
|
|
339
393
|
.map((r) => monomerFromDfRow(this.tv!.dataFrame.rows.get(r))));
|
|
340
394
|
this.createNewLibDialog(monomers);
|
|
341
395
|
});
|
|
396
|
+
group.item('Create Collection', async () => {
|
|
397
|
+
const monomerSymbols = Array.from(this.tv!.dataFrame.selection.getSelectedIndexes())
|
|
398
|
+
.map((r) => this.tv!.dataFrame.col(MONOMER_DF_COLUMN_NAMES.SYMBOL)!.get(r) as string)
|
|
399
|
+
.filter((s): s is string => !!s && s.trim().length > 0);
|
|
400
|
+
if (monomerSymbols.length === 0)
|
|
401
|
+
return grok.shell.warning('No valid monomer symbols found in selection');
|
|
402
|
+
this.createNewMonomersCollectionDialog(monomerSymbols);
|
|
403
|
+
});
|
|
342
404
|
} else {
|
|
343
|
-
|
|
405
|
+
menu.item('Remove Monomer', async () => {
|
|
344
406
|
const monomer = await monomerFromDfRow(this.tv!.dataFrame.rows.get(rowIdx));
|
|
345
407
|
this._newMonomerForm.removeMonomers([monomer], this.libInput.value!);
|
|
346
408
|
});
|
|
@@ -6,7 +6,6 @@ import * as DG from 'datagrok-api/dg';
|
|
|
6
6
|
import * as ui from 'datagrok-api/ui';
|
|
7
7
|
|
|
8
8
|
import {ColumnInputOptions} from '@datagrok-libraries/utils/src/type-declarations';
|
|
9
|
-
import {delay} from '@datagrok-libraries/test/src/test';
|
|
10
9
|
import {ALPHABET, NOTATION} from '@datagrok-libraries/bio/src/utils/macromolecule';
|
|
11
10
|
import {ISeqHelper} from '@datagrok-libraries/bio/src/utils/seq-helper';
|
|
12
11
|
|
|
@@ -82,7 +81,7 @@ export async function multipleSequenceAlignmentUI(
|
|
|
82
81
|
table: table, value: seqCol, onValueChanged: async (value: DG.Column<any>) => {
|
|
83
82
|
if (!value || value.semType !== DG.SEMTYPE.MACROMOLECULE) {
|
|
84
83
|
okBtn.disabled = true;
|
|
85
|
-
await delay(0); // to
|
|
84
|
+
await DG.delay(0); // to
|
|
86
85
|
colInput.value = prevSeqCol as DG.Column<string>;
|
|
87
86
|
return;
|
|
88
87
|
}
|
|
@@ -50,9 +50,19 @@ export class SeqHandler implements ISeqHandler {
|
|
|
50
50
|
if (col.type !== DG.TYPE.STRING)
|
|
51
51
|
throw new Error(`Unexpected column type '${col.type}', must be '${DG.TYPE.STRING}'.`);
|
|
52
52
|
this._column = col;
|
|
53
|
-
|
|
54
|
-
if (!units)
|
|
55
|
-
|
|
53
|
+
let units: string | null = this._column.meta.units;
|
|
54
|
+
if (!units) {
|
|
55
|
+
// it may be from layout that the macromolecule semtype is set but every other tag is missing, so we manually run detectors
|
|
56
|
+
if (!this._column.temp['seqHandlerDetectorRun']) {
|
|
57
|
+
this._column.temp['seqHandlerDetectorRun'] = true;
|
|
58
|
+
const detectorFunc = DG.Func.find({name: 'detectMacromolecule', meta: {role: 'semTypeDetector'}})[0];
|
|
59
|
+
if (detectorFunc)
|
|
60
|
+
detectorFunc.applySync({col: this._column});
|
|
61
|
+
units = this._column.meta.units;
|
|
62
|
+
}
|
|
63
|
+
if (!units)
|
|
64
|
+
throw new Error('Units are not specified in column');
|
|
65
|
+
}
|
|
56
66
|
this._units = units!;
|
|
57
67
|
|
|
58
68
|
this._notation = this.getNotation();
|
|
@@ -182,7 +192,7 @@ export class SeqHandler implements ISeqHandler {
|
|
|
182
192
|
|
|
183
193
|
let aligned = uh.column.getTag(TAGS.aligned);
|
|
184
194
|
if (aligned == null) {
|
|
185
|
-
aligned = uh.stats.sameLength ? ALIGNMENT.SEQ_MSA : ALIGNMENT.SEQ;
|
|
195
|
+
aligned = uh.stats.sameLength || uh.column.categories.slice(0, 5).filter((a) => !!a).every((a) => a.length > 100) ? ALIGNMENT.SEQ_MSA : ALIGNMENT.SEQ;
|
|
186
196
|
uh.column.setTag(TAGS.aligned, aligned);
|
|
187
197
|
}
|
|
188
198
|
|
|
@@ -2,7 +2,6 @@ import * as grok from 'datagrok-api/grok';
|
|
|
2
2
|
import * as ui from 'datagrok-api/ui';
|
|
3
3
|
import * as DG from 'datagrok-api/dg';
|
|
4
4
|
|
|
5
|
-
import {delay} from '@datagrok-libraries/test/src/test';
|
|
6
5
|
import {checkInputColumnUI} from './check-input-column';
|
|
7
6
|
import {splitAlignedSequences} from '@datagrok-libraries/bio/src/utils/splitter';
|
|
8
7
|
import * as C from './constants';
|
|
@@ -17,7 +16,7 @@ export async function splitToMonomersUI(
|
|
|
17
16
|
): Promise<DG.DataFrame> {
|
|
18
17
|
// Delay is required for initial function dialog to close before starting invalidating of molfiles.
|
|
19
18
|
// Otherwise, dialog is freezing
|
|
20
|
-
await delay(10);
|
|
19
|
+
await DG.delay(10);
|
|
21
20
|
if (!checkInputColumnUI(seqCol, 'Sequence space')) return table;
|
|
22
21
|
|
|
23
22
|
const seqHelper = _package.seqHelper;
|
|
@@ -4,7 +4,7 @@ import * as DG from 'datagrok-api/dg';
|
|
|
4
4
|
|
|
5
5
|
import {fromEvent, Observable, Subject, Unsubscribable} from 'rxjs';
|
|
6
6
|
|
|
7
|
-
import {testEvent} from '@datagrok-libraries/
|
|
7
|
+
import {testEvent} from '@datagrok-libraries/utils/src/test';
|
|
8
8
|
import {
|
|
9
9
|
IVdRegionsViewer,
|
|
10
10
|
VdRegion, VdRegionType,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
import {errorToConsole} from '@datagrok-libraries/utils/src/to-console';
|
|
23
23
|
import {intToHtmlA} from '@datagrok-libraries/utils/src/color';
|
|
24
24
|
import {ISeqSplitted} from '@datagrok-libraries/bio/src/utils/macromolecule/types';
|
|
25
|
-
import {testEvent} from '@datagrok-libraries/
|
|
25
|
+
import {testEvent} from '@datagrok-libraries/utils/src/test';
|
|
26
26
|
import {PromiseSyncer} from '@datagrok-libraries/bio/src/utils/syncer';
|
|
27
27
|
import {GAP_SYMBOL} from '@datagrok-libraries/bio/src/utils/macromolecule/consts';
|
|
28
28
|
import {IMonomerLibBase} from '@datagrok-libraries/bio/src/types/monomer-library';
|
|
@@ -9,7 +9,6 @@ import {App, IHelmWebEditor} from '@datagrok-libraries/bio/src/helm/types';
|
|
|
9
9
|
import {getHelmHelper} from '@datagrok-libraries/bio/src/helm/helm-helper';
|
|
10
10
|
import {ILogger} from '@datagrok-libraries/bio/src/utils/logger';
|
|
11
11
|
import {errInfo} from '@datagrok-libraries/bio/src/utils/err-info';
|
|
12
|
-
import {delay} from '@datagrok-libraries/test/src/test';
|
|
13
12
|
import {ISeqHelper} from '@datagrok-libraries/bio/src/utils/seq-helper';
|
|
14
13
|
|
|
15
14
|
import {updateDivInnerHTML} from '../utils/ui-utils';
|
|
@@ -141,7 +140,7 @@ export class HelmBioFilter extends BioFilterBase<BioFilterProps> /* implements I
|
|
|
141
140
|
const logPrefix = `${this.viewerToLog()}.substructureSearch( column = <${column.name}> )`;
|
|
142
141
|
_package.logger.debug(`${logPrefix}, start`);
|
|
143
142
|
try {
|
|
144
|
-
await delay(10);
|
|
143
|
+
await DG.delay(10);
|
|
145
144
|
const res = await helmSubstructureSearch(this.props.substructure, column, this.seqHelper);
|
|
146
145
|
return res;
|
|
147
146
|
} finally {
|
|
@@ -163,7 +162,7 @@ export class HelmBioFilter extends BioFilterBase<BioFilterProps> /* implements I
|
|
|
163
162
|
// async awaitRendered(timeout: number = 10000): Promise<void> {
|
|
164
163
|
// const callLog = `awaitRendered( ${timeout} )`;
|
|
165
164
|
// const logPrefix = `${this.viewerToLog()}.${callLog}`;
|
|
166
|
-
// await delay(0);
|
|
165
|
+
// await DG.delay(0);
|
|
167
166
|
// await testEvent(this.onRendered, () => {
|
|
168
167
|
// this.logger.debug(`${logPrefix}, ` + '_onRendered event caught');
|
|
169
168
|
// }, () => {
|
|
@@ -14,7 +14,7 @@ import wu from 'wu';
|
|
|
14
14
|
import {Observable, Subject, Unsubscribable} from 'rxjs';
|
|
15
15
|
|
|
16
16
|
import {TAGS as bioTAGS, NOTATION} from '@datagrok-libraries/bio/src/utils/macromolecule';
|
|
17
|
-
import {
|
|
17
|
+
import {testEvent} from '@datagrok-libraries/utils/src/test';
|
|
18
18
|
import {IRenderer} from '@datagrok-libraries/bio/src/types/renderer';
|
|
19
19
|
import {ILogger} from '@datagrok-libraries/bio/src/utils/logger';
|
|
20
20
|
import {PromiseSyncer} from '@datagrok-libraries/bio/src/utils/syncer';
|
|
@@ -269,7 +269,7 @@ export class BioSubstructureFilter extends DG.Filter implements IRenderer {
|
|
|
269
269
|
async awaitRendered(timeout: number = 10000): Promise<void> {
|
|
270
270
|
const callLog = `awaitRendered( ${timeout} )`;
|
|
271
271
|
const logPrefix = `${this.filterToLog()}.${callLog}`;
|
|
272
|
-
await delay(10);
|
|
272
|
+
await DG.delay(10);
|
|
273
273
|
await testEvent(this.onRendered, () => {
|
|
274
274
|
this.logger.debug(`${logPrefix}, ` + '_onRendered event caught');
|
|
275
275
|
}, () => {
|