@datagrok/sequence-translator 0.0.8 → 1.0.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.
@@ -1,3 +1,6 @@
1
+ // import * as grok from 'datagrok-api/grok';
2
+ // import * as ui from 'datagrok-api/ui';
3
+ // import * as DG from 'datagrok-api/dg';
1
4
  import {map, SYNTHESIZERS, TECHNOLOGIES, MODIFICATIONS} from './map';
2
5
  import {asoGapmersNucleotidesToBioSpring, asoGapmersNucleotidesToGcrs,
3
6
  asoGapmersBioSpringToNucleotides, asoGapmersBioSpringToGcrs, asoGapmersGcrsToNucleotides,
@@ -10,98 +13,196 @@ import {asoGapmersNucleotidesToBioSpring, asoGapmersNucleotidesToGcrs,
10
13
  const noTranslationTableAvailable = 'No translation table available';
11
14
  export const undefinedInputSequence = 'Type of input sequence is undefined';
12
15
 
13
- export function isValidSequence(sequence: string): {
14
- indexOfFirstNotValidCharacter: number,
15
- expectedSynthesizer: string | null,
16
- expectedTechnology: string | null
17
- } {
16
+ export function getFormat(sequence: string): string | null {
18
17
  const possibleSynthesizers = getListOfPossibleSynthesizersByFirstMatchedCode(sequence);
18
+
19
+ if (possibleSynthesizers.length == 0)
20
+ return null;
21
+
22
+ let outputIndex = 0;
23
+
24
+ const firstUniqueCharacters = ['r', 'd'];
25
+ const nucleotides = ['A', 'U', 'T', 'C', 'G'];
26
+
27
+ possibleSynthesizers.forEach((synthesizer) => {
28
+ const codes = getAllCodesOfSynthesizer(synthesizer);
29
+ while (outputIndex < sequence.length) {
30
+ const matchedCode = codes.find((c) => c == sequence.slice(outputIndex, outputIndex + c.length));
31
+
32
+ if (matchedCode == null)
33
+ break;
34
+
35
+ if ( // for mistake pattern 'rAA'
36
+ outputIndex > 1 &&
37
+ nucleotides.includes(sequence[outputIndex]) &&
38
+ firstUniqueCharacters.includes(sequence[outputIndex - 2])
39
+ ) break;
40
+
41
+ if ( // for mistake pattern 'ArA'
42
+ firstUniqueCharacters.includes(sequence[outputIndex + 1]) &&
43
+ nucleotides.includes(sequence[outputIndex])
44
+ ) {
45
+ outputIndex++;
46
+ break;
47
+ }
48
+
49
+ outputIndex += matchedCode.length;
50
+ }
51
+ });
52
+
53
+ const indexOfFirstNotValidChar = (outputIndex == sequence.length) ? -1 : outputIndex;
54
+ if (indexOfFirstNotValidChar != -1)
55
+ return possibleSynthesizers[0];
56
+
57
+ const possibleTechnologies = getListOfPossibleTechnologiesByFirstMatchedCode(sequence, possibleSynthesizers[0]);
58
+
59
+ if (possibleTechnologies.length == 0)
60
+ return null;
61
+
62
+ outputIndex = 0;
63
+
64
+ possibleTechnologies.forEach((technology: string) => {
65
+ const codes = Object.keys(map[possibleSynthesizers[0]][technology]);
66
+ while (outputIndex < sequence.length) {
67
+ const matchedCode = codes.find((c) => c == sequence.slice(outputIndex, outputIndex + c.length));
68
+
69
+ if (matchedCode == null)
70
+ break;
71
+
72
+ if ( // for mistake pattern 'rAA'
73
+ outputIndex > 1 &&
74
+ nucleotides.includes(sequence[outputIndex]) &&
75
+ firstUniqueCharacters.includes(sequence[outputIndex - 2])
76
+ ) break;
77
+
78
+ if ( // for mistake pattern 'ArA'
79
+ firstUniqueCharacters.includes(sequence[outputIndex + 1]) &&
80
+ nucleotides.includes(sequence[outputIndex])
81
+ ) {
82
+ outputIndex++;
83
+ break;
84
+ }
85
+
86
+ outputIndex += matchedCode.length;
87
+ }
88
+ });
89
+
90
+ return possibleSynthesizers[0];
91
+ }
92
+
93
+ export function isValidSequence(sequence: string, format: string | null): {
94
+ indexOfFirstNotValidChar: number,
95
+ synthesizer: string[] | null,
96
+ technology: string[] | null
97
+ } {
98
+ const possibleSynthesizers = format == null ?
99
+ getListOfPossibleSynthesizersByFirstMatchedCode(sequence) :
100
+ [format];
101
+
102
+ // if (possibleSynthesizers.length > 1) {
103
+ // const synthesizer = ui.choiceInput('Choose synthesizer from list: ', possibleSynthesizers[0],
104
+ // possibleSynthesizers);
105
+ // ui.dialog('Choose Synthesizer')
106
+ // .add(ui.panel([synthesizer.root], {style: {fontWeight: 'bold'}}))
107
+ // .onOK(() => possibleSynthesizers = [synthesizer.value])
108
+ // .onCancel(() => {
109
+ // possibleSynthesizers = [possibleSynthesizers[0]];
110
+ // grok.shell.warning('Input sequence is expected to be in format ' + possibleSynthesizers[0]);
111
+ // })
112
+ // .show();
113
+ // } else if (possibleSynthesizers.length == 0)
19
114
  if (possibleSynthesizers.length == 0)
20
- return {indexOfFirstNotValidCharacter: 0, expectedSynthesizer: null, expectedTechnology: null};
115
+ return {indexOfFirstNotValidChar: 0, synthesizer: null, technology: null};
21
116
 
22
- let outputIndices = Array(possibleSynthesizers.length).fill(0);
117
+ let outputIndex = 0;
23
118
 
24
119
  const firstUniqueCharacters = ['r', 'd'];
25
120
  const nucleotides = ['A', 'U', 'T', 'C', 'G'];
26
121
 
27
- possibleSynthesizers.forEach((synthesizer, synthesizerIndex) => {
122
+ possibleSynthesizers.forEach((synthesizer) => {
28
123
  const codes = getAllCodesOfSynthesizer(synthesizer);
29
- while (outputIndices[synthesizerIndex] < sequence.length) {
30
- const matchedCode = codes
31
- .find((c) => c == sequence.slice(outputIndices[synthesizerIndex], outputIndices[synthesizerIndex] + c.length));
124
+ while (outputIndex < sequence.length) {
125
+ const matchedCode = codes.find((c) => c == sequence.slice(outputIndex, outputIndex + c.length));
32
126
 
33
127
  if (matchedCode == null)
34
128
  break;
35
129
 
36
130
  if ( // for mistake pattern 'rAA'
37
- outputIndices[synthesizerIndex] > 1 &&
38
- nucleotides.includes(sequence[outputIndices[synthesizerIndex]]) &&
39
- firstUniqueCharacters.includes(sequence[outputIndices[synthesizerIndex] - 2])
131
+ outputIndex > 1 &&
132
+ nucleotides.includes(sequence[outputIndex]) &&
133
+ firstUniqueCharacters.includes(sequence[outputIndex - 2])
40
134
  ) break;
41
135
 
42
136
  if ( // for mistake pattern 'ArA'
43
- firstUniqueCharacters.includes(sequence[outputIndices[synthesizerIndex] + 1]) &&
44
- nucleotides.includes(sequence[outputIndices[synthesizerIndex]])
137
+ firstUniqueCharacters.includes(sequence[outputIndex + 1]) &&
138
+ nucleotides.includes(sequence[outputIndex])
45
139
  ) {
46
- outputIndices[synthesizerIndex]++;
140
+ outputIndex++;
47
141
  break;
48
142
  }
49
143
 
50
- outputIndices[synthesizerIndex] += matchedCode.length;
144
+ outputIndex += matchedCode.length;
51
145
  }
52
146
  });
53
147
 
54
- const indexOfExpectedSythesizer = Math.max(...outputIndices);
55
- const indexOfFirstNotValidCharacter = (indexOfExpectedSythesizer == sequence.length) ? -1 : indexOfExpectedSythesizer;
56
- const expectedSynthesizer = possibleSynthesizers[outputIndices.indexOf(indexOfExpectedSythesizer)];
57
- if (indexOfFirstNotValidCharacter != -1) {
148
+ const indexOfFirstNotValidChar = (outputIndex == sequence.length) ? -1 : outputIndex;
149
+ if (indexOfFirstNotValidChar != -1) {
58
150
  return {
59
- indexOfFirstNotValidCharacter: indexOfFirstNotValidCharacter,
60
- expectedSynthesizer: expectedSynthesizer,
61
- expectedTechnology: null,
151
+ indexOfFirstNotValidChar: indexOfFirstNotValidChar,
152
+ synthesizer: possibleSynthesizers,
153
+ technology: null,
62
154
  };
63
155
  }
64
156
 
65
- const possibleTechnologies = getListOfPossibleTechnologiesByFirstMatchedCode(sequence, expectedSynthesizer);
157
+ const possibleTechnologies = getListOfPossibleTechnologiesByFirstMatchedCode(sequence, possibleSynthesizers[0]);
158
+
159
+ // if (possibleTechnologies.length > 1) {
160
+ // const technology = ui.choiceInput('Choose technology from list: ', possibleTechnologies[0],
161
+ // possibleTechnologies);
162
+ // ui.dialog('Choose Technology')
163
+ // .add(ui.panel([technology.root], {style: {fontWeight: 'bold'}}))
164
+ // .onOK(() => possibleTechnologies = [technology.value])
165
+ // .onCancel(() => {
166
+ // possibleTechnologies = [possibleTechnologies[0]];
167
+ // grok.shell.warning('Input sequence is expected to be in format ' + possibleTechnologies[0]);
168
+ // })
169
+ // .show();
170
+ // } else if (possibleTechnologies.length == 0)
66
171
  if (possibleTechnologies.length == 0)
67
- return {indexOfFirstNotValidCharacter: 0, expectedSynthesizer: null, expectedTechnology: null};
172
+ return {indexOfFirstNotValidChar: 0, synthesizer: null, technology: null};
68
173
 
69
- outputIndices = Array(possibleTechnologies.length).fill(0);
174
+ outputIndex = 0;
70
175
 
71
- possibleTechnologies.forEach((technology: string, technologyIndex: number) => {
72
- const codes = Object.keys(map[expectedSynthesizer][technology]);
73
- while (outputIndices[technologyIndex] < sequence.length) {
74
- const matchedCode = codes
75
- .find((c) => c == sequence.slice(outputIndices[technologyIndex], outputIndices[technologyIndex] + c.length));
176
+ possibleTechnologies.forEach((technology: string) => {
177
+ const codes = Object.keys(map[possibleSynthesizers[0]][technology]);
178
+ while (outputIndex < sequence.length) {
179
+ const matchedCode = codes.find((c) => c == sequence.slice(outputIndex, outputIndex + c.length));
76
180
 
77
181
  if (matchedCode == null)
78
182
  break;
79
183
 
80
184
  if ( // for mistake pattern 'rAA'
81
- outputIndices[technologyIndex] > 1 &&
82
- nucleotides.includes(sequence[outputIndices[technologyIndex]]) &&
83
- firstUniqueCharacters.includes(sequence[outputIndices[technologyIndex] - 2])
185
+ outputIndex > 1 &&
186
+ nucleotides.includes(sequence[outputIndex]) &&
187
+ firstUniqueCharacters.includes(sequence[outputIndex - 2])
84
188
  ) break;
85
189
 
86
190
  if ( // for mistake pattern 'ArA'
87
- firstUniqueCharacters.includes(sequence[outputIndices[technologyIndex] + 1]) &&
88
- nucleotides.includes(sequence[outputIndices[technologyIndex]])
191
+ firstUniqueCharacters.includes(sequence[outputIndex + 1]) &&
192
+ nucleotides.includes(sequence[outputIndex])
89
193
  ) {
90
- outputIndices[technologyIndex]++;
194
+ outputIndex++;
91
195
  break;
92
196
  }
93
197
 
94
- outputIndices[technologyIndex] += matchedCode.length;
198
+ outputIndex += matchedCode.length;
95
199
  }
96
200
  });
97
201
 
98
- const indexOfExpectedTechnology = Math.max(...outputIndices);
99
- const expectedTechnology = possibleTechnologies[outputIndices.indexOf(indexOfExpectedTechnology)];
100
-
101
202
  return {
102
- indexOfFirstNotValidCharacter: indexOfFirstNotValidCharacter,
103
- expectedSynthesizer: expectedSynthesizer,
104
- expectedTechnology: expectedTechnology,
203
+ indexOfFirstNotValidChar: indexOfFirstNotValidChar,
204
+ synthesizer: possibleSynthesizers,
205
+ technology: [possibleTechnologies[outputIndex]],
105
206
  };
106
207
  }
107
208
 
@@ -140,93 +241,91 @@ function getListOfPossibleTechnologiesByFirstMatchedCode(sequence: string, synth
140
241
  return technologies;
141
242
  }
142
243
 
143
- export function convertSequence(text: string) {
144
- text = text.replace(/\s/g, '');
145
- const seq = text;
146
- const output = isValidSequence(seq);
147
- if (output.indexOfFirstNotValidCharacter != -1) {
244
+ export function convertSequence(sequence: string, output: {
245
+ indexOfFirstNotValidChar: number, synthesizer: string[] | null, technology: string[] | null}) {
246
+ if (output.indexOfFirstNotValidChar != -1) {
148
247
  return {
149
248
  // type: '',
150
- indexOfFirstNotValidCharacter: JSON.stringify(output),
249
+ indexOfFirstNotValidChar: JSON.stringify(output),
151
250
  Error: undefinedInputSequence,
152
251
  };
153
252
  }
154
- if (output.expectedSynthesizer == SYNTHESIZERS.RAW_NUCLEOTIDES && output.expectedTechnology == TECHNOLOGIES.DNA) {
253
+ if (output.synthesizer!.includes(SYNTHESIZERS.RAW_NUCLEOTIDES)) {//&& output.technology!.includes(TECHNOLOGIES.DNA)) {
155
254
  return {
156
- type: SYNTHESIZERS.RAW_NUCLEOTIDES + ' ' + TECHNOLOGIES.DNA,
157
- Nucleotides: seq,
158
- BioSpring: asoGapmersNucleotidesToBioSpring(seq),
159
- GCRS: asoGapmersNucleotidesToGcrs(seq),
255
+ type: SYNTHESIZERS.RAW_NUCLEOTIDES, // + ' ' + TECHNOLOGIES.DNA,
256
+ Nucleotides: sequence,
257
+ BioSpring: asoGapmersNucleotidesToBioSpring(sequence),
258
+ GCRS: asoGapmersNucleotidesToGcrs(sequence),
160
259
  };
161
260
  }
162
- if (output.expectedSynthesizer == SYNTHESIZERS.BIOSPRING && output.expectedTechnology == TECHNOLOGIES.ASO_GAPMERS) {
261
+ if (output.synthesizer!.includes(SYNTHESIZERS.BIOSPRING) && output.technology!.includes(TECHNOLOGIES.ASO_GAPMERS)) {
163
262
  return {
164
263
  type: SYNTHESIZERS.BIOSPRING + ' ' + TECHNOLOGIES.ASO_GAPMERS,
165
- Nucleotides: asoGapmersBioSpringToNucleotides(seq),
166
- BioSpring: seq,
167
- GCRS: asoGapmersBioSpringToGcrs(seq),
264
+ Nucleotides: asoGapmersBioSpringToNucleotides(sequence),
265
+ BioSpring: sequence,
266
+ GCRS: asoGapmersBioSpringToGcrs(sequence),
168
267
  };
169
268
  }
170
- if (output.expectedSynthesizer == SYNTHESIZERS.GCRS && output.expectedTechnology == TECHNOLOGIES.ASO_GAPMERS) {
269
+ if (output.synthesizer!.includes(SYNTHESIZERS.GCRS) && output.technology!.includes(TECHNOLOGIES.ASO_GAPMERS)) {
171
270
  return {
172
271
  type: SYNTHESIZERS.GCRS + ' ' + TECHNOLOGIES.ASO_GAPMERS,
173
- Nucleotides: asoGapmersGcrsToNucleotides(seq),
174
- BioSpring: asoGapmersGcrsToBioSpring(seq),
175
- Mermade12: gcrsToMermade12(seq),
176
- GCRS: seq,
272
+ Nucleotides: asoGapmersGcrsToNucleotides(sequence),
273
+ BioSpring: asoGapmersGcrsToBioSpring(sequence),
274
+ Mermade12: gcrsToMermade12(sequence),
275
+ GCRS: sequence,
177
276
  };
178
277
  }
179
- if (output.expectedSynthesizer == SYNTHESIZERS.RAW_NUCLEOTIDES && output.expectedTechnology == TECHNOLOGIES.RNA) {
278
+ if (output.synthesizer!.includes(SYNTHESIZERS.RAW_NUCLEOTIDES) && output.technology!.includes(TECHNOLOGIES.RNA)) {
180
279
  return {
181
280
  type: SYNTHESIZERS.RAW_NUCLEOTIDES + ' ' + TECHNOLOGIES.RNA,
182
- Nucleotides: seq,
183
- BioSpring: siRnaNucleotideToBioSpringSenseStrand(seq),
184
- Axolabs: siRnaNucleotideToAxolabsSenseStrand(seq),
185
- GCRS: siRnaNucleotidesToGcrs(seq),
281
+ Nucleotides: sequence,
282
+ BioSpring: siRnaNucleotideToBioSpringSenseStrand(sequence),
283
+ Axolabs: siRnaNucleotideToAxolabsSenseStrand(sequence),
284
+ GCRS: siRnaNucleotidesToGcrs(sequence),
186
285
  };
187
286
  }
188
- if (output.expectedSynthesizer == SYNTHESIZERS.BIOSPRING && output.expectedTechnology == TECHNOLOGIES.SI_RNA) {
287
+ if (output.synthesizer!.includes(SYNTHESIZERS.BIOSPRING) && output.technology!.includes(TECHNOLOGIES.SI_RNA)) {
189
288
  return {
190
289
  type: SYNTHESIZERS.BIOSPRING + ' ' + TECHNOLOGIES.SI_RNA,
191
- Nucleotides: siRnaBioSpringToNucleotides(seq),
192
- BioSpring: seq,
193
- Axolabs: siRnaBioSpringToAxolabs(seq),
194
- GCRS: siRnaBioSpringToGcrs(seq),
290
+ Nucleotides: siRnaBioSpringToNucleotides(sequence),
291
+ BioSpring: sequence,
292
+ Axolabs: siRnaBioSpringToAxolabs(sequence),
293
+ GCRS: siRnaBioSpringToGcrs(sequence),
195
294
  };
196
295
  }
197
- if (output.expectedSynthesizer == SYNTHESIZERS.AXOLABS && output.expectedTechnology == TECHNOLOGIES.SI_RNA) {
296
+ if (output.synthesizer!.includes(SYNTHESIZERS.AXOLABS)) {
198
297
  return {
199
298
  type: SYNTHESIZERS.AXOLABS + ' ' + TECHNOLOGIES.SI_RNA,
200
- Nucleotides: siRnaAxolabsToNucleotides(seq),
201
- BioSpring: siRnaAxolabsToBioSpring(seq),
202
- Axolabs: seq,
203
- GCRS: siRnaAxolabsToGcrs(seq),
299
+ Nucleotides: siRnaAxolabsToNucleotides(sequence),
300
+ BioSpring: siRnaAxolabsToBioSpring(sequence),
301
+ Axolabs: sequence,
302
+ GCRS: siRnaAxolabsToGcrs(sequence),
204
303
  };
205
304
  }
206
- if (output.expectedSynthesizer == SYNTHESIZERS.GCRS && output.expectedTechnology == TECHNOLOGIES.SI_RNA) {
305
+ if (output.synthesizer!.includes(SYNTHESIZERS.GCRS) && output.technology!.includes(TECHNOLOGIES.SI_RNA)) {
207
306
  return {
208
307
  type: SYNTHESIZERS.GCRS + ' ' + TECHNOLOGIES.SI_RNA,
209
- Nucleotides: siRnaGcrsToNucleotides(seq),
210
- BioSpring: siRnaGcrsToBioSpring(seq),
211
- Axolabs: siRnaGcrsToAxolabs(seq),
212
- MM12: gcrsToMermade12(seq),
213
- GCRS: seq,
308
+ Nucleotides: siRnaGcrsToNucleotides(sequence),
309
+ BioSpring: siRnaGcrsToBioSpring(sequence),
310
+ Axolabs: siRnaGcrsToAxolabs(sequence),
311
+ MM12: gcrsToMermade12(sequence),
312
+ GCRS: sequence,
214
313
  };
215
314
  }
216
- if (output.expectedSynthesizer == SYNTHESIZERS.GCRS) {
315
+ if (output.synthesizer!.includes(SYNTHESIZERS.GCRS)) {
217
316
  return {
218
317
  type: SYNTHESIZERS.GCRS,
219
- Nucleotides: gcrsToNucleotides(seq),
220
- GCRS: seq,
221
- Mermade12: gcrsToMermade12(seq),
318
+ Nucleotides: gcrsToNucleotides(sequence),
319
+ GCRS: sequence,
320
+ Mermade12: gcrsToMermade12(sequence),
222
321
  };
223
322
  }
224
- if (output.expectedSynthesizer == SYNTHESIZERS.MERMADE_12) {
323
+ if (output.synthesizer!.includes(SYNTHESIZERS.MERMADE_12)) {
225
324
  return {
226
325
  type: SYNTHESIZERS.MERMADE_12,
227
326
  Nucleotides: noTranslationTableAvailable,
228
327
  GCRS: noTranslationTableAvailable,
229
- Mermade12: seq,
328
+ Mermade12: sequence,
230
329
  };
231
330
  }
232
331
  return {
@@ -1,5 +1,6 @@
1
1
  import {category, expect, test} from '@datagrok-libraries/utils/src/test';
2
2
  import {sequenceToSmiles} from '../structures-works/from-monomers';
3
+ import {SYNTHESIZERS} from '../structures-works/map';
3
4
 
4
5
  category('sequence-translator', () => {
5
6
  test('AGGTCCTCTTGACTTAGGCC', async () => {
@@ -23,7 +24,7 @@ category('sequence-translator', () => {
23
24
  'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
24
25
  'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))C[C@@H]1OP(=O)(O)OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))C[C@@H]1O';
25
26
 
26
- expect(sequenceToSmiles('AGGTCCTCTTGACTTAGGCC'), expected);
27
+ expect(sequenceToSmiles('AGGTCCTCTTGACTTAGGCC', false, SYNTHESIZERS.RAW_NUCLEOTIDES), expected);
27
28
  });
28
29
 
29
30
  test('invabasic/galnac1', async () => {
@@ -34,7 +35,7 @@ category('sequence-translator', () => {
34
35
  'OCC(O)CNC(=O)CCCC(=O)NC(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
35
36
  '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
36
37
  '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)';
37
- expect(sequenceToSmiles('(invabasic)sgg(invabasic)(GalNAc-2-JNJ)'), expected);
38
+ expect(sequenceToSmiles('(invabasic)sgg(invabasic)(GalNAc-2-JNJ)', false, SYNTHESIZERS.AXOLABS), expected);
38
39
  });
39
40
 
40
41
  test('invabasic/galnac2', async () => {
@@ -45,7 +46,7 @@ category('sequence-translator', () => {
45
46
  'OCC(O)CNC(=O)CCCC(=O)NC(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
46
47
  '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
47
48
  '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)';
48
- expect(sequenceToSmiles('(invabasic)sgsg(invabasic)(GalNAc-2-JNJ)'), expected);
49
+ expect(sequenceToSmiles('(invabasic)sgsg(invabasic)(GalNAc-2-JNJ)', false, SYNTHESIZERS.AXOLABS), expected);
49
50
  });
50
51
 
51
52
  test('invabasic/galnac3', async () => {
@@ -56,7 +57,7 @@ category('sequence-translator', () => {
56
57
  'OCC(O)CNC(=O)CCCC(=O)NC(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
57
58
  '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
58
59
  '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)';
59
- expect(sequenceToSmiles('(invabasic)sggs(invabasic)(GalNAc-2-JNJ)'), expected);
60
+ expect(sequenceToSmiles('(invabasic)sggs(invabasic)(GalNAc-2-JNJ)', false, SYNTHESIZERS.AXOLABS), expected);
60
61
  });
61
62
 
62
63
  test('invabasic/galnac4', async () => {
@@ -67,7 +68,7 @@ category('sequence-translator', () => {
67
68
  'OCC(O)CNC(=O)CCCC(=O)NC(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
68
69
  '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
69
70
  '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)';
70
- expect(sequenceToSmiles('(invabasic)sgg(invabasic)s(GalNAc-2-JNJ)'), expected);
71
+ expect(sequenceToSmiles('(invabasic)sgg(invabasic)s(GalNAc-2-JNJ)', false, SYNTHESIZERS.AXOLABS), expected);
71
72
  });
72
73
 
73
74
  test('usCfCfUfGfAf', async () => {
@@ -77,7 +78,7 @@ category('sequence-translator', () => {
77
78
  'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
78
79
  'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](F)[C@@H]1OP(=O)(O)' +
79
80
  'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](F)[C@@H]1O';
80
- expect(sequenceToSmiles('usCfCfUfGfAf'), expected);
81
+ expect(sequenceToSmiles('usCfCfUfGfAf', false, SYNTHESIZERS.AXOLABS), expected);
81
82
  });
82
83
 
83
84
  test('usAfsusgsgsg', async () => {
@@ -87,7 +88,7 @@ category('sequence-translator', () => {
87
88
  'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(S)' +
88
89
  'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(S)' +
89
90
  'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1O';
90
- expect(sequenceToSmiles('usAfsusgsgsg'), expected);
91
+ expect(sequenceToSmiles('usAfsusgsgsg', false, SYNTHESIZERS.AXOLABS), expected);
91
92
  });
92
93
 
93
94
  test('UfUfUfsCfsuacg', async () => {
@@ -99,7 +100,7 @@ category('sequence-translator', () => {
99
100
  'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
100
101
  'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
101
102
  'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1O';
102
- expect(sequenceToSmiles('UfUfUfsCfsuacg'), expected);
103
+ expect(sequenceToSmiles('UfUfUfsCfsuacg', false, SYNTHESIZERS.AXOLABS), expected);
103
104
  });
104
105
 
105
106
  test('susususauasu', async () => {
@@ -110,7 +111,7 @@ category('sequence-translator', () => {
110
111
  'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
111
112
  'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(S)' +
112
113
  'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1O';
113
- expect(sequenceToSmiles('susususauasu'), expected);
114
+ expect(sequenceToSmiles('susususauasu', false, SYNTHESIZERS.AXOLABS), expected);
114
115
  });
115
116
 
116
117
  test('CfGfCfsGfsCf', async () => {
@@ -119,7 +120,7 @@ category('sequence-translator', () => {
119
120
  'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](F)[C@@H]1OP(=O)(S)' +
120
121
  'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](F)[C@@H]1OP(=O)(S)' +
121
122
  'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](F)[C@@H]1O';
122
- expect(sequenceToSmiles('CfGfCfsGfsCf'), expected);
123
+ expect(sequenceToSmiles('CfGfCfsGfsCf', false, SYNTHESIZERS.AXOLABS), expected);
123
124
  });
124
125
 
125
126
  test('acacacsacsac', async () => {
@@ -133,7 +134,7 @@ category('sequence-translator', () => {
133
134
  'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
134
135
  'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
135
136
  'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1O';
136
- expect(sequenceToSmiles('acacacsacsac'), expected);
137
+ expect(sequenceToSmiles('acacacsacsac', false, SYNTHESIZERS.AXOLABS), expected);
137
138
  });
138
139
 
139
140
  test('cccgggusug', async () => {
@@ -147,7 +148,7 @@ category('sequence-translator', () => {
147
148
  'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
148
149
  'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
149
150
  'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1O';
150
- expect(sequenceToSmiles('cccgggusug'), expected);
151
+ expect(sequenceToSmiles('cccgggusug', false, SYNTHESIZERS.AXOLABS), expected);
151
152
  });
152
153
 
153
154
  test('UfAfCfGfGfCfAfUf', async () => {
@@ -160,7 +161,7 @@ category('sequence-translator', () => {
160
161
  'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
161
162
  'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](F)[C@@H]1OP(=O)(O)' +
162
163
  'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](F)[C@@H]1O';
163
- expect(sequenceToSmiles('UfAfCfGfGfCfAfUf'), expected);
164
+ expect(sequenceToSmiles('UfAfCfGfGfCfAfUf', false, SYNTHESIZERS.AXOLABS), expected);
164
165
  });
165
166
 
166
167
  test('(invabasic)sucuCfuUf', async () => {
@@ -172,7 +173,7 @@ category('sequence-translator', () => {
172
173
  'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
173
174
  'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
174
175
  'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](F)[C@@H]1O';
175
- expect(sequenceToSmiles('(invabasic)sucuCfuUf'), expected);
176
+ expect(sequenceToSmiles('(invabasic)sucuCfuUf', false, SYNTHESIZERS.AXOLABS), expected);
176
177
  });
177
178
 
178
179
  test('(invabasic)sAfgcugUf', async () => {
@@ -184,7 +185,7 @@ category('sequence-translator', () => {
184
185
  'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
185
186
  'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
186
187
  'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](F)[C@@H]1O';
187
- expect(sequenceToSmiles('(invabasic)sAfgcugUf'), expected);
188
+ expect(sequenceToSmiles('(invabasic)sAfgcugUf', false, SYNTHESIZERS.AXOLABS), expected);
188
189
  });
189
190
 
190
191
  test('(invabasic)cuCfuUfsc', async () => {
@@ -196,7 +197,7 @@ category('sequence-translator', () => {
196
197
  'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
197
198
  'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](F)[C@@H]1OP(=O)(S)' +
198
199
  'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1O';
199
- expect(sequenceToSmiles('(invabasic)cuCfuUfsc'), expected);
200
+ expect(sequenceToSmiles('(invabasic)cuCfuUfsc', false, SYNTHESIZERS.AXOLABS), expected);
200
201
  });
201
202
 
202
203
  test('(invabasic)scususu(GalNAc-2-JNJ)', async () => {
@@ -209,7 +210,7 @@ category('sequence-translator', () => {
209
210
  'OCC(O)CNC(=O)CCCC(=O)NC(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
210
211
  '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
211
212
  '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)';
212
- expect(sequenceToSmiles('(invabasic)scususu(GalNAc-2-JNJ)'), expected);
213
+ expect(sequenceToSmiles('(invabasic)scususu(GalNAc-2-JNJ)', false, SYNTHESIZERS.AXOLABS), expected);
213
214
  });
214
215
 
215
216
  test('(invabasic)usAfsucuCfuUfAfgcugUfgCfacususu', async () => {
@@ -236,7 +237,7 @@ category('sequence-translator', () => {
236
237
  'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
237
238
  'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
238
239
  'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1O';
239
- expect(sequenceToSmiles('(invabasic)usAfsucuCfuUfAfgcugUfgCfacususu'), expected);
240
+ expect(sequenceToSmiles('(invabasic)usAfsucuCfuUfAfgcugUfgCfacususu', false, SYNTHESIZERS.AXOLABS), expected);
240
241
  });
241
242
 
242
243
  test('(invabasic)asacgGfuGfCfAfacucuauuca', async () => {
@@ -261,7 +262,7 @@ category('sequence-translator', () => {
261
262
  'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
262
263
  'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
263
264
  'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1O';
264
- expect(sequenceToSmiles('(invabasic)asacgGfuGfCfAfacucuauuca'), expected);
265
+ expect(sequenceToSmiles('(invabasic)asacgGfuGfCfAfacucuauuca', false, SYNTHESIZERS.AXOLABS), expected);
265
266
  });
266
267
 
267
268
  test('(invabasic)scsgguGfcAfAfCfucuauucuga', async () => {
@@ -286,7 +287,7 @@ category('sequence-translator', () => {
286
287
  'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
287
288
  'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
288
289
  'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1O';
289
- expect(sequenceToSmiles('(invabasic)scsgguGfcAfAfCfucuauucuga'), expected);
290
+ expect(sequenceToSmiles('(invabasic)scsgguGfcAfAfCfucuauucuga', false, SYNTHESIZERS.AXOLABS), expected);
290
291
  });
291
292
 
292
293
  test('(invabasic)scsaacUfcUfAfUfucuggacuua', async () => {
@@ -311,7 +312,7 @@ category('sequence-translator', () => {
311
312
  'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
312
313
  'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
313
314
  'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1O';
314
- expect(sequenceToSmiles('(invabasic)scsaacUfcUfAfUfucuggacuua'), expected);
315
+ expect(sequenceToSmiles('(invabasic)scsaacUfcUfAfUfucuggacuua', false, SYNTHESIZERS.AXOLABS), expected);
315
316
  });
316
317
 
317
318
  test('(invabasic)sasacuCfuAfUfUfcuggacuuua', async () => {
@@ -336,7 +337,7 @@ category('sequence-translator', () => {
336
337
  'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
337
338
  'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
338
339
  'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1O';
339
- expect(sequenceToSmiles('(invabasic)sasacuCfuAfUfUfcuggacuuua'), expected);
340
+ expect(sequenceToSmiles('(invabasic)sasacuCfuAfUfUfcuggacuuua', false, SYNTHESIZERS.AXOLABS), expected);
340
341
  });
341
342
 
342
343
  test('(invabasic)usAfscug(invabasic)(GalNAc-2-JNJ)', async () => {
@@ -350,7 +351,7 @@ category('sequence-translator', () => {
350
351
  'OCC(O)CNC(=O)CCCC(=O)NC(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
351
352
  '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
352
353
  '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)';
353
- expect(sequenceToSmiles('(invabasic)usAfscug(invabasic)(GalNAc-2-JNJ)'), expected);
354
+ expect(sequenceToSmiles('(invabasic)usAfscug(invabasic)(GalNAc-2-JNJ)', false, SYNTHESIZERS.AXOLABS), expected);
354
355
  });
355
356
 
356
357
  test('(invabasic)sasuaaCfcUf(GalNAc-2-JNJ)', async () => {
@@ -365,7 +366,7 @@ category('sequence-translator', () => {
365
366
  'OCC(O)CNC(=O)CCCC(=O)NC(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
366
367
  '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
367
368
  '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)';
368
- expect(sequenceToSmiles('(invabasic)sasuaaCfcUf(GalNAc-2-JNJ)'), expected);
369
+ expect(sequenceToSmiles('(invabasic)sasuaaCfcUf(GalNAc-2-JNJ)', false, SYNTHESIZERS.AXOLABS), expected);
369
370
  });
370
371
 
371
372
  test('(invabasic)sasuaaCfcUfCfUfuguaguuaua(GalNAc-2-JNJ)', async () => {
@@ -392,7 +393,8 @@ category('sequence-translator', () => {
392
393
  'OCC(O)CNC(=O)CCCC(=O)NC(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
393
394
  '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
394
395
  '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)';
395
- expect(sequenceToSmiles('(invabasic)sasuaaCfcUfCfUfuguaguuaua(GalNAc-2-JNJ)'), expected);
396
+ expect(sequenceToSmiles('(invabasic)sasuaaCfcUfCfUfuguaguuaua(GalNAc-2-JNJ)', false, SYNTHESIZERS.AXOLABS),
397
+ expected);
396
398
  });
397
399
 
398
400
  test('(invabasic)scsaucacguUfGfCfagccgucuua(invabasic)(GalNAc-2-JNJ)', async () => {
@@ -422,7 +424,8 @@ category('sequence-translator', () => {
422
424
  'OCC(O)CNC(=O)CCCC(=O)NC(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
423
425
  '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
424
426
  '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)';
425
- expect(sequenceToSmiles('(invabasic)scsaucacguUfGfCfagccgucuua(invabasic)(GalNAc-2-JNJ)'), expected);
427
+ expect(sequenceToSmiles('(invabasic)scsaucacguUfGfCfagccgucuua(invabasic)(GalNAc-2-JNJ)',
428
+ false, SYNTHESIZERS.AXOLABS), expected);
426
429
  });
427
430
 
428
431
  test('(invabasic)susguuUfgCfCfUfacaucuacua(GalNAc-2-JNJ)', async () => {
@@ -449,6 +452,7 @@ category('sequence-translator', () => {
449
452
  'OCC(O)CNC(=O)CCCC(=O)NC(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
450
453
  '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
451
454
  '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)';
452
- expect(sequenceToSmiles('(invabasic)susguuUfgCfCfUfacaucuacua(GalNAc-2-JNJ)'), expected);
455
+ expect(sequenceToSmiles('(invabasic)susguuUfgCfCfUfacaucuacua(GalNAc-2-JNJ)', false, SYNTHESIZERS.AXOLABS),
456
+ expected);
453
457
  });
454
458
  });
package/src/users.ts ADDED
@@ -0,0 +1,3 @@
1
+ export const USERS_CSV = `DISPLAY
2
+ NO DATA
3
+ `;