@datagrok/bio 2.4.2 → 2.4.3
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/.eslintrc.json +1 -1
- package/detectors.js +21 -17
- package/dist/package-test.js +1 -1
- package/dist/package-test.js.map +1 -1
- package/package.json +1 -1
- package/src/package-test.ts +1 -0
- package/src/tests/detectors-weak-and-likely-tests.ts +129 -0
- package/tsconfig.json +1 -1
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "Leonid Stolbov",
|
|
6
6
|
"email": "lstolbov@datagrok.ai"
|
|
7
7
|
},
|
|
8
|
-
"version": "2.4.
|
|
8
|
+
"version": "2.4.3",
|
|
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",
|
package/src/package-test.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {runTests, TestContext, tests} from '@datagrok-libraries/utils/src/test';
|
|
|
5
5
|
import './tests/_first-tests';
|
|
6
6
|
import './tests/Palettes-test';
|
|
7
7
|
import './tests/detectors-tests';
|
|
8
|
+
import './tests/detectors-weak-and-likely-tests';
|
|
8
9
|
import './tests/detectors-benchmark-tests';
|
|
9
10
|
import './tests/msa-tests';
|
|
10
11
|
import './tests/splitters-test';
|
|
@@ -0,0 +1,129 @@
|
|
|
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 {after, before, category, test, expect, expectObject} from '@datagrok-libraries/utils/src/test';
|
|
6
|
+
import {ALIGNMENT, ALPHABET, NOTATION} from '@datagrok-libraries/bio/src/utils/macromolecule';
|
|
7
|
+
import {_testNeg, _testPos} from './detectors-tests';
|
|
8
|
+
import {DfReaderFunc} from './types';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
category('detectors:weak-and-likely', () => {
|
|
12
|
+
const enum csvTests {
|
|
13
|
+
fastaDnaWeak1 = 'fastaDnaWeak1',
|
|
14
|
+
fastaDnaWeak1LikelyName = 'fastaDnaWeak1LikelyName',
|
|
15
|
+
|
|
16
|
+
fastaRnaWeak1 = 'fastaRnaWeak1',
|
|
17
|
+
fastaRnaWeak1LikelyName = 'fastaRnaWeak1LikelyName',
|
|
18
|
+
|
|
19
|
+
fastaPtWeak1 = 'fastaPtWeak1',
|
|
20
|
+
fastaPtWeak1LikelyName = 'fastaPtWeak1LikelyName',
|
|
21
|
+
|
|
22
|
+
fastaUn1 = 'fastaUn1',
|
|
23
|
+
fastaUn1LikelyName = 'fastaUn1LikelyName',
|
|
24
|
+
fastaUnMsa1LikelyName = 'fastaUnMsa1LikelyName',
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const csvData: { [name: string]: string } = {
|
|
28
|
+
[csvTests.fastaDnaWeak1]: `id,colName
|
|
29
|
+
1,TTTTT
|
|
30
|
+
2,TTTTT
|
|
31
|
+
3,TTTTT
|
|
32
|
+
4,TTTTT
|
|
33
|
+
`,
|
|
34
|
+
[csvTests.fastaDnaWeak1LikelyName]: `id,seq
|
|
35
|
+
1,TTTTT
|
|
36
|
+
2,TTTTT
|
|
37
|
+
3,TTTTT
|
|
38
|
+
4,TTTTT
|
|
39
|
+
`,
|
|
40
|
+
[csvTests.fastaRnaWeak1]: `id,colName
|
|
41
|
+
1,UUUUU
|
|
42
|
+
2,UUUUU
|
|
43
|
+
3,UUUUU
|
|
44
|
+
4,UUUUU
|
|
45
|
+
`,
|
|
46
|
+
[csvTests.fastaRnaWeak1LikelyName]: `id,seq
|
|
47
|
+
1,UUUUU
|
|
48
|
+
2,UUUUU
|
|
49
|
+
3,UUUUU
|
|
50
|
+
4,UUUUU
|
|
51
|
+
`,
|
|
52
|
+
[csvTests.fastaPtWeak1]: `id,colName
|
|
53
|
+
1,SLSLSPGK
|
|
54
|
+
2,SLSLSPGK
|
|
55
|
+
3,SLSLSPGK
|
|
56
|
+
4,SLSLSPGK
|
|
57
|
+
`,
|
|
58
|
+
[csvTests.fastaPtWeak1LikelyName]: `id,seq
|
|
59
|
+
1,SLSLSPGK
|
|
60
|
+
2,SLSLSPGK
|
|
61
|
+
3,SLSLSPGK
|
|
62
|
+
4,SLSLSPGK
|
|
63
|
+
`,
|
|
64
|
+
[csvTests.fastaUn1]: `id,colName
|
|
65
|
+
1,word
|
|
66
|
+
2,other
|
|
67
|
+
3,some
|
|
68
|
+
4,another
|
|
69
|
+
`,
|
|
70
|
+
[csvTests.fastaUn1LikelyName]: `id,seq
|
|
71
|
+
1,word
|
|
72
|
+
2,other
|
|
73
|
+
3,some
|
|
74
|
+
4,another
|
|
75
|
+
`,
|
|
76
|
+
[csvTests.fastaUnMsa1LikelyName]: `id,seq
|
|
77
|
+
1,word
|
|
78
|
+
2,male
|
|
79
|
+
3,bare
|
|
80
|
+
4,core
|
|
81
|
+
`,
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const readCsv: (key: csvTests) => DfReaderFunc = (key: keyof typeof csvData) => {
|
|
85
|
+
return async () => {
|
|
86
|
+
// Always recreate test data frame from CSV for reproducible detector behavior in tests.
|
|
87
|
+
const csv: string = csvData[key];
|
|
88
|
+
const df: DG.DataFrame = DG.DataFrame.fromCsv(csv);
|
|
89
|
+
await grok.data.detectSemanticTypes(df);
|
|
90
|
+
return df;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
test(csvTests.fastaDnaWeak1, async () => {
|
|
95
|
+
await _testNeg(readCsv(csvTests.fastaDnaWeak1), 'colName');
|
|
96
|
+
});
|
|
97
|
+
test(csvTests.fastaDnaWeak1LikelyName, async () => {
|
|
98
|
+
await _testPos(readCsv(csvTests.fastaDnaWeak1LikelyName), 'seq',
|
|
99
|
+
NOTATION.FASTA, ALIGNMENT.SEQ_MSA, ALPHABET.DNA, 4, false);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
test(csvTests.fastaRnaWeak1, async () => {
|
|
103
|
+
await _testNeg(readCsv(csvTests.fastaRnaWeak1), 'colName');
|
|
104
|
+
});
|
|
105
|
+
test(csvTests.fastaRnaWeak1LikelyName, async () => {
|
|
106
|
+
await _testPos(readCsv(csvTests.fastaRnaWeak1LikelyName), 'seq',
|
|
107
|
+
NOTATION.FASTA, ALIGNMENT.SEQ_MSA, ALPHABET.RNA, 4, false);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
test(csvTests.fastaPtWeak1, async () => {
|
|
111
|
+
await _testNeg(readCsv(csvTests.fastaPtWeak1), 'colName');
|
|
112
|
+
});
|
|
113
|
+
test(csvTests.fastaPtWeak1LikelyName, async () => {
|
|
114
|
+
await _testPos(readCsv(csvTests.fastaPtWeak1LikelyName), 'seq',
|
|
115
|
+
NOTATION.FASTA, ALIGNMENT.SEQ_MSA, ALPHABET.PT, 20, false);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
test(csvTests.fastaUn1, async () => {
|
|
119
|
+
await _testNeg(readCsv(csvTests.fastaUn1), 'colName');
|
|
120
|
+
});
|
|
121
|
+
test(csvTests.fastaUn1LikelyName, async () => {
|
|
122
|
+
await _testPos(readCsv(csvTests.fastaUn1LikelyName), 'seq',
|
|
123
|
+
NOTATION.FASTA, ALIGNMENT.SEQ, ALPHABET.UN, 11, false);
|
|
124
|
+
});
|
|
125
|
+
test(csvTests.fastaUnMsa1LikelyName, async () => {
|
|
126
|
+
await _testPos(readCsv(csvTests.fastaUnMsa1LikelyName), 'seq',
|
|
127
|
+
NOTATION.FASTA, ALIGNMENT.SEQ_MSA, ALPHABET.UN, 10, false);
|
|
128
|
+
});
|
|
129
|
+
});
|
package/tsconfig.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// "incremental": true, /* Enable incremental compilation */
|
|
7
7
|
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
|
|
8
8
|
"module": "es2020", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
|
|
9
|
-
"lib": ["
|
|
9
|
+
"lib": ["ES2022", "dom"], /* Specify library files to be included in the compilation. */
|
|
10
10
|
// "allowJs": true, /* Allow javascript files to be compiled. */
|
|
11
11
|
// "checkJs": true, /* Report errors in .js files. */
|
|
12
12
|
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */
|