@datagrok/bio 1.5.9 → 1.7.0
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/detectors.js +17 -5
- package/dist/package-test.js +616 -496
- package/dist/package.js +404 -473
- package/files/samples/sample_FASTA.csv +0 -1
- package/files/samples/sample_FASTA.fasta +0 -3
- package/files/samples/sample_FASTA_DNA.csv +101 -0
- package/files/samples/sample_FASTA_PT.csv +101 -0
- package/files/samples/sample_FASTA_RNA.csv +101 -0
- package/files/samples/testSmiles2.csv +12248 -0
- package/package.json +2 -2
- package/scripts/generate_fasta_csv_for_alphabets.R +70 -0
- package/src/package-test.ts +1 -0
- package/src/package.ts +105 -20
- package/src/tests/convert-test.ts +8 -8
- package/src/tests/detectors-test.ts +15 -3
- package/src/tests/renderer-test.ts +40 -18
- package/src/utils/cell-renderer.ts +47 -75
- package/src/utils/convert.ts +10 -14
- package/src/utils/multiple-sequence-alignment.ts +4 -2
- package/src/utils/notation-converter.ts +215 -55
- package/{test-Bio-34f75e5127b8-b47d4664.html → test-Bio-34f75e5127b8-7af21e5d.html} +17 -21
- package/src/utils/chem-palette.ts +0 -280
- package/src/utils/misc.ts +0 -29
|
@@ -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 7af21e5d.</title><style type="text/css">html,
|
|
2
2
|
body {
|
|
3
3
|
font-family: Arial, Helvetica, sans-serif;
|
|
4
4
|
font-size: 1rem;
|
|
@@ -229,14 +229,21 @@ 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
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
at /home/runner/work/public/public/packages/Bio/
|
|
237
|
-
at
|
|
238
|
-
at
|
|
239
|
-
at
|
|
232
|
+
</style></head><body><div id="jesthtml-content"><header><h1 id="title">Bio Test Report. Datagrok version datagrok/datagrok:latest SHA=34f75e5127b8. Commit 7af21e5d.</h1></header><div id="metadata-container"><div id="timestamp">Started: 2022-07-12 16:48:34</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">113.338s</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.002s</div></div><div class="failureMessages"> <pre class="failureMsg">Error: thrown: "Exceeded timeout of 100000 ms for a test.
|
|
233
|
+
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
|
|
234
|
+
at Object.<anonymous> (/home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:22:1)
|
|
235
|
+
at Runtime._execModule (/home/runner/work/public/public/packages/Bio/node_modules/jest-runtime/build/index.js:1646:24)
|
|
236
|
+
at Runtime._loadModule (/home/runner/work/public/public/packages/Bio/node_modules/jest-runtime/build/index.js:1185:12)
|
|
237
|
+
at Runtime.requireModule (/home/runner/work/public/public/packages/Bio/node_modules/jest-runtime/build/index.js:1009:12)
|
|
238
|
+
at jestAdapter (/home/runner/work/public/public/packages/Bio/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:13)
|
|
239
|
+
at runTestInternal (/home/runner/work/public/public/packages/Bio/node_modules/jest-runner/build/runTest.js:389:16)
|
|
240
|
+
at runTest (/home/runner/work/public/public/packages/Bio/node_modules/jest-runner/build/runTest.js:475:34)
|
|
241
|
+
at TestRunner.runTests (/home/runner/work/public/public/packages/Bio/node_modules/jest-runner/build/index.js:101:12)
|
|
242
|
+
at TestScheduler.scheduleTests (/home/runner/work/public/public/packages/Bio/node_modules/@jest/core/build/TestScheduler.js:333:13)
|
|
243
|
+
at runJest (/home/runner/work/public/public/packages/Bio/node_modules/@jest/core/build/runJest.js:404:19)
|
|
244
|
+
at _run10000 (/home/runner/work/public/public/packages/Bio/node_modules/@jest/core/build/cli/index.js:320:7)
|
|
245
|
+
at runCLI (/home/runner/work/public/public/packages/Bio/node_modules/@jest/core/build/cli/index.js:173:3)
|
|
246
|
+
at Object.run (/home/runner/work/public/public/packages/Bio/node_modules/jest-cli/build/cli/index.js:155:37)</pre></div></div></div><div class="suite-consolelog"><div class="suite-consolelog-header">Console Log</div><div class="suite-consolelog-item"><pre class="suite-consolelog-item-origin"> at Object.<anonymous> (/home/runner/work/public/public/packages/Bio/src/__jest__/test-node.ts:63:11)
|
|
240
247
|
at Generator.next (<anonymous>)
|
|
241
248
|
at fulfilled (/home/runner/work/public/public/packages/Bio/src/__jest__/test-node.ts:28:58)
|
|
242
249
|
at processTicksAndRejections (internal/process/task_queues.js:97:5)</pre><pre class="suite-consolelog-item-message">Using web root: http://localhost:8080</pre></div><div class="suite-consolelog-item"><pre class="suite-consolelog-item-origin"> at /home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:24:11
|
|
@@ -246,15 +253,4 @@ Received: true
|
|
|
246
253
|
at Object.<anonymous>.__awaiter (/home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:30:12)
|
|
247
254
|
at Object.<anonymous> (/home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:22:23)
|
|
248
255
|
at Promise.then.completed (/home/runner/work/public/public/packages/Bio/node_modules/jest-circus/build/utils.js:391:28)
|
|
249
|
-
at new Promise (<anonymous>)</pre><pre class="suite-consolelog-item-message">Testing Bio package</pre></div
|
|
250
|
-
at Generator.next (<anonymous>)
|
|
251
|
-
at fulfilled (/home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:31:58)
|
|
252
|
-
at processTicksAndRejections (internal/process/task_queues.js:97:5)</pre><pre class="suite-consolelog-item-message">detectors.samplesIdCsvNegativeID: Operation caused an exception (FileSystemException: Cannot open file, path = '/home/grok/data/prod/packages/data/Bio/samples/id.csv' (OS Error: No such file or directory, errno = 2))
|
|
253
|
-
MSA.is_correct: TypeError: Cannot read properties of undefined (reading 'split')
|
|
254
|
-
sequenceSpace.sequenceSpaceOpens: TypeError: Cannot read properties of undefined (reading 'col')
|
|
255
|
-
sequenceSpace.init: Operation caused an exception (FileSystemException: Cannot open file, path = '/home/grok/data/prod/packages/data/Bio/sample_FASTA.csv' (OS Error: No such file or directory, errno = 2))
|
|
256
|
-
activityCliffs.activityCliffsOpen: TypeError: Cannot read properties of undefined (reading 'columns')
|
|
257
|
-
activityCliffs.init: TypeError: Cannot read properties of undefined (reading 'close')
|
|
258
|
-
activityCliffs.init: Operation caused an exception (FileSystemException: Cannot open file, path = '/home/grok/data/prod/packages/data/Bio/sample_MSA.csv' (OS Error: No such file or directory, errno = 2))
|
|
259
|
-
renderers.afterMsa: Error: Expected "Macromolecule", got "null"
|
|
260
|
-
</pre></div></div></div></div></body></html>
|
|
256
|
+
at new Promise (<anonymous>)</pre><pre class="suite-consolelog-item-message">Testing Bio package</pre></div></div></div></div></body></html>
|
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
import * as grok from 'datagrok-api/grok';
|
|
2
|
-
import * as ui from 'datagrok-api/ui';
|
|
3
|
-
import * as DG from 'datagrok-api/dg';
|
|
4
|
-
|
|
5
|
-
import {StringDictionary} from '@datagrok-libraries/utils/src/type-declarations';
|
|
6
|
-
import {MonomerLibrary} from '../monomer-library';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export class ChemPalette {
|
|
10
|
-
cp: StringDictionary = {};
|
|
11
|
-
isInit: boolean = false;
|
|
12
|
-
monomerLib: MonomerLibrary | null = null;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Creates an instance of ChemPalette.
|
|
16
|
-
*
|
|
17
|
-
* @param {string} scheme Color scheme to use.
|
|
18
|
-
* @param {boolean} [grouping=false] Is grouping enabled.
|
|
19
|
-
* @memberof ChemPalette
|
|
20
|
-
*/
|
|
21
|
-
private constructor(scheme: string, grouping = false) {
|
|
22
|
-
if (scheme == 'grok')
|
|
23
|
-
this.cp = ChemPalette.getDatagrok(grouping);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Renders 2D representation of a amino acid residue in a tooltip.
|
|
28
|
-
*
|
|
29
|
-
* @param {DG.GridCell} cell Grid cell to show tooltip over.
|
|
30
|
-
* @param {number} x x coordinate of the mouse pointer.
|
|
31
|
-
* @param {number} y y coordinate of the mouse pointer.
|
|
32
|
-
* @param {MonomerLibrary} monomerLib Monomer Library instance
|
|
33
|
-
*/
|
|
34
|
-
static showTooltip(cell: DG.GridCell, x: number, y: number, monomerLib: MonomerLibrary): void {
|
|
35
|
-
const s = cell.cell.value as string;
|
|
36
|
-
let toDisplay = [ui.divText(s)];
|
|
37
|
-
const [, aarOuter, aarInner] = ChemPalette.getColorAAPivot(s);
|
|
38
|
-
for (const aar of [aarOuter, aarInner]) {
|
|
39
|
-
if (monomerLib.monomerNames.includes(aar)) {
|
|
40
|
-
if (aar in ChemPalette.AANames)
|
|
41
|
-
toDisplay = [ui.divText(ChemPalette.AANames[aar])];
|
|
42
|
-
|
|
43
|
-
if (aar in ChemPalette.AAFullNames)
|
|
44
|
-
toDisplay = [ui.divText(ChemPalette.AANames[ChemPalette.AAFullNames[aar]])];
|
|
45
|
-
|
|
46
|
-
const options = {
|
|
47
|
-
autoCrop: true,
|
|
48
|
-
autoCropMargin: 0,
|
|
49
|
-
suppressChiralText: true,
|
|
50
|
-
};
|
|
51
|
-
const sketch = grok.chem.svgMol(monomerLib.getMonomerMol(aar), undefined, undefined, options);
|
|
52
|
-
if (toDisplay.length == 2)
|
|
53
|
-
toDisplay.push(ui.divText('Modified'));
|
|
54
|
-
|
|
55
|
-
toDisplay.push(sketch);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
ui.tooltip.show(ui.divV(toDisplay), x, y);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Retursn divided amino with its content in the bracket, if the conetent is number, then its omitted
|
|
63
|
-
*
|
|
64
|
-
* @param {string} c raw amino
|
|
65
|
-
* @return {[string, string]} outer and inner content
|
|
66
|
-
*/
|
|
67
|
-
static getInnerOuter(c: string): [string, string] {
|
|
68
|
-
let isInner = 0;
|
|
69
|
-
let inner = '';
|
|
70
|
-
let outer = '';
|
|
71
|
-
|
|
72
|
-
for (const char of c) {
|
|
73
|
-
if (char == '(')
|
|
74
|
-
isInner++;
|
|
75
|
-
else if (char == ')')
|
|
76
|
-
isInner--;
|
|
77
|
-
else if (isInner)
|
|
78
|
-
inner += char;
|
|
79
|
-
else
|
|
80
|
-
outer += char;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return !isNaN(parseInt(inner)) ? [outer, ''] : [outer, inner];
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
static getColorAAPivot(monomer: string = '', scheme: 'grok' = 'grok'): [string, string, string, number] {
|
|
87
|
-
const chemPaletteInstance = ChemPalette.getPalette(scheme);
|
|
88
|
-
let [outerMonomer, innerMonomer] = ChemPalette.getInnerOuter(monomer);
|
|
89
|
-
outerMonomer = (outerMonomer.length > 6 ? `${outerMonomer.slice(0, 3)}...` : outerMonomer);
|
|
90
|
-
innerMonomer = (innerMonomer.length > 6 ? `${innerMonomer.slice(0, 3)}...` : innerMonomer);
|
|
91
|
-
|
|
92
|
-
if (monomer.length == 1 || monomer[1] == '(') {
|
|
93
|
-
const amino = monomer[0]?.toUpperCase()!;
|
|
94
|
-
return amino in chemPaletteInstance ?
|
|
95
|
-
[chemPaletteInstance[amino], amino, innerMonomer, 1]:
|
|
96
|
-
[ChemPalette.undefinedColor, outerMonomer, innerMonomer, 1];
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (monomer[0] == 'd' && monomer[1]! in chemPaletteInstance) {
|
|
100
|
-
if (monomer.length == 2 || monomer[2] == '(') {
|
|
101
|
-
const amino = monomer[1]?.toUpperCase()!;
|
|
102
|
-
return amino in chemPaletteInstance ?
|
|
103
|
-
[chemPaletteInstance[amino], amino, innerMonomer, 2]:
|
|
104
|
-
[ChemPalette.undefinedColor, outerMonomer, innerMonomer, 2];
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (monomer.substring(0, 3) in ChemPalette.AAFullNames) {
|
|
109
|
-
if (monomer.length == 3 || monomer[3] == '(') {
|
|
110
|
-
const amino = ChemPalette.AAFullNames[monomer.substring(0, 3)];
|
|
111
|
-
return amino in chemPaletteInstance ?
|
|
112
|
-
[chemPaletteInstance[amino], amino, innerMonomer, 3]:
|
|
113
|
-
[ChemPalette.undefinedColor, outerMonomer, innerMonomer, 3];
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (monomer[0]?.toLowerCase() == monomer[0]) {
|
|
118
|
-
if (monomer.substring(1, 3) in ChemPalette.AAFullNames) {
|
|
119
|
-
if (monomer.length == 4 || monomer[4] == '(') {
|
|
120
|
-
const amino = ChemPalette.AAFullNames[monomer.substring(1, 3)];
|
|
121
|
-
return amino in chemPaletteInstance ?
|
|
122
|
-
[chemPaletteInstance[amino], amino, innerMonomer, 4]:
|
|
123
|
-
[ChemPalette.undefinedColor, outerMonomer, innerMonomer, 4];
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return [ChemPalette.undefinedColor, outerMonomer, innerMonomer, 0];
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
static colourPalette: {[key: string]: string[]} = {
|
|
132
|
-
'orange': ['rgb(255,187,120)', 'rgb(245,167,100)', 'rgb(235,137,70)', 'rgb(205, 111, 71)'],
|
|
133
|
-
'all_green': ['rgb(44,160,44)', 'rgb(74,160,74)', 'rgb(23,103,57)', 'rgb(30,110,96)', 'rgb(60,131,95)',
|
|
134
|
-
'rgb(24,110,79)', 'rgb(152,223,138)', 'rgb(182, 223, 138)', 'rgb(152, 193, 138)'],
|
|
135
|
-
'all_blue': ['rgb(31,119,180)', 'rgb(23,190,207)', 'rgb(122, 102, 189)', 'rgb(158,218,229)', 'rgb(141, 124, 217)',
|
|
136
|
-
'rgb(31, 120, 150)'],
|
|
137
|
-
'magenta': ['rgb(162,106,192)', 'rgb(197,165,224)', 'rgb(208,113,218)'],
|
|
138
|
-
'red': ['rgb(214,39,40)', 'rgb(255,152,150)'],
|
|
139
|
-
'st_blue': ['rgb(23,190,207)', 'rgb(158,218,229)', 'rgb(31,119,180)'],
|
|
140
|
-
'dark_blue': ['rgb(31,119,180)', 'rgb(31, 120, 150)'],
|
|
141
|
-
'light_blue': ['rgb(23,190,207)', 'rgb(158,218,229)', 'rgb(108, 218, 229)', 'rgb(23,190,227)'],
|
|
142
|
-
'lilac_blue': ['rgb(124,102,211)', 'rgb(149,134,217)', 'rgb(97, 81, 150)'],
|
|
143
|
-
'dark_green': ['rgb(23,103,57)', 'rgb(30,110,96)', 'rgb(60,131,95)', 'rgb(24,110,79)'],
|
|
144
|
-
'green': ['rgb(44,160,44)', 'rgb(74,160,74)'],
|
|
145
|
-
'light_green': ['rgb(152,223,138)', 'rgb(182, 223, 138)', 'rgb(152, 193, 138)'],
|
|
146
|
-
'st_green': ['rgb(44,160,44)', 'rgb(152,223,138)', 'rgb(39, 174, 96)', 'rgb(74,160,74)'],
|
|
147
|
-
'pink': ['rgb(247,182,210)'],
|
|
148
|
-
'brown': ['rgb(140,86,75)', 'rgb(102, 62, 54)'],
|
|
149
|
-
'gray': ['rgb(127,127,127)', 'rgb(199,199,199)', 'rgb(196,156,148)', 'rgb(222, 222, 180)'],
|
|
150
|
-
'yellow': ['rgb(188,189,34)'],
|
|
151
|
-
'white': ['rgb(230,230,230)'],
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
static grokGroups: {[key: string]: string[]} = {
|
|
155
|
-
'yellow': ['C', 'U'],
|
|
156
|
-
'red': ['G', 'P'],
|
|
157
|
-
'all_green': ['A', 'V', 'I', 'L', 'M', 'F', 'Y', 'W'],
|
|
158
|
-
'light_blue': ['R', 'H', 'K'],
|
|
159
|
-
'dark_blue': ['D', 'E'],
|
|
160
|
-
'orange': ['S', 'T', 'N', 'Q'],
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
static undefinedColor = 'rgb(100,100,100)';
|
|
164
|
-
|
|
165
|
-
static makePalette(dt: {[key: string]: string[]}, simplified = false, grouping = false): StringDictionary {
|
|
166
|
-
const palette: { [key: string]: string } = {};
|
|
167
|
-
const groups = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
168
|
-
let currentGroup = 0;
|
|
169
|
-
for (const [color, monomers] of Object.entries(dt)) {
|
|
170
|
-
monomers.forEach((monomer, index) => {
|
|
171
|
-
palette[grouping ? groups[currentGroup] : monomer] = ChemPalette.colourPalette[color][simplified ? 0 : index];
|
|
172
|
-
});
|
|
173
|
-
currentGroup++;
|
|
174
|
-
}
|
|
175
|
-
return palette;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
static AANames: StringDictionary = {
|
|
179
|
-
'G': 'Glycine',
|
|
180
|
-
'L': 'Leucine',
|
|
181
|
-
'Y': 'Tyrosine',
|
|
182
|
-
'S': 'Serine',
|
|
183
|
-
'E': 'Glutamic acid',
|
|
184
|
-
'Q': 'Glutamine',
|
|
185
|
-
'D': 'Aspartic acid',
|
|
186
|
-
'N': 'Asparagine',
|
|
187
|
-
'F': 'Phenylalanine',
|
|
188
|
-
'A': 'Alanine',
|
|
189
|
-
'K': 'Lysine',
|
|
190
|
-
'R': 'Arginine',
|
|
191
|
-
'H': 'Histidine',
|
|
192
|
-
'C': 'Cysteine',
|
|
193
|
-
'V': 'Valine',
|
|
194
|
-
'P': 'Proline',
|
|
195
|
-
'W': 'Tryptophan',
|
|
196
|
-
'I': 'Isoleucine',
|
|
197
|
-
'M': 'Methionine',
|
|
198
|
-
'T': 'Threonine',
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
static AASmiles: StringDictionary = {
|
|
202
|
-
'G': 'NCC(=O)O',
|
|
203
|
-
'L': 'N[C@H](CC(C)C)C(=O)O',
|
|
204
|
-
'Y': 'NC(CC1=CC=C(O)C=C1)C(=O)O',
|
|
205
|
-
'S': 'NC(CO)C(=O)O',
|
|
206
|
-
'E': 'N[C@@H](CCC(O)=O)C(=O)O',
|
|
207
|
-
'Q': 'N[C@@H](CCC(N)=O)C(=O)O',
|
|
208
|
-
'D': 'N[C@@H](CC(O)=O)C(=O)O',
|
|
209
|
-
'N': 'N[C@@H](CC(N)=O)C(=O)O',
|
|
210
|
-
'F': 'NC(CC1=CC=CC=C1)C(=O)O',
|
|
211
|
-
'A': 'N[C@H](C)C(=O)O',
|
|
212
|
-
'K': 'NC(CCCCN)C(=O)O',
|
|
213
|
-
'R': 'N[C@H](CCCNC(=N)C)C(=O)O',
|
|
214
|
-
'H': 'NC(CC1=CN=C[N]1)C(=O)O',
|
|
215
|
-
'C': 'N[C@@H](CS)C(=O)O',
|
|
216
|
-
'V': 'NC(C(C)C)C(=O)O',
|
|
217
|
-
'P': 'N(CCC1)C1C(=O)O',
|
|
218
|
-
'W': 'N[C@@H](Cc1c2ccccc2n([H])c1)C(=O)O',
|
|
219
|
-
'I': 'N[C@H]([C@H](C)CC)C(=O)O',
|
|
220
|
-
'M': 'NC(CCSC)C(=O)O',
|
|
221
|
-
'T': 'NC(C(O)C)C(=O)O',
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
static AASmilesTruncated: StringDictionary = {
|
|
225
|
-
'G': '*C*',
|
|
226
|
-
'L': 'CC(C)C[C@H](*)*',
|
|
227
|
-
'Y': 'C1=CC(=CC=C1CC(*)*)O',
|
|
228
|
-
'S': 'OCC(*)C*',
|
|
229
|
-
'E': '*[C@@H](CCC(O)=O)*',
|
|
230
|
-
'Q': '*N[C@@H](CCC(N)=O)*',
|
|
231
|
-
'D': '*[C@@H](CC(O)=O)*',
|
|
232
|
-
'N': '*[C@@H](CC(N)=O)*',
|
|
233
|
-
'F': 'C1=CC=C(C=C1)CC(*)*',
|
|
234
|
-
'A': 'C[C@H](*)*',
|
|
235
|
-
'K': 'C(CCN)CC(*)*',
|
|
236
|
-
'R': '*[C@H](CCCNC(=N)C)*',
|
|
237
|
-
'H': 'C1=C(NC=N1)CC(*)*',
|
|
238
|
-
'C': 'C([C@@H](*)*)S',
|
|
239
|
-
'V': 'CC(C)C(*)*',
|
|
240
|
-
'P': 'C1CCN(*)C1*',
|
|
241
|
-
'W': '*[C@@H](Cc1c2ccccc2n([H])c1)*',
|
|
242
|
-
'I': 'CC[C@H](C)[C@H](*)*',
|
|
243
|
-
'M': 'CSCCC(*)*',
|
|
244
|
-
'T': 'CC(O)C(*)*',
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
static AAFullNames: StringDictionary = {
|
|
248
|
-
'Ala': 'A',
|
|
249
|
-
'Arg': 'R',
|
|
250
|
-
'Asn': 'N',
|
|
251
|
-
'Asp': 'D',
|
|
252
|
-
'Cys': 'C',
|
|
253
|
-
'Gln': 'Q',
|
|
254
|
-
'Glu': 'E',
|
|
255
|
-
'Gly': 'G',
|
|
256
|
-
'His': 'H',
|
|
257
|
-
'Ile': 'I',
|
|
258
|
-
'Leu': 'L',
|
|
259
|
-
'Lys': 'K',
|
|
260
|
-
'Met': 'M',
|
|
261
|
-
'Phe': 'F',
|
|
262
|
-
'Pro': 'P',
|
|
263
|
-
'Ser': 'S',
|
|
264
|
-
'Thr': 'T',
|
|
265
|
-
'Trp': 'W',
|
|
266
|
-
'Tyr': 'Y',
|
|
267
|
-
'Val': 'V',
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
static getDatagrok(grouping = false): StringDictionary {
|
|
271
|
-
return ChemPalette.makePalette(ChemPalette.grokGroups, false, grouping);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
static getPalette(scheme: 'grok'): StringDictionary {
|
|
275
|
-
if (scheme == 'grok')
|
|
276
|
-
return ChemPalette.getDatagrok();
|
|
277
|
-
else
|
|
278
|
-
throw new Error(`ChemPalette: scheme \`${scheme}\` does not exist`);
|
|
279
|
-
}
|
|
280
|
-
}
|
package/src/utils/misc.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as DG from 'datagrok-api/dg';
|
|
2
|
-
|
|
3
|
-
import * as C from './constants';
|
|
4
|
-
|
|
5
|
-
export function stringToBool(str: string): boolean {
|
|
6
|
-
return str === 'true' ? true : false;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function getSeparator(col: DG.Column<string>): string {
|
|
10
|
-
const separator = col.tags[C.TAGS.SEPARATOR];
|
|
11
|
-
if (separator)
|
|
12
|
-
return separator as string;
|
|
13
|
-
|
|
14
|
-
const defaultSeparators = ['.', '-', ' '];
|
|
15
|
-
const categories = col.categories;
|
|
16
|
-
const catLen = categories.length;
|
|
17
|
-
for (const potentialSeparator of defaultSeparators) {
|
|
18
|
-
if (categories.filter((sequence) => sequence.includes(potentialSeparator)).length == catLen)
|
|
19
|
-
return potentialSeparator;
|
|
20
|
-
}
|
|
21
|
-
return separator as string ?? '';
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function getTypedArrayConstructor(
|
|
25
|
-
maxNum: number): Uint8ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor {
|
|
26
|
-
return maxNum < 256 ? Uint8Array :
|
|
27
|
-
maxNum < 65536 ? Uint16Array :
|
|
28
|
-
Uint32Array;
|
|
29
|
-
}
|