@datagrok/bio 1.7.4 → 1.7.5
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/dist/package-test.js +258 -57
- package/dist/package.js +231 -41
- package/files/samples/sample_SEPARATOR_PT.csv +101 -0
- package/package.json +3 -2
- package/src/const.ts +21 -0
- package/src/package-test.ts +1 -1
- package/src/package.ts +11 -4
- package/src/tests/{renderer-test.ts → renderers-test.ts} +25 -16
- package/src/utils/cell-renderer.ts +60 -16
- package/src/utils/convert.ts +38 -15
- package/src/utils/utils.ts +35 -0
- package/{test-Bio-34f75e5127b8-1314754e.html → test-Bio-34f75e5127b8-0507068d.html} +2 -2
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
id,sequence
|
|
2
|
+
1,M-F-I-T-M-F-C-M-F-W-L-F-I-F-I-L-M-M-L-I-F-F-M-E-A-M-I-K-P-M-L
|
|
3
|
+
2,A-Q-M-T-M-F-C-I-M-F-F-L-M-L-M-F-I-I-M-I-M-F-M-I-L-E-A-M-K-K-M-L-N-A-I
|
|
4
|
+
3,I-L-M-T-M-F-C-I-C-W-M-I-M-I-F-F-L-L-L-I-M-F-M-L-M-A-M-M-K-M-L-I-F-L
|
|
5
|
+
4,F-Q-M-T-M-I-C-M-L-F-F-L-M-M-F-M-F-D-L-I-I-L-F-I-M-M-E-A-M-M-K-P-D-L-M-F-I
|
|
6
|
+
5,L-L-M-T-M-F-C-F-F-M-M-L-L-M-F-F-M-F-M-I-M-F-M-Y-F-E-A-M-K-K-F-F-I-L-F
|
|
7
|
+
6,A-M-M-T-M-F-C-F-M-L-I-M-M-F-I-L-L-F-I-D-I-I-M-E-A-M-L-K-L-D-N-F-I
|
|
8
|
+
7,L-L-M-T-M-F-C-M-I-L-I-S-M-I-M-I-L-M-M-I-M-F-L-M-E-A-M-K-K-I-F-F-A-V
|
|
9
|
+
8,L-I-M-T-M-F-C-M-L-I-L-I-F-M-L-M-D-F-M-I-I-M-I-F-F-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-I-L-L-E-A-M-K-K-P-M-F-I-I
|
|
97
|
+
96,M-F-M-M-T-M-F-C-F-M-I-I-F-F-M-M-M-D-I-M-I-I-M-D-F-I-L-E-A-M-L-K-I-F-L-I-I-I
|
|
98
|
+
97,I-I-M-T-M-F-C-M-I-I-N-M-L-F-F-D-L-L-I-I-I-L-L-E-A-M-L-K-F-D-M-F-F
|
|
99
|
+
98,M-L-M-T-M-F-C-M-L-L-I-M-F-M-I-L-I-L-M-F-I-F-L-L-Y-D-E-A-M-K-K-M-L-M-L-I
|
|
100
|
+
99,L-F-M-T-M-F-C-M-L-I-N-S-L-I-M-I-F-F-D-I-I-I-F-L-E-A-M-F-K-F-F-L-I-L-L
|
|
101
|
+
100,F-L-M-T-M-F-C-M-M-M-F-S-M-M-M-M-F-I-I-F-M-L-L-I-E-A-M-L-K-I-F-N-A-L
|
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.
|
|
5
|
+
"version": "1.7.5",
|
|
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",
|
|
@@ -11,12 +11,13 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@biowasm/aioli": ">=2.4.0",
|
|
14
|
-
"@datagrok-libraries/bio": "2.8.
|
|
14
|
+
"@datagrok-libraries/bio": "2.8.3",
|
|
15
15
|
"@datagrok-libraries/utils": "^1.0.0",
|
|
16
16
|
"@datagrok-libraries/ml": "^2.0.10",
|
|
17
17
|
"cash-dom": "latest",
|
|
18
18
|
"datagrok-api": "^1.4.12",
|
|
19
19
|
"dayjs": "latest",
|
|
20
|
+
"rxjs": "^6.5.5",
|
|
20
21
|
"ts-loader": "^9.2.5",
|
|
21
22
|
"typescript": "^4.4.2",
|
|
22
23
|
"openchemlib": "6.0.1"
|
package/src/const.ts
CHANGED
|
@@ -2,3 +2,24 @@ import * as ui from 'datagrok-api/ui';
|
|
|
2
2
|
import * as grok from 'datagrok-api/grok';
|
|
3
3
|
import * as DG from 'datagrok-api/dg';
|
|
4
4
|
|
|
5
|
+
export const jsonSdfMonomerLibDict = {
|
|
6
|
+
"monomerType": null,
|
|
7
|
+
"smiles": null,
|
|
8
|
+
"name": "MonomerName",
|
|
9
|
+
"author": null,
|
|
10
|
+
"molfile": "molecule",
|
|
11
|
+
"naturalAnalog": "MonomerNaturalAnalogCode",
|
|
12
|
+
"rgroups": "MonomerCaps",
|
|
13
|
+
"createDate": null,
|
|
14
|
+
"id": null,
|
|
15
|
+
"polymerType": "MonomerType",
|
|
16
|
+
"symbol": "MonomerCode"
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const RGROUP_FIELD = "rgroups";
|
|
20
|
+
export const CAP_GROUP_SMILES = "capGroupSmiles";
|
|
21
|
+
export const RGROUP_ALTER_ID = "alternateId";
|
|
22
|
+
export const CAP_GROUP_NAME = "capGroupName";
|
|
23
|
+
export const RGROUP_LABEL = "label";
|
|
24
|
+
export const MONOMER_SYMBOL = "symbol";
|
|
25
|
+
export const SDF_MONOMER_NAME = "MonomerName";
|
package/src/package-test.ts
CHANGED
|
@@ -9,7 +9,7 @@ import './tests/msa-tests';
|
|
|
9
9
|
import './tests/sequence-space-test';
|
|
10
10
|
import './tests/activity-cliffs-tests';
|
|
11
11
|
import './tests/splitters-test';
|
|
12
|
-
import './tests/
|
|
12
|
+
import './tests/renderers-test';
|
|
13
13
|
import './tests/convert-test';
|
|
14
14
|
|
|
15
15
|
export const _package = new DG.Package();
|
package/src/package.ts
CHANGED
|
@@ -15,10 +15,9 @@ import {getEmbeddingColsNames, sequenceSpace} from './utils/sequence-space';
|
|
|
15
15
|
import {AvailableMetrics} from '@datagrok-libraries/ml/src/typed-metrics';
|
|
16
16
|
import {getActivityCliffs} from '@datagrok-libraries/ml/src/viewers/activity-cliffs';
|
|
17
17
|
import {sequenceGetSimilarities, drawTooltip} from './utils/sequence-activity-cliffs';
|
|
18
|
-
import {getMolfilesFromSeq, HELM_CORE_LIB_FILENAME} from './utils/utils';
|
|
18
|
+
import {createJsonMonomerLibFromSdf, getMolfilesFromSeq, HELM_CORE_LIB_FILENAME} from './utils/utils';
|
|
19
19
|
import {getMacroMol} from './utils/atomic-works';
|
|
20
20
|
import {MacromoleculeSequenceCellRenderer} from './utils/cell-renderer';
|
|
21
|
-
import {delay} from '@datagrok-libraries/utils/src/test';
|
|
22
21
|
import {convert} from './utils/convert';
|
|
23
22
|
|
|
24
23
|
//tags: init
|
|
@@ -245,7 +244,15 @@ export async function compositionAnalysis(): Promise<void> {
|
|
|
245
244
|
return;
|
|
246
245
|
}
|
|
247
246
|
|
|
248
|
-
tv.addViewer('WebLogo', {sequenceColumnName: col.name});
|
|
247
|
+
const wlViewer = tv.addViewer('WebLogo', {sequenceColumnName: col.name});
|
|
248
|
+
grok.shell.tv.dockManager.dock(wlViewer, DG.DOCK_TYPE.DOWN, null, 'Composition analysis', 0.25);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
//top-menu: Bio | Sdf to Json lib...
|
|
252
|
+
//name: sdfToJsonLib
|
|
253
|
+
//input: dataframe table
|
|
254
|
+
export async function sdfToJsonLib(table: DG.DataFrame) {
|
|
255
|
+
const jsonMonomerLibrary = createJsonMonomerLibFromSdf(table);
|
|
249
256
|
}
|
|
250
257
|
|
|
251
258
|
// helper function for importFasta
|
|
@@ -325,7 +332,7 @@ export function importFasta(fileContent: string): DG.DataFrame [] {
|
|
|
325
332
|
])];
|
|
326
333
|
}
|
|
327
334
|
|
|
328
|
-
//name: Bio | Convert
|
|
335
|
+
//name: Bio | Convert ...
|
|
329
336
|
//friendly-name: Bio | Convert
|
|
330
337
|
//tags: panel, bio
|
|
331
338
|
//input: column col {semType: Macromolecule}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {after, before, category,
|
|
1
|
+
import {after, before, category, expect, test} from '@datagrok-libraries/utils/src/test';
|
|
2
2
|
|
|
3
3
|
import * as grok from 'datagrok-api/grok';
|
|
4
|
-
import * as ui from 'datagrok-api/ui';
|
|
5
4
|
import * as DG from 'datagrok-api/dg';
|
|
6
5
|
import {importFasta, multipleSequenceAlignmentAny} from '../package';
|
|
6
|
+
import {readDataframe} from './utils';
|
|
7
|
+
import {convertDo} from '../utils/convert';
|
|
8
|
+
import {NOTATION} from '@datagrok-libraries/bio/src/utils/notation-converter';
|
|
7
9
|
|
|
8
10
|
category('renderers', () => {
|
|
9
11
|
let tvList: DG.TableView[];
|
|
@@ -23,42 +25,49 @@ category('renderers', () => {
|
|
|
23
25
|
await _testAfterMsa();
|
|
24
26
|
});
|
|
25
27
|
|
|
28
|
+
test('afterConvert', async () => {
|
|
29
|
+
await _testAfterConvert();
|
|
30
|
+
});
|
|
31
|
+
|
|
26
32
|
async function _testAfterMsa() {
|
|
27
33
|
const fastaTxt: string = await grok.dapi.files.readAsText('System:AppData/Bio/samples/sample_FASTA.fasta');
|
|
28
34
|
const df: DG.DataFrame = importFasta(fastaTxt)[0];
|
|
29
|
-
// await grok.data.detectSemanticTypes(df);
|
|
30
|
-
|
|
31
|
-
const srcSeqCol: DG.Column | null = df.col('sequence');
|
|
32
|
-
expect(srcSeqCol !== null, true);
|
|
33
|
-
console.log('Bio: tests/renderers/afterMsa, src data loaded');
|
|
34
|
-
|
|
35
35
|
const tv: DG.TableView = grok.shell.addTableView(df);
|
|
36
|
+
await grok.data.detectSemanticTypes(df);
|
|
36
37
|
console.log('Bio: tests/renderers/afterMsa, table view');
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
const srcSeqCol: DG.Column | null = df.col('sequence');
|
|
40
|
+
expect(srcSeqCol !== null, true);
|
|
40
41
|
|
|
41
42
|
console.log('Bio: tests/renderers/afterMsa, src before test ' +
|
|
42
43
|
`semType="${srcSeqCol!.semType}", units="${srcSeqCol!.getTag(DG.TAGS.UNITS)}", ` +
|
|
43
44
|
`cell.renderer="${srcSeqCol!.getTag('cell.renderer')}"`);
|
|
44
45
|
expect(srcSeqCol!.semType, DG.SEMTYPE.MACROMOLECULE);
|
|
45
46
|
expect(srcSeqCol!.getTag(DG.TAGS.UNITS), 'fasta:SEQ:PT');
|
|
46
|
-
// TODO: Find the way to check renderer for columns
|
|
47
47
|
expect(srcSeqCol!.getTag('cell.renderer'), 'Macromolecule');
|
|
48
|
-
console.log('Bio: tests/renderers/afterMsa, src semType tested');
|
|
49
48
|
|
|
50
49
|
const msaSeqCol: DG.Column | null = await multipleSequenceAlignmentAny(df, srcSeqCol!);
|
|
51
|
-
console.log('Bio: tests/renderers/afterMsa, msaSeqCol created');
|
|
52
|
-
|
|
53
50
|
tv.grid.invalidate();
|
|
54
|
-
console.log('Bio: tests/renderers/afterMsa, tv.grid invalidated');
|
|
55
51
|
|
|
56
52
|
expect(msaSeqCol!.semType, DG.SEMTYPE.MACROMOLECULE);
|
|
57
53
|
expect(msaSeqCol!.getTag(DG.TAGS.UNITS), 'fasta:SEQ.MSA:PT');
|
|
58
54
|
expect(msaSeqCol!.getTag('cell.renderer'), 'Macromolecule');
|
|
59
|
-
console.log('Bio: tests/renderers/afterMsa, msa semType tested');
|
|
60
55
|
|
|
61
56
|
dfList.push(df);
|
|
62
57
|
tvList.push(tv);
|
|
63
58
|
}
|
|
59
|
+
|
|
60
|
+
async function _testAfterConvert() {
|
|
61
|
+
const csv: string = await grok.dapi.files.readAsText('System:AppData/Bio/samples/sample_FASTA_PT.csv');
|
|
62
|
+
const df: DG.DataFrame = DG.DataFrame.fromCsv(csv);
|
|
63
|
+
const tv: DG.TableView = grok.shell.addTableView(df);
|
|
64
|
+
await grok.data.detectSemanticTypes(df);
|
|
65
|
+
|
|
66
|
+
const srcCol: DG.Column = df.col('sequence')!;
|
|
67
|
+
const tgtCol: DG.Column = await convertDo(srcCol, NOTATION.SEPARATOR, '/');
|
|
68
|
+
expect(tgtCol.getTag('cell.renderer'), 'Macromolecule');
|
|
69
|
+
|
|
70
|
+
tvList.push(tv);
|
|
71
|
+
dfList.push(df);
|
|
72
|
+
};
|
|
64
73
|
});
|
|
@@ -9,6 +9,7 @@ import * as ui from 'datagrok-api/ui';
|
|
|
9
9
|
|
|
10
10
|
const lru = new DG.LruCache<any, any>();
|
|
11
11
|
const undefinedColor = 'rgb(100,100,100)';
|
|
12
|
+
const grayColor = '#808080'
|
|
12
13
|
|
|
13
14
|
function getPalleteByType(paletteType: string): SeqPalette {
|
|
14
15
|
switch (paletteType) {
|
|
@@ -81,7 +82,7 @@ function printLeftOrCentered(
|
|
|
81
82
|
g.fillStyle = color;
|
|
82
83
|
g.globalAlpha = transparencyRate;
|
|
83
84
|
g.fillText(colorPart, x + dx1, y + dy);
|
|
84
|
-
g.fillStyle =
|
|
85
|
+
g.fillStyle = grayColor;
|
|
85
86
|
g.fillText(grayPart, x + dx2, y + dy);
|
|
86
87
|
}
|
|
87
88
|
|
|
@@ -96,6 +97,22 @@ function printLeftOrCentered(
|
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
|
|
100
|
+
function findMonomers(helmString: string) {
|
|
101
|
+
//@ts-ignore
|
|
102
|
+
const types = Object.keys(org.helm.webeditor.monomerTypeList());
|
|
103
|
+
const monomers: any = [];
|
|
104
|
+
const monomer_names: any = [];
|
|
105
|
+
for (var i = 0; i < types.length; i++) {
|
|
106
|
+
//@ts-ignore
|
|
107
|
+
monomers.push(new scil.helm.Monomers.getMonomerSet(types[i]));
|
|
108
|
+
Object.keys(monomers[i]).forEach(k => {
|
|
109
|
+
monomer_names.push(monomers[i][k].id);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
const split_string = WebLogo.splitterAsHelm(helmString);
|
|
113
|
+
return new Set(split_string.filter(val => !monomer_names.includes(val)));
|
|
114
|
+
}
|
|
115
|
+
|
|
99
116
|
export class MacromoleculeSequenceCellRenderer extends DG.GridCellRenderer {
|
|
100
117
|
get name(): string { return 'macromoleculeSequence'; }
|
|
101
118
|
|
|
@@ -125,22 +142,47 @@ export class MacromoleculeSequenceCellRenderer extends DG.GridCellRenderer {
|
|
|
125
142
|
const cell = gridCell.cell;
|
|
126
143
|
const tag = gridCell.cell.column.getTag(DG.TAGS.UNITS);
|
|
127
144
|
if (tag === 'HELM') {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
const formula = canvas.getFormula(true);
|
|
135
|
-
if (!formula) {
|
|
136
|
-
gridCell.element = ui.divText(gridCell.cell.value, {style: {color: 'red'}});
|
|
137
|
-
} else {
|
|
145
|
+
console.log(findMonomers(cell.value));
|
|
146
|
+
const monomers = findMonomers(cell.value);
|
|
147
|
+
if (monomers.size == 0) {
|
|
148
|
+
const host = ui.div([], {style: {width: `${w}px`, height: `${h}px`}});
|
|
149
|
+
host.setAttribute('dataformat', 'helm');
|
|
150
|
+
host.setAttribute('data', gridCell.cell.value);
|
|
138
151
|
gridCell.element = host;
|
|
139
|
-
|
|
140
|
-
const
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
152
|
+
//@ts-ignore
|
|
153
|
+
const canvas = new JSDraw2.Editor(host, {width: w, height: h, skin: 'w8', viewonly: true});
|
|
154
|
+
const formula = canvas.getFormula(true);
|
|
155
|
+
if (!formula) {
|
|
156
|
+
gridCell.element = ui.divText(gridCell.cell.value, {style: {color: 'red'}});
|
|
157
|
+
}
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
if (monomers.size > 0) {
|
|
161
|
+
w = grid ? Math.min(grid.canvas.width - x, w) : g.canvas.width - x;
|
|
162
|
+
g.save();
|
|
163
|
+
g.beginPath();
|
|
164
|
+
g.rect(x, y, w, h);
|
|
165
|
+
g.clip();
|
|
166
|
+
g.font = '12px monospace';
|
|
167
|
+
g.textBaseline = 'top';
|
|
168
|
+
let x1 = x;
|
|
169
|
+
const s: string = cell.value ?? '';
|
|
170
|
+
let subParts: string[] = WebLogo.splitterAsHelm(s);
|
|
171
|
+
let color = undefinedColor;
|
|
172
|
+
subParts.forEach((amino, index) => {
|
|
173
|
+
if (monomers.has(amino)) {
|
|
174
|
+
color = 'red';
|
|
175
|
+
} else {
|
|
176
|
+
color = grayColor;
|
|
177
|
+
}
|
|
178
|
+
g.fillStyle = undefinedColor;
|
|
179
|
+
let last = false;
|
|
180
|
+
if (index === subParts.length - 1)
|
|
181
|
+
last = true;
|
|
182
|
+
x1 = printLeftOrCentered(x1, y, w, h, g, amino, color, 0, true, 1.0, '/', last);
|
|
183
|
+
});
|
|
184
|
+
g.restore();
|
|
185
|
+
return;
|
|
144
186
|
}
|
|
145
187
|
} else {
|
|
146
188
|
const [type, subtype, paletteType] = gridCell.cell.column.getTag(DG.TAGS.UNITS).split(':');
|
|
@@ -176,6 +218,8 @@ export class MacromoleculeSequenceCellRenderer extends DG.GridCellRenderer {
|
|
|
176
218
|
});
|
|
177
219
|
|
|
178
220
|
g.restore();
|
|
221
|
+
return;
|
|
222
|
+
|
|
179
223
|
}
|
|
180
224
|
}
|
|
181
225
|
}
|
package/src/utils/convert.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import * as DG from 'datagrok-api/dg';
|
|
2
2
|
import * as ui from 'datagrok-api/ui';
|
|
3
|
+
import * as grok from 'datagrok-api/grok';
|
|
4
|
+
|
|
5
|
+
import {Subscription} from 'rxjs';
|
|
3
6
|
import {NotationConverter, NOTATION} from '@datagrok-libraries/bio/src/utils/notation-converter';
|
|
4
7
|
|
|
8
|
+
|
|
9
|
+
let convertDialog: DG.Dialog | null = null;
|
|
10
|
+
let convertDialogSubs: Subscription[] = [];
|
|
11
|
+
|
|
5
12
|
/**
|
|
6
13
|
* Converts notations of a Macromolecule column
|
|
7
14
|
*
|
|
@@ -22,19 +29,35 @@ export function convert(col: DG.Column): void {
|
|
|
22
29
|
|
|
23
30
|
const separatorInput = ui.choiceInput('Choose separator', separatorArray[0], separatorArray);
|
|
24
31
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
ui.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
if (convertDialog == null) {
|
|
33
|
+
convertDialog = ui.dialog('Convert sequence notation')
|
|
34
|
+
.add(ui.div([
|
|
35
|
+
ui.h1('Current notation: ' + current),
|
|
36
|
+
targetNotationInput.root,
|
|
37
|
+
// TODO: conditional separator input
|
|
38
|
+
separatorInput.root
|
|
39
|
+
]))
|
|
40
|
+
.onOK(async () => {
|
|
41
|
+
const targetNotation = targetNotationInput.value as NOTATION;
|
|
42
|
+
const separator: string | null = separatorInput.value;
|
|
43
|
+
|
|
44
|
+
await convertDo(col, targetNotation, separator);
|
|
45
|
+
})
|
|
46
|
+
.show();
|
|
47
|
+
|
|
48
|
+
convertDialogSubs.push(convertDialog.onClose.subscribe((value) => {
|
|
49
|
+
convertDialogSubs.forEach((s) => {s.unsubscribe(); });
|
|
50
|
+
convertDialogSubs = [];
|
|
51
|
+
convertDialog = null;
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export async function convertDo(srcCol: DG.Column, targetNotation: NOTATION, separator: string | null): Promise<DG.Column> {
|
|
57
|
+
const converter = new NotationConverter(srcCol);
|
|
58
|
+
const newColumn = converter.convert(targetNotation, separator);
|
|
59
|
+
srcCol.dataFrame.columns.add(newColumn);
|
|
60
|
+
await grok.data.detectSemanticTypes(srcCol.dataFrame);
|
|
61
|
+
return newColumn;
|
|
40
62
|
}
|
|
63
|
+
|
package/src/utils/utils.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as DG from 'datagrok-api/dg';
|
|
2
2
|
import {WebLogo, SplitterFunc} from '@datagrok-libraries/bio/src/viewers/web-logo';
|
|
3
3
|
import * as grok from 'datagrok-api/grok';
|
|
4
|
+
import { CAP_GROUP_NAME, CAP_GROUP_SMILES, jsonSdfMonomerLibDict, MONOMER_SYMBOL, RGROUP_ALTER_ID, RGROUP_FIELD, RGROUP_LABEL, SDF_MONOMER_NAME } from '../const';
|
|
4
5
|
|
|
5
6
|
export const HELM_CORE_LIB_FILENAME = '/samples/HELMCoreLibrary.json';
|
|
6
7
|
export const HELM_CORE_LIB_MONOMER_SYMBOL = 'symbol';
|
|
@@ -43,3 +44,37 @@ export function createMomomersMolDict(lib: any[]): { [key: string]: string | any
|
|
|
43
44
|
});
|
|
44
45
|
return dict;
|
|
45
46
|
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
export function createJsonMonomerLibFromSdf(table: DG.DataFrame): any {
|
|
50
|
+
const resultLib = [];
|
|
51
|
+
for (let i = 0; i < table.rowCount; i++) {
|
|
52
|
+
const monomer: { [key: string]: string | any } = {};
|
|
53
|
+
Object.keys(jsonSdfMonomerLibDict).forEach(key => {
|
|
54
|
+
if (key === MONOMER_SYMBOL) {
|
|
55
|
+
const monomerSymbol = table.get(jsonSdfMonomerLibDict[key], i);
|
|
56
|
+
monomer[key] = monomerSymbol === '.' ? table.get(SDF_MONOMER_NAME, i) : monomerSymbol;
|
|
57
|
+
} else if (key === RGROUP_FIELD) {
|
|
58
|
+
const rgroups = table.get(jsonSdfMonomerLibDict[key], i).split('\n');
|
|
59
|
+
const jsonRgroups: any[] = [];
|
|
60
|
+
rgroups.forEach((g: string) => {
|
|
61
|
+
const rgroup: { [key: string]: string | any } = {};
|
|
62
|
+
const altAtom = g.substring(g.lastIndexOf("]") + 1);
|
|
63
|
+
let radicalNum = g.match(/\[R(\d+)\]/)![1];
|
|
64
|
+
rgroup[CAP_GROUP_SMILES] = altAtom === 'H' ? `[*:${radicalNum}][H]` : `O[*:${radicalNum}]`;
|
|
65
|
+
rgroup[RGROUP_ALTER_ID] = altAtom === 'H' ? `R${radicalNum}-H` : `R${radicalNum}-OH`;
|
|
66
|
+
rgroup[CAP_GROUP_NAME] = altAtom === 'H' ? `H` : `OH`;
|
|
67
|
+
rgroup[RGROUP_LABEL] = `R${radicalNum}`;
|
|
68
|
+
jsonRgroups.push(rgroup);
|
|
69
|
+
})
|
|
70
|
+
monomer[key] = jsonRgroups;
|
|
71
|
+
} else {
|
|
72
|
+
if((jsonSdfMonomerLibDict as { [key: string]: string | any })[key]) {
|
|
73
|
+
monomer[key] = table.get((jsonSdfMonomerLibDict as { [key: string]: string | any })[key], i);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
})
|
|
77
|
+
resultLib.push(monomer);
|
|
78
|
+
}
|
|
79
|
+
return resultLib;
|
|
80
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<html><head><meta charset="utf-8"/><title>Bio Test Report. Datagrok version datagrok/datagrok:latest SHA=34f75e5127b8. Commit
|
|
1
|
+
<html><head><meta charset="utf-8"/><title>Bio Test Report. Datagrok version datagrok/datagrok:latest SHA=34f75e5127b8. Commit 0507068d.</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
|
|
232
|
+
</style></head><body><div id="jesthtml-content"><header><h1 id="title">Bio Test Report. Datagrok version datagrok/datagrok:latest SHA=34f75e5127b8. Commit 0507068d.</h1></header><div id="metadata-container"><div id="timestamp">Started: 2022-07-14 14:09:37</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">110.386s</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">100.001s</div></div><div class="failureMessages"> <pre class="failureMsg">Error: thrown: "Exceeded timeout of 100000 ms for a test.
|
|
233
233
|
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
|
|
234
234
|
at Object.<anonymous> (/home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:22:1)
|
|
235
235
|
at Runtime._execModule (/home/runner/work/public/public/packages/Bio/node_modules/jest-runtime/build/index.js:1646:24)
|