@datagrok/bio 1.5.8 → 1.5.9
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 +7 -7
- package/dist/package-test.js +37 -8
- package/dist/package.js +2 -4
- package/files/samples/testDemog.csv +5851 -0
- package/files/samples/testHelm.csv +6 -0
- package/files/samples/{id.csv → testId.csv} +0 -0
- package/files/samples/{sar-small.csv → testSmiles.csv} +0 -0
- package/package.json +1 -1
- package/src/tests/detectors-test.ts +42 -6
- package/src/utils/cell-renderer.ts +9 -12
- package/{test-Bio-34f75e5127b8-c4c5a3dc.html → test-Bio-34f75e5127b8-b47d4664.html} +4 -3
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
ID,Test type,HELM string,Valid?,Mol Weight,Mol Formula,SMILES
|
|
2
|
+
RNA,Simple RNA ,RNA1{R(U)P.R(T)P.R(G)P.R(C)P.R(A)}$$$$,yes,1543.98,C48H61N17O34P4,[H]OCC1OC(N2C=CC(=O)NC2=O)C(O)C1OP(=O)(O)OCC3OC(N4C=C(C(=O)NC4=O)C)C(O)C3OP(=O)(O)OCC5OC(N6C=NC=7C(=O)NC(=NC76)N)C(O)C5OP(=O)(O)OCC8OC(N9C=CC(=NC9=O)N)C(O)C8OP(=O)(O)OCC%10OC(N%11C=NC=%12C(=NC=NC%12%11)N)C(O)C%10O[H]
|
|
3
|
+
Different arrangements of dots,Only dots beween the backbone monomers,RNA1{P.R(U)P.R(T)}$$$$,yes,644.37,C19H26N4O17P2,OP(O)(OC[C@H]1O[C@@H](N(C2=O)C=CC(N2)=O)[C@H](O)[C@@H]1OP(O)(OC[C@H]3O[C@@H](N(C4=O)C=C(C)C(N4)=O)[C@H](O)[C@@H]3O[H])=O)=O
|
|
4
|
+
Different arrangements of dots,Dot after the branch,RNA1{P.R(U).P.R(T)}$$$$,yes,644.37,C19H26N4O17P2,OP(O)(OC[C@H]1O[C@@H](N(C2=O)C=CC(N2)=O)[C@H](O)[C@@H]1OP(O)(OC[C@H]3O[C@@H](N(C4=O)C=C(C)C(N4)=O)[C@H](O)[C@@H]3O[H])=O)=O
|
|
5
|
+
Hydrogen bonding,RNA with hydrogen bonding,"RNA1{R(A)P.R(C)P.R(G)P}|RNA2{P.R(C)P.R(G)P.R(T)}$RNA1,RNA2,2:pair-9:pair|RNA1,RNA2,5:pair-6:pair|RNA1,RNA2,8:pair-3:pair$$$",yes,1986.2,C58H77N23O44P6,NA
|
|
6
|
+
Hydrogen bonding,Shorter RNA with H bonding,"RNA1{R(U)P.R(T)P}|RNA2{P.R(A)P.R(A)}$RNA1,RNA2,2:pair-6:pair|RNA1,RNA2,5:pair-3:pair$$$",yes,1320.8,C39H52N14O30P4,NA
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@datagrok/bio",
|
|
3
3
|
"beta": false,
|
|
4
4
|
"friendlyName": "Bio",
|
|
5
|
-
"version": "1.5.
|
|
5
|
+
"version": "1.5.9",
|
|
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",
|
|
@@ -105,9 +105,11 @@ MWRSWY-CKHP
|
|
|
105
105
|
fastaCsv = 'fastaCsv',
|
|
106
106
|
fastaFasta = 'fastaFasta',
|
|
107
107
|
msaComplex = 'msaComplex',
|
|
108
|
-
idCsv = 'idCsv',
|
|
109
|
-
sarSmallCsv = 'sarSmallCsv',
|
|
110
108
|
helmCsv = 'helmCsv',
|
|
109
|
+
testIdCsv = 'testIdCsv',
|
|
110
|
+
testSmilesCsv = 'testSmilesCsv',
|
|
111
|
+
testHelmCsv = 'testHelmCsv',
|
|
112
|
+
testDemogCsv = 'testDemogCsv',
|
|
111
113
|
}
|
|
112
114
|
|
|
113
115
|
const samples: { [key: string]: string } = {
|
|
@@ -115,9 +117,11 @@ MWRSWY-CKHP
|
|
|
115
117
|
'fastaCsv': 'System:AppData/Bio/samples/sample_FASTA.csv',
|
|
116
118
|
'fastaFasta': 'System:AppData/Bio/samples/sample_FASTA.fasta',
|
|
117
119
|
'msaComplex': 'System:AppData/Bio/samples/sample_MSA.csv',
|
|
118
|
-
'idCsv': 'System:AppData/Bio/samples/id.csv',
|
|
119
|
-
'sarSmallCsv': 'System:AppData/Bio/samples/sar-small.csv',
|
|
120
120
|
'helmCsv': 'System:AppData/Bio/samples/sample_HELM.csv',
|
|
121
|
+
'testDemogCsv': 'System:AppData/Bio/samples/testDemog.csv',
|
|
122
|
+
'testIdCsv': 'System:AppData/Bio/samples/id.csv',
|
|
123
|
+
'testHelmCsv': 'System:AppData/Bio/samples/testHelm.csv',
|
|
124
|
+
'testSmilesCsv': 'System:AppData/Bio/samples/testSmiles.csv',
|
|
121
125
|
};
|
|
122
126
|
|
|
123
127
|
const _samplesDfs: { [key: string]: Promise<DG.DataFrame> } = {};
|
|
@@ -238,11 +242,11 @@ MWRSWY-CKHP
|
|
|
238
242
|
});
|
|
239
243
|
|
|
240
244
|
test('samplesIdCsvNegativeID', async () => {
|
|
241
|
-
await _testNeg(readSamples(Samples.
|
|
245
|
+
await _testNeg(readSamples(Samples.testIdCsv), 'ID');
|
|
242
246
|
});
|
|
243
247
|
|
|
244
248
|
test('samplesSarSmallCsvNegativeSmiles', async () => {
|
|
245
|
-
await _testNeg(readSamples(Samples.
|
|
249
|
+
await _testNeg(readSamples(Samples.testSmilesCsv), 'smiles');
|
|
246
250
|
});
|
|
247
251
|
|
|
248
252
|
test('samplesHelmCsvHELM', async () => {
|
|
@@ -252,6 +256,38 @@ MWRSWY-CKHP
|
|
|
252
256
|
test('samplesHelmCsvNegativeActivity', async () => {
|
|
253
257
|
await _testNeg(readSamples(Samples.helmCsv), 'Activity');
|
|
254
258
|
});
|
|
259
|
+
|
|
260
|
+
// sample_testHelm.csb
|
|
261
|
+
// columns: ID,Test type,HELM string,Valid?,Mol Weight,Mol Formula,SMILES
|
|
262
|
+
test('samplesTestHelmNegativeID', async () => {
|
|
263
|
+
await _testNeg(readSamples(Samples.testHelmCsv), 'ID');
|
|
264
|
+
});
|
|
265
|
+
test('samplesTestHelmNegativeTestType', async () => {
|
|
266
|
+
await _testNeg(readSamples(Samples.testHelmCsv), 'Test type');
|
|
267
|
+
});
|
|
268
|
+
test('samplesTestHelmPositiveHelmString', async () => {
|
|
269
|
+
await _testPos(readSamples(Samples.testHelmCsv), 'HELM string', 'HELM');
|
|
270
|
+
});
|
|
271
|
+
test('samplesTestHelmNegativeValid', async () => {
|
|
272
|
+
await _testNeg(readSamples(Samples.testHelmCsv), 'Valid?');
|
|
273
|
+
});
|
|
274
|
+
test('samplesTestHelmNegativeMolWeight', async () => {
|
|
275
|
+
await _testNeg(readSamples(Samples.testHelmCsv), 'Mol Weight');
|
|
276
|
+
});
|
|
277
|
+
test('samplesTestHelmNegativeMolFormula', async () => {
|
|
278
|
+
await _testNeg(readSamples(Samples.testHelmCsv), 'Mol Formula');
|
|
279
|
+
});
|
|
280
|
+
test('samplesTestHelmNegativeSmiles', async () => {
|
|
281
|
+
await _testNeg(readSamples(Samples.testHelmCsv), 'Smiles');
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
test('samplesTestDemogNegativeAll', async () => {
|
|
285
|
+
const dfFunc: DfReaderFunc = readSamples(Samples.testDemogCsv);
|
|
286
|
+
const df: DG.DataFrame = await dfFunc();
|
|
287
|
+
|
|
288
|
+
for (const col of df.columns.toList())
|
|
289
|
+
await _testNeg(dfFunc, col.name);
|
|
290
|
+
});
|
|
255
291
|
});
|
|
256
292
|
|
|
257
293
|
export async function _testNeg(readDf: DfReaderFunc, colName: string) {
|
|
@@ -9,7 +9,7 @@ import {SplitterFunc, WebLogo} from "@datagrok-libraries/bio/src/viewers/web-log
|
|
|
9
9
|
import {SeqPalette} from "@datagrok-libraries/bio/src/seq-palettes";
|
|
10
10
|
import * as ui from 'datagrok-api/ui';
|
|
11
11
|
|
|
12
|
-
const lru = new DG.LruCache<any, any>();
|
|
12
|
+
const lru = new DG.LruCache<any, any>();
|
|
13
13
|
|
|
14
14
|
function getPalleteByType(paletteType: string): SeqPalette {
|
|
15
15
|
switch (paletteType) {
|
|
@@ -127,9 +127,6 @@ function renderSequense(
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
export class MacromoleculeSequenceCellRenderer extends DG.GridCellRenderer {
|
|
130
|
-
constructor() {
|
|
131
|
-
super();
|
|
132
|
-
}
|
|
133
130
|
|
|
134
131
|
get name(): string {return 'macromoleculeSequence';}
|
|
135
132
|
|
|
@@ -162,7 +159,7 @@ export class MacromoleculeSequenceCellRenderer extends DG.GridCellRenderer {
|
|
|
162
159
|
let host = ui.div([], { style: { width: `${w}px`, height: `${h}px`}});
|
|
163
160
|
host.setAttribute('dataformat', 'helm');
|
|
164
161
|
host.setAttribute('data', gridCell.cell.value);
|
|
165
|
-
|
|
162
|
+
gridCell.element = host;
|
|
166
163
|
//@ts-ignore
|
|
167
164
|
var canvas = new JSDraw2.Editor(host, { width: w, height: h, skin: "w8", viewonly: true });
|
|
168
165
|
var formula = canvas.getFormula(true);
|
|
@@ -186,28 +183,28 @@ export class MacromoleculeSequenceCellRenderer extends DG.GridCellRenderer {
|
|
|
186
183
|
g.font = '12px monospace';
|
|
187
184
|
g.textBaseline = 'top';
|
|
188
185
|
const s: string = cell.value ?? '';
|
|
189
|
-
|
|
186
|
+
|
|
190
187
|
//TODO: can this be replaced/merged with splitSequence?
|
|
191
188
|
const units = gridCell.cell.column.getTag(DG.TAGS.UNITS);
|
|
192
|
-
|
|
189
|
+
|
|
193
190
|
const palette = getPalleteByType(paletteType);
|
|
194
|
-
|
|
191
|
+
|
|
195
192
|
const separator = gridCell.cell.column.getTag('separator') ?? '';
|
|
196
193
|
const splitterFunc: SplitterFunc = WebLogo.getSplitter(units, gridCell.cell.column.getTag('separator') );// splitter,
|
|
197
|
-
|
|
194
|
+
|
|
198
195
|
const subParts:string[] = splitterFunc(cell.value);
|
|
199
196
|
console.log(subParts);
|
|
200
|
-
|
|
197
|
+
|
|
201
198
|
const textSize = g.measureText(subParts.join(''));
|
|
202
199
|
let x1 = Math.max(x, x + (w - textSize.width) / 2);
|
|
203
|
-
|
|
200
|
+
|
|
204
201
|
subParts.forEach((amino, index) => {
|
|
205
202
|
let [color, outerAmino,, pivot] = ChemPalette.getColorAAPivot(amino);
|
|
206
203
|
color = palette.get(amino);
|
|
207
204
|
g.fillStyle = ChemPalette.undefinedColor;
|
|
208
205
|
x1 = printLeftOrCentered(x1, y, w, h, g, amino, color, pivot, true, false, 1.0, separator);
|
|
209
206
|
});
|
|
210
|
-
|
|
207
|
+
|
|
211
208
|
g.restore();
|
|
212
209
|
}
|
|
213
210
|
}
|
|
@@ -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 b47d4664.</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 b47d4664.</h1></header><div id="metadata-container"><div id="timestamp">Started: 2022-07-11 12:49:26</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">107.855s</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">98.311s</div></div><div class="failureMessages"> <pre class="failureMsg">Error: expect(received).toBe(expected) // Object.is equality
|
|
233
233
|
|
|
234
234
|
Expected: false
|
|
235
235
|
Received: true
|
|
@@ -249,7 +249,8 @@ Received: true
|
|
|
249
249
|
at new Promise (<anonymous>)</pre><pre class="suite-consolelog-item-message">Testing Bio package</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:47:11
|
|
250
250
|
at Generator.next (<anonymous>)
|
|
251
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">
|
|
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')
|
|
253
254
|
sequenceSpace.sequenceSpaceOpens: TypeError: Cannot read properties of undefined (reading 'col')
|
|
254
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))
|
|
255
256
|
activityCliffs.activityCliffsOpen: TypeError: Cannot read properties of undefined (reading 'columns')
|