@datagrok/sequence-translator 0.0.3 → 0.0.6

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.
@@ -0,0 +1,44 @@
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
+ }
@@ -0,0 +1,454 @@
1
+ import {category, expect, test} from '@datagrok-libraries/utils/src/test';
2
+ import {sequenceToSmiles} from '../package';
3
+
4
+ category('sequence-translator', () => {
5
+ test('AGGTCCTCTTGACTTAGGCC', async () => {
6
+ const expected = 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)C[C@@H]1OP(=O)(O)' +
7
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
8
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
9
+ 'OC[C@H]1O[C@@H](N2C=C(C)C(=O)NC2(=O))C[C@@H]1OP(=O)(O)' +
10
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))C[C@@H]1OP(=O)(O)' +
11
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))C[C@@H]1OP(=O)(O)' +
12
+ 'OC[C@H]1O[C@@H](N2C=C(C)C(=O)NC2(=O))C[C@@H]1OP(=O)(O)' +
13
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))C[C@@H]1OP(=O)(O)' +
14
+ 'OC[C@H]1O[C@@H](N2C=C(C)C(=O)NC2(=O))C[C@@H]1OP(=O)(O)' +
15
+ 'OC[C@H]1O[C@@H](N2C=C(C)C(=O)NC2(=O))C[C@@H]1OP(=O)(O)' +
16
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
17
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)C[C@@H]1OP(=O)(O)' +
18
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))C[C@@H]1OP(=O)(O)' +
19
+ 'OC[C@H]1O[C@@H](N2C=C(C)C(=O)NC2(=O))C[C@@H]1OP(=O)(O)' +
20
+ 'OC[C@H]1O[C@@H](N2C=C(C)C(=O)NC2(=O))C[C@@H]1OP(=O)(O)' +
21
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)C[C@@H]1OP(=O)(O)' +
22
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
23
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
24
+ '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
+ expect(sequenceToSmiles('AGGTCCTCTTGACTTAGGCC'), expected);
27
+ });
28
+
29
+ test('invabasic/galnac1', async () => {
30
+ const expected = 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(S)' +
31
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
32
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
33
+ 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(O)' +
34
+ 'OCC(O)CNC(=O)CCCC(=O)NC(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
35
+ '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
36
+ '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)';
37
+ expect(sequenceToSmiles('(invabasic)sgg(invabasic)(GalNAc-2-JNJ)'), expected);
38
+ });
39
+
40
+ test('invabasic/galnac2', async () => {
41
+ const expected = 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(S)' +
42
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(S)' +
43
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
44
+ 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(O)' +
45
+ 'OCC(O)CNC(=O)CCCC(=O)NC(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
46
+ '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
47
+ '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)';
48
+ expect(sequenceToSmiles('(invabasic)sgsg(invabasic)(GalNAc-2-JNJ)'), expected);
49
+ });
50
+
51
+ test('invabasic/galnac3', async () => {
52
+ const expected = 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(S)' +
53
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
54
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(S)' +
55
+ 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(O)' +
56
+ 'OCC(O)CNC(=O)CCCC(=O)NC(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
57
+ '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
58
+ '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)';
59
+ expect(sequenceToSmiles('(invabasic)sggs(invabasic)(GalNAc-2-JNJ)'), expected);
60
+ });
61
+
62
+ test('invabasic/galnac4', async () => {
63
+ const expected = 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(S)' +
64
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
65
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
66
+ 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(S)' +
67
+ 'OCC(O)CNC(=O)CCCC(=O)NC(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
68
+ '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
69
+ '(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
+ });
72
+
73
+ test('usCfCfUfGfAf', async () => {
74
+ const expected = 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
75
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
76
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
77
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
78
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](F)[C@@H]1OP(=O)(O)' +
79
+ '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
+ });
82
+
83
+ test('usAfsusgsgsg', async () => {
84
+ const expected = 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
85
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](F)[C@@H]1OP(=O)(S)' +
86
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
87
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(S)' +
88
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(S)' +
89
+ '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
+ });
92
+
93
+ test('UfUfUfsCfsuacg', async () => {
94
+ const expected = 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
95
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
96
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](F)[C@@H]1OP(=O)(S)' +
97
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](F)[C@@H]1OP(=O)(S)' +
98
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
99
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
100
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
101
+ '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
+ });
104
+
105
+ test('susususauasu', async () => {
106
+ const expected = 'OP(=O)(S)OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
107
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
108
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
109
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
110
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
111
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(S)' +
112
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1O';
113
+ expect(sequenceToSmiles('susususauasu'), expected);
114
+ });
115
+
116
+ test('CfGfCfsGfsCf', async () => {
117
+ const expected = 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
118
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](F)[C@@H]1OP(=O)(O)' +
119
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](F)[C@@H]1OP(=O)(S)' +
120
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](F)[C@@H]1OP(=O)(S)' +
121
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](F)[C@@H]1O';
122
+ expect(sequenceToSmiles('CfGfCfsGfsCf'), expected);
123
+ });
124
+
125
+ test('acacacsacsac', async () => {
126
+ const expected = 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
127
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
128
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
129
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
130
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
131
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
132
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
133
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
134
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
135
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1O';
136
+ expect(sequenceToSmiles('acacacsacsac'), expected);
137
+ });
138
+
139
+ test('cccgggusug', async () => {
140
+ const expected =
141
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
142
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
143
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
144
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
145
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
146
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
147
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
148
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
149
+ '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
+ });
152
+
153
+ test('UfAfCfGfGfCfAfUf', async () => {
154
+ const expected =
155
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
156
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](F)[C@@H]1OP(=O)(O)' +
157
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
158
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](F)[C@@H]1OP(=O)(O)' +
159
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](F)[C@@H]1OP(=O)(O)' +
160
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
161
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](F)[C@@H]1OP(=O)(O)' +
162
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](F)[C@@H]1O';
163
+ expect(sequenceToSmiles('UfAfCfGfGfCfAfUf'), expected);
164
+ });
165
+
166
+ test('(invabasic)sucuCfuUf', async () => {
167
+ const expected =
168
+ 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(S)' +
169
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
170
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
171
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
172
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
173
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
174
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](F)[C@@H]1O';
175
+ expect(sequenceToSmiles('(invabasic)sucuCfuUf'), expected);
176
+ });
177
+
178
+ test('(invabasic)sAfgcugUf', async () => {
179
+ const expected =
180
+ 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(S)' +
181
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](F)[C@@H]1OP(=O)(O)' +
182
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
183
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
184
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
185
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
186
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](F)[C@@H]1O';
187
+ expect(sequenceToSmiles('(invabasic)sAfgcugUf'), expected);
188
+ });
189
+
190
+ test('(invabasic)cuCfuUfsc', async () => {
191
+ const expected =
192
+ 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(O)' +
193
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
194
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
195
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
196
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
197
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](F)[C@@H]1OP(=O)(S)' +
198
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1O';
199
+ expect(sequenceToSmiles('(invabasic)cuCfuUfsc'), expected);
200
+ });
201
+
202
+ test('(invabasic)scususu(GalNAc-2-JNJ)', async () => {
203
+ const expected =
204
+ 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(S)' +
205
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
206
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
207
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
208
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
209
+ 'OCC(O)CNC(=O)CCCC(=O)NC(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
210
+ '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
211
+ '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)';
212
+ expect(sequenceToSmiles('(invabasic)scususu(GalNAc-2-JNJ)'), expected);
213
+ });
214
+
215
+ test('(invabasic)usAfsucuCfuUfAfgcugUfgCfacususu', async () => {
216
+ const expected =
217
+ 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(O)' +
218
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
219
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](F)[C@@H]1OP(=O)(S)' +
220
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC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'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
237
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
238
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1O';
239
+ expect(sequenceToSmiles('(invabasic)usAfsucuCfuUfAfgcugUfgCfacususu'), expected);
240
+ });
241
+
242
+ test('(invabasic)asacgGfuGfCfAfacucuauuca', async () => {
243
+ const expected =
244
+ 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(O)' +
245
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(S)' +
246
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
247
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
248
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
249
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](F)[C@@H]1OP(=O)(O)' +
250
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
251
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](F)[C@@H]1OP(=O)(O)' +
252
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
253
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](F)[C@@H]1OP(=O)(O)' +
254
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
255
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
256
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
257
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
258
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
259
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
260
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
261
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
262
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
263
+ '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
+ });
266
+
267
+ test('(invabasic)scsgguGfcAfAfCfucuauucuga', async () => {
268
+ const expected =
269
+ 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(S)' +
270
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
271
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
272
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
273
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
274
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](F)[C@@H]1OP(=O)(O)' +
275
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
276
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](F)[C@@H]1OP(=O)(O)' +
277
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](F)[C@@H]1OP(=O)(O)' +
278
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
279
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
280
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
281
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
282
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
283
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
284
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
285
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
286
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
287
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
288
+ '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
+ });
291
+
292
+ test('(invab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[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
310
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
311
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
312
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
313
+ '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
+ });
316
+
317
+ test('(invabasic)sasacuCfuAfUfUfcuggacuuua', async () => {
318
+ const expected =
319
+ 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(S)' +
320
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(S)' +
321
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
322
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
323
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
324
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
325
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
326
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](F)[C@@H]1OP(=O)(O)' +
327
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
328
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
329
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
330
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
331
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
332
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
333
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
334
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
335
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
336
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
337
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
338
+ '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
+ });
341
+
342
+ test('(invabasic)usAfscug(invabasic)(GalNAc-2-JNJ)', async () => {
343
+ const expected = 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(O)' +
344
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
345
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](F)[C@@H]1OP(=O)(S)' +
346
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
347
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
348
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
349
+ 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(O)' +
350
+ 'OCC(O)CNC(=O)CCCC(=O)NC(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
351
+ '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
352
+ '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)';
353
+ expect(sequenceToSmiles('(invabasic)usAfscug(invabasic)(GalNAc-2-JNJ)'), expected);
354
+ });
355
+
356
+ test('(invabasic)sasuaaCfcUf(GalNAc-2-JNJ)', async () => {
357
+ const expected = 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(S)' +
358
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(S)' +
359
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
360
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
361
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
362
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
363
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
364
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
365
+ 'OCC(O)CNC(=O)CCCC(=O)NC(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
366
+ '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
367
+ '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)';
368
+ expect(sequenceToSmiles('(invabasic)sasuaaCfcUf(GalNAc-2-JNJ)'), expected);
369
+ });
370
+
371
+ test('(invabasic)sasuaaCfcUfCfUfuguaguuaua(GalNAc-2-JNJ)', async () => {
372
+ const expected = 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(S)' +
373
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(S)' +
374
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
375
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
376
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
377
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
378
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
379
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
380
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
381
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](F)[C@@H]1OP(=O)(O)' +
382
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
383
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
384
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
385
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
386
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
387
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
388
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
389
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
390
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
391
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
392
+ 'OCC(O)CNC(=O)CCCC(=O)NC(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
393
+ '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
394
+ '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)';
395
+ expect(sequenceToSmiles('(invabasic)sasuaaCfcUfCfUfuguaguuaua(GalNAc-2-JNJ)'), expected);
396
+ });
397
+
398
+ test('(invabasic)scsaucacguUfGfCfagccgucuua(invabasic)(GalNAc-2-JNJ)', async () => {
399
+ const expected = 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(S)' +
400
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
401
+ 'OC[C@H]1O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(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
417
+ 'OC[C@H]1O[C@@H](N2C=CC(N)=NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
418
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
419
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
420
+ 'OC[C@H]1O[C@@H](N2C3N=CN=C(N)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
421
+ 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(O)' +
422
+ 'OCC(O)CNC(=O)CCCC(=O)NC(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
423
+ '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
424
+ '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)';
425
+ expect(sequenceToSmiles('(invabasic)scsaucacguUfGfCfagccgucuua(invabasic)(GalNAc-2-JNJ)'), expected);
426
+ });
427
+
428
+ test('(invabasic)susguuUfgCfCfUfacaucuacua(GalNAc-2-JNJ)', async () => {
429
+ const expected = 'O[C@@H]1C[C@@H]O[C@H]1COP(=O)(S)' +
430
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(S)' +
431
+ 'OC[C@H]1O[C@@H](N2C3N=C(N)NC(=O)C=3N=C2)[C@H](OC)[C@@H]1OP(=O)(O)' +
432
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
433
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](OC)[C@@H]1OP(=O)(O)' +
434
+ 'OC[C@H]1O[C@@H](N2C=CC(=O)NC2(=O))[C@H](F)[C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C)' +
450
+ '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' +
451
+ '(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)';
452
+ expect(sequenceToSmiles('(invabasic)susguuUfgCfCfUfacaucuacua(GalNAc-2-JNJ)'), expected);
453
+ });
454
+ });
package/webpack.config.js CHANGED
@@ -1,9 +1,15 @@
1
1
  const path = require('path');
