@datagrok/sequence-translator 1.10.4 → 1.10.6
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 +4 -0
- package/detectors.js +3 -1
- package/dist/package-test.js +1 -1
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/package.json +9 -5
- package/scripts/build-monomer-lib.py +0 -1
- package/src/apps/common/view/components/colored-input/input-painters.ts +1 -1
- package/src/apps/structure/model/monomer-code-parser.ts +1 -1
- package/src/apps/translator/model/conversion-utils.ts +1 -1
- package/src/demo/demo-st-ui.ts +1 -1
- package/src/package-test.ts +1 -1
- package/src/package.g.ts +8 -0
- package/src/package.ts +18 -12
- package/src/polytool/conversion/pt-synthetic.ts +16 -8
- package/src/polytool/pt-enumerate-seq-dialog.ts +29 -7
- package/src/tests/files-tests.ts +1 -1
- package/src/tests/formats-support.ts +1 -1
- package/src/tests/formats-to-helm.ts +1 -1
- package/src/tests/helm-to-nucleotides.ts +1 -1
- package/src/tests/polytool-chain-from-notation-tests.ts +1 -1
- package/src/tests/polytool-chain-parse-notation-tests.ts +1 -1
- package/src/tests/polytool-convert-tests.ts +1 -1
- package/src/tests/polytool-detectors-custom-notation-test.ts +1 -1
- package/src/tests/polytool-enumerate-breadth-tests.ts +1 -1
- package/src/tests/polytool-enumerate-tests.ts +1 -1
- package/src/tests/polytool-unrule-tests.ts +1 -1
- package/src/tests/toAtomicLevel-tests.ts +1 -1
- package/src/tests/utils/detect-macromolecule-utils.ts +1 -1
- package/test-console-output-1.log +253 -1496
- package/test-record-1.mp4 +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datagrok/sequence-translator",
|
|
3
3
|
"friendlyName": "Sequence Translator",
|
|
4
|
-
"version": "1.10.
|
|
4
|
+
"version": "1.10.6",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Davit Rizhinashvili",
|
|
7
7
|
"email": "drizhinashvili@datagrok.ai"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@datagrok-libraries/utils": "^4.6.5",
|
|
29
29
|
"@types/react": "^18.0.15",
|
|
30
30
|
"cash-dom": "^8.1.0",
|
|
31
|
-
"datagrok-api": "^1.
|
|
31
|
+
"datagrok-api": "^1.26.0",
|
|
32
32
|
"lodash": "^4.17.21",
|
|
33
33
|
"object-hash": "^3.0.0",
|
|
34
34
|
"openchemlib": "6.0.1",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"ts-loader": "^9.3.1",
|
|
37
37
|
"typeahead-standalone": "4.14.1",
|
|
38
38
|
"typescript": "^5.4.2",
|
|
39
|
-
"wu": "^2.1.0"
|
|
39
|
+
"wu": "^2.1.0",
|
|
40
|
+
"@datagrok-libraries/test": "^1.1.0"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
43
|
"@datagrok-libraries/helm-web-editor": "^1.1.16",
|
|
@@ -54,7 +55,7 @@
|
|
|
54
55
|
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
|
55
56
|
"@typescript-eslint/parser": "^7.2.0",
|
|
56
57
|
"css-loader": "^6.7.3",
|
|
57
|
-
"datagrok-tools": "^
|
|
58
|
+
"datagrok-tools": "^5.0.0",
|
|
58
59
|
"eslint": "^8.57.0",
|
|
59
60
|
"eslint-config-google": "^0.14.0",
|
|
60
61
|
"style-loader": "^3.3.1",
|
|
@@ -89,5 +90,8 @@
|
|
|
89
90
|
"canView": [
|
|
90
91
|
"All users"
|
|
91
92
|
],
|
|
92
|
-
"category": "Bioinformatics"
|
|
93
|
+
"category": "Bioinformatics",
|
|
94
|
+
"overrides": {
|
|
95
|
+
"datagrok-api": "$datagrok-api"
|
|
96
|
+
}
|
|
93
97
|
}
|
|
@@ -24,7 +24,7 @@ export function demoPainter(input: string): HTMLSpanElement[] {
|
|
|
24
24
|
return spans;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
/* todo: port to another place */
|
|
28
28
|
export function highlightInvalidSubsequence(input: string, th: ITranslationHelper): HTMLSpanElement[] {
|
|
29
29
|
// validate sequence
|
|
30
30
|
let cutoff = 0;
|
|
@@ -84,7 +84,7 @@ export class MonomerSequenceParser {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
/* todo: to be eliminated after full helm support */
|
|
88
88
|
function monomerHasLeftPhosphateLinker(monomerSymbol: string): boolean {
|
|
89
89
|
return _package.jsonData.monomersWithPhosphate['left'].includes(monomerSymbol);
|
|
90
90
|
}
|
|
@@ -51,7 +51,7 @@ export function getNucleotidesSequence(helmString: string, monomerLib: MonomerLi
|
|
|
51
51
|
return nucleotides;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
/* todo: remove after refactoring as a workaround */
|
|
55
55
|
export function convert(
|
|
56
56
|
sequence: string, sourceFormat: string, targetFormat: string, th: ITranslationHelper
|
|
57
57
|
): string | null {
|
package/src/demo/demo-st-ui.ts
CHANGED
|
@@ -2,7 +2,7 @@ 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/
|
|
5
|
+
import {delay} from '@datagrok-libraries/test/src/test';
|
|
6
6
|
import {PackageFunctions} from '../package';
|
|
7
7
|
import {tryCatch} from '../apps/common/model/helpers';
|
|
8
8
|
|
package/src/package-test.ts
CHANGED
|
@@ -2,7 +2,7 @@ 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 {runTests, tests, TestContext, initAutoTests as initTests} from '@datagrok-libraries/
|
|
5
|
+
import {runTests, tests, TestContext, initAutoTests as initTests} from '@datagrok-libraries/test/src/test';
|
|
6
6
|
|
|
7
7
|
import './tests/formats-to-helm';
|
|
8
8
|
import './tests/helm-to-nucleotides';
|
package/src/package.g.ts
CHANGED
|
@@ -4,6 +4,7 @@ import * as DG from 'datagrok-api/dg';
|
|
|
4
4
|
//name: Oligo Toolkit
|
|
5
5
|
//tags: app
|
|
6
6
|
//output: view result
|
|
7
|
+
//meta.role: app
|
|
7
8
|
//meta.icon: img/icons/toolkit.png
|
|
8
9
|
//meta.browsePath: Peptides | Oligo Toolkit
|
|
9
10
|
export async function oligoToolkitApp() : Promise<any> {
|
|
@@ -11,6 +12,7 @@ export async function oligoToolkitApp() : Promise<any> {
|
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
//tags: init
|
|
15
|
+
//meta.role: init
|
|
14
16
|
export async function init() : Promise<void> {
|
|
15
17
|
await PackageFunctions.init();
|
|
16
18
|
}
|
|
@@ -18,6 +20,7 @@ export async function init() : Promise<void> {
|
|
|
18
20
|
//name: Oligo Translator
|
|
19
21
|
//tags: app
|
|
20
22
|
//output: view result
|
|
23
|
+
//meta.role: app
|
|
21
24
|
//meta.icon: img/icons/translator.png
|
|
22
25
|
//meta.browsePath: Peptides | Oligo Toolkit
|
|
23
26
|
export async function oligoTranslatorApp() : Promise<any> {
|
|
@@ -27,6 +30,7 @@ export async function oligoTranslatorApp() : Promise<any> {
|
|
|
27
30
|
//name: Oligo Pattern
|
|
28
31
|
//tags: app
|
|
29
32
|
//output: view result
|
|
33
|
+
//meta.role: app
|
|
30
34
|
//meta.icon: img/icons/pattern.png
|
|
31
35
|
//meta.browsePath: Peptides | Oligo Toolkit
|
|
32
36
|
export async function oligoPatternApp() : Promise<any> {
|
|
@@ -36,6 +40,7 @@ export async function oligoPatternApp() : Promise<any> {
|
|
|
36
40
|
//name: Oligo Structure
|
|
37
41
|
//tags: app
|
|
38
42
|
//output: view result
|
|
43
|
+
//meta.role: app
|
|
39
44
|
//meta.icon: img/icons/structure.png
|
|
40
45
|
//meta.browsePath: Peptides | Oligo Toolkit
|
|
41
46
|
export async function oligoStructureApp() : Promise<any> {
|
|
@@ -113,6 +118,7 @@ export async function polyToolConvertTopMenu() : Promise<void> {
|
|
|
113
118
|
//tags: editor
|
|
114
119
|
//input: funccall call
|
|
115
120
|
//output: column result
|
|
121
|
+
//meta.role: editor
|
|
116
122
|
export async function getPolyToolConvertEditor(call: DG.FuncCall) : Promise<any> {
|
|
117
123
|
return await PackageFunctions.getPolyToolConvertEditor(call);
|
|
118
124
|
}
|
|
@@ -157,6 +163,7 @@ export async function createMonomerLibraryForPolyTool(file: DG.FileInfo) : Promi
|
|
|
157
163
|
//tags: app
|
|
158
164
|
//meta.icon: img/icons/structure.png
|
|
159
165
|
//meta.browsePath: Peptides | PolyTool
|
|
166
|
+
//meta.role: app
|
|
160
167
|
export async function ptEnumeratorHelmApp() : Promise<void> {
|
|
161
168
|
await PackageFunctions.ptEnumeratorHelmApp();
|
|
162
169
|
}
|
|
@@ -165,6 +172,7 @@ export async function ptEnumeratorHelmApp() : Promise<void> {
|
|
|
165
172
|
//tags: app
|
|
166
173
|
//meta.icon: img/icons/structure.png
|
|
167
174
|
//meta.browsePath: Peptides | PolyTool
|
|
175
|
+
//meta.role: app
|
|
168
176
|
export async function ptEnumeratorChemApp() : Promise<void> {
|
|
169
177
|
await PackageFunctions.ptEnumeratorChemApp();
|
|
170
178
|
}
|
package/src/package.ts
CHANGED
|
@@ -79,7 +79,8 @@ export class PackageFunctions {
|
|
|
79
79
|
@grok.decorators.app({
|
|
80
80
|
icon: 'img/icons/toolkit.png',
|
|
81
81
|
browsePath: 'Peptides | Oligo Toolkit',
|
|
82
|
-
name: 'Oligo Toolkit'
|
|
82
|
+
name: 'Oligo Toolkit',
|
|
83
|
+
tags: ['app']
|
|
83
84
|
})
|
|
84
85
|
static async oligoToolkitApp(): Promise<DG.ViewBase> {
|
|
85
86
|
await _package.initLibData();
|
|
@@ -92,7 +93,7 @@ export class PackageFunctions {
|
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
|
|
95
|
-
@grok.decorators.init()
|
|
96
|
+
@grok.decorators.init({tags: ['init']})
|
|
96
97
|
static async init(): Promise<void> {
|
|
97
98
|
if (initSequenceTranslatorPromise === null)
|
|
98
99
|
_package.startInit(initSequenceTranslatorPromise = initSequenceTranslatorInt());
|
|
@@ -103,7 +104,8 @@ export class PackageFunctions {
|
|
|
103
104
|
@grok.decorators.app({
|
|
104
105
|
icon: 'img/icons/translator.png',
|
|
105
106
|
browsePath: 'Peptides | Oligo Toolkit',
|
|
106
|
-
name: 'Oligo Translator'
|
|
107
|
+
name: 'Oligo Translator',
|
|
108
|
+
tags: ['app']
|
|
107
109
|
})
|
|
108
110
|
static async oligoTranslatorApp(): Promise<DG.ViewBase> {
|
|
109
111
|
const view = await getSpecifiedAppView(APP_NAME.TRANSLATOR);
|
|
@@ -114,7 +116,8 @@ export class PackageFunctions {
|
|
|
114
116
|
@grok.decorators.app({
|
|
115
117
|
icon: 'img/icons/pattern.png',
|
|
116
118
|
browsePath: 'Peptides | Oligo Toolkit',
|
|
117
|
-
name: 'Oligo Pattern'
|
|
119
|
+
name: 'Oligo Pattern',
|
|
120
|
+
tags: ['app']
|
|
118
121
|
})
|
|
119
122
|
static async oligoPatternApp(): Promise<DG.ViewBase> {
|
|
120
123
|
const view = await getSpecifiedAppView(APP_NAME.PATTERN);
|
|
@@ -125,7 +128,8 @@ export class PackageFunctions {
|
|
|
125
128
|
@grok.decorators.app({
|
|
126
129
|
icon: 'img/icons/structure.png',
|
|
127
130
|
browsePath: 'Peptides | Oligo Toolkit',
|
|
128
|
-
name: 'Oligo Structure'
|
|
131
|
+
name: 'Oligo Structure',
|
|
132
|
+
tags: ['app']
|
|
129
133
|
})
|
|
130
134
|
static async oligoStructureApp(): Promise<DG.ViewBase> {
|
|
131
135
|
const view = await getSpecifiedAppView(APP_NAME.STRUCTURE);
|
|
@@ -229,7 +233,7 @@ export class PackageFunctions {
|
|
|
229
233
|
await polyToolConvertUI();
|
|
230
234
|
}
|
|
231
235
|
|
|
232
|
-
@grok.decorators.editor()
|
|
236
|
+
@grok.decorators.editor({tags: ['editor']})
|
|
233
237
|
static async getPolyToolConvertEditor(
|
|
234
238
|
call: DG.FuncCall): Promise<DG.Column<string> | null> {
|
|
235
239
|
const funcEditor = await PolyToolConvertFuncEditor.create(call);
|
|
@@ -296,10 +300,11 @@ export class PackageFunctions {
|
|
|
296
300
|
@grok.decorators.func({
|
|
297
301
|
meta: {
|
|
298
302
|
icon: 'img/icons/structure.png',
|
|
299
|
-
browsePath: 'Peptides | PolyTool'
|
|
303
|
+
browsePath: 'Peptides | PolyTool',
|
|
304
|
+
role: 'app'
|
|
300
305
|
},
|
|
301
|
-
|
|
302
|
-
|
|
306
|
+
name: 'HELM Enumerator',
|
|
307
|
+
tags: ['app']
|
|
303
308
|
})
|
|
304
309
|
static async ptEnumeratorHelmApp(): Promise<void> {
|
|
305
310
|
await polyToolEnumerateHelmUI();
|
|
@@ -309,10 +314,11 @@ export class PackageFunctions {
|
|
|
309
314
|
@grok.decorators.func({
|
|
310
315
|
meta: {
|
|
311
316
|
icon: 'img/icons/structure.png',
|
|
312
|
-
browsePath: 'Peptides | PolyTool'
|
|
317
|
+
browsePath: 'Peptides | PolyTool',
|
|
318
|
+
role: 'app'
|
|
313
319
|
},
|
|
314
|
-
|
|
315
|
-
|
|
320
|
+
name: 'Chem Enumerator',
|
|
321
|
+
tags: ['app']
|
|
316
322
|
})
|
|
317
323
|
static async ptEnumeratorChemApp(): Promise<void> {
|
|
318
324
|
polyToolEnumerateChemUI();
|
|
@@ -70,19 +70,27 @@ export function getNewMonomers(rdkit: RDModule, mLib: IMonomerLib, rule: RuleRea
|
|
|
70
70
|
for (let i = 0; i < rule.firstMonomers.length; i++) {
|
|
71
71
|
const monomer = mLib.getMonomer('PEPTIDE', rule.firstMonomers[i]);
|
|
72
72
|
|
|
73
|
-
if (monomer) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
if (monomer && monomer.molfile) {
|
|
74
|
+
try {
|
|
75
|
+
const sMolBlock = cutReactant(rdkit, monomer.molfile, rxnCutFirst, monomer.name);
|
|
76
|
+
monomers[counter] = sMolBlock;
|
|
77
|
+
monomerNames[counter] = `${monomer.symbol}_${monomerName}`;
|
|
78
|
+
} catch (e: any) {
|
|
79
|
+
console.error(e);
|
|
80
|
+
}
|
|
77
81
|
}
|
|
78
82
|
counter++;
|
|
79
83
|
}
|
|
80
84
|
for (let i = 0; i < rule.secondMonomers.length; i++) {
|
|
81
85
|
const monomer = mLib.getMonomer('PEPTIDE', rule.secondMonomers[i]);
|
|
82
|
-
if (monomer) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
if (monomer && monomer.molfile) {
|
|
87
|
+
try {
|
|
88
|
+
const sMolBlock = cutReactant(rdkit, monomer.molfile, rxnCutSecond, monomer.name);
|
|
89
|
+
monomers[counter] = sMolBlock;
|
|
90
|
+
monomerNames[counter] = `${monomer.symbol}_${monomerName}`;
|
|
91
|
+
} catch (e: any) {
|
|
92
|
+
console.error(e);
|
|
93
|
+
}
|
|
86
94
|
}
|
|
87
95
|
counter++;
|
|
88
96
|
}
|
|
@@ -19,6 +19,7 @@ import {errInfo} from '@datagrok-libraries/bio/src/utils/err-info';
|
|
|
19
19
|
import {InputColumnBase} from '@datagrok-libraries/bio/src/types/input';
|
|
20
20
|
import {SeqValueBase} from '@datagrok-libraries/bio/src/utils/macromolecule/seq-handler';
|
|
21
21
|
import {NOTATION} from '@datagrok-libraries/bio/src/utils/macromolecule';
|
|
22
|
+
import {SeqTemps} from '@datagrok-libraries/bio/src/utils/macromolecule/seq-handler';
|
|
22
23
|
|
|
23
24
|
import {PolyToolEnumeratorParams, PolyToolEnumeratorType, PolyToolEnumeratorTypes} from './types';
|
|
24
25
|
import {getLibrariesList, LIB_PATH} from './utils';
|
|
@@ -32,11 +33,13 @@ import {RuleInputs, RULES_PATH, RULES_STORAGE_NAME} from './conversion/pt-rules'
|
|
|
32
33
|
import {Chain} from './conversion/pt-chain';
|
|
33
34
|
import {polyToolConvert} from './pt-dialog';
|
|
34
35
|
|
|
35
|
-
import {_package, PackageFunctions} from '../package';
|
|
36
|
+
import {_package, applyNotationProviderForCyclized, PackageFunctions} from '../package';
|
|
36
37
|
import {buildMonomerHoverLink} from '@datagrok-libraries/bio/src/monomer-works/monomer-hover';
|
|
37
38
|
import {getRdKitModule} from '@datagrok-libraries/bio/src/chem/rdkit-module';
|
|
38
39
|
|
|
39
40
|
import {PolymerTypes} from '@datagrok-libraries/js-draw-lite/src/types/org';
|
|
41
|
+
import { CyclizedNotationProvider } from '../utils/cyclized';
|
|
42
|
+
import { INotationProvider } from '@datagrok-libraries/bio/src/utils/macromolecule/types';
|
|
40
43
|
|
|
41
44
|
type PolyToolEnumerateInputs = {
|
|
42
45
|
macromolecule: HelmInputBase;
|
|
@@ -161,9 +164,22 @@ async function getPolyToolEnumerateDialog(
|
|
|
161
164
|
const getValue = (cell?: DG.Cell): [SeqValueBase, PolyToolDataRole] => {
|
|
162
165
|
let resSeqValue: SeqValueBase;
|
|
163
166
|
let resDataRole: PolyToolDataRole;
|
|
167
|
+
let resHelm: string | null = null;
|
|
164
168
|
if (cell && cell.rowIndex >= 0 && cell?.column.semType == DG.SEMTYPE.MACROMOLECULE) {
|
|
165
169
|
const sh = seqHelper.getSeqHandler(cell.column);
|
|
166
170
|
resSeqValue = sh.getValue(cell.rowIndex);
|
|
171
|
+
// if (cell.column.temp?.[SeqTemps.notationProvider])
|
|
172
|
+
if (cell.column.temp?.[SeqTemps.notationProvider] && !(cell.column.temp[SeqTemps.notationProvider] instanceof CyclizedNotationProvider)) {
|
|
173
|
+
const notationProvider = cell.column.temp[SeqTemps.notationProvider] as INotationProvider;
|
|
174
|
+
resHelm = notationProvider.getHelm(resSeqValue.value, {});
|
|
175
|
+
// create temp helm column to apply notation provider for cyclized sequences
|
|
176
|
+
let seqCol: DG.Column;
|
|
177
|
+
DG.DataFrame.fromColumns([seqCol = DG.Column.fromList(DG.COLUMN_TYPE.STRING, 'seq', [resHelm])]);
|
|
178
|
+
seqCol.semType = DG.SEMTYPE.MACROMOLECULE;
|
|
179
|
+
seqCol.meta.units = NOTATION.HELM;
|
|
180
|
+
const sh = seqHelper.getSeqHandler(seqCol);
|
|
181
|
+
resSeqValue = sh.getValue(0);
|
|
182
|
+
}
|
|
167
183
|
resDataRole = (resSeqValue.tags[PolyToolTags.dataRole] as PolyToolDataRole.template) ?? PolyToolDataRole.macromolecule;
|
|
168
184
|
} else {
|
|
169
185
|
const seqCol = DG.Column.fromList(DG.COLUMN_TYPE.STRING, 'seq', [PT_HELM_EXAMPLE]);
|
|
@@ -200,8 +216,13 @@ async function getPolyToolEnumerateDialog(
|
|
|
200
216
|
if (aa.T === 'ATOM') {
|
|
201
217
|
try {
|
|
202
218
|
if (!seqValue.isDna() && !seqValue.isRna()) {
|
|
203
|
-
|
|
204
|
-
|
|
219
|
+
if (cell?.column?.temp?.[SeqTemps.notationProvider] instanceof CyclizedNotationProvider) {
|
|
220
|
+
const canonicalSymbol = seqValue.getSplitted().getCanonical(aa.bio!.continuousId - 1);
|
|
221
|
+
return monomerLibFuncs.getMonomer(aa.bio!.type, canonicalSymbol);
|
|
222
|
+
} else {
|
|
223
|
+
const canonicalSymbol = aa.elem;
|
|
224
|
+
return monomerLibFuncs.getMonomer(aa.bio!.type, canonicalSymbol);
|
|
225
|
+
}
|
|
205
226
|
} else {
|
|
206
227
|
const canonicalSymbol = seqValue.getSplittedWithSugarsAndPhosphates().getCanonical(aa.bio!.continuousId - 1);
|
|
207
228
|
return monomerLibFuncs.getMonomer(aa.bio!.type, canonicalSymbol);
|
|
@@ -475,7 +496,7 @@ async function getPolyToolEnumerateDialog(
|
|
|
475
496
|
const cell = grok.shell.tv.dataFrame.currentCell;
|
|
476
497
|
if (cell.column.semType !== DG.SEMTYPE.MACROMOLECULE) return;
|
|
477
498
|
|
|
478
|
-
[seqValue, dataRole] = getValue();
|
|
499
|
+
[seqValue, dataRole] = getValue(cell);
|
|
479
500
|
fillForCurrentCell(seqValue, dataRole, cell);
|
|
480
501
|
}));
|
|
481
502
|
|
|
@@ -554,9 +575,9 @@ async function getPolyToolEnumerateDialog(
|
|
|
554
575
|
const exec = async (): Promise<void> => {
|
|
555
576
|
try {
|
|
556
577
|
const srcHelm = inputs.macromolecule.stringValue;
|
|
557
|
-
const helmSelections
|
|
578
|
+
const helmSelections = wu.enumerate<HelmAtom>(inputs.macromolecule.molValue.atoms)
|
|
558
579
|
.filter(([a, aI]) => a.highlighted)
|
|
559
|
-
.map(([a, aI]) =>
|
|
580
|
+
.map(([a, aI]) => a).toArray();
|
|
560
581
|
if (inputs.enumeratorType.value === PolyToolEnumeratorTypes.Library) {
|
|
561
582
|
if (helmSelections.length === 0) {
|
|
562
583
|
grok.shell.warning('PolyTool: position for enumeration was not selected');
|
|
@@ -595,7 +616,8 @@ async function getPolyToolEnumerateDialog(
|
|
|
595
616
|
grok.shell.warning(`Monomer Library '${monLibName}' was not found`);
|
|
596
617
|
return;
|
|
597
618
|
}
|
|
598
|
-
const
|
|
619
|
+
const polymerType = helmTypeToPolymerType(helmSelections[0].biotype() ?? 'HELM_AA');
|
|
620
|
+
const peptideMonomers = monLib.getMonomerSymbolsByType(polymerType);
|
|
599
621
|
placeHoldersValue[0].monomers = peptideMonomers;
|
|
600
622
|
enumerationType = PolyToolEnumeratorTypes.Single;
|
|
601
623
|
}
|
package/src/tests/files-tests.ts
CHANGED
|
@@ -2,7 +2,7 @@ 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 {after, before, category, expect, test} from '@datagrok-libraries/
|
|
5
|
+
import {after, before, category, expect, test} from '@datagrok-libraries/test/src/test';
|
|
6
6
|
import {errInfo} from '@datagrok-libraries/bio/src/utils/err-info';
|
|
7
7
|
|
|
8
8
|
import {getHelm} from './utils';
|
|
@@ -2,7 +2,7 @@ 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 {before, category, expect, test} from '@datagrok-libraries/
|
|
5
|
+
import {before, category, expect, test} from '@datagrok-libraries/test/src/test';
|
|
6
6
|
import {DEFAULT_FORMATS} from '../apps/common/model/const';
|
|
7
7
|
import {getTranslatedSequences} from '../apps/translator/model/conversion-utils';
|
|
8
8
|
import {ITranslationHelper} from '../types';
|
|
@@ -2,7 +2,7 @@ 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 {before, category, expect, test} from '@datagrok-libraries/
|
|
5
|
+
import {before, category, expect, test} from '@datagrok-libraries/test/src/test';
|
|
6
6
|
import {getFormat, getHelm} from './utils';
|
|
7
7
|
import {ITranslationHelper} from '../types';
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@ 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 {before, category, expect, test} from '@datagrok-libraries/
|
|
5
|
+
import {before, category, expect, test} from '@datagrok-libraries/test/src/test';
|
|
6
6
|
import {getNucleotidesSequence} from '../apps/translator/model/conversion-utils';
|
|
7
7
|
import {ITranslationHelper} from '../types';
|
|
8
8
|
|
|
@@ -3,7 +3,7 @@ import * as grok from 'datagrok-api/grok';
|
|
|
3
3
|
import * as ui from 'datagrok-api/ui';
|
|
4
4
|
import * as DG from 'datagrok-api/dg';
|
|
5
5
|
|
|
6
|
-
import {before, after, category, expect, test, expectArray, testEvent, delay} from '@datagrok-libraries/
|
|
6
|
+
import {before, after, category, expect, test, expectArray, testEvent, delay} from '@datagrok-libraries/test/src/test';
|
|
7
7
|
import {Chain} from '../polytool/conversion/pt-chain';
|
|
8
8
|
import {getRules} from '../polytool/conversion/pt-rules';
|
|
9
9
|
import {getHelmHelper, IHelmHelper} from '@datagrok-libraries/bio/src/helm/helm-helper';
|
|
@@ -3,7 +3,7 @@ import * as grok from 'datagrok-api/grok';
|
|
|
3
3
|
import * as ui from 'datagrok-api/ui';
|
|
4
4
|
import * as DG from 'datagrok-api/dg';
|
|
5
5
|
|
|
6
|
-
import {before, after, category, expect, test, expectArray, testEvent, delay} from '@datagrok-libraries/
|
|
6
|
+
import {before, after, category, expect, test, expectArray, testEvent, delay} from '@datagrok-libraries/test/src/test';
|
|
7
7
|
import {Chain} from '../polytool/conversion/pt-chain';
|
|
8
8
|
import {getInnerIdx, getOuterIdx} from '../polytool/conversion/pt-misc';
|
|
9
9
|
import {getRules} from '../polytool/conversion/pt-rules';
|
|
@@ -4,7 +4,7 @@ import * as ui from 'datagrok-api/ui';
|
|
|
4
4
|
import * as DG from 'datagrok-api/dg';
|
|
5
5
|
|
|
6
6
|
import {before, after, category, expect, test, expectArray, testEvent, expectObject}
|
|
7
|
-
from '@datagrok-libraries/
|
|
7
|
+
from '@datagrok-libraries/test/src/test';
|
|
8
8
|
import {getMonomerLibHelper, IMonomerLibHelper} from '@datagrok-libraries/bio/src/types/monomer-library';
|
|
9
9
|
import {UserLibSettings} from '@datagrok-libraries/bio/src/monomer-works/types';
|
|
10
10
|
import {
|
|
@@ -2,7 +2,7 @@ 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 {category, test, expect, before} from '@datagrok-libraries/
|
|
5
|
+
import {category, test, expect, before} from '@datagrok-libraries/test/src/test';
|
|
6
6
|
import {ISeqHelper, getSeqHelper} from '@datagrok-libraries/bio/src/utils/seq-helper';
|
|
7
7
|
import {ALIGNMENT, ALPHABET, NOTATION} from '@datagrok-libraries/bio/src/utils/macromolecule';
|
|
8
8
|
import {_testNeg, _testPos, DetectorTestData, DfReaderFunc, PosCol} from './utils/detect-macromolecule-utils';
|
|
@@ -2,7 +2,7 @@ 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 {before, after, category, expect, test, expectArray} from '@datagrok-libraries/
|
|
5
|
+
import {before, after, category, expect, test, expectArray} from '@datagrok-libraries/test/src/test';
|
|
6
6
|
import {getHelmHelper, IHelmHelper} from '@datagrok-libraries/bio/src/helm/helm-helper';
|
|
7
7
|
import {getMonomerLibHelper, IMonomerLibHelper} from '@datagrok-libraries/bio/src/types/monomer-library';
|
|
8
8
|
import {UserLibSettings} from '@datagrok-libraries/bio/src/monomer-works/types';
|
|
@@ -2,7 +2,7 @@ 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 {before, after, category, expect, test, expectArray} from '@datagrok-libraries/
|
|
5
|
+
import {before, after, category, expect, test, expectArray} from '@datagrok-libraries/test/src/test';
|
|
6
6
|
import {getHelmHelper, IHelmHelper} from '@datagrok-libraries/bio/src/helm/helm-helper';
|
|
7
7
|
import {getMonomerLibHelper, IMonomerLibHelper} from '@datagrok-libraries/bio/src/types/monomer-library';
|
|
8
8
|
import {UserLibSettings} from '@datagrok-libraries/bio/src/monomer-works/types';
|
|
@@ -2,7 +2,7 @@ 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 {before, after, category, expect, test, expectArray, testEvent, delay} from '@datagrok-libraries/
|
|
5
|
+
import {before, after, category, expect, test, expectArray, testEvent, delay} from '@datagrok-libraries/test/src/test';
|
|
6
6
|
|
|
7
7
|
import {doPolyToolUnrule} from '../polytool/pt-unrule';
|
|
8
8
|
import {getRules} from '../polytool/conversion/pt-rules';
|
|
@@ -3,7 +3,7 @@ import * as grok from 'datagrok-api/grok';
|
|
|
3
3
|
import * as ui from 'datagrok-api/ui';
|
|
4
4
|
import * as DG from 'datagrok-api/dg';
|
|
5
5
|
|
|
6
|
-
import {before, after, category, expect, test, expectArray, testEvent, delay} from '@datagrok-libraries/
|
|
6
|
+
import {before, after, category, expect, test, expectArray, testEvent, delay} from '@datagrok-libraries/test/src/test';
|
|
7
7
|
import {Monomer, MonomerLibData} from '@datagrok-libraries/bio/src/types/monomer-library';
|
|
8
8
|
|
|
9
9
|
import {PolymerTypes} from '@datagrok-libraries/bio/src/helm/consts';
|
|
@@ -3,7 +3,7 @@ import * as DG from 'datagrok-api/dg';
|
|
|
3
3
|
import * as grok from 'datagrok-api/grok';
|
|
4
4
|
|
|
5
5
|
import {ALIGNMENT, NOTATION, TAGS as bioTAGS} from '@datagrok-libraries/bio/src/utils/macromolecule';
|
|
6
|
-
import {delay, expect} from '@datagrok-libraries/
|
|
6
|
+
import {delay, expect} from '@datagrok-libraries/test/src/test';
|
|
7
7
|
import {ISeqHelper} from '@datagrok-libraries/bio/src/utils/seq-helper';
|
|
8
8
|
|
|
9
9
|
export type DetectorTestData = { [testName: string]: { csv: string, neg?: string[], pos?: { [colName: string]: PosCol } } };
|