smiles-js 2.1.0 → 2.2.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.
- package/docs/smiles.peggy +215 -0
- package/package.json +1 -1
- package/src/decompiler.js +209 -49
- package/src/decompiler.test.js +232 -60
- package/src/fragment.test.js +7 -2
- package/src/method-attachers.js +8 -8
- package/test-integration/__snapshots__/acetaminophen.test.js.snap +20 -0
- package/test-integration/__snapshots__/adjuvant-analgesics.test.js.snap +62 -0
- package/test-integration/__snapshots__/cholesterol-drugs.test.js.snap +261 -0
- package/test-integration/__snapshots__/dexamethasone.test.js.snap +31 -0
- package/test-integration/__snapshots__/endocannabinoids.test.js.snap +77 -0
- package/test-integration/__snapshots__/endogenous-opioids.test.js.snap +1116 -0
- package/test-integration/__snapshots__/hypertension-medication.test.js.snap +69 -0
- package/test-integration/__snapshots__/local-anesthetics.test.js.snap +97 -0
- package/test-integration/__snapshots__/nsaids-otc.test.js.snap +60 -0
- package/test-integration/__snapshots__/nsaids-prescription.test.js.snap +113 -0
- package/test-integration/__snapshots__/opioids.test.js.snap +109 -0
- package/test-integration/__snapshots__/steroids.test.js.snap +379 -0
- package/test-integration/acetaminophen.test.js +15 -3
- package/test-integration/adjuvant-analgesics.test.js +43 -7
- package/test-integration/cholesterol-drugs.test.js +88 -22
- package/test-integration/dexamethasone.test.js +8 -2
- package/test-integration/endocannabinoids.test.js +48 -12
- package/test-integration/endogenous-opioids.smiles.js +32 -0
- package/test-integration/endogenous-opioids.test.js +192 -0
- package/test-integration/hypertension-medication.test.js +32 -8
- package/test-integration/local-anesthetics.smiles.js +33 -0
- package/test-integration/local-anesthetics.test.js +64 -16
- package/test-integration/nsaids-otc.test.js +40 -10
- package/test-integration/nsaids-prescription.test.js +72 -18
- package/test-integration/opioids.test.js +56 -14
- package/test-integration/steroids.test.js +112 -28
- package/test-integration/utils.js +4 -2
- package/todo +2 -1
|
@@ -0,0 +1,1116 @@
|
|
|
1
|
+
// Bun Snapshot v1, https://bun.sh/docs/test/snapshots
|
|
2
|
+
|
|
3
|
+
exports[`Met-Enkephalin Integration Test parses met-enkephalin 1`] = `
|
|
4
|
+
{
|
|
5
|
+
"atoms": [
|
|
6
|
+
"C",
|
|
7
|
+
"S",
|
|
8
|
+
"C",
|
|
9
|
+
"C",
|
|
10
|
+
"C",
|
|
11
|
+
"N",
|
|
12
|
+
"C",
|
|
13
|
+
"C",
|
|
14
|
+
"N",
|
|
15
|
+
"C",
|
|
16
|
+
"C",
|
|
17
|
+
"N",
|
|
18
|
+
"C",
|
|
19
|
+
"C",
|
|
20
|
+
"N",
|
|
21
|
+
"C",
|
|
22
|
+
"C",
|
|
23
|
+
"N",
|
|
24
|
+
],
|
|
25
|
+
"attachments": {
|
|
26
|
+
"10": [
|
|
27
|
+
{
|
|
28
|
+
"atoms": [
|
|
29
|
+
"O",
|
|
30
|
+
],
|
|
31
|
+
"attachments": {},
|
|
32
|
+
"bonds": [
|
|
33
|
+
"=",
|
|
34
|
+
],
|
|
35
|
+
"type": "linear",
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
"13": [
|
|
39
|
+
{
|
|
40
|
+
"atoms": [
|
|
41
|
+
"O",
|
|
42
|
+
],
|
|
43
|
+
"attachments": {},
|
|
44
|
+
"bonds": [
|
|
45
|
+
"=",
|
|
46
|
+
],
|
|
47
|
+
"type": "linear",
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
"16": [
|
|
51
|
+
{
|
|
52
|
+
"atoms": [
|
|
53
|
+
"O",
|
|
54
|
+
],
|
|
55
|
+
"attachments": {},
|
|
56
|
+
"bonds": [
|
|
57
|
+
"=",
|
|
58
|
+
],
|
|
59
|
+
"type": "linear",
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
"17": [
|
|
63
|
+
{
|
|
64
|
+
"components": [
|
|
65
|
+
{
|
|
66
|
+
"atoms": [
|
|
67
|
+
"C",
|
|
68
|
+
],
|
|
69
|
+
"attachments": {},
|
|
70
|
+
"bonds": [
|
|
71
|
+
null,
|
|
72
|
+
],
|
|
73
|
+
"type": "linear",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"atoms": "C",
|
|
77
|
+
"attachments": {},
|
|
78
|
+
"bonds": [
|
|
79
|
+
"=",
|
|
80
|
+
null,
|
|
81
|
+
"=",
|
|
82
|
+
null,
|
|
83
|
+
"=",
|
|
84
|
+
null,
|
|
85
|
+
],
|
|
86
|
+
"offset": 0,
|
|
87
|
+
"ringNumber": 2,
|
|
88
|
+
"size": 6,
|
|
89
|
+
"substitutions": {},
|
|
90
|
+
"type": "ring",
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"atoms": [
|
|
94
|
+
"O",
|
|
95
|
+
],
|
|
96
|
+
"attachments": {},
|
|
97
|
+
"bonds": [],
|
|
98
|
+
"type": "linear",
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
"type": "molecule",
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
"5": [
|
|
105
|
+
{
|
|
106
|
+
"atoms": [
|
|
107
|
+
"C",
|
|
108
|
+
"O",
|
|
109
|
+
],
|
|
110
|
+
"attachments": {
|
|
111
|
+
"1": [
|
|
112
|
+
{
|
|
113
|
+
"atoms": [
|
|
114
|
+
"O",
|
|
115
|
+
],
|
|
116
|
+
"attachments": {},
|
|
117
|
+
"bonds": [
|
|
118
|
+
"=",
|
|
119
|
+
],
|
|
120
|
+
"type": "linear",
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
"bonds": [
|
|
125
|
+
null,
|
|
126
|
+
null,
|
|
127
|
+
],
|
|
128
|
+
"type": "linear",
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
"7": [
|
|
132
|
+
{
|
|
133
|
+
"atoms": [
|
|
134
|
+
"O",
|
|
135
|
+
],
|
|
136
|
+
"attachments": {},
|
|
137
|
+
"bonds": [
|
|
138
|
+
"=",
|
|
139
|
+
],
|
|
140
|
+
"type": "linear",
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
"8": [
|
|
144
|
+
{
|
|
145
|
+
"components": [
|
|
146
|
+
{
|
|
147
|
+
"atoms": [
|
|
148
|
+
"C",
|
|
149
|
+
],
|
|
150
|
+
"attachments": {},
|
|
151
|
+
"bonds": [
|
|
152
|
+
null,
|
|
153
|
+
],
|
|
154
|
+
"type": "linear",
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"atoms": "C",
|
|
158
|
+
"attachments": {},
|
|
159
|
+
"bonds": [
|
|
160
|
+
"=",
|
|
161
|
+
null,
|
|
162
|
+
"=",
|
|
163
|
+
null,
|
|
164
|
+
"=",
|
|
165
|
+
null,
|
|
166
|
+
],
|
|
167
|
+
"offset": 0,
|
|
168
|
+
"ringNumber": 1,
|
|
169
|
+
"size": 6,
|
|
170
|
+
"substitutions": {},
|
|
171
|
+
"type": "ring",
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
"type": "molecule",
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
},
|
|
178
|
+
"bonds": [
|
|
179
|
+
null,
|
|
180
|
+
null,
|
|
181
|
+
null,
|
|
182
|
+
null,
|
|
183
|
+
null,
|
|
184
|
+
null,
|
|
185
|
+
null,
|
|
186
|
+
null,
|
|
187
|
+
null,
|
|
188
|
+
null,
|
|
189
|
+
null,
|
|
190
|
+
null,
|
|
191
|
+
null,
|
|
192
|
+
null,
|
|
193
|
+
null,
|
|
194
|
+
null,
|
|
195
|
+
null,
|
|
196
|
+
],
|
|
197
|
+
"type": "linear",
|
|
198
|
+
}
|
|
199
|
+
`;
|
|
200
|
+
|
|
201
|
+
exports[`Met-Enkephalin Integration Test generates valid code via toCode() 1`] = `
|
|
202
|
+
"export const v1 = Fragment('CSCCCNCCNCCNCCNCCN');
|
|
203
|
+
export const v2 = Fragment('CO');
|
|
204
|
+
export const v3 = Linear(['O'], ['=']);
|
|
205
|
+
export const v4 = v2.attach(1, v3);
|
|
206
|
+
export const v5 = v1.attach(5, v4);
|
|
207
|
+
export const v6 = Linear(['O'], ['=']);
|
|
208
|
+
export const v7 = v5.attach(7, v6);
|
|
209
|
+
export const v8 = Fragment('C');
|
|
210
|
+
export const v9 = Fragment('C1=CC=CC=C1');
|
|
211
|
+
export const v10 = Molecule([v8, v9]);
|
|
212
|
+
export const v11 = v7.attach(8, v10);
|
|
213
|
+
export const v12 = Linear(['O'], ['=']);
|
|
214
|
+
export const v13 = v11.attach(10, v12);
|
|
215
|
+
export const v14 = Linear(['O'], ['=']);
|
|
216
|
+
export const v15 = v13.attach(13, v14);
|
|
217
|
+
export const v16 = Linear(['O'], ['=']);
|
|
218
|
+
export const v17 = v15.attach(16, v16);
|
|
219
|
+
export const v18 = Fragment('C');
|
|
220
|
+
export const v19 = Fragment('C2=CC=C(C=C2)');
|
|
221
|
+
export const v20 = Fragment('O');
|
|
222
|
+
export const v21 = Molecule([v18, v19, v20]);
|
|
223
|
+
export const v22 = v17.attach(17, v21);"
|
|
224
|
+
`;
|
|
225
|
+
|
|
226
|
+
exports[`Met-Enkephalin Integration Test generates valid verbose code via toCode() 1`] = `
|
|
227
|
+
"export const v1 = Linear(['C', 'S', 'C', 'C', 'C', 'N', 'C', 'C', 'N', 'C', 'C', 'N', 'C', 'C', 'N', 'C', 'C', 'N']);
|
|
228
|
+
export const v2 = Linear(['C', 'O']);
|
|
229
|
+
export const v3 = Linear(['O'], ['=']);
|
|
230
|
+
export const v4 = v2.attach(1, v3);
|
|
231
|
+
export const v5 = v1.attach(5, v4);
|
|
232
|
+
export const v6 = Linear(['O'], ['=']);
|
|
233
|
+
export const v7 = v5.attach(7, v6);
|
|
234
|
+
export const v8 = Linear(['C']);
|
|
235
|
+
export const v9 = Ring({ atoms: 'C', size: 6, bonds: ['=', null, '=', null, '=', null] });
|
|
236
|
+
export const v10 = Molecule([v8, v9]);
|
|
237
|
+
export const v11 = v7.attach(8, v10);
|
|
238
|
+
export const v12 = Linear(['O'], ['=']);
|
|
239
|
+
export const v13 = v11.attach(10, v12);
|
|
240
|
+
export const v14 = Linear(['O'], ['=']);
|
|
241
|
+
export const v15 = v13.attach(13, v14);
|
|
242
|
+
export const v16 = Linear(['O'], ['=']);
|
|
243
|
+
export const v17 = v15.attach(16, v16);
|
|
244
|
+
export const v18 = Linear(['C']);
|
|
245
|
+
export const v19 = Ring({ atoms: 'C', size: 6, ringNumber: 2, bonds: ['=', null, '=', null, '=', null], branchDepths: [1, 1, 1, 1, 2, 2] });
|
|
246
|
+
export const v20 = Linear(['O']);
|
|
247
|
+
export const v21 = Molecule([v18, v19, v20]);
|
|
248
|
+
export const v22 = v17.attach(17, v21);"
|
|
249
|
+
`;
|
|
250
|
+
|
|
251
|
+
exports[`Leu-Enkephalin Integration Test parses leu-enkephalin 1`] = `
|
|
252
|
+
{
|
|
253
|
+
"atoms": [
|
|
254
|
+
"C",
|
|
255
|
+
"C",
|
|
256
|
+
"C",
|
|
257
|
+
"C",
|
|
258
|
+
"N",
|
|
259
|
+
"C",
|
|
260
|
+
"C",
|
|
261
|
+
"N",
|
|
262
|
+
"C",
|
|
263
|
+
"C",
|
|
264
|
+
"N",
|
|
265
|
+
"C",
|
|
266
|
+
"C",
|
|
267
|
+
"N",
|
|
268
|
+
"C",
|
|
269
|
+
"C",
|
|
270
|
+
"N",
|
|
271
|
+
],
|
|
272
|
+
"attachments": {
|
|
273
|
+
"12": [
|
|
274
|
+
{
|
|
275
|
+
"atoms": [
|
|
276
|
+
"O",
|
|
277
|
+
],
|
|
278
|
+
"attachments": {},
|
|
279
|
+
"bonds": [
|
|
280
|
+
"=",
|
|
281
|
+
],
|
|
282
|
+
"type": "linear",
|
|
283
|
+
},
|
|
284
|
+
],
|
|
285
|
+
"15": [
|
|
286
|
+
{
|
|
287
|
+
"atoms": [
|
|
288
|
+
"O",
|
|
289
|
+
],
|
|
290
|
+
"attachments": {},
|
|
291
|
+
"bonds": [
|
|
292
|
+
"=",
|
|
293
|
+
],
|
|
294
|
+
"type": "linear",
|
|
295
|
+
},
|
|
296
|
+
],
|
|
297
|
+
"16": [
|
|
298
|
+
{
|
|
299
|
+
"components": [
|
|
300
|
+
{
|
|
301
|
+
"atoms": [
|
|
302
|
+
"C",
|
|
303
|
+
],
|
|
304
|
+
"attachments": {},
|
|
305
|
+
"bonds": [
|
|
306
|
+
null,
|
|
307
|
+
],
|
|
308
|
+
"type": "linear",
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"atoms": "C",
|
|
312
|
+
"attachments": {},
|
|
313
|
+
"bonds": [
|
|
314
|
+
"=",
|
|
315
|
+
null,
|
|
316
|
+
"=",
|
|
317
|
+
null,
|
|
318
|
+
"=",
|
|
319
|
+
null,
|
|
320
|
+
],
|
|
321
|
+
"offset": 0,
|
|
322
|
+
"ringNumber": 2,
|
|
323
|
+
"size": 6,
|
|
324
|
+
"substitutions": {},
|
|
325
|
+
"type": "ring",
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"atoms": [
|
|
329
|
+
"O",
|
|
330
|
+
],
|
|
331
|
+
"attachments": {},
|
|
332
|
+
"bonds": [],
|
|
333
|
+
"type": "linear",
|
|
334
|
+
},
|
|
335
|
+
],
|
|
336
|
+
"type": "molecule",
|
|
337
|
+
},
|
|
338
|
+
],
|
|
339
|
+
"2": [
|
|
340
|
+
{
|
|
341
|
+
"atoms": [
|
|
342
|
+
"C",
|
|
343
|
+
],
|
|
344
|
+
"attachments": {},
|
|
345
|
+
"bonds": [
|
|
346
|
+
null,
|
|
347
|
+
],
|
|
348
|
+
"type": "linear",
|
|
349
|
+
},
|
|
350
|
+
],
|
|
351
|
+
"4": [
|
|
352
|
+
{
|
|
353
|
+
"atoms": [
|
|
354
|
+
"C",
|
|
355
|
+
"O",
|
|
356
|
+
],
|
|
357
|
+
"attachments": {
|
|
358
|
+
"1": [
|
|
359
|
+
{
|
|
360
|
+
"atoms": [
|
|
361
|
+
"O",
|
|
362
|
+
],
|
|
363
|
+
"attachments": {},
|
|
364
|
+
"bonds": [
|
|
365
|
+
"=",
|
|
366
|
+
],
|
|
367
|
+
"type": "linear",
|
|
368
|
+
},
|
|
369
|
+
],
|
|
370
|
+
},
|
|
371
|
+
"bonds": [
|
|
372
|
+
null,
|
|
373
|
+
null,
|
|
374
|
+
],
|
|
375
|
+
"type": "linear",
|
|
376
|
+
},
|
|
377
|
+
],
|
|
378
|
+
"6": [
|
|
379
|
+
{
|
|
380
|
+
"atoms": [
|
|
381
|
+
"O",
|
|
382
|
+
],
|
|
383
|
+
"attachments": {},
|
|
384
|
+
"bonds": [
|
|
385
|
+
"=",
|
|
386
|
+
],
|
|
387
|
+
"type": "linear",
|
|
388
|
+
},
|
|
389
|
+
],
|
|
390
|
+
"7": [
|
|
391
|
+
{
|
|
392
|
+
"components": [
|
|
393
|
+
{
|
|
394
|
+
"atoms": [
|
|
395
|
+
"C",
|
|
396
|
+
],
|
|
397
|
+
"attachments": {},
|
|
398
|
+
"bonds": [
|
|
399
|
+
null,
|
|
400
|
+
],
|
|
401
|
+
"type": "linear",
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"atoms": "C",
|
|
405
|
+
"attachments": {},
|
|
406
|
+
"bonds": [
|
|
407
|
+
"=",
|
|
408
|
+
null,
|
|
409
|
+
"=",
|
|
410
|
+
null,
|
|
411
|
+
"=",
|
|
412
|
+
null,
|
|
413
|
+
],
|
|
414
|
+
"offset": 0,
|
|
415
|
+
"ringNumber": 1,
|
|
416
|
+
"size": 6,
|
|
417
|
+
"substitutions": {},
|
|
418
|
+
"type": "ring",
|
|
419
|
+
},
|
|
420
|
+
],
|
|
421
|
+
"type": "molecule",
|
|
422
|
+
},
|
|
423
|
+
],
|
|
424
|
+
"9": [
|
|
425
|
+
{
|
|
426
|
+
"atoms": [
|
|
427
|
+
"O",
|
|
428
|
+
],
|
|
429
|
+
"attachments": {},
|
|
430
|
+
"bonds": [
|
|
431
|
+
"=",
|
|
432
|
+
],
|
|
433
|
+
"type": "linear",
|
|
434
|
+
},
|
|
435
|
+
],
|
|
436
|
+
},
|
|
437
|
+
"bonds": [
|
|
438
|
+
null,
|
|
439
|
+
null,
|
|
440
|
+
null,
|
|
441
|
+
null,
|
|
442
|
+
null,
|
|
443
|
+
null,
|
|
444
|
+
null,
|
|
445
|
+
null,
|
|
446
|
+
null,
|
|
447
|
+
null,
|
|
448
|
+
null,
|
|
449
|
+
null,
|
|
450
|
+
null,
|
|
451
|
+
null,
|
|
452
|
+
null,
|
|
453
|
+
null,
|
|
454
|
+
],
|
|
455
|
+
"type": "linear",
|
|
456
|
+
}
|
|
457
|
+
`;
|
|
458
|
+
|
|
459
|
+
exports[`Leu-Enkephalin Integration Test generates valid code via toCode() 1`] = `
|
|
460
|
+
"export const v1 = Fragment('CCCCNCCNCCNCCNCCN');
|
|
461
|
+
export const v2 = Fragment('C');
|
|
462
|
+
export const v3 = v1.attach(2, v2);
|
|
463
|
+
export const v4 = Fragment('CO');
|
|
464
|
+
export const v5 = Linear(['O'], ['=']);
|
|
465
|
+
export const v6 = v4.attach(1, v5);
|
|
466
|
+
export const v7 = v3.attach(4, v6);
|
|
467
|
+
export const v8 = Linear(['O'], ['=']);
|
|
468
|
+
export const v9 = v7.attach(6, v8);
|
|
469
|
+
export const v10 = Fragment('C');
|
|
470
|
+
export const v11 = Fragment('C1=CC=CC=C1');
|
|
471
|
+
export const v12 = Molecule([v10, v11]);
|
|
472
|
+
export const v13 = v9.attach(7, v12);
|
|
473
|
+
export const v14 = Linear(['O'], ['=']);
|
|
474
|
+
export const v15 = v13.attach(9, v14);
|
|
475
|
+
export const v16 = Linear(['O'], ['=']);
|
|
476
|
+
export const v17 = v15.attach(12, v16);
|
|
477
|
+
export const v18 = Linear(['O'], ['=']);
|
|
478
|
+
export const v19 = v17.attach(15, v18);
|
|
479
|
+
export const v20 = Fragment('C');
|
|
480
|
+
export const v21 = Fragment('C2=CC=C(C=C2)');
|
|
481
|
+
export const v22 = Fragment('O');
|
|
482
|
+
export const v23 = Molecule([v20, v21, v22]);
|
|
483
|
+
export const v24 = v19.attach(16, v23);"
|
|
484
|
+
`;
|
|
485
|
+
|
|
486
|
+
exports[`Leu-Enkephalin Integration Test generates valid verbose code via toCode() 1`] = `
|
|
487
|
+
"export const v1 = Linear(['C', 'C', 'C', 'C', 'N', 'C', 'C', 'N', 'C', 'C', 'N', 'C', 'C', 'N', 'C', 'C', 'N']);
|
|
488
|
+
export const v2 = Linear(['C']);
|
|
489
|
+
export const v3 = v1.attach(2, v2);
|
|
490
|
+
export const v4 = Linear(['C', 'O']);
|
|
491
|
+
export const v5 = Linear(['O'], ['=']);
|
|
492
|
+
export const v6 = v4.attach(1, v5);
|
|
493
|
+
export const v7 = v3.attach(4, v6);
|
|
494
|
+
export const v8 = Linear(['O'], ['=']);
|
|
495
|
+
export const v9 = v7.attach(6, v8);
|
|
496
|
+
export const v10 = Linear(['C']);
|
|
497
|
+
export const v11 = Ring({ atoms: 'C', size: 6, bonds: ['=', null, '=', null, '=', null] });
|
|
498
|
+
export const v12 = Molecule([v10, v11]);
|
|
499
|
+
export const v13 = v9.attach(7, v12);
|
|
500
|
+
export const v14 = Linear(['O'], ['=']);
|
|
501
|
+
export const v15 = v13.attach(9, v14);
|
|
502
|
+
export const v16 = Linear(['O'], ['=']);
|
|
503
|
+
export const v17 = v15.attach(12, v16);
|
|
504
|
+
export const v18 = Linear(['O'], ['=']);
|
|
505
|
+
export const v19 = v17.attach(15, v18);
|
|
506
|
+
export const v20 = Linear(['C']);
|
|
507
|
+
export const v21 = Ring({ atoms: 'C', size: 6, ringNumber: 2, bonds: ['=', null, '=', null, '=', null], branchDepths: [1, 1, 1, 1, 2, 2] });
|
|
508
|
+
export const v22 = Linear(['O']);
|
|
509
|
+
export const v23 = Molecule([v20, v21, v22]);
|
|
510
|
+
export const v24 = v19.attach(16, v23);"
|
|
511
|
+
`;
|
|
512
|
+
|
|
513
|
+
exports[`Endomorphin-1 Integration Test parses endomorphin-1 1`] = `
|
|
514
|
+
{
|
|
515
|
+
"components": [
|
|
516
|
+
{
|
|
517
|
+
"atoms": "C",
|
|
518
|
+
"attachments": {
|
|
519
|
+
"3": [
|
|
520
|
+
{
|
|
521
|
+
"atoms": [
|
|
522
|
+
"C",
|
|
523
|
+
"C",
|
|
524
|
+
"N",
|
|
525
|
+
],
|
|
526
|
+
"attachments": {
|
|
527
|
+
"1": [
|
|
528
|
+
{
|
|
529
|
+
"atoms": [
|
|
530
|
+
"O",
|
|
531
|
+
],
|
|
532
|
+
"attachments": {},
|
|
533
|
+
"bonds": [
|
|
534
|
+
"=",
|
|
535
|
+
],
|
|
536
|
+
"type": "linear",
|
|
537
|
+
},
|
|
538
|
+
],
|
|
539
|
+
"2": [
|
|
540
|
+
{
|
|
541
|
+
"components": [
|
|
542
|
+
{
|
|
543
|
+
"atoms": [
|
|
544
|
+
"C",
|
|
545
|
+
],
|
|
546
|
+
"attachments": {},
|
|
547
|
+
"bonds": [
|
|
548
|
+
null,
|
|
549
|
+
],
|
|
550
|
+
"type": "linear",
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
"atoms": "C",
|
|
554
|
+
"attachments": {},
|
|
555
|
+
"bonds": [
|
|
556
|
+
"=",
|
|
557
|
+
null,
|
|
558
|
+
"=",
|
|
559
|
+
null,
|
|
560
|
+
"=",
|
|
561
|
+
null,
|
|
562
|
+
],
|
|
563
|
+
"offset": 0,
|
|
564
|
+
"ringNumber": 2,
|
|
565
|
+
"size": 6,
|
|
566
|
+
"substitutions": {},
|
|
567
|
+
"type": "ring",
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
"atoms": [
|
|
571
|
+
"O",
|
|
572
|
+
],
|
|
573
|
+
"attachments": {},
|
|
574
|
+
"bonds": [],
|
|
575
|
+
"type": "linear",
|
|
576
|
+
},
|
|
577
|
+
],
|
|
578
|
+
"type": "molecule",
|
|
579
|
+
},
|
|
580
|
+
],
|
|
581
|
+
},
|
|
582
|
+
"bonds": [
|
|
583
|
+
null,
|
|
584
|
+
null,
|
|
585
|
+
null,
|
|
586
|
+
],
|
|
587
|
+
"type": "linear",
|
|
588
|
+
},
|
|
589
|
+
],
|
|
590
|
+
},
|
|
591
|
+
"bonds": [
|
|
592
|
+
null,
|
|
593
|
+
null,
|
|
594
|
+
null,
|
|
595
|
+
null,
|
|
596
|
+
null,
|
|
597
|
+
],
|
|
598
|
+
"offset": 0,
|
|
599
|
+
"ringNumber": 1,
|
|
600
|
+
"size": 5,
|
|
601
|
+
"substitutions": {
|
|
602
|
+
"4": "N",
|
|
603
|
+
},
|
|
604
|
+
"type": "ring",
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
"atoms": [
|
|
608
|
+
"C",
|
|
609
|
+
"N",
|
|
610
|
+
"C",
|
|
611
|
+
"C",
|
|
612
|
+
"N",
|
|
613
|
+
"C",
|
|
614
|
+
"C",
|
|
615
|
+
"N",
|
|
616
|
+
],
|
|
617
|
+
"attachments": {
|
|
618
|
+
"1": [
|
|
619
|
+
{
|
|
620
|
+
"atoms": [
|
|
621
|
+
"O",
|
|
622
|
+
],
|
|
623
|
+
"attachments": {},
|
|
624
|
+
"bonds": [
|
|
625
|
+
"=",
|
|
626
|
+
],
|
|
627
|
+
"type": "linear",
|
|
628
|
+
},
|
|
629
|
+
],
|
|
630
|
+
"3": [
|
|
631
|
+
{
|
|
632
|
+
"components": [
|
|
633
|
+
{
|
|
634
|
+
"atoms": [
|
|
635
|
+
"C",
|
|
636
|
+
],
|
|
637
|
+
"attachments": {},
|
|
638
|
+
"bonds": [
|
|
639
|
+
null,
|
|
640
|
+
],
|
|
641
|
+
"type": "linear",
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
"rings": [
|
|
645
|
+
{
|
|
646
|
+
"atoms": "C",
|
|
647
|
+
"attachments": {},
|
|
648
|
+
"bonds": [
|
|
649
|
+
"=",
|
|
650
|
+
null,
|
|
651
|
+
null,
|
|
652
|
+
"=",
|
|
653
|
+
null,
|
|
654
|
+
"=",
|
|
655
|
+
null,
|
|
656
|
+
"=",
|
|
657
|
+
null,
|
|
658
|
+
],
|
|
659
|
+
"offset": 0,
|
|
660
|
+
"ringNumber": 3,
|
|
661
|
+
"size": 9,
|
|
662
|
+
"substitutions": {
|
|
663
|
+
"3": "N",
|
|
664
|
+
},
|
|
665
|
+
"type": "ring",
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
"atoms": "C",
|
|
669
|
+
"attachments": {},
|
|
670
|
+
"bonds": [
|
|
671
|
+
"=",
|
|
672
|
+
null,
|
|
673
|
+
"=",
|
|
674
|
+
null,
|
|
675
|
+
"=",
|
|
676
|
+
null,
|
|
677
|
+
],
|
|
678
|
+
"offset": 3,
|
|
679
|
+
"ringNumber": 4,
|
|
680
|
+
"size": 6,
|
|
681
|
+
"substitutions": {},
|
|
682
|
+
"type": "ring",
|
|
683
|
+
},
|
|
684
|
+
],
|
|
685
|
+
"type": "fused_ring",
|
|
686
|
+
},
|
|
687
|
+
],
|
|
688
|
+
"type": "molecule",
|
|
689
|
+
},
|
|
690
|
+
],
|
|
691
|
+
"4": [
|
|
692
|
+
{
|
|
693
|
+
"atoms": [
|
|
694
|
+
"O",
|
|
695
|
+
],
|
|
696
|
+
"attachments": {},
|
|
697
|
+
"bonds": [
|
|
698
|
+
"=",
|
|
699
|
+
],
|
|
700
|
+
"type": "linear",
|
|
701
|
+
},
|
|
702
|
+
],
|
|
703
|
+
"6": [
|
|
704
|
+
{
|
|
705
|
+
"components": [
|
|
706
|
+
{
|
|
707
|
+
"atoms": [
|
|
708
|
+
"C",
|
|
709
|
+
],
|
|
710
|
+
"attachments": {},
|
|
711
|
+
"bonds": [
|
|
712
|
+
null,
|
|
713
|
+
],
|
|
714
|
+
"type": "linear",
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
"atoms": "C",
|
|
718
|
+
"attachments": {},
|
|
719
|
+
"bonds": [
|
|
720
|
+
"=",
|
|
721
|
+
null,
|
|
722
|
+
"=",
|
|
723
|
+
null,
|
|
724
|
+
"=",
|
|
725
|
+
null,
|
|
726
|
+
],
|
|
727
|
+
"offset": 0,
|
|
728
|
+
"ringNumber": 5,
|
|
729
|
+
"size": 6,
|
|
730
|
+
"substitutions": {},
|
|
731
|
+
"type": "ring",
|
|
732
|
+
},
|
|
733
|
+
],
|
|
734
|
+
"type": "molecule",
|
|
735
|
+
},
|
|
736
|
+
],
|
|
737
|
+
"7": [
|
|
738
|
+
{
|
|
739
|
+
"atoms": [
|
|
740
|
+
"O",
|
|
741
|
+
],
|
|
742
|
+
"attachments": {},
|
|
743
|
+
"bonds": [
|
|
744
|
+
"=",
|
|
745
|
+
],
|
|
746
|
+
"type": "linear",
|
|
747
|
+
},
|
|
748
|
+
],
|
|
749
|
+
},
|
|
750
|
+
"bonds": [
|
|
751
|
+
null,
|
|
752
|
+
null,
|
|
753
|
+
null,
|
|
754
|
+
null,
|
|
755
|
+
null,
|
|
756
|
+
null,
|
|
757
|
+
null,
|
|
758
|
+
],
|
|
759
|
+
"type": "linear",
|
|
760
|
+
},
|
|
761
|
+
],
|
|
762
|
+
"type": "molecule",
|
|
763
|
+
}
|
|
764
|
+
`;
|
|
765
|
+
|
|
766
|
+
exports[`Endomorphin-1 Integration Test generates valid code via toCode() 1`] = `
|
|
767
|
+
"export const v1 = Fragment('C1CC(C(C1))');
|
|
768
|
+
export const v2 = Fragment('C1CC(N(C1))');
|
|
769
|
+
export const v3 = Fragment('CCN');
|
|
770
|
+
export const v4 = Linear(['O'], ['=']);
|
|
771
|
+
export const v5 = v3.attach(1, v4);
|
|
772
|
+
export const v6 = Fragment('C');
|
|
773
|
+
export const v7 = Fragment('C2=CC=C(C=C2)');
|
|
774
|
+
export const v8 = Fragment('O');
|
|
775
|
+
export const v9 = Molecule([v6, v7, v8]);
|
|
776
|
+
export const v10 = v5.attach(2, v9);
|
|
777
|
+
export const v11 = v2.attach(3, v10, { sibling: false });
|
|
778
|
+
export const v12 = Fragment('CNCCNCCN');
|
|
779
|
+
export const v13 = Linear(['O'], ['=']);
|
|
780
|
+
export const v14 = v12.attach(1, v13);
|
|
781
|
+
export const v15 = Fragment('C');
|
|
782
|
+
export const v16 = Fragment('C3=CCC=CC=CC=C3');
|
|
783
|
+
export const v17 = Fragment('C3=CNC=CC=CC=C3');
|
|
784
|
+
export const v18 = Fragment('C4=CC=CC=C4');
|
|
785
|
+
export const v19 = FusedRing({ metadata: { rings: [{ ring: v17, start: 22, end: 30, atoms: [{ position: 22, depth: 1, value: 'C', rings: [3, 3], branchId: 42 }, { position: 23, depth: 1, value: 'C', bond: '=', rings: [3], branchId: 42 }, { position: 24, depth: 1, value: 'N', rings: [3], branchId: 42 }, { position: 25, depth: 1, value: 'C', rings: [4, 4, 3], branchId: 42 }, { position: 26, depth: 1, value: 'C', bond: '=', rings: [4, 3], branchId: 42 }, { position: 27, depth: 1, value: 'C', rings: [4, 3], branchId: 42 }, { position: 28, depth: 1, value: 'C', bond: '=', rings: [4, 3], branchId: 42 }, { position: 29, depth: 1, value: 'C', rings: [4, 3], branchId: 42 }, { position: 30, depth: 1, value: 'C', bond: '=', rings: [4, 3], branchId: 42 }] }, { ring: v18, start: 25, end: 30, atoms: [{ position: 25, depth: 1, value: 'C', rings: [4, 4, 3], branchId: 42 }, { position: 26, depth: 1, value: 'C', bond: '=', rings: [4, 3], branchId: 42 }, { position: 27, depth: 1, value: 'C', rings: [4, 3], branchId: 42 }, { position: 28, depth: 1, value: 'C', bond: '=', rings: [4, 3], branchId: 42 }, { position: 29, depth: 1, value: 'C', rings: [4, 3], branchId: 42 }, { position: 30, depth: 1, value: 'C', bond: '=', rings: [4, 3], branchId: 42 }] }] } });
|
|
786
|
+
export const v20 = Molecule([v15, v19]);
|
|
787
|
+
export const v21 = v14.attach(3, v20);
|
|
788
|
+
export const v22 = Linear(['O'], ['=']);
|
|
789
|
+
export const v23 = v21.attach(4, v22);
|
|
790
|
+
export const v24 = Fragment('C');
|
|
791
|
+
export const v25 = Fragment('C5=CC=CC=C5');
|
|
792
|
+
export const v26 = Molecule([v24, v25]);
|
|
793
|
+
export const v27 = v23.attach(6, v26);
|
|
794
|
+
export const v28 = Linear(['O'], ['=']);
|
|
795
|
+
export const v29 = v27.attach(7, v28);
|
|
796
|
+
export const v30 = Molecule([v11, v29]);"
|
|
797
|
+
`;
|
|
798
|
+
|
|
799
|
+
exports[`Endomorphin-1 Integration Test generates valid verbose code via toCode() 1`] = `
|
|
800
|
+
"export const v1 = Ring({ atoms: 'C', size: 5, branchDepths: [0, 0, 0, 1, 2] });
|
|
801
|
+
export const v2 = v1.substitute(4, 'N');
|
|
802
|
+
export const v3 = Linear(['C', 'C', 'N']);
|
|
803
|
+
export const v4 = Linear(['O'], ['=']);
|
|
804
|
+
export const v5 = v3.attach(1, v4);
|
|
805
|
+
export const v6 = Linear(['C']);
|
|
806
|
+
export const v7 = Ring({ atoms: 'C', size: 6, ringNumber: 2, bonds: ['=', null, '=', null, '=', null], branchDepths: [2, 2, 2, 2, 3, 3] });
|
|
807
|
+
export const v8 = Linear(['O']);
|
|
808
|
+
export const v9 = Molecule([v6, v7, v8]);
|
|
809
|
+
export const v10 = v5.attach(2, v9);
|
|
810
|
+
export const v11 = v2.attach(3, v10, { sibling: false });
|
|
811
|
+
export const v12 = Linear(['C', 'N', 'C', 'C', 'N', 'C', 'C', 'N']);
|
|
812
|
+
export const v13 = Linear(['O'], ['=']);
|
|
813
|
+
export const v14 = v12.attach(1, v13);
|
|
814
|
+
export const v15 = Linear(['C']);
|
|
815
|
+
export const v16 = Ring({ atoms: 'C', size: 9, ringNumber: 3, bonds: ['=', null, null, '=', null, '=', null, '=', null] });
|
|
816
|
+
export const v17 = v16.substitute(3, 'N');
|
|
817
|
+
export const v18 = Ring({ atoms: 'C', size: 6, ringNumber: 4, offset: 3, bonds: ['=', null, '=', null, '=', null] });
|
|
818
|
+
export const v19 = FusedRing({ metadata: { rings: [{ ring: v17, start: 22, end: 30, atoms: [{ position: 22, depth: 1, value: 'C', rings: [3, 3], branchId: 42 }, { position: 23, depth: 1, value: 'C', bond: '=', rings: [3], branchId: 42 }, { position: 24, depth: 1, value: 'N', rings: [3], branchId: 42 }, { position: 25, depth: 1, value: 'C', rings: [4, 4, 3], branchId: 42 }, { position: 26, depth: 1, value: 'C', bond: '=', rings: [4, 3], branchId: 42 }, { position: 27, depth: 1, value: 'C', rings: [4, 3], branchId: 42 }, { position: 28, depth: 1, value: 'C', bond: '=', rings: [4, 3], branchId: 42 }, { position: 29, depth: 1, value: 'C', rings: [4, 3], branchId: 42 }, { position: 30, depth: 1, value: 'C', bond: '=', rings: [4, 3], branchId: 42 }] }, { ring: v18, start: 25, end: 30, atoms: [{ position: 25, depth: 1, value: 'C', rings: [4, 4, 3], branchId: 42 }, { position: 26, depth: 1, value: 'C', bond: '=', rings: [4, 3], branchId: 42 }, { position: 27, depth: 1, value: 'C', rings: [4, 3], branchId: 42 }, { position: 28, depth: 1, value: 'C', bond: '=', rings: [4, 3], branchId: 42 }, { position: 29, depth: 1, value: 'C', rings: [4, 3], branchId: 42 }, { position: 30, depth: 1, value: 'C', bond: '=', rings: [4, 3], branchId: 42 }] }] } });
|
|
819
|
+
export const v20 = Molecule([v15, v19]);
|
|
820
|
+
export const v21 = v14.attach(3, v20);
|
|
821
|
+
export const v22 = Linear(['O'], ['=']);
|
|
822
|
+
export const v23 = v21.attach(4, v22);
|
|
823
|
+
export const v24 = Linear(['C']);
|
|
824
|
+
export const v25 = Ring({ atoms: 'C', size: 6, ringNumber: 5, bonds: ['=', null, '=', null, '=', null] });
|
|
825
|
+
export const v26 = Molecule([v24, v25]);
|
|
826
|
+
export const v27 = v23.attach(6, v26);
|
|
827
|
+
export const v28 = Linear(['O'], ['=']);
|
|
828
|
+
export const v29 = v27.attach(7, v28);
|
|
829
|
+
export const v30 = Molecule([v11, v29]);"
|
|
830
|
+
`;
|
|
831
|
+
|
|
832
|
+
exports[`Endomorphin-2 Integration Test parses endomorphin-2 1`] = `
|
|
833
|
+
{
|
|
834
|
+
"components": [
|
|
835
|
+
{
|
|
836
|
+
"atoms": "C",
|
|
837
|
+
"attachments": {
|
|
838
|
+
"3": [
|
|
839
|
+
{
|
|
840
|
+
"atoms": [
|
|
841
|
+
"C",
|
|
842
|
+
"C",
|
|
843
|
+
"N",
|
|
844
|
+
],
|
|
845
|
+
"attachments": {
|
|
846
|
+
"1": [
|
|
847
|
+
{
|
|
848
|
+
"atoms": [
|
|
849
|
+
"O",
|
|
850
|
+
],
|
|
851
|
+
"attachments": {},
|
|
852
|
+
"bonds": [
|
|
853
|
+
"=",
|
|
854
|
+
],
|
|
855
|
+
"type": "linear",
|
|
856
|
+
},
|
|
857
|
+
],
|
|
858
|
+
"2": [
|
|
859
|
+
{
|
|
860
|
+
"components": [
|
|
861
|
+
{
|
|
862
|
+
"atoms": [
|
|
863
|
+
"C",
|
|
864
|
+
],
|
|
865
|
+
"attachments": {},
|
|
866
|
+
"bonds": [
|
|
867
|
+
null,
|
|
868
|
+
],
|
|
869
|
+
"type": "linear",
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
"atoms": "C",
|
|
873
|
+
"attachments": {},
|
|
874
|
+
"bonds": [
|
|
875
|
+
"=",
|
|
876
|
+
null,
|
|
877
|
+
"=",
|
|
878
|
+
null,
|
|
879
|
+
"=",
|
|
880
|
+
null,
|
|
881
|
+
],
|
|
882
|
+
"offset": 0,
|
|
883
|
+
"ringNumber": 2,
|
|
884
|
+
"size": 6,
|
|
885
|
+
"substitutions": {},
|
|
886
|
+
"type": "ring",
|
|
887
|
+
},
|
|
888
|
+
{
|
|
889
|
+
"atoms": [
|
|
890
|
+
"O",
|
|
891
|
+
],
|
|
892
|
+
"attachments": {},
|
|
893
|
+
"bonds": [],
|
|
894
|
+
"type": "linear",
|
|
895
|
+
},
|
|
896
|
+
],
|
|
897
|
+
"type": "molecule",
|
|
898
|
+
},
|
|
899
|
+
],
|
|
900
|
+
},
|
|
901
|
+
"bonds": [
|
|
902
|
+
null,
|
|
903
|
+
null,
|
|
904
|
+
null,
|
|
905
|
+
],
|
|
906
|
+
"type": "linear",
|
|
907
|
+
},
|
|
908
|
+
],
|
|
909
|
+
},
|
|
910
|
+
"bonds": [
|
|
911
|
+
null,
|
|
912
|
+
null,
|
|
913
|
+
null,
|
|
914
|
+
null,
|
|
915
|
+
null,
|
|
916
|
+
],
|
|
917
|
+
"offset": 0,
|
|
918
|
+
"ringNumber": 1,
|
|
919
|
+
"size": 5,
|
|
920
|
+
"substitutions": {
|
|
921
|
+
"4": "N",
|
|
922
|
+
},
|
|
923
|
+
"type": "ring",
|
|
924
|
+
},
|
|
925
|
+
{
|
|
926
|
+
"atoms": [
|
|
927
|
+
"C",
|
|
928
|
+
"N",
|
|
929
|
+
"C",
|
|
930
|
+
"C",
|
|
931
|
+
"N",
|
|
932
|
+
"C",
|
|
933
|
+
"C",
|
|
934
|
+
"N",
|
|
935
|
+
],
|
|
936
|
+
"attachments": {
|
|
937
|
+
"1": [
|
|
938
|
+
{
|
|
939
|
+
"atoms": [
|
|
940
|
+
"O",
|
|
941
|
+
],
|
|
942
|
+
"attachments": {},
|
|
943
|
+
"bonds": [
|
|
944
|
+
"=",
|
|
945
|
+
],
|
|
946
|
+
"type": "linear",
|
|
947
|
+
},
|
|
948
|
+
],
|
|
949
|
+
"3": [
|
|
950
|
+
{
|
|
951
|
+
"components": [
|
|
952
|
+
{
|
|
953
|
+
"atoms": [
|
|
954
|
+
"C",
|
|
955
|
+
],
|
|
956
|
+
"attachments": {},
|
|
957
|
+
"bonds": [
|
|
958
|
+
null,
|
|
959
|
+
],
|
|
960
|
+
"type": "linear",
|
|
961
|
+
},
|
|
962
|
+
{
|
|
963
|
+
"atoms": "C",
|
|
964
|
+
"attachments": {},
|
|
965
|
+
"bonds": [
|
|
966
|
+
"=",
|
|
967
|
+
null,
|
|
968
|
+
"=",
|
|
969
|
+
null,
|
|
970
|
+
"=",
|
|
971
|
+
null,
|
|
972
|
+
],
|
|
973
|
+
"offset": 0,
|
|
974
|
+
"ringNumber": 3,
|
|
975
|
+
"size": 6,
|
|
976
|
+
"substitutions": {},
|
|
977
|
+
"type": "ring",
|
|
978
|
+
},
|
|
979
|
+
],
|
|
980
|
+
"type": "molecule",
|
|
981
|
+
},
|
|
982
|
+
],
|
|
983
|
+
"4": [
|
|
984
|
+
{
|
|
985
|
+
"atoms": [
|
|
986
|
+
"O",
|
|
987
|
+
],
|
|
988
|
+
"attachments": {},
|
|
989
|
+
"bonds": [
|
|
990
|
+
"=",
|
|
991
|
+
],
|
|
992
|
+
"type": "linear",
|
|
993
|
+
},
|
|
994
|
+
],
|
|
995
|
+
"6": [
|
|
996
|
+
{
|
|
997
|
+
"components": [
|
|
998
|
+
{
|
|
999
|
+
"atoms": [
|
|
1000
|
+
"C",
|
|
1001
|
+
],
|
|
1002
|
+
"attachments": {},
|
|
1003
|
+
"bonds": [
|
|
1004
|
+
null,
|
|
1005
|
+
],
|
|
1006
|
+
"type": "linear",
|
|
1007
|
+
},
|
|
1008
|
+
{
|
|
1009
|
+
"atoms": "C",
|
|
1010
|
+
"attachments": {},
|
|
1011
|
+
"bonds": [
|
|
1012
|
+
"=",
|
|
1013
|
+
null,
|
|
1014
|
+
"=",
|
|
1015
|
+
null,
|
|
1016
|
+
"=",
|
|
1017
|
+
null,
|
|
1018
|
+
],
|
|
1019
|
+
"offset": 0,
|
|
1020
|
+
"ringNumber": 4,
|
|
1021
|
+
"size": 6,
|
|
1022
|
+
"substitutions": {},
|
|
1023
|
+
"type": "ring",
|
|
1024
|
+
},
|
|
1025
|
+
],
|
|
1026
|
+
"type": "molecule",
|
|
1027
|
+
},
|
|
1028
|
+
],
|
|
1029
|
+
"7": [
|
|
1030
|
+
{
|
|
1031
|
+
"atoms": [
|
|
1032
|
+
"O",
|
|
1033
|
+
],
|
|
1034
|
+
"attachments": {},
|
|
1035
|
+
"bonds": [
|
|
1036
|
+
"=",
|
|
1037
|
+
],
|
|
1038
|
+
"type": "linear",
|
|
1039
|
+
},
|
|
1040
|
+
],
|
|
1041
|
+
},
|
|
1042
|
+
"bonds": [
|
|
1043
|
+
null,
|
|
1044
|
+
null,
|
|
1045
|
+
null,
|
|
1046
|
+
null,
|
|
1047
|
+
null,
|
|
1048
|
+
null,
|
|
1049
|
+
null,
|
|
1050
|
+
],
|
|
1051
|
+
"type": "linear",
|
|
1052
|
+
},
|
|
1053
|
+
],
|
|
1054
|
+
"type": "molecule",
|
|
1055
|
+
}
|
|
1056
|
+
`;
|
|
1057
|
+
|
|
1058
|
+
exports[`Endomorphin-2 Integration Test generates valid code via toCode() 1`] = `
|
|
1059
|
+
"export const v1 = Fragment('C1CC(C(C1))');
|
|
1060
|
+
export const v2 = Fragment('C1CC(N(C1))');
|
|
1061
|
+
export const v3 = Fragment('CCN');
|
|
1062
|
+
export const v4 = Linear(['O'], ['=']);
|
|
1063
|
+
export const v5 = v3.attach(1, v4);
|
|
1064
|
+
export const v6 = Fragment('C');
|
|
1065
|
+
export const v7 = Fragment('C2=CC=C(C=C2)');
|
|
1066
|
+
export const v8 = Fragment('O');
|
|
1067
|
+
export const v9 = Molecule([v6, v7, v8]);
|
|
1068
|
+
export const v10 = v5.attach(2, v9);
|
|
1069
|
+
export const v11 = v2.attach(3, v10, { sibling: false });
|
|
1070
|
+
export const v12 = Fragment('CNCCNCCN');
|
|
1071
|
+
export const v13 = Linear(['O'], ['=']);
|
|
1072
|
+
export const v14 = v12.attach(1, v13);
|
|
1073
|
+
export const v15 = Fragment('C');
|
|
1074
|
+
export const v16 = Fragment('C3=CC=CC=C3');
|
|
1075
|
+
export const v17 = Molecule([v15, v16]);
|
|
1076
|
+
export const v18 = v14.attach(3, v17);
|
|
1077
|
+
export const v19 = Linear(['O'], ['=']);
|
|
1078
|
+
export const v20 = v18.attach(4, v19);
|
|
1079
|
+
export const v21 = Fragment('C');
|
|
1080
|
+
export const v22 = Fragment('C4=CC=CC=C4');
|
|
1081
|
+
export const v23 = Molecule([v21, v22]);
|
|
1082
|
+
export const v24 = v20.attach(6, v23);
|
|
1083
|
+
export const v25 = Linear(['O'], ['=']);
|
|
1084
|
+
export const v26 = v24.attach(7, v25);
|
|
1085
|
+
export const v27 = Molecule([v11, v26]);"
|
|
1086
|
+
`;
|
|
1087
|
+
|
|
1088
|
+
exports[`Endomorphin-2 Integration Test generates valid verbose code via toCode() 1`] = `
|
|
1089
|
+
"export const v1 = Ring({ atoms: 'C', size: 5, branchDepths: [0, 0, 0, 1, 2] });
|
|
1090
|
+
export const v2 = v1.substitute(4, 'N');
|
|
1091
|
+
export const v3 = Linear(['C', 'C', 'N']);
|
|
1092
|
+
export const v4 = Linear(['O'], ['=']);
|
|
1093
|
+
export const v5 = v3.attach(1, v4);
|
|
1094
|
+
export const v6 = Linear(['C']);
|
|
1095
|
+
export const v7 = Ring({ atoms: 'C', size: 6, ringNumber: 2, bonds: ['=', null, '=', null, '=', null], branchDepths: [2, 2, 2, 2, 3, 3] });
|
|
1096
|
+
export const v8 = Linear(['O']);
|
|
1097
|
+
export const v9 = Molecule([v6, v7, v8]);
|
|
1098
|
+
export const v10 = v5.attach(2, v9);
|
|
1099
|
+
export const v11 = v2.attach(3, v10, { sibling: false });
|
|
1100
|
+
export const v12 = Linear(['C', 'N', 'C', 'C', 'N', 'C', 'C', 'N']);
|
|
1101
|
+
export const v13 = Linear(['O'], ['=']);
|
|
1102
|
+
export const v14 = v12.attach(1, v13);
|
|
1103
|
+
export const v15 = Linear(['C']);
|
|
1104
|
+
export const v16 = Ring({ atoms: 'C', size: 6, ringNumber: 3, bonds: ['=', null, '=', null, '=', null] });
|
|
1105
|
+
export const v17 = Molecule([v15, v16]);
|
|
1106
|
+
export const v18 = v14.attach(3, v17);
|
|
1107
|
+
export const v19 = Linear(['O'], ['=']);
|
|
1108
|
+
export const v20 = v18.attach(4, v19);
|
|
1109
|
+
export const v21 = Linear(['C']);
|
|
1110
|
+
export const v22 = Ring({ atoms: 'C', size: 6, ringNumber: 4, bonds: ['=', null, '=', null, '=', null] });
|
|
1111
|
+
export const v23 = Molecule([v21, v22]);
|
|
1112
|
+
export const v24 = v20.attach(6, v23);
|
|
1113
|
+
export const v25 = Linear(['O'], ['=']);
|
|
1114
|
+
export const v26 = v24.attach(7, v25);
|
|
1115
|
+
export const v27 = Molecule([v11, v26]);"
|
|
1116
|
+
`;
|