2
+ const packageName = path.parse(require('./package.json').name).name.toLowerCase().replace(/-/g, '');
2
3
 
3
4
  module.exports = {
4
5
  mode: 'development',
5
6
  entry: {
6
- package: './src/package.ts'
7
+ package: ['./src/package.ts'],
8
+ test: {
9
+ filename: 'package-test.js',
10
+ library: {type: 'var', name: `${packageName}_test`},
11
+ import: './src/package-test.ts',
12
+ }
7
13
  },
8
14
  resolve: {
9
15
  extensions: ['.wasm', '.mjs', '.js', '.json', '.ts', '.tsx'],
@@ -1,24 +0,0 @@
1
- #name: convertFastaToSmiles
2
- #description: Converts FASTA format to smiles
3
- #language: python
4
- #tags: demo, chem, rdkit, smiles
5
- #input: string sequence_in_fasta_format = AGGTCTTCATGACTTCGGCC {semType: nucleotides}
6
- #input: string flavor = DNA_no_cap {choices: ["Protein_L_amino_acids","Protein_D_amino_acids","RNA_no_cap","RNA_5_cap","RNA_3_cap","RNA_both_caps","DNA_no_cap","DNA_5_cap","DNA_3_cap","DNA_both_caps"]}
7
- #output: string smiles {semType: Molecule}
8
-
9
- from rdkit import Chem
10
-
11
- flavors = {
12
- "Protein_L_amino_acids": 0,
13
- "Protein_D_amino_acids": 1,
14
- "RNA_no_cap": 2,
15
- "RNA_5_cap": 3,
16
- "RNA_3_cap": 4,
17
- "RNA_both_caps": 5,
18
- "DNA_no_cap": 6,
19
- "DNA_5_cap": 7,
20
- "DNA_3_cap": 8,
21
- "DNA_both_caps": 9
22
- }
23
-
24
- smiles = Chem.MolToSmiles(Chem.MolFromFASTA(text=sequence_in_fasta_format, flavor=flavors[flavor]))
@@ -1,50 +0,0 @@
1
- #name: drawAxolabsPattern
2
- #language: python
3
- #input: dataframe ss_df
4
- #input: dataframe as_df
5
- #input: string patternName
6
- #output: graphics pattern
7
-
8
- import matplotlib.pyplot as plt
9
-
10
- basis_color_dict = {
11
- "RNA": 'k', # black
12
- "DNA": 'm', # magenta
13
- "2'-Fluoro": 'b', # blue
14
- "2'-O-Methyl": 'r', # red
15
- "2'-O-MOE": 'c', # cyan
16
- "Glycol nucleic acid": 'y', # yellow
17
- "LNA": 'aquamarine',
18
- "Unlocked (UNA)": 'g' # green
19
- }
20
-
21
- pattern = plt.figure()
22
-
23
- max_length = 2 * max(len(ss_df), len(as_df)) + 2.5
24
-
25
- for i in range(len(ss_df) - 1, -1, -1):
26
- plt.gca().add_patch(plt.Circle(xy=(-2 * i, 3), radius=1, fc=basis_color_dict[ss_df['basis'][i]]))
27
- if ss_df['pto'][i]:
28
- plt.gca()._add_text(plt.Text(x=-2 * i - 1.25, y=3.25, text="*", color='r', fontsize=20))
29
- plt.gca()._add_text(plt.Text(x=-2 * len(ss_df) - 0.25, y=2.5, text="5'", fontsize=30))
30
- plt.gca()._add_text(plt.Text(x=-max_length, y=2.5, text='SS:', fontsize=30))
31
- plt.gca()._add_text(plt.Text(x=1, y=2.5, text="3'", fontsize=30))
32
-
33
- for i in range(len(as_df) - 1, -1, -1):
34
- plt.gca().add_patch(plt.Circle(xy=(-2 * i, 0), radius=1, fc=basis_color_dict[as_df['basis'][i]]))
35
- if as_df['pto'][i]:
36
- plt.gca()._add_text(plt.Text(x=-2 * i - 1.25, y=-1.25, text="*", color='r', fontsize=20))
37
- plt.gca()._add_text(plt.Text(x=-2 * len(as_df) - 0.25, y=-0.5, text="3'", fontsize=30))
38
- plt.gca()._add_text(plt.Text(x=-max_length, y=-0.5, text='AS:', fontsize=30))
39
- plt.gca()._add_text(plt.Text(x=1, y=-0.5, text="5'", fontsize=30))
40
-
41
- scaler = -1
42
- for index, key in enumerate(basis_color_dict):
43
- if key in as_df['basis'].unique() or key in ss_df['basis'].unique():
44
- scaler += 1
45
- plt.gca().add_patch(plt.Circle(xy=(-3 * scaler, -2), radius=0.5, fc=basis_color_dict[key]))
46
- plt.gca()._add_text(plt.Text(x=-3 * scaler - 1, y=-4, text=key, fontsize=10))
47
-
48
- plt.axis('scaled')
49
- plt.axis('off')
50
- plt.title(patternName + ' for ' + str(len(ss_df)) + '/' + str(len(as_df)) + 'mer')