@datagrok/sequence-translator 0.0.6 → 0.0.12
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/css/style.css +18 -0
- package/dist/package-test.js +2387 -0
- package/dist/package.js +5151 -0
- package/jest.config.js +33 -0
- package/package.json +21 -5
- package/setup.cmd +1 -1
- package/src/ICDs.ts +3 -0
- package/src/IDPs.ts +3 -0
- package/src/__jest__/remote.test.ts +49 -0
- package/src/__jest__/test-node.ts +96 -0
- package/src/defineAxolabsPattern.ts +2 -8
- package/src/package-test.ts +2 -1
- package/src/package.ts +186 -703
- package/src/salts.ts +2 -0
- package/src/sources.ts +3 -0
- package/src/structures-works/converters.ts +288 -0
- package/src/structures-works/from-monomers.ts +104 -0
- package/src/{map.ts → structures-works/map.ts} +28 -6
- package/src/structures-works/mol-transformations.ts +432 -0
- package/src/structures-works/save-sense-antisense.ts +51 -0
- package/src/structures-works/sequence-codes-tools.ts +252 -0
- package/src/tests/smiles-tests.ts +1 -1
- package/src/users.ts +3 -0
- package/test-SequenceTranslator-c2bbc2b235db-afc0e1c5.html +245 -0
- package/tsconfig.json +2 -1
- package/src/save-sense-antisense.ts +0 -44
|
@@ -0,0 +1,252 @@
|
|
|
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
|
+
import {map, SYNTHESIZERS, TECHNOLOGIES, MODIFICATIONS} from './map';
|
|
5
|
+
import {asoGapmersNucleotidesToBioSpring, asoGapmersNucleotidesToGcrs,
|
|
6
|
+
asoGapmersBioSpringToNucleotides, asoGapmersBioSpringToGcrs, asoGapmersGcrsToNucleotides,
|
|
7
|
+
asoGapmersGcrsToBioSpring, gcrsToMermade12, siRnaNucleotideToBioSpringSenseStrand,
|
|
8
|
+
siRnaNucleotideToAxolabsSenseStrand, siRnaNucleotidesToGcrs, siRnaBioSpringToNucleotides,
|
|
9
|
+
siRnaBioSpringToAxolabs, siRnaBioSpringToGcrs, siRnaAxolabsToNucleotides,
|
|
10
|
+
siRnaAxolabsToBioSpring, siRnaAxolabsToGcrs, siRnaGcrsToNucleotides,
|
|
11
|
+
siRnaGcrsToBioSpring, siRnaGcrsToAxolabs, gcrsToNucleotides} from './converters';
|
|
12
|
+
|
|
13
|
+
const noTranslationTableAvailable = 'No translation table available';
|
|
14
|
+
export const undefinedInputSequence = 'Type of input sequence is undefined';
|
|
15
|
+
|
|
16
|
+
export function isValidSequence(sequence: string): {
|
|
17
|
+
indexOfFirstNotValidChar: number,
|
|
18
|
+
synthesizer: string | null,
|
|
19
|
+
technology: string | null
|
|
20
|
+
} {
|
|
21
|
+
let possibleSynthesizers = getListOfPossibleSynthesizersByFirstMatchedCode(sequence);
|
|
22
|
+
|
|
23
|
+
if (possibleSynthesizers.length > 1) {
|
|
24
|
+
const synthesizer = ui.choiceInput('Choose synthesizer from list: ', possibleSynthesizers[0], possibleSynthesizers);
|
|
25
|
+
ui.dialog('Choose Synthesizer')
|
|
26
|
+
.add(ui.panel([synthesizer.root], {style: {fontWeight: 'bold'}}))
|
|
27
|
+
.onOK(() => possibleSynthesizers = [synthesizer.value])
|
|
28
|
+
.onCancel(() => {
|
|
29
|
+
possibleSynthesizers = [possibleSynthesizers[0]];
|
|
30
|
+
grok.shell.warning('Input sequence is expected to be in format ' + possibleSynthesizers[0]);
|
|
31
|
+
})
|
|
32
|
+
.show();
|
|
33
|
+
} else if (possibleSynthesizers.length == 0)
|
|
34
|
+
return {indexOfFirstNotValidChar: 0, synthesizer: null, technology: null};
|
|
35
|
+
|
|
36
|
+
let outputIndex = 0;
|
|
37
|
+
|
|
38
|
+
const firstUniqueCharacters = ['r', 'd'];
|
|
39
|
+
const nucleotides = ['A', 'U', 'T', 'C', 'G'];
|
|
40
|
+
|
|
41
|
+
possibleSynthesizers.forEach((synthesizer) => {
|
|
42
|
+
const codes = getAllCodesOfSynthesizer(synthesizer);
|
|
43
|
+
while (outputIndex < sequence.length) {
|
|
44
|
+
const matchedCode = codes.find((c) => c == sequence.slice(outputIndex, outputIndex + c.length));
|
|
45
|
+
|
|
46
|
+
if (matchedCode == null)
|
|
47
|
+
break;
|
|
48
|
+
|
|
49
|
+
if ( // for mistake pattern 'rAA'
|
|
50
|
+
outputIndex > 1 &&
|
|
51
|
+
nucleotides.includes(sequence[outputIndex]) &&
|
|
52
|
+
firstUniqueCharacters.includes(sequence[outputIndex - 2])
|
|
53
|
+
) break;
|
|
54
|
+
|
|
55
|
+
if ( // for mistake pattern 'ArA'
|
|
56
|
+
firstUniqueCharacters.includes(sequence[outputIndex + 1]) &&
|
|
57
|
+
nucleotides.includes(sequence[outputIndex])
|
|
58
|
+
) {
|
|
59
|
+
outputIndex++;
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
outputIndex += matchedCode.length;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const indexOfFirstNotValidChar = (outputIndex == sequence.length) ? -1 : outputIndex;
|
|
68
|
+
if (indexOfFirstNotValidChar != -1) {
|
|
69
|
+
return {
|
|
70
|
+
indexOfFirstNotValidChar: indexOfFirstNotValidChar,
|
|
71
|
+
synthesizer: possibleSynthesizers[0],
|
|
72
|
+
technology: null,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
let possibleTechnologies = getListOfPossibleTechnologiesByFirstMatchedCode(sequence, possibleSynthesizers[0]);
|
|
77
|
+
|
|
78
|
+
if (possibleTechnologies.length > 1) {
|
|
79
|
+
const technology = ui.choiceInput('Choose technology from list: ', possibleTechnologies[0], possibleTechnologies);
|
|
80
|
+
ui.dialog('Choose Technology')
|
|
81
|
+
.add(ui.panel([technology.root], {style: {fontWeight: 'bold'}}))
|
|
82
|
+
.onOK(() => possibleTechnologies = [technology.value])
|
|
83
|
+
.onCancel(() => {
|
|
84
|
+
possibleTechnologies = [possibleTechnologies[0]];
|
|
85
|
+
grok.shell.warning('Input sequence is expected to be in format ' + possibleTechnologies[0]);
|
|
86
|
+
})
|
|
87
|
+
.show();
|
|
88
|
+
} else if (possibleTechnologies.length == 0)
|
|
89
|
+
return {indexOfFirstNotValidChar: 0, synthesizer: null, technology: null};
|
|
90
|
+
|
|
91
|
+
outputIndex = 0;
|
|
92
|
+
|
|
93
|
+
possibleTechnologies.forEach((technology: string) => {
|
|
94
|
+
const codes = Object.keys(map[possibleSynthesizers[0]][technology]);
|
|
95
|
+
while (outputIndex < sequence.length) {
|
|
96
|
+
const matchedCode = codes.find((c) => c == sequence.slice(outputIndex, outputIndex + c.length));
|
|
97
|
+
|
|
98
|
+
if (matchedCode == null)
|
|
99
|
+
break;
|
|
100
|
+
|
|
101
|
+
if ( // for mistake pattern 'rAA'
|
|
102
|
+
outputIndex > 1 &&
|
|
103
|
+
nucleotides.includes(sequence[outputIndex]) &&
|
|
104
|
+
firstUniqueCharacters.includes(sequence[outputIndex - 2])
|
|
105
|
+
) break;
|
|
106
|
+
|
|
107
|
+
if ( // for mistake pattern 'ArA'
|
|
108
|
+
firstUniqueCharacters.includes(sequence[outputIndex + 1]) &&
|
|
109
|
+
nucleotides.includes(sequence[outputIndex])
|
|
110
|
+
) {
|
|
111
|
+
outputIndex++;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
outputIndex += matchedCode.length;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
return {
|
|
120
|
+
indexOfFirstNotValidChar: indexOfFirstNotValidChar,
|
|
121
|
+
synthesizer: possibleSynthesizers[0],
|
|
122
|
+
technology: possibleTechnologies[outputIndex],
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function getAllCodesOfSynthesizer(synthesizer: string): string[] {
|
|
127
|
+
let codes: string[] = [];
|
|
128
|
+
for (const technology of Object.keys(map[synthesizer]))
|
|
129
|
+
codes = codes.concat(Object.keys(map[synthesizer][technology]));
|
|
130
|
+
return codes.concat(Object.keys(MODIFICATIONS));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function getListOfPossibleSynthesizersByFirstMatchedCode(sequence: string): string[] {
|
|
134
|
+
const synthesizers: string[] = [];
|
|
135
|
+
Object.keys(map).forEach((synthesizer: string) => {
|
|
136
|
+
const codes = getAllCodesOfSynthesizer(synthesizer);
|
|
137
|
+
//TODO: get first non-dropdown code when there are two modifications
|
|
138
|
+
let start = 0;
|
|
139
|
+
for (let i = 0; i < sequence.length; i++) {
|
|
140
|
+
if (sequence[i] == ')' && i != sequence.length - 1) {
|
|
141
|
+
start = i + 1;
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (codes.some((s: string) => s == sequence.slice(start, start + s.length)))
|
|
146
|
+
synthesizers.push(synthesizer);
|
|
147
|
+
});
|
|
148
|
+
return synthesizers;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function getListOfPossibleTechnologiesByFirstMatchedCode(sequence: string, synthesizer: string): string[] {
|
|
152
|
+
const technologies: string[] = [];
|
|
153
|
+
Object.keys(map[synthesizer]).forEach((technology: string) => {
|
|
154
|
+
const codes = Object.keys(map[synthesizer][technology]).concat(Object.keys(MODIFICATIONS));
|
|
155
|
+
if (codes.some((s) => s == sequence.slice(0, s.length)))
|
|
156
|
+
technologies.push(technology);
|
|
157
|
+
});
|
|
158
|
+
return technologies;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function convertSequence(sequence: string, output: {
|
|
162
|
+
indexOfFirstNotValidChar: number, synthesizer: string | null, technology: string | null}) {
|
|
163
|
+
if (output.indexOfFirstNotValidChar != -1) {
|
|
164
|
+
return {
|
|
165
|
+
// type: '',
|
|
166
|
+
indexOfFirstNotValidChar: JSON.stringify(output),
|
|
167
|
+
Error: undefinedInputSequence,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
if (output.synthesizer == SYNTHESIZERS.RAW_NUCLEOTIDES && output.technology == TECHNOLOGIES.DNA) {
|
|
171
|
+
return {
|
|
172
|
+
type: SYNTHESIZERS.RAW_NUCLEOTIDES + ' ' + TECHNOLOGIES.DNA,
|
|
173
|
+
Nucleotides: sequence,
|
|
174
|
+
BioSpring: asoGapmersNucleotidesToBioSpring(sequence),
|
|
175
|
+
GCRS: asoGapmersNucleotidesToGcrs(sequence),
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
if (output.synthesizer == SYNTHESIZERS.BIOSPRING && output.technology == TECHNOLOGIES.ASO_GAPMERS) {
|
|
179
|
+
return {
|
|
180
|
+
type: SYNTHESIZERS.BIOSPRING + ' ' + TECHNOLOGIES.ASO_GAPMERS,
|
|
181
|
+
Nucleotides: asoGapmersBioSpringToNucleotides(sequence),
|
|
182
|
+
BioSpring: sequence,
|
|
183
|
+
GCRS: asoGapmersBioSpringToGcrs(sequence),
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
if (output.synthesizer == SYNTHESIZERS.GCRS && output.technology == TECHNOLOGIES.ASO_GAPMERS) {
|
|
187
|
+
return {
|
|
188
|
+
type: SYNTHESIZERS.GCRS + ' ' + TECHNOLOGIES.ASO_GAPMERS,
|
|
189
|
+
Nucleotides: asoGapmersGcrsToNucleotides(sequence),
|
|
190
|
+
BioSpring: asoGapmersGcrsToBioSpring(sequence),
|
|
191
|
+
Mermade12: gcrsToMermade12(sequence),
|
|
192
|
+
GCRS: sequence,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
if (output.synthesizer == SYNTHESIZERS.RAW_NUCLEOTIDES && output.technology == TECHNOLOGIES.RNA) {
|
|
196
|
+
return {
|
|
197
|
+
type: SYNTHESIZERS.RAW_NUCLEOTIDES + ' ' + TECHNOLOGIES.RNA,
|
|
198
|
+
Nucleotides: sequence,
|
|
199
|
+
BioSpring: siRnaNucleotideToBioSpringSenseStrand(sequence),
|
|
200
|
+
Axolabs: siRnaNucleotideToAxolabsSenseStrand(sequence),
|
|
201
|
+
GCRS: siRnaNucleotidesToGcrs(sequence),
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
if (output.synthesizer == SYNTHESIZERS.BIOSPRING && output.technology == TECHNOLOGIES.SI_RNA) {
|
|
205
|
+
return {
|
|
206
|
+
type: SYNTHESIZERS.BIOSPRING + ' ' + TECHNOLOGIES.SI_RNA,
|
|
207
|
+
Nucleotides: siRnaBioSpringToNucleotides(sequence),
|
|
208
|
+
BioSpring: sequence,
|
|
209
|
+
Axolabs: siRnaBioSpringToAxolabs(sequence),
|
|
210
|
+
GCRS: siRnaBioSpringToGcrs(sequence),
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
if (output.synthesizer == SYNTHESIZERS.AXOLABS && output.technology == TECHNOLOGIES.SI_RNA) {
|
|
214
|
+
return {
|
|
215
|
+
type: SYNTHESIZERS.AXOLABS + ' ' + TECHNOLOGIES.SI_RNA,
|
|
216
|
+
Nucleotides: siRnaAxolabsToNucleotides(sequence),
|
|
217
|
+
BioSpring: siRnaAxolabsToBioSpring(sequence),
|
|
218
|
+
Axolabs: sequence,
|
|
219
|
+
GCRS: siRnaAxolabsToGcrs(sequence),
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
if (output.synthesizer == SYNTHESIZERS.GCRS && output.technology == TECHNOLOGIES.SI_RNA) {
|
|
223
|
+
return {
|
|
224
|
+
type: SYNTHESIZERS.GCRS + ' ' + TECHNOLOGIES.SI_RNA,
|
|
225
|
+
Nucleotides: siRnaGcrsToNucleotides(sequence),
|
|
226
|
+
BioSpring: siRnaGcrsToBioSpring(sequence),
|
|
227
|
+
Axolabs: siRnaGcrsToAxolabs(sequence),
|
|
228
|
+
MM12: gcrsToMermade12(sequence),
|
|
229
|
+
GCRS: sequence,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
if (output.synthesizer == SYNTHESIZERS.GCRS) {
|
|
233
|
+
return {
|
|
234
|
+
type: SYNTHESIZERS.GCRS,
|
|
235
|
+
Nucleotides: gcrsToNucleotides(sequence),
|
|
236
|
+
GCRS: sequence,
|
|
237
|
+
Mermade12: gcrsToMermade12(sequence),
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
if (output.synthesizer == SYNTHESIZERS.MERMADE_12) {
|
|
241
|
+
return {
|
|
242
|
+
type: SYNTHESIZERS.MERMADE_12,
|
|
243
|
+
Nucleotides: noTranslationTableAvailable,
|
|
244
|
+
GCRS: noTranslationTableAvailable,
|
|
245
|
+
Mermade12: sequence,
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
return {
|
|
249
|
+
type: undefinedInputSequence,
|
|
250
|
+
Nucleotides: undefinedInputSequence,
|
|
251
|
+
};
|
|
252
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {category, expect, test} from '@datagrok-libraries/utils/src/test';
|
|
2
|
-
import {sequenceToSmiles} from '../
|
|
2
|
+
import {sequenceToSmiles} from '../structures-works/from-monomers';
|
|
3
3
|
|
|
4
4
|
category('sequence-translator', () => {
|
|
5
5
|
test('AGGTCCTCTTGACTTAGGCC', async () => {
|
package/src/users.ts
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
<html><head><meta charset="utf-8"/><title>SequenceTranslator Test Report. Datagrok version datagrok/datagrok:latest SHA=c2bbc2b235db. Commit afc0e1c5.</title><style type="text/css">html,
|
|
2
|
+
body {
|
|
3
|
+
font-family: Arial, Helvetica, sans-serif;
|
|
4
|
+
font-size: 1rem;
|
|
5
|
+
margin: 0;
|
|
6
|
+
padding: 0;
|
|
7
|
+
color: #333;
|
|
8
|
+
}
|
|
9
|
+
body {
|
|
10
|
+
padding: 2rem 1rem;
|
|
11
|
+
font-size: 0.85rem;
|
|
12
|
+
}
|
|
13
|
+
#jesthtml-content {
|
|
14
|
+
margin: 0 auto;
|
|
15
|
+
max-width: 70rem;
|
|
16
|
+
}
|
|
17
|
+
header {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
}
|
|
21
|
+
#title {
|
|
22
|
+
margin: 0;
|
|
23
|
+
flex-grow: 1;
|
|
24
|
+
}
|
|
25
|
+
#logo {
|
|
26
|
+
height: 4rem;
|
|
27
|
+
}
|
|
28
|
+
#timestamp {
|
|
29
|
+
color: #777;
|
|
30
|
+
margin-top: 0.5rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** SUMMARY */
|
|
34
|
+
#summary {
|
|
35
|
+
color: #333;
|
|
36
|
+
margin: 2rem 0;
|
|
37
|
+
display: flex;
|
|
38
|
+
font-family: monospace;
|
|
39
|
+
font-size: 1rem;
|
|
40
|
+
}
|
|
41
|
+
#summary > div {
|
|
42
|
+
margin-right: 2rem;
|
|
43
|
+
background: #eee;
|
|
44
|
+
padding: 1rem;
|
|
45
|
+
min-width: 15rem;
|
|
46
|
+
}
|
|
47
|
+
#summary > div:last-child {
|
|
48
|
+
margin-right: 0;
|
|
49
|
+
}
|
|
50
|
+
@media only screen and (max-width: 720px) {
|
|
51
|
+
#summary {
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
}
|
|
54
|
+
#summary > div {
|
|
55
|
+
margin-right: 0;
|
|
56
|
+
margin-top: 2rem;
|
|
57
|
+
}
|
|
58
|
+
#summary > div:first-child {
|
|
59
|
+
margin-top: 0;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.summary-total {
|
|
64
|
+
font-weight: bold;
|
|
65
|
+
margin-bottom: 0.5rem;
|
|
66
|
+
}
|
|
67
|
+
.summary-passed {
|
|
68
|
+
color: #4f8a10;
|
|
69
|
+
border-left: 0.4rem solid #4f8a10;
|
|
70
|
+
padding-left: 0.5rem;
|
|
71
|
+
}
|
|
72
|
+
.summary-failed,
|
|
73
|
+
.summary-obsolete-snapshots {
|
|
74
|
+
color: #d8000c;
|
|
75
|
+
border-left: 0.4rem solid #d8000c;
|
|
76
|
+
padding-left: 0.5rem;
|
|
77
|
+
}
|
|
78
|
+
.summary-pending {
|
|
79
|
+
color: #9f6000;
|
|
80
|
+
border-left: 0.4rem solid #9f6000;
|
|
81
|
+
padding-left: 0.5rem;
|
|
82
|
+
}
|
|
83
|
+
.summary-empty {
|
|
84
|
+
color: #999;
|
|
85
|
+
border-left: 0.4rem solid #999;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.test-result {
|
|
89
|
+
padding: 1rem;
|
|
90
|
+
margin-bottom: 0.25rem;
|
|
91
|
+
}
|
|
92
|
+
.test-result:last-child {
|
|
93
|
+
border: 0;
|
|
94
|
+
}
|
|
95
|
+
.test-result.passed {
|
|
96
|
+
background-color: #dff2bf;
|
|
97
|
+
color: #4f8a10;
|
|
98
|
+
}
|
|
99
|
+
.test-result.failed {
|
|
100
|
+
background-color: #ffbaba;
|
|
101
|
+
color: #d8000c;
|
|
102
|
+
}
|
|
103
|
+
.test-result.pending {
|
|
104
|
+
background-color: #ffdf61;
|
|
105
|
+
color: #9f6000;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.test-info {
|
|
109
|
+
display: flex;
|
|
110
|
+
justify-content: space-between;
|
|
111
|
+
}
|
|
112
|
+
.test-suitename {
|
|
113
|
+
width: 20%;
|
|
114
|
+
text-align: left;
|
|
115
|
+
font-weight: bold;
|
|
116
|
+
word-break: break-word;
|
|
117
|
+
}
|
|
118
|
+
.test-title {
|
|
119
|
+
width: 40%;
|
|
120
|
+
text-align: left;
|
|
121
|
+
font-style: italic;
|
|
122
|
+
}
|
|
123
|
+
.test-status {
|
|
124
|
+
width: 20%;
|
|
125
|
+
text-align: right;
|
|
126
|
+
}
|
|
127
|
+
.test-duration {
|
|
128
|
+
width: 10%;
|
|
129
|
+
text-align: right;
|
|
130
|
+
font-size: 0.75rem;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.failureMessages {
|
|
134
|
+
padding: 0 1rem;
|
|
135
|
+
margin-top: 1rem;
|
|
136
|
+
border-top: 1px dashed #d8000c;
|
|
137
|
+
}
|
|
138
|
+
.failureMessages.suiteFailure {
|
|
139
|
+
border-top: none;
|
|
140
|
+
}
|
|
141
|
+
.failureMsg {
|
|
142
|
+
white-space: pre-wrap;
|
|
143
|
+
white-space: -moz-pre-wrap;
|
|
144
|
+
white-space: -pre-wrap;
|
|
145
|
+
white-space: -o-pre-wrap;
|
|
146
|
+
word-wrap: break-word;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.suite-container {
|
|
150
|
+
margin-bottom: 2rem;
|
|
151
|
+
}
|
|
152
|
+
.suite-info {
|
|
153
|
+
padding: 1rem;
|
|
154
|
+
background-color: #eee;
|
|
155
|
+
color: #777;
|
|
156
|
+
display: flex;
|
|
157
|
+
align-items: center;
|
|
158
|
+
margin-bottom: 0.25rem;
|
|
159
|
+
}
|
|
160
|
+
.suite-info .suite-path {
|
|
161
|
+
word-break: break-all;
|
|
162
|
+
flex-grow: 1;
|
|
163
|
+
font-family: monospace;
|
|
164
|
+
font-size: 1rem;
|
|
165
|
+
}
|
|
166
|
+
.suite-info .suite-time {
|
|
167
|
+
margin-left: 0.5rem;
|
|
168
|
+
padding: 0.2rem 0.3rem;
|
|
169
|
+
font-size: 0.75rem;
|
|
170
|
+
}
|
|
171
|
+
.suite-info .suite-time.warn {
|
|
172
|
+
background-color: #d8000c;
|
|
173
|
+
color: #fff;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* CONSOLE LOGS */
|
|
177
|
+
.suite-consolelog {
|
|
178
|
+
margin-bottom: 0.25rem;
|
|
179
|
+
padding: 1rem;
|
|
180
|
+
background-color: #efefef;
|
|
181
|
+
}
|
|
182
|
+
.suite-consolelog-header {
|
|
183
|
+
font-weight: bold;
|
|
184
|
+
}
|
|
185
|
+
.suite-consolelog-item {
|
|
186
|
+
padding: 0.5rem;
|
|
187
|
+
}
|
|
188
|
+
.suite-consolelog-item pre {
|
|
189
|
+
margin: 0.5rem 0;
|
|
190
|
+
white-space: pre-wrap;
|
|
191
|
+
white-space: -moz-pre-wrap;
|
|
192
|
+
white-space: -pre-wrap;
|
|
193
|
+
white-space: -o-pre-wrap;
|
|
194
|
+
word-wrap: break-word;
|
|
195
|
+
}
|
|
196
|
+
.suite-consolelog-item-origin {
|
|
197
|
+
color: #777;
|
|
198
|
+
font-weight: bold;
|
|
199
|
+
}
|
|
200
|
+
.suite-consolelog-item-message {
|
|
201
|
+
color: #000;
|
|
202
|
+
font-size: 1rem;
|
|
203
|
+
padding: 0 0.5rem;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* OBSOLETE SNAPSHOTS */
|
|
207
|
+
.suite-obsolete-snapshots {
|
|
208
|
+
margin-bottom: 0.25rem;
|
|
209
|
+
padding: 1rem;
|
|
210
|
+
background-color: #ffbaba;
|
|
211
|
+
color: #d8000c;
|
|
212
|
+
}
|
|
213
|
+
.suite-obsolete-snapshots-header {
|
|
214
|
+
font-weight: bold;
|
|
215
|
+
}
|
|
216
|
+
.suite-obsolete-snapshots-item {
|
|
217
|
+
padding: 0.5rem;
|
|
218
|
+
}
|
|
219
|
+
.suite-obsolete-snapshots-item pre {
|
|
220
|
+
margin: 0.5rem 0;
|
|
221
|
+
white-space: pre-wrap;
|
|
222
|
+
white-space: -moz-pre-wrap;
|
|
223
|
+
white-space: -pre-wrap;
|
|
224
|
+
white-space: -o-pre-wrap;
|
|
225
|
+
word-wrap: break-word;
|
|
226
|
+
}
|
|
227
|
+
.suite-obsolete-snapshots-item-message {
|
|
228
|
+
color: #000;
|
|
229
|
+
font-size: 1rem;
|
|
230
|
+
padding: 0 0.5rem;
|
|
231
|
+
}
|
|
232
|
+
</style></head><body><div id="jesthtml-content"><header><h1 id="title">SequenceTranslator Test Report. Datagrok version datagrok/datagrok:latest SHA=c2bbc2b235db. Commit afc0e1c5.</h1></header><div id="metadata-container"><div id="timestamp">Started: 2022-05-13 15:45:08</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/SequenceTranslator/src/__jest__/remote.test.ts</div><div class="suite-time warn">26.07s</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">2.12s</div></div><div class="failureMessages"> <pre class="failureMsg">Error: Evaluation failed: Unable to find JS function "test"
|
|
233
|
+
at ExecutionContext._evaluateInternal (/home/runner/work/public/public/packages/SequenceTranslator/node_modules/puppeteer/src/common/ExecutionContext.ts:273:13)
|
|
234
|
+
at processTicksAndRejections (internal/process/task_queues.js:97:5)
|
|
235
|
+
at ExecutionContext.evaluate (/home/runner/work/public/public/packages/SequenceTranslator/node_modules/puppeteer/src/common/ExecutionContext.ts:140:12)</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/SequenceTranslator/src/__jest__/test-node.ts:62:11)
|
|
236
|
+
at Generator.next (<anonymous>)
|
|
237
|
+
at fulfilled (/home/runner/work/public/public/packages/SequenceTranslator/src/__jest__/test-node.ts:24:58)
|
|
238
|
+
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/SequenceTranslator/src/__jest__/remote.test.ts:24:11
|
|
239
|
+
at Generator.next (<anonymous>)
|
|
240
|
+
at /home/runner/work/public/public/packages/SequenceTranslator/src/__jest__/remote.test.ts:27:71
|
|
241
|
+
at new Promise (<anonymous>)
|
|
242
|
+
at Object.<anonymous>.__awaiter (/home/runner/work/public/public/packages/SequenceTranslator/src/__jest__/remote.test.ts:23:12)
|
|
243
|
+
at Object.<anonymous> (/home/runner/work/public/public/packages/SequenceTranslator/src/__jest__/remote.test.ts:22:23)
|
|
244
|
+
at Promise.then.completed (/home/runner/work/public/public/packages/SequenceTranslator/node_modules/jest-circus/build/utils.js:391:28)
|
|
245
|
+
at new Promise (<anonymous>)</pre><pre class="suite-consolelog-item-message">Testing SequenceTranslator package</pre></div></div></div></div></body></html>
|
package/tsconfig.json
CHANGED
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
/* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
|
|
11
11
|
"lib": [
|
|
12
12
|
"es2020",
|
|
13
|
-
"dom"
|
|
13
|
+
"dom",
|
|
14
|
+
"ES2021.String"
|
|
14
15
|
],
|
|
15
16
|
/* Specify library files to be included in the compilation. */
|
|
16
17
|
// "allowJs": true, /* Allow javascript files to be compiled. */
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import * as ui from 'datagrok-api/ui';
|
|
2
|
-
import {sequenceToSmiles} from './package';
|
|
3
|
-
import * as OCL from 'openchemlib/full.js';
|
|
4
|
-
|
|
5
|
-
export function saveSenseAntiSense() {
|
|
6
|
-
const ssInput = ui.textInput('Sense Strand 5\' ->3\'', '');
|
|
7
|
-
const asInput = ui.textInput('Anti Sense 3\' ->5\'', '');
|
|
8
|
-
const saveOption = ui.switchInput('save as one entity', false);
|
|
9
|
-
const saveBtn = ui.button('Save SDF', () => {
|
|
10
|
-
const smiSS = sequenceToSmiles(ssInput.value);
|
|
11
|
-
const smiAS = sequenceToSmiles(asInput.value, true);
|
|
12
|
-
let result: string;
|
|
13
|
-
if (saveOption.value)
|
|
14
|
-
result = `${OCL.Molecule.fromSmiles(smiSS + '.' + smiAS).toMolfile()}\n\n$$$$\n`;
|
|
15
|
-
else {
|
|
16
|
-
result =
|
|
17
|
-
`${OCL.Molecule.fromSmiles(smiSS).toMolfile()}\n` +
|
|
18
|
-
`> <Sequence>\nSense Strand\n\n$$$$\n` +
|
|
19
|
-
`${OCL.Molecule.fromSmiles(smiAS).toMolfile()}\n` +
|
|
20
|
-
`> <Sequence>\nAnti Sense\n\n$$$$\n`;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const element = document.createElement('a');
|
|
24
|
-
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(result));
|
|
25
|
-
element.setAttribute('download', ssInput.value.replace(/\s/g, '') + '.sdf');
|
|
26
|
-
element.click();
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const saveSection = ui.panel([
|
|
30
|
-
ui.div([
|
|
31
|
-
ui.div([
|
|
32
|
-
ui.divH([ui.h1('Inputs')]),
|
|
33
|
-
ui.divV([
|
|
34
|
-
ui.div([ssInput.root]),
|
|
35
|
-
ui.div([asInput.root]),
|
|
36
|
-
saveOption,
|
|
37
|
-
ui.buttonsInput([saveBtn]),
|
|
38
|
-
], 'ui-form'),
|
|
39
|
-
], 'ui-form'),
|
|
40
|
-
], 'ui-form'),
|
|
41
|
-
]);
|
|
42
|
-
|
|
43
|
-
return saveSection;
|
|
44
|
-
}
|