@datagrok/sequence-translator 1.0.13 → 1.0.15

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,573 +1,30 @@
1
- const PHOSHATE = `
2
- Datagrok monomer library Nucleotides
3
-
4
- 0 0 0 0 0 0 0 V3000
5
- M V30 BEGIN CTAB
6
- M V30 COUNTS 5 4 0 0 0
7
- M V30 BEGIN ATOM
8
- M V30 1 O -1.5 0 0 0
9
- M V30 2 P 0 0 0 0
10
- M V30 3 O 0 1 0 0
11
- M V30 4 O 0 -1 0 0
12
- M V30 5 O 1.5 0 0 0
13
- M V30 END ATOM
14
- M V30 BEGIN BOND
15
- M V30 1 1 1 2
16
- M V30 2 2 2 3
17
- M V30 3 1 2 4
18
- M V30 4 1 2 5
19
- M V30 END BOND
20
- M V30 END CTAB
21
- M V30 BEGIN COLLECTION
22
- M V30 END COLLECTION
23
- M END`;
24
-
25
- const THIOPHOSHATE = `
26
- Datagrok monomer library Nucleotides
27
-
28
- 0 0 0 0 0 0 0 V3000
29
- M V30 BEGIN CTAB
30
- M V30 COUNTS 5 4 0 0 0
31
- M V30 BEGIN ATOM
32
- M V30 1 O -1.5 0 0 0
33
- M V30 2 P 0 0 0 0
34
- M V30 3 O 0 1 0 0
35
- M V30 4 S 0 -1 0 0
36
- M V30 5 O 1.5 0 0 0
37
- M V30 END ATOM
38
- M V30 BEGIN BOND
39
- M V30 1 1 1 2
40
- M V30 2 2 2 3
41
- M V30 3 1 2 4
42
- M V30 4 1 2 5
43
- M V30 END BOND
44
- M V30 END CTAB
45
- M V30 BEGIN COLLECTION
46
- M V30 END COLLECTION
47
- M END`;
48
-
49
- const INVABASIC = `
50
- Datagrok monomer library Nucleotides
51
-
52
- 0 0 0 0 0 0 0 V3000
53
- M V30 BEGIN CTAB
54
- M V30 COUNTS 8 8 0 0 0
55
- M V30 BEGIN ATOM
56
- M V30 1 O 1.0934 -2.1636 0 0
57
- M V30 2 C 1.8365 -1.4945 0 0 CFG=2
58
- M V30 3 C 2.8147 -1.7024 0 0
59
- M V30 4 C 3.3147 -0.8364 0 0
60
- M V30 5 O 2.6455 -0.0932 0 0
61
- M V30 6 C 1.732 -0.5 0 0 CFG=1
62
- M V30 7 C 0.866 0 0 0
63
- M V30 8 O 0.866 1 0 0
64
- M V30 END ATOM
65
- M V30 BEGIN BOND
66
- M V30 1 1 2 1 CFG=1
67
- M V30 2 1 2 3
68
- M V30 3 1 3 4
69
- M V30 4 1 4 5
70
- M V30 5 1 6 5
71
- M V30 6 1 2 6
72
- M V30 7 1 6 7 CFG=3
73
- M V30 8 1 7 8
74
- M V30 END BOND
75
- M V30 BEGIN COLLECTION
76
- M V30 MDLV30/STEABS ATOMS=(2 2 6)
77
- M V30 END COLLECTION
78
- M V30 END CTAB
79
- M END`;
80
-
81
- const GALNAC = `
82
- Datagrok monomer library Nucleotides
83
-
84
- 0 0 0 0 0 999 V3000
85
- M V30 BEGIN CTAB
86
- M V30 COUNTS 111 113 0 0 0
87
- M V30 BEGIN ATOM
88
- M V30 1 O -20.7313 -0.7027 0 0
89
- M V30 2 C -19.3976 0.0673 0 0
90
- M V30 3 C -18.0638 -0.7027 0 0
91
- M V30 4 C -16.7303 0.0673 0 0
92
- M V30 5 N -15.3965 -0.7027 0 0
93
- M V30 6 C -14.0628 0.0673 0 0
94
- M V30 7 C -12.7293 -0.7027 0 0
95
- M V30 8 C -11.3955 0.0673 0 0
96
- M V30 9 C -10.062 -0.7027 0 0
97
- M V30 10 C -8.7283 0.0673 0 0
98
- M V30 11 N -7.3947 -0.7027 0 0
99
- M V30 12 O -18.0638 -2.2427 0 0
100
- M V30 13 O -14.0628 1.6073 0 0
101
- M V30 14 O -8.7283 1.6073 0 0
102
- M V30 15 C -5.8547 -0.7027 0 0
103
- M V30 16 C -5.8547 0.8373 0 0
104
- M V30 17 C -5.8547 -2.2427 0 0
105
- M V30 18 C -3.4848 -3.0127 0 0
106
- M V30 19 C -2.4544 -4.157 0 0
107
- M V30 20 C -0.948 -3.8368 0 0
108
- M V30 21 N 0.0824 -4.9813 0 0
109
- M V30 22 C 1.5888 -4.6612 0 0
110
- M V30 23 C 2.6192 -5.8056 0 0
111
- M V30 24 C 4.1256 -5.4855 0 0
112
- M V30 25 N 5.156 -6.6297 0 0
113
- M V30 26 C 6.6624 -6.3096 0 0
114
- M V30 27 C 7.6928 -7.4541 0 0
115
- M V30 28 C 9.1992 -7.1339 0 0
116
- M V30 29 C 10.2296 -8.2784 0 0
117
- M V30 30 C 11.736 -7.9583 0 0
118
- M V30 31 O 12.7664 -9.1027 0 0
119
- M V30 32 O -0.4722 -2.3723 0 0
120
- M V30 33 O 7.1382 -4.845 0 0
121
- M V30 34 C 14.2728 -8.7824 0 0
122
- M V30 35 C 15.3032 -9.9267 0 0
123
- M V30 36 C 16.8098 -9.6065 0 0
124
- M V30 37 C 17.2856 -8.1421 0 0
125
- M V30 38 C 16.2552 -6.9975 0 0
126
- M V30 39 O 14.7486 -7.3178 0 0
127
- M V30 40 C 16.7312 -5.5329 0 0
128
- M V30 41 O 18.7918 -7.8218 0 0
129
- M V30 42 O 17.8404 -10.751 0 0
130
- M V30 43 N 14.8274 -11.3914 0 0
131
- M V30 44 C 15.7325 -12.6372 0 0
132
- M V30 45 C 15.2567 -14.1018 0 0
133
- M V30 46 O 17.2537 -12.3963 0 0
134
- M V30 47 O 18.2628 -5.372 0 0
135
- M V30 48 O -4.9494 -3.4885 0 0
136
- M V30 49 C -4.521 0.0673 0 0
137
- M V30 50 C -1.9414 0.2026 0 0
138
- M V30 51 C -0.6077 -0.5674 0 0
139
- M V30 52 C 0.726 0.2026 0 0
140
- M V30 53 N 2.0596 -0.5674 0 0
141
- M V30 54 C 3.3933 0.2026 0 0
142
- M V30 55 C 4.7271 -0.5674 0 0
143
- M V30 56 C 6.0606 0.2026 0 0
144
- M V30 57 N 7.3943 -0.5674 0 0
145
- M V30 58 C 8.7281 0.2026 0 0
146
- M V30 59 C 10.0618 -0.5674 0 0
147
- M V30 60 C 11.3953 0.2026 0 0
148
- M V30 61 C 14.0628 0.2026 0 0
149
- M V30 62 O 15.3964 -0.5674 0 0
150
- M V30 63 O 0.726 1.7426 0 0
151
- M V30 64 O 8.7281 1.7426 0 0
152
- M V30 65 C 16.7301 0.2026 0 0
153
- M V30 66 C 18.0638 -0.5676 0 0
154
- M V30 67 C 19.3976 0.2026 0 0
155
- M V30 68 C 19.3974 1.7426 0 0
156
- M V30 69 C 18.0638 2.5126 0 0
157
- M V30 70 O 16.7301 1.7426 0 0
158
- M V30 71 C 18.064 4.0526 0 0
159
- M V30 72 O 20.7311 2.5126 0 0
160
- M V30 73 O 20.7313 -0.5674 0 0
161
- M V30 74 N 18.0638 -2.1076 0 0
162
- M V30 75 C 19.3096 -3.0127 0 0
163
- M V30 76 C 19.3096 -4.5527 0 0
164
- M V30 77 O 20.6818 -2.3135 0 0
165
- M V30 78 O 19.4709 4.6791 0 0
166
- M V30 79 O -3.1872 -0.7027 0 0
167
- M V30 80 C 12.7291 -0.5674 0 0
168
- M V30 81 C -3.919 3.2277 0 0
169
- M V30 82 C -2.4126 2.9076 0 0
170
- M V30 83 C -1.3822 4.0519 0 0
171
- M V30 84 N 0.1242 3.7317 0 0
172
- M V30 85 C 1.1546 4.8762 0 0
173
- M V30 86 C 2.661 4.5561 0 0
174
- M V30 87 C 3.6914 5.7005 0 0
175
- M V30 88 N 5.1978 5.3804 0 0
176
- M V30 89 C 6.2282 6.5248 0 0
177
- M V30 90 C 7.7346 6.2045 0 0
178
- M V30 91 C 8.765 7.349 0 0
179
- M V30 92 C 10.2714 7.0288 0 0
180
- M V30 93 C 11.3018 8.1733 0 0
181
- M V30 94 O 12.8082 7.8532 0 0
182
- M V30 95 O -1.858 5.5167 0 0
183
- M V30 96 O 5.7524 7.9894 0 0
184
- M V30 97 C 13.8386 8.9976 0 0
185
- M V30 98 C 15.345 8.6773 0 0
186
- M V30 99 C 16.3756 9.8219 0 0
187
- M V30 100 C 15.8996 11.2863 0 0
188
- M V30 101 C 14.3934 11.6068 0 0
189
- M V30 102 O 13.3628 10.4622 0 0
190
- M V30 103 C 13.9176 13.0714 0 0
191
- M V30 104 O 16.93 12.4308 0 0
192
- M V30 105 O 17.882 9.5018 0 0
193
- M V30 106 N 15.8208 7.2127 0 0
194
- M V30 107 C 17.2856 6.7367 0 0
195
- M V30 108 C 17.7614 5.2721 0 0
196
- M V30 109 O 18.3744 7.8257 0 0
197
- M V30 110 O 15.062 14.1018 0 0
198
- M V30 111 O -4.8241 1.9817 0 0
199
- M V30 END ATOM
200
- M V30 BEGIN BOND
201
- M V30 1 1 2 3
202
- M V30 2 1 3 4
203
- M V30 3 1 6 7
204
- M V30 4 1 7 8
205
- M V30 5 1 8 9
206
- M V30 6 1 9 10
207
- M V30 7 1 1 2
208
- M V30 8 1 3 12
209
- M V30 9 1 4 5
210
- M V30 10 1 5 6
211
- M V30 11 2 6 13
212
- M V30 12 1 10 11
213
- M V30 13 1 11 15
214
- M V30 14 1 15 16
215
- M V30 15 1 15 17
216
- M V30 16 2 10 14
217
- M V30 17 1 18 19
218
- M V30 18 1 19 20
219
- M V30 19 1 22 23
220
- M V30 20 1 23 24
221
- M V30 21 1 26 27
222
- M V30 22 1 27 28
223
- M V30 23 1 28 29
224
- M V30 24 1 29 30
225
- M V30 25 2 26 33
226
- M V30 26 2 20 32
227
- M V30 27 1 20 21
228
- M V30 28 1 21 22
229
- M V30 29 1 24 25
230
- M V30 30 1 25 26
231
- M V30 31 1 30 31
232
- M V30 32 1 31 34
233
- M V30 33 1 35 36
234
- M V30 34 1 36 37
235
- M V30 35 1 37 38
236
- M V30 36 1 34 35
237
- M V30 37 1 38 39
238
- M V30 38 1 34 39
239
- M V30 39 1 38 40
240
- M V30 40 1 35 43
241
- M V30 41 1 43 44
242
- M V30 42 1 44 45
243
- M V30 43 2 44 46
244
- M V30 44 1 36 42
245
- M V30 45 1 37 41
246
- M V30 46 1 40 47
247
- M V30 47 1 18 48
248
- M V30 48 1 15 49
249
- M V30 49 1 50 51
250
- M V30 50 1 51 52
251
- M V30 51 1 54 55
252
- M V30 52 1 55 56
253
- M V30 53 1 58 59
254
- M V30 54 1 59 60
255
- M V30 55 2 58 64
256
- M V30 56 2 52 63
257
- M V30 57 1 52 53
258
- M V30 58 1 53 54
259
- M V30 59 1 56 57
260
- M V30 60 1 57 58
261
- M V30 61 1 61 62
262
- M V30 62 1 62 65
263
- M V30 63 1 66 67
264
- M V30 64 1 67 68
265
- M V30 65 1 68 69
266
- M V30 66 1 65 66
267
- M V30 67 1 69 70
268
- M V30 68 1 65 70
269
- M V30 69 1 69 71
270
- M V30 70 1 66 74
271
- M V30 71 1 74 75
272
- M V30 72 1 75 76
273
- M V30 73 2 75 77
274
- M V30 74 1 67 73
275
- M V30 75 1 68 72
276
- M V30 76 1 71 78
277
- M V30 77 1 50 79
278
- M V30 78 1 49 79
279
- M V30 79 1 60 80
280
- M V30 80 1 80 61
281
- M V30 81 1 81 82
282
- M V30 82 1 82 83
283
- M V30 83 1 85 86
284
- M V30 84 1 86 87
285
- M V30 85 1 89 90
286
- M V30 86 1 90 91
287
- M V30 87 1 91 92
288
- M V30 88 1 92 93
289
- M V30 89 2 89 96
290
- M V30 90 2 83 95
291
- M V30 91 1 83 84
292
- M V30 92 1 84 85
293
- M V30 93 1 87 88
294
- M V30 94 1 88 89
295
- M V30 95 1 93 94
296
- M V30 96 1 94 97
297
- M V30 97 1 98 99
298
- M V30 98 1 99 100
299
- M V30 99 1 100 101
300
- M V30 100 1 97 98
301
- M V30 101 1 101 102
302
- M V30 102 1 97 102
303
- M V30 103 1 101 103
304
- M V30 104 1 98 106
305
- M V30 105 1 106 107
306
- M V30 106 1 107 108
307
- M V30 107 2 107 109
308
- M V30 108 1 99 105
309
- M V30 109 1 100 104
310
- M V30 110 1 103 110
311
- M V30 111 1 81 111
312
- M V30 112 1 16 111
313
- M V30 113 1 17 48
314
- M V30 END BOND
315
- M V30 END CTAB
316
- M END`;
317
-
318
- const GALNACPRIME = `
319
- Datagrok monomer library Nucleotides
320
-
321
- 0 0 0 0 0 999 V3000
322
- M V30 BEGIN CTAB
323
- M V30 COUNTS 111 113 0 0 0
324
- M V30 BEGIN ATOM
325
- M V30 1 O 20.7313 0.7027 0 0
326
- M V30 2 C 19.3976 -0.0673 0 0
327
- M V30 3 C 18.0638 0.7027 0 0
328
- M V30 4 C 16.7303 -0.0673 0 0
329
- M V30 5 N 15.3965 0.7027 0 0
330
- M V30 6 C 14.0628 -0.0673 0 0
331
- M V30 7 C 12.7293 0.7027 0 0
332
- M V30 8 C 11.3955 -0.0673 0 0
333
- M V30 9 C 10.062 0.7027 0 0
334
- M V30 10 C 8.7283 -0.0673 0 0
335
- M V30 11 N 7.3947 0.7027 0 0
336
- M V30 12 O 18.0638 2.2427 0 0
337
- M V30 13 O 14.0628 -1.6073 0 0
338
- M V30 14 O 8.7283 -1.6073 0 0
339
- M V30 15 C 5.8547 0.7027 0 0
340
- M V30 16 C 5.8547 -0.8373 0 0
341
- M V30 17 C 5.8547 2.2427 0 0
342
- M V30 18 C 3.4848 3.0127 0 0
343
- M V30 19 C 2.4544 4.157 0 0
344
- M V30 20 C 0.948 3.8368 0 0
345
- M V30 21 N -0.0824 4.9813 0 0
346
- M V30 22 C -1.5888 4.6612 0 0
347
- M V30 23 C -2.6192 5.8056 0 0
348
- M V30 24 C -4.1256 5.4855 0 0
349
- M V30 25 N -5.156 6.6297 0 0
350
- M V30 26 C -6.6624 6.3096 0 0
351
- M V30 27 C -7.6928 7.4541 0 0
352
- M V30 28 C -9.1992 7.1339 0 0
353
- M V30 29 C -10.2296 8.2784 0 0
354
- M V30 30 C -11.736 7.9583 0 0
355
- M V30 31 O -12.7664 9.1027 0 0
356
- M V30 32 O 0.4722 2.3723 0 0
357
- M V30 33 O -7.1382 4.845 0 0
358
- M V30 34 C -14.2728 8.7824 0 0
359
- M V30 35 C -15.3032 9.9267 0 0
360
- M V30 36 C -16.8098 9.6065 0 0
361
- M V30 37 C -17.2856 8.1421 0 0
362
- M V30 38 C -16.2552 6.9975 0 0
363
- M V30 39 O -14.7486 7.3178 0 0
364
- M V30 40 C -16.7312 5.5329 0 0
365
- M V30 41 O -18.7918 7.8218 0 0
366
- M V30 42 O -17.8404 10.751 0 0
367
- M V30 43 N -14.8274 11.3914 0 0
368
- M V30 44 C -15.7325 12.6372 0 0
369
- M V30 45 C -15.2567 14.1018 0 0
370
- M V30 46 O -17.2537 12.3963 0 0
371
- M V30 47 O -18.2628 5.372 0 0
372
- M V30 48 O 4.9494 3.4885 0 0
373
- M V30 49 C 4.521 -0.0673 0 0
374
- M V30 50 C 1.9414 -0.2026 0 0
375
- M V30 51 C 0.6077 0.5674 0 0
376
- M V30 52 C -0.726 -0.2026 0 0
377
- M V30 53 N -2.0596 0.5674 0 0
378
- M V30 54 C -3.3933 -0.2026 0 0
379
- M V30 55 C -4.7271 0.5674 0 0
380
- M V30 56 C -6.0606 -0.2026 0 0
381
- M V30 57 N -7.3943 0.5674 0 0
382
- M V30 58 C -8.7281 -0.2026 0 0
383
- M V30 59 C -10.0618 0.5674 0 0
384
- M V30 60 C -11.3953 -0.2026 0 0
385
- M V30 61 C -14.0628 -0.2026 0 0
386
- M V30 62 O -15.3964 0.5674 0 0
387
- M V30 63 O -0.726 -1.7426 0 0
388
- M V30 64 O -8.7281 -1.7426 0 0
389
- M V30 65 C -16.7301 -0.2026 0 0
390
- M V30 66 C -18.0638 0.5676 0 0
391
- M V30 67 C -19.3976 -0.2026 0 0
392
- M V30 68 C -19.3974 -1.7426 0 0
393
- M V30 69 C -18.0638 -2.5126 0 0
394
- M V30 70 O -16.7301 -1.7426 0 0
395
- M V30 71 C -18.064 -4.0526 0 0
396
- M V30 72 O -20.7311 -2.5126 0 0
397
- M V30 73 O -20.7313 0.5674 0 0
398
- M V30 74 N -18.0638 2.1076 0 0
399
- M V30 75 C -19.3096 3.0127 0 0
400
- M V30 76 C -19.3096 4.5527 0 0
401
- M V30 77 O -20.6818 2.3135 0 0
402
- M V30 78 O -19.4709 -4.6791 0 0
403
- M V30 79 O 3.1872 0.7027 0 0
404
- M V30 80 C -12.7291 0.5674 0 0
405
- M V30 81 C 3.919 -3.2277 0 0
406
- M V30 82 C 2.4126 -2.9076 0 0
407
- M V30 83 C 1.3822 -4.0519 0 0
408
- M V30 84 N -0.1242 -3.7317 0 0
409
- M V30 85 C -1.1546 -4.8762 0 0
410
- M V30 86 C -2.661 -4.5561 0 0
411
- M V30 87 C -3.6914 -5.7005 0 0
412
- M V30 88 N -5.1978 -5.3804 0 0
413
- M V30 89 C -6.2282 -6.5248 0 0
414
- M V30 90 C -7.7346 -6.2045 0 0
415
- M V30 91 C -8.765 -7.349 0 0
416
- M V30 92 C -10.2714 -7.0288 0 0
417
- M V30 93 C -11.3018 -8.1733 0 0
418
- M V30 94 O -12.8082 -7.8532 0 0
419
- M V30 95 O 1.858 -5.5167 0 0
420
- M V30 96 O -5.7524 -7.9894 0 0
421
- M V30 97 C -13.8386 -8.9976 0 0
422
- M V30 98 C -15.345 -8.6773 0 0
423
- M V30 99 C -16.3756 -9.8219 0 0
424
- M V30 100 C -15.8996 -11.2863 0 0
425
- M V30 101 C -14.3934 -11.6068 0 0
426
- M V30 102 O -13.3628 -10.4622 0 0
427
- M V30 103 C -13.9176 -13.0714 0 0
428
- M V30 104 O -16.93 -12.4308 0 0
429
- M V30 105 O -17.882 -9.5018 0 0
430
- M V30 106 N -15.8208 -7.2127 0 0
431
- M V30 107 C -17.2856 -6.7367 0 0
432
- M V30 108 C -17.7614 -5.2721 0 0
433
- M V30 109 O -18.3744 -7.8257 0 0
434
- M V30 110 O -15.062 -14.1018 0 0
435
- M V30 111 O 4.8241 -1.9817 0 0
436
- M V30 END ATOM
437
- M V30 BEGIN BOND
438
- M V30 1 1 2 3
439
- M V30 2 1 3 4
440
- M V30 3 1 6 7
441
- M V30 4 1 7 8
442
- M V30 5 1 8 9
443
- M V30 6 1 9 10
444
- M V30 7 1 1 2
445
- M V30 8 1 3 12
446
- M V30 9 1 4 5
447
- M V30 10 1 5 6
448
- M V30 11 2 6 13
449
- M V30 12 1 10 11
450
- M V30 13 1 11 15
451
- M V30 14 1 15 16
452
- M V30 15 1 15 17
453
- M V30 16 2 10 14
454
- M V30 17 1 18 19
455
- M V30 18 1 19 20
456
- M V30 19 1 22 23
457
- M V30 20 1 23 24
458
- M V30 21 1 26 27
459
- M V30 22 1 27 28
460
- M V30 23 1 28 29
461
- M V30 24 1 29 30
462
- M V30 25 2 26 33
463
- M V30 26 2 20 32
464
- M V30 27 1 20 21
465
- M V30 28 1 21 22
466
- M V30 29 1 24 25
467
- M V30 30 1 25 26
468
- M V30 31 1 30 31
469
- M V30 32 1 31 34
470
- M V30 33 1 35 36
471
- M V30 34 1 36 37
472
- M V30 35 1 37 38
473
- M V30 36 1 34 35
474
- M V30 37 1 38 39
475
- M V30 38 1 34 39
476
- M V30 39 1 38 40
477
- M V30 40 1 35 43
478
- M V30 41 1 43 44
479
- M V30 42 1 44 45
480
- M V30 43 2 44 46
481
- M V30 44 1 36 42
482
- M V30 45 1 37 41
483
- M V30 46 1 40 47
484
- M V30 47 1 18 48
485
- M V30 48 1 15 49
486
- M V30 49 1 50 51
487
- M V30 50 1 51 52
488
- M V30 51 1 54 55
489
- M V30 52 1 55 56
490
- M V30 53 1 58 59
491
- M V30 54 1 59 60
492
- M V30 55 2 58 64
493
- M V30 56 2 52 63
494
- M V30 57 1 52 53
495
- M V30 58 1 53 54
496
- M V30 59 1 56 57
497
- M V30 60 1 57 58
498
- M V30 61 1 61 62
499
- M V30 62 1 62 65
500
- M V30 63 1 66 67
501
- M V30 64 1 67 68
502
- M V30 65 1 68 69
503
- M V30 66 1 65 66
504
- M V30 67 1 69 70
505
- M V30 68 1 65 70
506
- M V30 69 1 69 71
507
- M V30 70 1 66 74
508
- M V30 71 1 74 75
509
- M V30 72 1 75 76
510
- M V30 73 2 75 77
511
- M V30 74 1 67 73
512
- M V30 75 1 68 72
513
- M V30 76 1 71 78
514
- M V30 77 1 50 79
515
- M V30 78 1 49 79
516
- M V30 79 1 60 80
517
- M V30 80 1 80 61
518
- M V30 81 1 81 82
519
- M V30 82 1 82 83
520
- M V30 83 1 85 86
521
- M V30 84 1 86 87
522
- M V30 85 1 89 90
523
- M V30 86 1 90 91
524
- M V30 87 1 91 92
525
- M V30 88 1 92 93
526
- M V30 89 2 89 96
527
- M V30 90 2 83 95
528
- M V30 91 1 83 84
529
- M V30 92 1 84 85
530
- M V30 93 1 87 88
531
- M V30 94 1 88 89
532
- M V30 95 1 93 94
533
- M V30 96 1 94 97
534
- M V30 97 1 98 99
535
- M V30 98 1 99 100
536
- M V30 99 1 100 101
537
- M V30 100 1 97 98
538
- M V30 101 1 101 102
539
- M V30 102 1 97 102
540
- M V30 103 1 101 103
541
- M V30 104 1 98 106
542
- M V30 105 1 106 107
543
- M V30 106 1 107 108
544
- M V30 107 2 107 109
545
- M V30 108 1 99 105
546
- M V30 109 1 100 104
547
- M V30 110 1 103 110
548
- M V30 111 1 81 111
549
- M V30 112 1 16 111
550
- M V30 113 1 17 48
551
- M V30 END BOND
552
- M V30 END CTAB
553
- M END`;
554
-
555
- export function getNucleotidesMol(smilesCodes: string[]) {
1
+ export function getNucleotidesMol(codes: string[]) {
556
2
  const molBlocks: string[] = [];
557
3
 
558
- for (let i = 0; i < smilesCodes.length - 1; i++) {
559
- smilesCodes[i] == 'OP(=O)(O)O' ? molBlocks.push(PHOSHATE) :
560
- smilesCodes[i] == 'OP(=O)(S)O' ? molBlocks.push(THIOPHOSHATE) :
561
- smilesCodes[i] == 'O[C@@H]1C[C@@H]O[C@H]1CO' ? molBlocks.push(rotateNucleotidesV3000(INVABASIC)) :
562
- smilesCodes[i] == 'OCC(O)CNC(=O)CCCC(=O)NC(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' ? molBlocks.push(GALNAC) :
563
- smilesCodes[i] == 'C(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)NC(=O)CCCC(=O)NCC(O)CO' ? molBlocks.push(GALNACPRIME) :
564
- molBlocks.push(rotateNucleotidesV3000(smilesCodes[i]));
4
+ // for (let i = 0; i < smilesCodes.length - 1; i++) {
5
+ // smilesCodes[i] == 'OP(=O)(O)O' ? molBlocks.push(PHOSHATE) :
6
+ // smilesCodes[i] == 'OP(=O)(S)O' ? molBlocks.push(THIOPHOSHATE) :
7
+ // smilesCodes[i] == 'O[C@@H]1C[C@@H]O[C@H]1CO' ? molBlocks.push(rotateNucleotidesV3000(INVABASIC)) :
8
+ // smilesCodes[i] == 'OCC(O)CNC(=O)CCCC(=O)NC(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)' ? molBlocks.push(GALNAC) :
9
+ // smilesCodes[i] == 'C(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)(COCCC(=O)NCCCNC(=O)CCCCOC2OC(CO)C(O)C(O)C2NC(=O)C)NC(=O)CCCC(=O)NCC(O)CO' ? molBlocks.push(GALNACPRIME) :
10
+ // molBlocks.push(rotateNucleotidesV3000(smilesCodes[i]));
11
+ // }
12
+
13
+ for (let i = 0; i < codes.length - 1; i++) {
14
+ if (codes[i].includes('MODIFICATION')) {
15
+ if (i == 0)
16
+ molBlocks.push(reflect(codes[i]));
17
+ else
18
+ molBlocks.push(codes[i]);
19
+ }
20
+ else
21
+ molBlocks.push(rotateNucleotidesV3000(codes[i]));
565
22
  }
566
23
 
567
24
  return linkV3000(molBlocks);
568
25
  }
569
26
 
570
- export function linkStrandsV3000(strands:{senseStrands: string[], antiStrands: string[]}, useChirality: boolean = true) {
27
+ export function linkStrandsV3000(strands: { senseStrands: string[], antiStrands: string[] }, useChirality: boolean = true) {
571
28
  let macroMolBlock = '\nDatagrok macromolecule handler\n\n';
572
29
  macroMolBlock += ' 0 0 0 0 0 0 999 V3000\n';
573
30
  macroMolBlock += 'M V30 BEGIN CTAB\n';
@@ -583,7 +40,7 @@ export function linkStrandsV3000(strands:{senseStrands: string[], antiStrands: s
583
40
  // molBlocks[1] = invertNucleotidesV3000(molBlocks[1]);
584
41
 
585
42
  if (strands.antiStrands.length > 0) {
586
- for(let i = 0; i < strands.antiStrands.length; i++) {
43
+ for (let i = 0; i < strands.antiStrands.length; i++) {
587
44
  strands.antiStrands[i] = invertNucleotidesV3000(strands.antiStrands[i]);
588
45
  }
589
46
  }
@@ -633,15 +90,15 @@ export function linkStrandsV3000(strands:{senseStrands: string[], antiStrands: s
633
90
 
634
91
  const totalShift = true ? 0 : xShift - coordinates.x[0];
635
92
  let coordinate = true ?
636
- Math.round(10000*coordinates.x[j])/10000 :
637
- Math.round(10000*(parseFloat(molBlocks[i].substring(index, indexEnd)) + totalShift))/10000;
93
+ Math.round(10000 * coordinates.x[j]) / 10000 :
94
+ Math.round(10000 * (parseFloat(molBlocks[i].substring(index, indexEnd)) + totalShift)) / 10000;
638
95
  molBlocks[i] = molBlocks[i].slice(0, index) + coordinate + molBlocks[i].slice(indexEnd);
639
96
 
640
97
  index = molBlocks[i].indexOf(' ', index) + 1;
641
98
  indexEnd = molBlocks[i].indexOf(' ', index);
642
99
  coordinate = true ?
643
- Math.round(10000*coordinates.y[j])/10000 :
644
- Math.round(10000*(parseFloat(molBlocks[i].substring(index, indexEnd))))/10000;
100
+ Math.round(10000 * coordinates.y[j]) / 10000 :
101
+ Math.round(10000 * (parseFloat(molBlocks[i].substring(index, indexEnd)))) / 10000;
645
102
  molBlocks[i] = molBlocks[i].slice(0, index) + coordinate + molBlocks[i].slice(indexEnd);
646
103
 
647
104
  index = molBlocks[i].indexOf('\n', index) + 1;
@@ -701,27 +158,27 @@ export function linkStrandsV3000(strands:{senseStrands: string[], antiStrands: s
701
158
  const collNumber = Math.ceil(collection.length / entries);
702
159
 
703
160
  //if (oclRender) {
704
- // collectionBlock += 'M V30 MDLV30/STEABS ATOMS=(' + collection.length;
161
+ // collectionBlock += 'M V30 MDLV30/STEABS ATOMS=(' + collection.length;
705
162
 
706
- // for (let j = 0; j < collection.length; j++)
707
- // collectionBlock += ' ' + collection[j];
163
+ // for (let j = 0; j < collection.length; j++)
164
+ // collectionBlock += ' ' + collection[j];
708
165
 
709
- // collectionBlock += ')\n';
166
+ // collectionBlock += ')\n';
710
167
  //} else {
711
- collectionBlock += 'M V30 MDLV30/STEABS ATOMS=(' + collection.length + ' -\n';
712
- for (let i = 0; i < collNumber; i++) {
713
- collectionBlock += 'M V30 ';
714
- const entriesCurrent = i + 1 == collNumber ? collection.length - (collNumber - 1)*entries : entries;
715
- for (let j = 0; j < entriesCurrent; j++) {
716
- collectionBlock += (j + 1 == entriesCurrent) ?
717
- (i == collNumber - 1 ? collection[entries*i + j] + ')\n' : collection[entries*i + j] + ' -\n') :
718
- collection[entries*i + j] + ' ';
719
- }
168
+ collectionBlock += 'M V30 MDLV30/STEABS ATOMS=(' + collection.length + ' -\n';
169
+ for (let i = 0; i < collNumber; i++) {
170
+ collectionBlock += 'M V30 ';
171
+ const entriesCurrent = i + 1 == collNumber ? collection.length - (collNumber - 1) * entries : entries;
172
+ for (let j = 0; j < entriesCurrent; j++) {
173
+ collectionBlock += (j + 1 == entriesCurrent) ?
174
+ (i == collNumber - 1 ? collection[entries * i + j] + ')\n' : collection[entries * i + j] + ' -\n') :
175
+ collection[entries * i + j] + ' ';
720
176
  }
177
+ }
721
178
  //}
722
179
 
723
180
  //generate file
724
- true? natom : natom++;
181
+ true ? natom : natom++;
725
182
  macroMolBlock += 'M V30 COUNTS ' + natom + ' ' + nbond + ' 0 0 0\n';
726
183
  macroMolBlock += 'M V30 BEGIN ATOM\n';
727
184
  macroMolBlock += atomBlock;
@@ -729,7 +186,7 @@ export function linkStrandsV3000(strands:{senseStrands: string[], antiStrands: s
729
186
  macroMolBlock += 'M V30 BEGIN BOND\n';
730
187
  macroMolBlock += bondBlock;
731
188
  macroMolBlock += 'M V30 END BOND\n';
732
- if(useChirality){
189
+ if (useChirality) {
733
190
  macroMolBlock += 'M V30 BEGIN COLLECTION\n';
734
191
  macroMolBlock += collectionBlock;
735
192
  macroMolBlock += 'M V30 END COLLECTION\n';
@@ -755,6 +212,14 @@ export function linkV3000(molBlocks: string[], useChirality: boolean = true) {
755
212
  let xShift = 0;
756
213
 
757
214
  for (let i = 0; i < molBlocks.length; i++) {
215
+ const isBoundary = molBlocks[i].includes('MODIFICATION') && i == 0;
216
+ let specLength = 0;
217
+ if (isBoundary) {
218
+ const coordinates = extractAtomDataV3000(molBlocks[i]);
219
+ specLength = coordinates.atomIndex.length;
220
+ }
221
+
222
+
758
223
  molBlocks[i] = molBlocks[i].replaceAll('(-\nM V30 ', '(')
759
224
  .replaceAll('-\nM V30 ', '').replaceAll(' )', ')');
760
225
  const numbers = extractAtomsBondsNumbersV3000(molBlocks[i]);
@@ -770,7 +235,17 @@ export function linkV3000(molBlocks: string[], useChirality: boolean = true) {
770
235
  //rewrite atom number
771
236
  index = molBlocks[i].indexOf('V30', index) + 4;
772
237
  indexEnd = molBlocks[i].indexOf(' ', index);
773
- const atomNumber = parseInt(molBlocks[i].substring(index, indexEnd)) + natom;
238
+ let atomNumber = 0;
239
+ if (isBoundary) {
240
+ atomNumber = parseInt(molBlocks[i].substring(index, indexEnd))
241
+ if (atomNumber == 1)
242
+ atomNumber = specLength;
243
+ else if (atomNumber == specLength)
244
+ atomNumber = 1;
245
+ atomNumber += natom;
246
+ } else {
247
+ atomNumber = parseInt(molBlocks[i].substring(index, indexEnd)) + natom;
248
+ }
774
249
  molBlocks[i] = molBlocks[i].slice(0, index) + atomNumber + molBlocks[i].slice(indexEnd);
775
250
 
776
251
  //rewrite coordinates
@@ -779,14 +254,14 @@ export function linkV3000(molBlocks: string[], useChirality: boolean = true) {
779
254
  indexEnd = molBlocks[i].indexOf(' ', index);
780
255
 
781
256
  const totalShift = xShift - coordinates.x[0];
782
- let coordinate =
783
- Math.round(10000*(parseFloat(molBlocks[i].substring(index, indexEnd)) + totalShift))/10000;
257
+ let coordinate =
258
+ Math.round(10000 * (parseFloat(molBlocks[i].substring(index, indexEnd)) + totalShift)) / 10000;
784
259
  molBlocks[i] = molBlocks[i].slice(0, index) + coordinate + molBlocks[i].slice(indexEnd);
785
260
 
786
261
  index = molBlocks[i].indexOf(' ', index) + 1;
787
262
  indexEnd = molBlocks[i].indexOf(' ', index);
788
- coordinate =
789
- Math.round(10000*(parseFloat(molBlocks[i].substring(index, indexEnd))))/10000;
263
+ coordinate =
264
+ Math.round(10000 * (parseFloat(molBlocks[i].substring(index, indexEnd)))) / 10000;
790
265
  molBlocks[i] = molBlocks[i].slice(0, index) + coordinate + molBlocks[i].slice(indexEnd);
791
266
 
792
267
  index = molBlocks[i].indexOf('\n', index) + 1;
@@ -816,11 +291,32 @@ export function linkV3000(molBlocks: string[], useChirality: boolean = true) {
816
291
  index = molBlocks[i].indexOf(' ', index) + 1;
817
292
  index = molBlocks[i].indexOf(' ', index) + 1;
818
293
  indexEnd = molBlocks[i].indexOf(' ', index);
819
- let atomNumber = parseInt(molBlocks[i].substring(index, indexEnd)) + natom;
294
+ let atomNumber = 0;
295
+ if (isBoundary) {
296
+ atomNumber = parseInt(molBlocks[i].substring(index, indexEnd))
297
+ if (atomNumber == 1)
298
+ atomNumber = specLength;
299
+ else if (atomNumber == specLength)
300
+ atomNumber = 1;
301
+ atomNumber += natom;
302
+ } else {
303
+ atomNumber = parseInt(molBlocks[i].substring(index, indexEnd)) + natom;
304
+ }
305
+
820
306
  molBlocks[i] = molBlocks[i].slice(0, index) + atomNumber + molBlocks[i].slice(indexEnd);
821
307
  index = molBlocks[i].indexOf(' ', index) + 1;
822
308
  indexEnd = Math.min(molBlocks[i].indexOf('\n', index), molBlocks[i].indexOf(' ', index));
823
- atomNumber = parseInt(molBlocks[i].substring(index, indexEnd)) + natom;
309
+ atomNumber = 0;
310
+ if (isBoundary) {
311
+ atomNumber = parseInt(molBlocks[i].substring(index, indexEnd))
312
+ if (atomNumber == 1)
313
+ atomNumber = specLength;
314
+ else if (atomNumber == specLength)
315
+ atomNumber = 1;
316
+ atomNumber += natom;
317
+ } else {
318
+ atomNumber = parseInt(molBlocks[i].substring(index, indexEnd)) + natom;
319
+ }
824
320
  molBlocks[i] = molBlocks[i].slice(0, index) + atomNumber + molBlocks[i].slice(indexEnd);
825
321
 
826
322
  index = molBlocks[i].indexOf('\n', index) + 1;
@@ -844,30 +340,33 @@ export function linkV3000(molBlocks: string[], useChirality: boolean = true) {
844
340
 
845
341
  natom += numbers.natom - 1;
846
342
  nbond += numbers.nbond;
847
- xShift += coordinates.x[numbers.natom - 1] - coordinates.x[0];
343
+ if (isBoundary)
344
+ xShift += Math.max(...coordinates.x);
345
+ else
346
+ xShift += coordinates.x[numbers.natom - 1] - coordinates.x[0];
848
347
  }
849
348
 
850
349
  const entries = 4;
851
350
  const collNumber = Math.ceil(collection.length / entries);
852
351
 
853
352
  //if (oclRender) {
854
- // collectionBlock += 'M V30 MDLV30/STEABS ATOMS=(' + collection.length;
353
+ // collectionBlock += 'M V30 MDLV30/STEABS ATOMS=(' + collection.length;
855
354
 
856
- // for (let j = 0; j < collection.length; j++)
857
- // collectionBlock += ' ' + collection[j];
355
+ // for (let j = 0; j < collection.length; j++)
356
+ // collectionBlock += ' ' + collection[j];
858
357
 
859
- // collectionBlock += ')\n';
358
+ // collectionBlock += ')\n';
860
359
  //} else {
861
- collectionBlock += 'M V30 MDLV30/STEABS ATOMS=(' + collection.length + ' -\n';
862
- for (let i = 0; i < collNumber; i++) {
863
- collectionBlock += 'M V30 ';
864
- const entriesCurrent = i + 1 == collNumber ? collection.length - (collNumber - 1)*entries : entries;
865
- for (let j = 0; j < entriesCurrent; j++) {
866
- collectionBlock += (j + 1 == entriesCurrent) ?
867
- (i == collNumber - 1 ? collection[entries*i + j] + ')\n' : collection[entries*i + j] + ' -\n') :
868
- collection[entries*i + j] + ' ';
869
- }
360
+ collectionBlock += 'M V30 MDLV30/STEABS ATOMS=(' + collection.length + ' -\n';
361
+ for (let i = 0; i < collNumber; i++) {
362
+ collectionBlock += 'M V30 ';
363
+ const entriesCurrent = i + 1 == collNumber ? collection.length - (collNumber - 1) * entries : entries;
364
+ for (let j = 0; j < entriesCurrent; j++) {
365
+ collectionBlock += (j + 1 == entriesCurrent) ?
366
+ (i == collNumber - 1 ? collection[entries * i + j] + ')\n' : collection[entries * i + j] + ' -\n') :
367
+ collection[entries * i + j] + ' ';
870
368
  }
369
+ }
871
370
  //}
872
371
 
873
372
  //generate file
@@ -879,7 +378,7 @@ export function linkV3000(molBlocks: string[], useChirality: boolean = true) {
879
378
  macroMolBlock += 'M V30 BEGIN BOND\n';
880
379
  macroMolBlock += bondBlock;
881
380
  macroMolBlock += 'M V30 END BOND\n';
882
- if(useChirality){
381
+ if (useChirality) {
883
382
  macroMolBlock += 'M V30 BEGIN COLLECTION\n';
884
383
  macroMolBlock += collectionBlock;
885
384
  macroMolBlock += 'M V30 END COLLECTION\n';
@@ -905,8 +404,8 @@ function rotateNucleotidesV3000(molecule: string) {
905
404
  if (natom > 8)
906
405
  fix5Prime(coordinates, indexFivePrime, indexThreePrime);
907
406
 
908
- const xCenter = (coordinates.x[indexThreePrime] + coordinates.x[indexFivePrime])/2;
909
- const yCenter = (coordinates.y[indexThreePrime] + coordinates.y[indexFivePrime])/2;
407
+ const xCenter = (coordinates.x[indexThreePrime] + coordinates.x[indexFivePrime]) / 2;
408
+ const yCenter = (coordinates.y[indexThreePrime] + coordinates.y[indexFivePrime]) / 2;
910
409
 
911
410
  //place to center
912
411
  for (let i = 0; i < natom; i++) {
@@ -916,12 +415,14 @@ function rotateNucleotidesV3000(molecule: string) {
916
415
 
917
416
  let angle = 0;
918
417
  if (coordinates.x[indexFivePrime] == 0)
919
- angle = coordinates.y[indexFivePrime] > coordinates.y[indexThreePrime] ? Math.PI/2 : 3*Math.PI/2;
418
+ angle = coordinates.y[indexFivePrime] > coordinates.y[indexThreePrime] ? Math.PI / 2 : 3 * Math.PI / 2;
920
419
  else if (coordinates.y[indexFivePrime] == 0)
921
420
  angle = coordinates.x[indexFivePrime] > coordinates.x[indexThreePrime] ? Math.PI : 0;
922
421
  else {
923
- const derivative = coordinates.y[indexFivePrime]/coordinates.x[indexFivePrime];
924
- angle = derivative > 0 ? Math.PI - Math.atan(derivative) : Math.atan(derivative);
422
+ const derivative = coordinates.y[indexFivePrime] / coordinates.x[indexFivePrime];
423
+ angle = derivative > 0
424
+ ? (coordinates.x[indexFivePrime] > 0 ? Math.PI - Math.atan(derivative) : Math.PI * 2 - Math.atan(derivative))
425
+ : (coordinates.x[indexFivePrime] > 0 ? -Math.PI - Math.atan(derivative) : Math.atan(derivative));
925
426
  }
926
427
 
927
428
  const cos = Math.cos(angle);
@@ -929,10 +430,58 @@ function rotateNucleotidesV3000(molecule: string) {
929
430
 
930
431
  for (let i = 0; i < natom; i++) {
931
432
  const xAdd = coordinates.x[i];
932
- coordinates.x[i] = xAdd*cos - coordinates.y[i]*sin;
933
- coordinates.y[i] = xAdd*sin + coordinates.y[i]*cos;
433
+ coordinates.x[i] = xAdd * cos - coordinates.y[i] * sin;
434
+ coordinates.y[i] = xAdd * sin + coordinates.y[i] * cos;
435
+ }
436
+
437
+ //place to right
438
+ const xShift = coordinates.x[indexFivePrime];
439
+ for (let i = 0; i < natom; i++)
440
+ coordinates.x[i] -= xShift;
441
+
442
+ //rewrite molBlock
443
+ let index = molBlock.indexOf('M V30 BEGIN ATOM'); // V3000 index for atoms coordinates
444
+ index = molBlock.indexOf('\n', index);
445
+ let indexEnd = index;
446
+ for (let i = 0; i < natom; i++) {
447
+ index = molBlock.indexOf('V30', index) + 4;
448
+ index = molBlock.indexOf(' ', index) + 1;
449
+ index = molBlock.indexOf(' ', index) + 1;
450
+ indexEnd = molBlock.indexOf(' ', index) + 1;
451
+ indexEnd = molBlock.indexOf(' ', indexEnd);
452
+
453
+ molBlock = molBlock.slice(0, index) +
454
+ coordinates.x[i] + ' ' + coordinates.y[i] +
455
+ molBlock.slice(indexEnd);
456
+
457
+ index = molBlock.indexOf('\n', index) + 1;
458
+ }
459
+
460
+ return molBlock;
461
+ }
462
+
463
+ function reflect(molecule: string) {
464
+ // @ts-ignore
465
+ let molBlock = molecule.includes('M END') ? molecule : OCL.Molecule.fromSmiles(molecule).toMolfileV3();
466
+ const coordinates = extractAtomDataV3000(molBlock);
467
+ const natom = coordinates.atomIndex.length;
468
+
469
+ const indexFivePrime = coordinates.atomIndex.indexOf(1);
470
+ const indexThreePrime = coordinates.atomIndex.indexOf(natom);
471
+
472
+ const xCenter = (coordinates.x[indexThreePrime] + coordinates.x[indexFivePrime]) / 2;
473
+ const yCenter = (coordinates.y[indexThreePrime] + coordinates.y[indexFivePrime]) / 2;
474
+
475
+ //place to center
476
+ for (let i = 0; i < natom; i++) {
477
+ coordinates.x[i] -= xCenter;
478
+ coordinates.y[i] -= yCenter;
934
479
  }
935
480
 
481
+ //place to center
482
+ for (let i = 0; i < natom; i++)
483
+ coordinates.x[i] = -coordinates.x[i];
484
+
936
485
  //place to right
937
486
  const xShift = coordinates.x[indexFivePrime];
938
487
  for (let i = 0; i < natom; i++)
@@ -959,14 +508,15 @@ function rotateNucleotidesV3000(molecule: string) {
959
508
  return molBlock;
960
509
  }
961
510
 
511
+
962
512
  function invertNucleotidesV3000(molecule: string) {
963
513
  // @ts-ignore
964
514
  let molBlock = molecule.includes('M END') ? molecule : OCL.Molecule.fromSmiles(molecule).toMolfileV3();
965
515
  const coordinates = extractAtomDataV3000(molBlock);
966
516
  const natom = coordinates.atomIndex.length;
967
517
 
968
- const xCenter = (Math.max(...coordinates.x) + Math.min(...coordinates.x))/2;
969
- const yCenter = (Math.max(...coordinates.y) + Math.min(...coordinates.y))/2;
518
+ const xCenter = (Math.max(...coordinates.x) + Math.min(...coordinates.x)) / 2;
519
+ const yCenter = (Math.max(...coordinates.y) + Math.min(...coordinates.y)) / 2;
970
520
 
971
521
  //place to center
972
522
  for (let i = 0; i < natom; i++) {
@@ -981,8 +531,8 @@ function invertNucleotidesV3000(molecule: string) {
981
531
 
982
532
  for (let i = 0; i < natom; i++) {
983
533
  const xAdd = coordinates.x[i];
984
- coordinates.x[i] = xAdd*cos - coordinates.y[i]*sin;
985
- coordinates.y[i] = xAdd*sin + coordinates.y[i]*cos;
534
+ coordinates.x[i] = xAdd * cos - coordinates.y[i] * sin;
535
+ coordinates.y[i] = xAdd * sin + coordinates.y[i] * cos;
986
536
  }
987
537
 
988
538
  //place back
@@ -1013,7 +563,7 @@ function invertNucleotidesV3000(molecule: string) {
1013
563
  return molBlock;
1014
564
  }
1015
565
 
1016
- function fix5Prime(coordinates: {atomIndex: number[], atomType: string[], x: number[], y: number[]},
566
+ function fix5Prime(coordinates: { atomIndex: number[], atomType: string[], x: number[], y: number[] },
1017
567
  indexFivePrime: number, indexThreePrime: number) {
1018
568
  const indexFivePrimeNeighbour = indexFivePrime + 1;
1019
569
  const xShift = coordinates.x[indexFivePrimeNeighbour];
@@ -1023,21 +573,21 @@ function fix5Prime(coordinates: {atomIndex: number[], atomType: string[], x: num
1023
573
  const base5PrimeX = coordinates.x[indexFivePrime] - xShift;
1024
574
  const base5PrimeY = coordinates.y[indexFivePrime] - yShift;
1025
575
 
1026
- const rotated5PrimeX = base5PrimeX*Math.cos(Math.PI*2/3) - base5PrimeY*Math.sin(Math.PI*2/3);
1027
- const rotated5PrimeY = base5PrimeX*Math.sin(Math.PI*2/3) + base5PrimeY*Math.cos(Math.PI*2/3);
576
+ const rotated5PrimeX = base5PrimeX * Math.cos(Math.PI * 2 / 3) - base5PrimeY * Math.sin(Math.PI * 2 / 3);
577
+ const rotated5PrimeY = base5PrimeX * Math.sin(Math.PI * 2 / 3) + base5PrimeY * Math.cos(Math.PI * 2 / 3);
1028
578
 
1029
579
  const dx = base5PrimeX - base3PrimeX;
1030
580
  const dy = base5PrimeY - base3PrimeY;
1031
581
  const dxRotated = rotated5PrimeX - base3PrimeX;
1032
582
  const dyRotated = rotated5PrimeY - base3PrimeY;
1033
583
 
1034
- if (Math.sqrt(dyRotated*dyRotated + dxRotated*dxRotated) >= Math.sqrt(dy*dy + dx*dx)) {
584
+ if (Math.sqrt(dyRotated * dyRotated + dxRotated * dxRotated) >= Math.sqrt(dy * dy + dx * dx)) {
1035
585
  coordinates.x[indexFivePrime] = rotated5PrimeX + xShift;
1036
586
  coordinates.y[indexFivePrime] = rotated5PrimeY + yShift;
1037
587
  }
1038
588
  }
1039
589
 
1040
- function extractAtomsBondsNumbersV3000(molBlock: string): {natom: number, nbond: number} {
590
+ function extractAtomsBondsNumbersV3000(molBlock: string): { natom: number, nbond: number } {
1041
591
  molBlock = molBlock.replaceAll('\r', ''); //equalize old and new sdf standards
1042
592
  let index = molBlock.indexOf('COUNTS') + 7; // V3000 index for atoms and bonds number
1043
593
  let indexEnd = molBlock.indexOf(' ', index);
@@ -1050,7 +600,7 @@ function extractAtomsBondsNumbersV3000(molBlock: string): {natom: number, nbond:
1050
600
  return {natom: atomsNumber, nbond: bondsNumber};
1051
601
  }
1052
602
 
1053
- function extractAtomDataV3000(molBlock: string) {
603
+ export function extractAtomDataV3000(molBlock: string) {
1054
604
  const numbers = extractAtomsBondsNumbersV3000(molBlock);
1055
605
  let index = molBlock.indexOf('M V30 BEGIN ATOM'); // V3000 index for atoms coordinates
1056
606
  index = molBlock.indexOf('\n', index);