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.
Files changed (34) hide show
  1. package/docs/smiles.peggy +215 -0
  2. package/package.json +1 -1
  3. package/src/decompiler.js +209 -49
  4. package/src/decompiler.test.js +232 -60
  5. package/src/fragment.test.js +7 -2
  6. package/src/method-attachers.js +8 -8
  7. package/test-integration/__snapshots__/acetaminophen.test.js.snap +20 -0
  8. package/test-integration/__snapshots__/adjuvant-analgesics.test.js.snap +62 -0
  9. package/test-integration/__snapshots__/cholesterol-drugs.test.js.snap +261 -0
  10. package/test-integration/__snapshots__/dexamethasone.test.js.snap +31 -0
  11. package/test-integration/__snapshots__/endocannabinoids.test.js.snap +77 -0
  12. package/test-integration/__snapshots__/endogenous-opioids.test.js.snap +1116 -0
  13. package/test-integration/__snapshots__/hypertension-medication.test.js.snap +69 -0
  14. package/test-integration/__snapshots__/local-anesthetics.test.js.snap +97 -0
  15. package/test-integration/__snapshots__/nsaids-otc.test.js.snap +60 -0
  16. package/test-integration/__snapshots__/nsaids-prescription.test.js.snap +113 -0
  17. package/test-integration/__snapshots__/opioids.test.js.snap +109 -0
  18. package/test-integration/__snapshots__/steroids.test.js.snap +379 -0
  19. package/test-integration/acetaminophen.test.js +15 -3
  20. package/test-integration/adjuvant-analgesics.test.js +43 -7
  21. package/test-integration/cholesterol-drugs.test.js +88 -22
  22. package/test-integration/dexamethasone.test.js +8 -2
  23. package/test-integration/endocannabinoids.test.js +48 -12
  24. package/test-integration/endogenous-opioids.smiles.js +32 -0
  25. package/test-integration/endogenous-opioids.test.js +192 -0
  26. package/test-integration/hypertension-medication.test.js +32 -8
  27. package/test-integration/local-anesthetics.smiles.js +33 -0
  28. package/test-integration/local-anesthetics.test.js +64 -16
  29. package/test-integration/nsaids-otc.test.js +40 -10
  30. package/test-integration/nsaids-prescription.test.js +72 -18
  31. package/test-integration/opioids.test.js +56 -14
  32. package/test-integration/steroids.test.js +112 -28
  33. package/test-integration/utils.js +4 -2
  34. package/todo +2 -1
@@ -65,6 +65,16 @@ exports[`Acetaminophen Integration Test parses acetaminophen 1`] = `
65
65
  `;
66
66
 
67
67
  exports[`Acetaminophen Integration Test generates valid code via toCode() 1`] = `
68
+ "export const v1 = Fragment('CCN');
69
+ export const v2 = Linear(['O'], ['=']);
70
+ export const v3 = v1.attach(2, v2);
71
+ export const v4 = Fragment('c1ccccc1');
72
+ export const v5 = Fragment('O');
73
+ export const v6 = v4.attach(4, v5);
74
+ export const v7 = Molecule([v3, v6]);"
75
+ `;
76
+
77
+ exports[`Acetaminophen Integration Test generates valid verbose code via toCode() 1`] = `
68
78
  "export const v1 = Linear(['C', 'C', 'N']);
69
79
  export const v2 = Linear(['O'], ['=']);
70
80
  export const v3 = v1.attach(2, v2);
@@ -143,6 +153,16 @@ exports[`Phenacetin Integration Test parses phenacetin 1`] = `
143
153
  `;
144
154
 
145
155
  exports[`Phenacetin Integration Test generates valid code via toCode() 1`] = `
156
+ "export const v1 = Fragment('CCN');
157
+ export const v2 = Linear(['O'], ['=']);
158
+ export const v3 = v1.attach(2, v2);
159
+ export const v4 = Fragment('c1ccccc1');
160
+ export const v5 = Fragment('OCC');
161
+ export const v6 = v4.attach(4, v5);
162
+ export const v7 = Molecule([v3, v6]);"
163
+ `;
164
+
165
+ exports[`Phenacetin Integration Test generates valid verbose code via toCode() 1`] = `
146
166
  "export const v1 = Linear(['C', 'C', 'N']);
147
167
  export const v2 = Linear(['O'], ['=']);
148
168
  export const v3 = v1.attach(2, v2);
@@ -67,6 +67,16 @@ exports[`Gabapentin Integration Test parses gabapentin 1`] = `
67
67
  `;
68
68
 
69
69
  exports[`Gabapentin Integration Test generates valid code via toCode() 1`] = `
70
+ "export const v1 = Fragment('C1CCC(CC1)');
71
+ export const v2 = Fragment('CCO');
72
+ export const v3 = Linear(['O'], ['=']);
73
+ export const v4 = v2.attach(2, v3);
74
+ export const v5 = v1.attach(4, v4, { sibling: true });
75
+ export const v6 = Fragment('CN');
76
+ export const v7 = Molecule([v5, v6]);"
77
+ `;
78
+
79
+ exports[`Gabapentin Integration Test generates valid verbose code via toCode() 1`] = `
70
80
  "export const v1 = Ring({ atoms: 'C', size: 6, branchDepths: [0, 0, 0, 0, 1, 1] });
71
81
  export const v2 = Linear(['C', 'C', 'O']);
72
82
  export const v3 = Linear(['O'], ['=']);
@@ -141,6 +151,16 @@ exports[`Pregabalin Integration Test parses pregabalin 1`] = `
141
151
  `;
142
152
 
143
153
  exports[`Pregabalin Integration Test generates valid code via toCode() 1`] = `
154
+ "export const v1 = Fragment('CCCCCN');
155
+ export const v2 = Fragment('C');
156
+ export const v3 = v1.attach(2, v2);
157
+ export const v4 = Fragment('CCO');
158
+ export const v5 = Linear(['O'], ['=']);
159
+ export const v6 = v4.attach(2, v5);
160
+ export const v7 = v3.attach(4, v6);"
161
+ `;
162
+
163
+ exports[`Pregabalin Integration Test generates valid verbose code via toCode() 1`] = `
144
164
  "export const v1 = Linear(['C', 'C', 'C', 'C', 'C', 'N']);
145
165
  export const v2 = Linear(['C']);
146
166
  export const v3 = v1.attach(2, v2);
@@ -250,6 +270,17 @@ exports[`Amitriptyline Integration Test parses amitriptyline 1`] = `
250
270
  `;
251
271
 
252
272
  exports[`Amitriptyline Integration Test generates valid code via toCode() 1`] = `
273
+ "export const v1 = Fragment('CNCCC');
274
+ export const v2 = Fragment('C');
275
+ export const v3 = v1.attach(2, v2);
276
+ export const v4 = Ring({ atoms: 'C', size: 11, bonds: [null, '=', null, null, null, '=', null, '=', null, '=', null], leadingBond: '=' });
277
+ export const v5 = Fragment('C2=CC=CC=C2');
278
+ export const v6 = Fragment('C3=CC=CC=C3');
279
+ export const v7 = FusedRing({ metadata: { leadingBond: '=', rings: [{ ring: v4, start: 6, end: 20, atoms: [{ position: 6, depth: 0, value: 'C', bond: '=', rings: [1, 1] }, { position: 7, depth: 0, value: 'C', rings: [2, 2, 1] }, { position: 12, depth: 0, value: 'C', bond: '=', rings: [2, 1] }, { position: 13, depth: 0, value: 'C', rings: [1] }, { position: 14, depth: 0, value: 'C', rings: [1] }, { position: 15, depth: 0, value: 'C', rings: [3, 3, 1] }, { position: 16, depth: 0, value: 'C', bond: '=', rings: [3, 1] }, { position: 17, depth: 0, value: 'C', rings: [3, 1] }, { position: 18, depth: 0, value: 'C', bond: '=', rings: [3, 1] }, { position: 19, depth: 0, value: 'C', rings: [3, 1] }, { position: 20, depth: 0, value: 'C', bond: '=', rings: [3, 1] }] }, { ring: v5, start: 7, end: 12, atoms: [{ position: 7, depth: 0, value: 'C', rings: [2, 2, 1] }, { position: 8, depth: 0, value: 'C', bond: '=', rings: [2] }, { position: 9, depth: 0, value: 'C', rings: [2] }, { position: 10, depth: 0, value: 'C', bond: '=', rings: [2] }, { position: 11, depth: 0, value: 'C', rings: [2] }, { position: 12, depth: 0, value: 'C', bond: '=', rings: [2, 1] }] }, { ring: v6, start: 15, end: 20, atoms: [{ position: 15, depth: 0, value: 'C', rings: [3, 3, 1] }, { position: 16, depth: 0, value: 'C', bond: '=', rings: [3, 1] }, { position: 17, depth: 0, value: 'C', rings: [3, 1] }, { position: 18, depth: 0, value: 'C', bond: '=', rings: [3, 1] }, { position: 19, depth: 0, value: 'C', rings: [3, 1] }, { position: 20, depth: 0, value: 'C', bond: '=', rings: [3, 1] }] }] } });
280
+ export const v8 = Molecule([v3, v7]);"
281
+ `;
282
+
283
+ exports[`Amitriptyline Integration Test generates valid verbose code via toCode() 1`] = `
253
284
  "export const v1 = Linear(['C', 'N', 'C', 'C', 'C']);
254
285
  export const v2 = Linear(['C']);
255
286
  export const v3 = v1.attach(2, v2);
@@ -352,6 +383,17 @@ exports[`Duloxetine Integration Test parses duloxetine 1`] = `
352
383
  `;
353
384
 
354
385
  exports[`Duloxetine Integration Test generates valid code via toCode() 1`] = `
386
+ "export const v1 = Fragment('CNCCCO');
387
+ export const v2 = Fragment('C1=CC=CC1');
388
+ export const v3 = Fragment('C1=CC=CS1');
389
+ export const v4 = v1.attach(5, v3);
390
+ export const v5 = Fragment('C2=CC=CC=CC=CC=C2');
391
+ export const v6 = Fragment('C3=CC=CC=C3');
392
+ export const v7 = FusedRing({ metadata: { rings: [{ ring: v5, start: 11, end: 20, atoms: [{ position: 11, depth: 0, value: 'C', rings: [2, 2] }, { position: 12, depth: 0, value: 'C', bond: '=', rings: [2] }, { position: 13, depth: 0, value: 'C', rings: [2] }, { position: 14, depth: 0, value: 'C', bond: '=', rings: [2] }, { position: 15, depth: 0, value: 'C', rings: [3, 3, 2] }, { position: 16, depth: 0, value: 'C', bond: '=', rings: [3, 2] }, { position: 17, depth: 0, value: 'C', rings: [3, 2] }, { position: 18, depth: 0, value: 'C', bond: '=', rings: [3, 2] }, { position: 19, depth: 0, value: 'C', rings: [3, 2] }, { position: 20, depth: 0, value: 'C', bond: '=', rings: [3, 2] }] }, { ring: v6, start: 15, end: 20, atoms: [{ position: 15, depth: 0, value: 'C', rings: [3, 3, 2] }, { position: 16, depth: 0, value: 'C', bond: '=', rings: [3, 2] }, { position: 17, depth: 0, value: 'C', rings: [3, 2] }, { position: 18, depth: 0, value: 'C', bond: '=', rings: [3, 2] }, { position: 19, depth: 0, value: 'C', rings: [3, 2] }, { position: 20, depth: 0, value: 'C', bond: '=', rings: [3, 2] }] }] } });
393
+ export const v8 = Molecule([v4, v7]);"
394
+ `;
395
+
396
+ exports[`Duloxetine Integration Test generates valid verbose code via toCode() 1`] = `
355
397
  "export const v1 = Linear(['C', 'N', 'C', 'C', 'C', 'O']);
356
398
  export const v2 = Ring({ atoms: 'C', size: 5, bonds: ['=', null, '=', null, null] });
357
399
  export const v3 = v2.substitute(5, 'S');
@@ -454,6 +496,18 @@ exports[`Carbamazepine Integration Test parses carbamazepine 1`] = `
454
496
  `;
455
497
 
456
498
  exports[`Carbamazepine Integration Test generates valid code via toCode() 1`] = `
499
+ "export const v1 = Fragment('C1=CC=CC(=C1)');
500
+ export const v2 = Ring({ atoms: 'C', size: 7, ringNumber: 2, offset: 3, bonds: [null, null, '=', null, '=', null, null], leadingBond: '=' });
501
+ export const v3 = v2.substitute(7, 'N');
502
+ export const v4 = Fragment('C3=CC=CC=C3');
503
+ export const v5 = FusedRing({ metadata: { rings: [{ ring: v1, start: 0, end: 5, atoms: [{ position: 0, depth: 0, value: 'C', rings: [1, 1] }, { position: 1, depth: 0, value: 'C', bond: '=', rings: [1] }, { position: 2, depth: 0, value: 'C', rings: [1] }, { position: 3, depth: 0, value: 'C', bond: '=', rings: [2, 1, 2] }, { position: 4, depth: 0, value: 'C', rings: [1, 2] }, { position: 5, depth: 1, value: 'C', bond: '=', rings: [1], branchId: 9 }] }, { ring: v3, start: 3, end: 14, atoms: [{ position: 3, depth: 0, value: 'C', bond: '=', rings: [2, 1, 2] }, { position: 4, depth: 0, value: 'C', rings: [1, 2] }, { position: 6, depth: 0, value: 'C', rings: [2] }, { position: 7, depth: 0, value: 'C', bond: '=', rings: [2] }, { position: 8, depth: 0, value: 'C', rings: [3, 3, 2] }, { position: 13, depth: 0, value: 'C', bond: '=', rings: [3, 2] }, { position: 14, depth: 0, value: 'N', rings: [2] }] }, { ring: v4, start: 8, end: 13, atoms: [{ position: 8, depth: 0, value: 'C', rings: [3, 3, 2] }, { position: 9, depth: 0, value: 'C', bond: '=', rings: [3] }, { position: 10, depth: 0, value: 'C', rings: [3] }, { position: 11, depth: 0, value: 'C', bond: '=', rings: [3] }, { position: 12, depth: 0, value: 'C', rings: [3] }, { position: 13, depth: 0, value: 'C', bond: '=', rings: [3, 2] }] }] } });
504
+ export const v6 = Fragment('CN');
505
+ export const v7 = Linear(['O'], ['=']);
506
+ export const v8 = v6.attach(1, v7);
507
+ export const v9 = Molecule([v5, v8]);"
508
+ `;
509
+
510
+ exports[`Carbamazepine Integration Test generates valid verbose code via toCode() 1`] = `
457
511
  "export const v1 = Ring({ atoms: 'C', size: 6, bonds: ['=', null, '=', null, '=', null], branchDepths: [0, 0, 0, 0, 0, 1] });
458
512
  export const v2 = Ring({ atoms: 'C', size: 7, ringNumber: 2, offset: 3, bonds: [null, null, '=', null, '=', null, null], leadingBond: '=' });
459
513
  export const v3 = v2.substitute(7, 'N');
@@ -517,6 +571,14 @@ exports[`Valproic Acid Integration Test parses valproic acid 1`] = `
517
571
  `;
518
572
 
519
573
  exports[`Valproic Acid Integration Test generates valid code via toCode() 1`] = `
574
+ "export const v1 = Fragment('CCCCCO');
575
+ export const v2 = Fragment('CCC');
576
+ export const v3 = v1.attach(4, v2);
577
+ export const v4 = Linear(['O'], ['=']);
578
+ export const v5 = v3.attach(5, v4);"
579
+ `;
580
+
581
+ exports[`Valproic Acid Integration Test generates valid verbose code via toCode() 1`] = `
520
582
  "export const v1 = Linear(['C', 'C', 'C', 'C', 'C', 'O']);
521
583
  export const v2 = Linear(['C', 'C', 'C']);
522
584
  export const v3 = v1.attach(4, v2);
@@ -212,6 +212,34 @@ exports[`Atorvastatin Integration Test parses atorvastatin 1`] = `
212
212
  `;
213
213
 
214
214
  exports[`Atorvastatin Integration Test generates valid code via toCode() 1`] = `
215
+ "export const v1 = Fragment('CC');
216
+ export const v2 = Fragment('C');
217
+ export const v3 = v1.attach(2, v2);
218
+ export const v4 = Fragment('c1cccc1');
219
+ export const v5 = Fragment('c1cccn1');
220
+ export const v6 = Fragment('CN');
221
+ export const v7 = Linear(['O'], ['=']);
222
+ export const v8 = v6.attach(1, v7);
223
+ export const v9 = Fragment('c2ccccc2');
224
+ export const v10 = Molecule([v8, v9]);
225
+ export const v11 = v5.attach(2, v10);
226
+ export const v12 = Ring({ atoms: 'c', size: 6, ringNumber: 2, leadingBond: '-' });
227
+ export const v13 = v11.attach(3, v12);
228
+ export const v14 = Ring({ atoms: 'c', size: 6, ringNumber: 2, leadingBond: '-' });
229
+ export const v15 = Fragment('F');
230
+ export const v16 = v14.attach(4, v15);
231
+ export const v17 = v13.attach(4, v16);
232
+ export const v18 = Fragment('CC[C@@H]C[C@@H]CCO');
233
+ export const v19 = Fragment('O');
234
+ export const v20 = v18.attach(3, v19);
235
+ export const v21 = Fragment('O');
236
+ export const v22 = v20.attach(5, v21);
237
+ export const v23 = Linear(['O'], ['=']);
238
+ export const v24 = v22.attach(7, v23);
239
+ export const v25 = Molecule([v3, v17, v24]);"
240
+ `;
241
+
242
+ exports[`Atorvastatin Integration Test generates valid verbose code via toCode() 1`] = `
215
243
  "export const v1 = Linear(['C', 'C']);
216
244
  export const v2 = Linear(['C']);
217
245
  export const v3 = v1.attach(2, v2);
@@ -497,6 +525,31 @@ exports[`Simvastatin Integration Test parses simvastatin 1`] = `
497
525
  `;
498
526
 
499
527
  exports[`Simvastatin Integration Test generates valid code via toCode() 1`] = `
528
+ "export const v1 = Fragment('CCCCO');
529
+ export const v2 = Fragment('C');
530
+ export const v3 = v1.attach(3, v2);
531
+ export const v4 = Linear(['O'], ['=']);
532
+ export const v5 = v3.attach(4, v4);
533
+ export const v6 = Fragment('C1CCC=CC=CCCC1');
534
+ export const v7 = Fragment('C');
535
+ export const v8 = v6.attach(3, v7);
536
+ export const v9 = Fragment('C');
537
+ export const v10 = v8.attach(8, v9);
538
+ export const v11 = Fragment('CC');
539
+ export const v12 = Fragment('C3CCCCC3');
540
+ export const v13 = Fragment('C3CCCCO3');
541
+ export const v14 = Fragment('O');
542
+ export const v15 = v13.attach(3, v14);
543
+ export const v16 = Linear(['O'], ['=']);
544
+ export const v17 = v15.attach(5, v16);
545
+ export const v18 = Molecule([v11, v17]);
546
+ export const v19 = v10.attach(9, v18);
547
+ export const v20 = Ring({ atoms: 'C', size: 6, ringNumber: 2, offset: 4, bonds: [null, '=', null, null, null, null], leadingBond: '=' });
548
+ export const v21 = v19.fuse(4, v20);
549
+ export const v22 = Molecule([v5, v21]);"
550
+ `;
551
+
552
+ exports[`Simvastatin Integration Test generates valid verbose code via toCode() 1`] = `
500
553
  "export const v1 = Linear(['C', 'C', 'C', 'C', 'O']);
501
554
  export const v2 = Linear(['C']);
502
555
  export const v3 = v1.attach(3, v2);
@@ -718,6 +771,34 @@ exports[`Rosuvastatin Integration Test parses rosuvastatin 1`] = `
718
771
  `;
719
772
 
720
773
  exports[`Rosuvastatin Integration Test generates valid code via toCode() 1`] = `
774
+ "export const v1 = Fragment('CC');
775
+ export const v2 = Fragment('C');
776
+ export const v3 = v1.attach(2, v2);
777
+ export const v4 = Fragment('c1cc(cc(c1))');
778
+ export const v5 = Fragment('c1nc(nc(c1))');
779
+ export const v6 = Fragment('c2ccccc2');
780
+ export const v7 = Fragment('F');
781
+ export const v8 = v6.attach(4, v7);
782
+ export const v9 = v5.attach(3, v8, { sibling: false });
783
+ export const v10 = Linear(['C', 'C', '[C@@H]', 'C', '[C@@H]', 'C', 'C', 'O'], ['/', '=', '/', null, null, null, null, null]);
784
+ export const v11 = Fragment('O');
785
+ export const v12 = v10.attach(3, v11);
786
+ export const v13 = Fragment('O');
787
+ export const v14 = v12.attach(5, v13);
788
+ export const v15 = Linear(['O'], ['=']);
789
+ export const v16 = v14.attach(7, v15);
790
+ export const v17 = v9.attach(5, v16, { sibling: false });
791
+ export const v18 = Fragment('NSC');
792
+ export const v19 = Fragment('C');
793
+ export const v20 = v18.attach(1, v19);
794
+ export const v21 = Linear(['O'], ['=']);
795
+ export const v22 = v20.attach(2, v21);
796
+ export const v23 = Linear(['O'], ['=']);
797
+ export const v24 = v22.attach(2, v23);
798
+ export const v25 = Molecule([v3, v17, v24]);"
799
+ `;
800
+
801
+ exports[`Rosuvastatin Integration Test generates valid verbose code via toCode() 1`] = `
721
802
  "export const v1 = Linear(['C', 'C']);
722
803
  export const v2 = Linear(['C']);
723
804
  export const v3 = v1.attach(2, v2);
@@ -982,6 +1063,29 @@ exports[`Pravastatin Integration Test parses pravastatin 1`] = `
982
1063
  `;
983
1064
 
984
1065
  exports[`Pravastatin Integration Test generates valid code via toCode() 1`] = `
1066
+ "export const v1 = Fragment('CCCCO');
1067
+ export const v2 = Fragment('C');
1068
+ export const v3 = v1.attach(3, v2);
1069
+ export const v4 = Linear(['O'], ['=']);
1070
+ export const v5 = v3.attach(4, v4);
1071
+ export const v6 = Fragment('C1CCC=CC=CCCC1');
1072
+ export const v7 = Fragment('[C@H]1C[C@H]C=CC=C[C@H][C@H][C@H]1');
1073
+ export const v8 = Fragment('O');
1074
+ export const v9 = v7.attach(3, v8);
1075
+ export const v10 = Fragment('C');
1076
+ export const v11 = v9.attach(8, v10);
1077
+ export const v12 = Fragment('CC[C@@H]CCO');
1078
+ export const v13 = Fragment('O');
1079
+ export const v14 = v12.attach(3, v13);
1080
+ export const v15 = Linear(['O'], ['=']);
1081
+ export const v16 = v14.attach(5, v15);
1082
+ export const v17 = v11.attach(9, v16);
1083
+ export const v18 = Ring({ atoms: '[C@H]', size: 6, ringNumber: 2, offset: 4, bonds: [null, '=', null, null, null, null], leadingBond: '=' });
1084
+ export const v19 = v17.fuse(4, v18);
1085
+ export const v20 = Molecule([v5, v19]);"
1086
+ `;
1087
+
1088
+ exports[`Pravastatin Integration Test generates valid verbose code via toCode() 1`] = `
985
1089
  "export const v1 = Linear(['C', 'C', 'C', 'C', 'O']);
986
1090
  export const v2 = Linear(['C']);
987
1091
  export const v3 = v1.attach(3, v2);
@@ -1266,6 +1370,31 @@ exports[`Lovastatin Integration Test parses lovastatin 1`] = `
1266
1370
  `;
1267
1371
 
1268
1372
  exports[`Lovastatin Integration Test generates valid code via toCode() 1`] = `
1373
+ "export const v1 = Fragment('CCCCO');
1374
+ export const v2 = Fragment('C');
1375
+ export const v3 = v1.attach(3, v2);
1376
+ export const v4 = Linear(['O'], ['=']);
1377
+ export const v5 = v3.attach(4, v4);
1378
+ export const v6 = Fragment('C1CCC=CC=CCCC1');
1379
+ export const v7 = Fragment('C');
1380
+ export const v8 = v6.attach(3, v7);
1381
+ export const v9 = Fragment('C');
1382
+ export const v10 = v8.attach(8, v9);
1383
+ export const v11 = Fragment('CC');
1384
+ export const v12 = Fragment('C3CCCCC3');
1385
+ export const v13 = Fragment('C3CCCCO3');
1386
+ export const v14 = Fragment('O');
1387
+ export const v15 = v13.attach(3, v14);
1388
+ export const v16 = Linear(['O'], ['=']);
1389
+ export const v17 = v15.attach(5, v16);
1390
+ export const v18 = Molecule([v11, v17]);
1391
+ export const v19 = v10.attach(9, v18);
1392
+ export const v20 = Ring({ atoms: 'C', size: 6, ringNumber: 2, offset: 4, bonds: [null, '=', null, null, null, null], leadingBond: '=' });
1393
+ export const v21 = v19.fuse(4, v20);
1394
+ export const v22 = Molecule([v5, v21]);"
1395
+ `;
1396
+
1397
+ exports[`Lovastatin Integration Test generates valid verbose code via toCode() 1`] = `
1269
1398
  "export const v1 = Linear(['C', 'C', 'C', 'C', 'O']);
1270
1399
  export const v2 = Linear(['C']);
1271
1400
  export const v3 = v1.attach(3, v2);
@@ -1497,6 +1626,34 @@ exports[`Fluvastatin Integration Test parses fluvastatin 1`] = `
1497
1626
  `;
1498
1627
 
1499
1628
  exports[`Fluvastatin Integration Test generates valid code via toCode() 1`] = `
1629
+ "export const v1 = Fragment('CC');
1630
+ export const v2 = Fragment('C');
1631
+ export const v3 = v1.attach(2, v2);
1632
+ export const v4 = Fragment('c1cccc1');
1633
+ export const v5 = Fragment('n1cccc1');
1634
+ export const v6 = Fragment('CN');
1635
+ export const v7 = Linear(['O'], ['=']);
1636
+ export const v8 = v6.attach(1, v7);
1637
+ export const v9 = Fragment('c2ccccc2');
1638
+ export const v10 = Fragment('C');
1639
+ export const v11 = Linear(['O'], ['=']);
1640
+ export const v12 = v10.attach(1, v11);
1641
+ export const v13 = Molecule([v9, v12]);
1642
+ export const v14 = Fragment('O');
1643
+ export const v15 = Molecule([v8, v13, v14]);
1644
+ export const v16 = v5.attach(2, v15);
1645
+ export const v17 = Ring({ atoms: 'c', size: 6, ringNumber: 2, leadingBond: '-' });
1646
+ export const v18 = Fragment('F');
1647
+ export const v19 = v17.attach(4, v18);
1648
+ export const v20 = v16.attach(3, v19);
1649
+ export const v21 = Fragment('O');
1650
+ export const v22 = v20.attach(4, v21);
1651
+ export const v23 = Linear(['C', 'C'], ['='], {}, '/');
1652
+ export const v24 = Ring({ atoms: 'c', size: 6, leadingBond: '/' });
1653
+ export const v25 = Molecule([v3, v22, v23, v24]);"
1654
+ `;
1655
+
1656
+ exports[`Fluvastatin Integration Test generates valid verbose code via toCode() 1`] = `
1500
1657
  "export const v1 = Linear(['C', 'C']);
1501
1658
  export const v2 = Linear(['C']);
1502
1659
  export const v3 = v1.attach(2, v2);
@@ -1678,6 +1835,30 @@ exports[`Ezetimibe Integration Test parses ezetimibe 1`] = `
1678
1835
  `;
1679
1836
 
1680
1837
  exports[`Ezetimibe Integration Test generates valid code via toCode() 1`] = `
1838
+ "export const v1 = Fragment('C');
1839
+ export const v2 = Fragment('[C@H]1[C@H][C@H]([C@H][C@H]1)');
1840
+ export const v3 = Fragment('[C@H]1[C@@H][C@H](O[C@H]1)');
1841
+ export const v4 = Fragment('O');
1842
+ export const v5 = v3.attach(2, v4, { sibling: true });
1843
+ export const v6 = Fragment('c2ccccc2');
1844
+ export const v7 = Fragment('F');
1845
+ export const v8 = v6.attach(4, v7);
1846
+ export const v9 = v5.addSequentialRings([{ ring: v8, depth: 1 }], { baseMetadata: { positions: [1, 2, 4, 5, 6], start: 1, end: 6, totalAtoms: 7, useInterleavedCodegen: true, branchDepthMap: [[1, 0], [2, 0], [4, 0], [5, 1], [6, 1]], atomValueMap: [[1, '[C@H]'], [2, '[C@@H]'], [4, '[C@H]'], [5, 'O'], [6, '[C@H]']] } });
1847
+ export const v10 = Fragment('c3ccccc3');
1848
+ export const v11 = Fragment('O');
1849
+ export const v12 = v10.attach(4, v11);
1850
+ export const v13 = Fragment('C');
1851
+ export const v14 = Linear(['O'], ['=']);
1852
+ export const v15 = v13.attach(1, v14);
1853
+ export const v16 = Fragment('C4CCC(CC4)');
1854
+ export const v17 = Fragment('N4CCC(CC4)');
1855
+ export const v18 = Fragment('c5ccccc5');
1856
+ export const v19 = Fragment('F');
1857
+ export const v20 = v18.attach(4, v19);
1858
+ export const v21 = Molecule([v1, v9, v12, v15, v17, v20]);"
1859
+ `;
1860
+
1861
+ exports[`Ezetimibe Integration Test generates valid verbose code via toCode() 1`] = `
1681
1862
  "export const v1 = Linear(['C']);
1682
1863
  export const v2 = Ring({ atoms: '[C@H]', size: 5, branchDepths: [0, 0, 0, 1, 1] });
1683
1864
  export const v3 = v2.substitute(2, '[C@@H]');
@@ -1845,6 +2026,26 @@ exports[`Fenofibrate Integration Test parses fenofibrate 1`] = `
1845
2026
  `;
1846
2027
 
1847
2028
  exports[`Fenofibrate Integration Test generates valid code via toCode() 1`] = `
2029
+ "export const v1 = Fragment('CCOCCO');
2030
+ export const v2 = Fragment('C');
2031
+ export const v3 = v1.attach(2, v2);
2032
+ export const v4 = Linear(['O'], ['=']);
2033
+ export const v5 = v3.attach(4, v4);
2034
+ export const v6 = Fragment('C');
2035
+ export const v7 = v5.attach(5, v6);
2036
+ export const v8 = Fragment('C');
2037
+ export const v9 = v7.attach(5, v8);
2038
+ export const v10 = Fragment('c1ccc(cc1)');
2039
+ export const v11 = Fragment('C');
2040
+ export const v12 = Linear(['O'], ['=']);
2041
+ export const v13 = v11.attach(1, v12);
2042
+ export const v14 = Fragment('c2ccccc2');
2043
+ export const v15 = Fragment('Cl');
2044
+ export const v16 = v14.attach(4, v15);
2045
+ export const v17 = Molecule([v9, v10, v13, v16]);"
2046
+ `;
2047
+
2048
+ exports[`Fenofibrate Integration Test generates valid verbose code via toCode() 1`] = `
1848
2049
  "export const v1 = Linear(['C', 'C', 'O', 'C', 'C', 'O']);
1849
2050
  export const v2 = Linear(['C']);
1850
2051
  export const v3 = v1.attach(2, v2);
@@ -1965,6 +2166,21 @@ exports[`Gemfibrozil Integration Test parses gemfibrozil 1`] = `
1965
2166
  `;
1966
2167
 
1967
2168
  exports[`Gemfibrozil Integration Test generates valid code via toCode() 1`] = `
2169
+ "export const v1 = Fragment('C');
2170
+ export const v2 = Fragment('C1=CC=CC=C1');
2171
+ export const v3 = Fragment('C');
2172
+ export const v4 = v2.attach(3, v3);
2173
+ export const v5 = Fragment('CCCCCO');
2174
+ export const v6 = Fragment('C');
2175
+ export const v7 = v5.attach(4, v6);
2176
+ export const v8 = Fragment('C');
2177
+ export const v9 = v7.attach(4, v8);
2178
+ export const v10 = Linear(['O'], ['=']);
2179
+ export const v11 = v9.attach(5, v10);
2180
+ export const v12 = Molecule([v1, v4, v11]);"
2181
+ `;
2182
+
2183
+ exports[`Gemfibrozil Integration Test generates valid verbose code via toCode() 1`] = `
1968
2184
  "export const v1 = Linear(['C']);
1969
2185
  export const v2 = Ring({ atoms: 'C', size: 6, bonds: ['=', null, '=', null, '=', null] });
1970
2186
  export const v3 = Linear(['C']);
@@ -2166,6 +2382,31 @@ exports[`Pitavastatin Integration Test parses pitavastatin 1`] = `
2166
2382
  `;
2167
2383
 
2168
2384
  exports[`Pitavastatin Integration Test generates valid code via toCode() 1`] = `
2385
+ "export const v1 = Fragment('CC');
2386
+ export const v2 = Fragment('C');
2387
+ export const v3 = v1.attach(2, v2);
2388
+ export const v4 = Fragment('c1cc(cc(c1))');
2389
+ export const v5 = Fragment('c1nc(nc(c1))');
2390
+ export const v6 = Fragment('c2ccccc2');
2391
+ export const v7 = Fragment('F');
2392
+ export const v8 = v6.attach(4, v7);
2393
+ export const v9 = v5.attach(3, v8, { sibling: false });
2394
+ export const v10 = Linear(['C', 'C', '[C@@H]', 'C', '[C@@H]', 'C', 'C', 'O'], ['/', '=', '/', null, null, null, null, null]);
2395
+ export const v11 = Fragment('O');
2396
+ export const v12 = v10.attach(3, v11);
2397
+ export const v13 = Fragment('O');
2398
+ export const v14 = v12.attach(5, v13);
2399
+ export const v15 = Linear(['O'], ['=']);
2400
+ export const v16 = v14.attach(7, v15);
2401
+ export const v17 = v9.attach(5, v16, { sibling: false });
2402
+ export const v18 = Fragment('NC');
2403
+ export const v19 = Linear(['O'], ['=']);
2404
+ export const v20 = v18.attach(2, v19);
2405
+ export const v21 = Fragment('C3CC3');
2406
+ export const v22 = Molecule([v3, v17, v20, v21]);"
2407
+ `;
2408
+
2409
+ exports[`Pitavastatin Integration Test generates valid verbose code via toCode() 1`] = `
2169
2410
  "export const v1 = Linear(['C', 'C']);
2170
2411
  export const v2 = Linear(['C']);
2171
2412
  export const v3 = v1.attach(2, v2);
@@ -2341,6 +2582,26 @@ exports[`Cholesterol Integration Test parses cholesterol 1`] = `
2341
2582
  `;
2342
2583
 
2343
2584
  exports[`Cholesterol Integration Test generates valid code via toCode() 1`] = `
2585
+ "export const v1 = Fragment('C[C@H]');
2586
+ export const v2 = Fragment('CCCCC');
2587
+ export const v3 = Fragment('C');
2588
+ export const v4 = v2.attach(4, v3);
2589
+ export const v5 = v1.attach(2, v4);
2590
+ export const v6 = Fragment('C1CCCC1');
2591
+ export const v7 = Fragment('[C@H]1CC[C@@H][C@@]1');
2592
+ export const v8 = Fragment('[C@H]2[C@H]([C@H][C@H][C@H][C@H]2)');
2593
+ export const v9 = Fragment('[C@@H]2[C@@](CC[C@H][C@H]2)');
2594
+ export const v10 = Fragment('C3CCC=CC3');
2595
+ export const v11 = Fragment('[C@H]3[C@H]CC=C[C@@]3');
2596
+ export const v12 = Ring({ atoms: 'C', size: 6, ringNumber: 4, branchDepths: [1, 1, 2, 2, 2, 3], leadingBond: '=' });
2597
+ export const v13 = v12.substitute(2, '[C@@]');
2598
+ export const v14 = v13.substitute(5, '[C@@H]');
2599
+ export const v15 = FusedRing({ metadata: { rings: [{ ring: v7, start: 8, end: 12, atoms: [{ position: 8, depth: 0, value: '[C@H]', rings: [1, 1] }, { position: 9, depth: 0, value: 'C', rings: [1] }, { position: 10, depth: 0, value: 'C', rings: [1] }, { position: 11, depth: 0, value: '[C@@H]', rings: [2, 1, 2] }, { position: 12, depth: 0, value: '[C@@]', rings: [1, 2] }] }, { ring: v9, start: 11, end: 16, atoms: [{ position: 11, depth: 0, value: '[C@@H]', rings: [2, 1, 2] }, { position: 12, depth: 0, value: '[C@@]', rings: [1, 2] }, { position: 13, depth: 1, value: 'C', rings: [2], branchId: 20 }, { position: 14, depth: 1, value: 'C', rings: [2], branchId: 20 }, { position: 15, depth: 1, value: '[C@H]', rings: [3, 2, 3], branchId: 20 }, { position: 16, depth: 1, value: '[C@H]', rings: [2, 3], branchId: 20 }] }, { ring: v11, start: 15, end: 20, atoms: [{ position: 15, depth: 1, value: '[C@H]', rings: [3, 2, 3], branchId: 20 }, { position: 16, depth: 1, value: '[C@H]', rings: [2, 3], branchId: 20 }, { position: 17, depth: 1, value: 'C', rings: [3], branchId: 20 }, { position: 18, depth: 1, value: 'C', rings: [3], branchId: 20 }, { position: 19, depth: 1, value: 'C', bond: '=', rings: [4, 3, 4], branchId: 20 }, { position: 20, depth: 1, value: '[C@@]', rings: [3, 4], branchId: 20 }] }, { ring: v14, start: 19, end: 24, atoms: [{ position: 19, depth: 1, value: 'C', bond: '=', rings: [4, 3, 4], branchId: 20 }, { position: 20, depth: 1, value: '[C@@]', rings: [3, 4], branchId: 20 }, { position: 21, depth: 2, value: 'C', rings: [4], branchId: 34 }, { position: 22, depth: 2, value: 'C', rings: [4], branchId: 34 }, { position: 23, depth: 2, value: '[C@@H]', rings: [4], branchId: 34 }, { position: 24, depth: 3, value: 'C', rings: [4], branchId: 38 }] }], atoms: [{ position: 25, depth: 2, value: 'O', branchId: 34 }, { position: 26, depth: 1, value: 'C', branchId: 20 }] } });
2600
+ export const v16 = Fragment('C');
2601
+ export const v17 = Molecule([v5, v15, v16]);"
2602
+ `;
2603
+
2604
+ exports[`Cholesterol Integration Test generates valid verbose code via toCode() 1`] = `
2344
2605
  "export const v1 = Linear(['C', '[C@H]']);
2345
2606
  export const v2 = Linear(['C', 'C', 'C', 'C', 'C']);
2346
2607
  export const v3 = Linear(['C']);
@@ -227,6 +227,37 @@ exports[`Dexamethasone Integration Test parses dexamethasone 1`] = `
227
227
  `;
228
228
 
229
229
  exports[`Dexamethasone Integration Test generates valid code via toCode() 1`] = `
230
+ "export const v1 = Fragment('C');
231
+ export const v2 = Fragment('C1CCCC1');
232
+ export const v3 = Fragment('C');
233
+ export const v4 = v2.attach(4, v3);
234
+ export const v5 = Fragment('O');
235
+ export const v6 = v4.attach(5, v5);
236
+ export const v7 = Fragment('C2CCCCC2');
237
+ export const v8 = Fragment('F');
238
+ export const v9 = v7.attach(3, v8);
239
+ export const v10 = Fragment('O');
240
+ export const v11 = v9.attach(4, v10);
241
+ export const v12 = Fragment('C');
242
+ export const v13 = v11.attach(6, v12);
243
+ export const v14 = Fragment('C3CCCCC3');
244
+ export const v15 = Fragment('C');
245
+ export const v16 = v14.attach(5, v15);
246
+ export const v17 = Fragment('F');
247
+ export const v18 = v16.attach(6, v17);
248
+ export const v19 = Fragment('C4=CCC=CC4');
249
+ export const v20 = Linear(['O'], ['=']);
250
+ export const v21 = v19.attach(3, v20);
251
+ export const v22 = Fragment('C');
252
+ export const v23 = v21.attach(6, v22);
253
+ export const v24 = FusedRing({ metadata: { rings: [{ ring: v6, start: 1, end: 22, atoms: [{ position: 1, depth: 0, value: 'C', rings: [1, 1] }, { position: 2, depth: 0, value: 'C', rings: [1] }, { position: 3, depth: 0, value: 'C', rings: [2, 2, 1] }, { position: 20, depth: 0, value: 'C', rings: [2, 1] }, { position: 22, depth: 0, value: 'C', rings: [1] }] }, { ring: v13, start: 3, end: 20, atoms: [{ position: 3, depth: 0, value: 'C', rings: [2, 2, 1] }, { position: 4, depth: 0, value: 'C', rings: [3, 3, 2] }, { position: 15, depth: 0, value: 'C', rings: [3, 2] }, { position: 17, depth: 0, value: 'C', rings: [2] }, { position: 19, depth: 0, value: 'C', rings: [2] }, { position: 20, depth: 0, value: 'C', rings: [2, 1] }] }, { ring: v18, start: 4, end: 15, atoms: [{ position: 4, depth: 0, value: 'C', rings: [3, 3, 2] }, { position: 5, depth: 0, value: 'C', rings: [3] }, { position: 6, depth: 0, value: 'C', rings: [3] }, { position: 7, depth: 0, value: 'C', rings: [4, 4, 3] }, { position: 13, depth: 0, value: 'C', rings: [4, 3] }, { position: 15, depth: 0, value: 'C', rings: [3, 2] }] }, { ring: v23, start: 7, end: 13, atoms: [{ position: 7, depth: 0, value: 'C', rings: [4, 4, 3] }, { position: 8, depth: 0, value: 'C', bond: '=', rings: [4] }, { position: 9, depth: 0, value: 'C', rings: [4] }, { position: 11, depth: 0, value: 'C', rings: [4] }, { position: 12, depth: 0, value: 'C', bond: '=', rings: [4] }, { position: 13, depth: 0, value: 'C', rings: [4, 3] }] }] } });
254
+ export const v25 = Fragment('CCO');
255
+ export const v26 = Linear(['O'], ['=']);
256
+ export const v27 = v25.attach(1, v26);
257
+ export const v28 = Molecule([v1, v24, v27]);"
258
+ `;
259
+
260
+ exports[`Dexamethasone Integration Test generates valid verbose code via toCode() 1`] = `
230
261
  "export const v1 = Linear(['C']);
231
262
  export const v2 = Ring({ atoms: 'C', size: 5 });
232
263
  export const v3 = Linear(['C']);
@@ -77,6 +77,12 @@ export const v2 = Linear(['O'], ['=']);
77
77
  export const v3 = v1.attach(20, v2);"
78
78
  `;
79
79
 
80
+ exports[`Anandamide Integration Test generates valid verbose code via toCode() 1`] = `
81
+ "export const v1 = Linear(['C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'N', 'C', 'C', 'O'], [null, null, null, null, null, '=', null, null, '=', null, null, '=', null, null, '=', null, null, null, null, null, null, null, null]);
82
+ export const v2 = Linear(['O'], ['=']);
83
+ export const v3 = v1.attach(20, v2);"
84
+ `;
85
+
80
86
  exports[`2-Arachidonoylglycerol Integration Test parses 2-arachidonoylglycerol 1`] = `
81
87
  {
82
88
  "atoms": [
@@ -166,6 +172,14 @@ exports[`2-Arachidonoylglycerol Integration Test generates valid code via toCode
166
172
  "export const v1 = Linear(['C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'O', 'C', 'C', 'O'], [null, null, null, null, null, '=', null, null, '=', null, null, '=', null, null, '=', null, null, null, null, null, null, null, null]);
167
173
  export const v2 = Linear(['O'], ['=']);
168
174
  export const v3 = v1.attach(20, v2);
175
+ export const v4 = Fragment('CO');
176
+ export const v5 = v3.attach(22, v4);"
177
+ `;
178
+
179
+ exports[`2-Arachidonoylglycerol Integration Test generates valid verbose code via toCode() 1`] = `
180
+ "export const v1 = Linear(['C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'O', 'C', 'C', 'O'], [null, null, null, null, null, '=', null, null, '=', null, null, '=', null, null, '=', null, null, null, null, null, null, null, null]);
181
+ export const v2 = Linear(['O'], ['=']);
182
+ export const v3 = v1.attach(20, v2);
169
183
  export const v4 = Linear(['C', 'O']);
170
184
  export const v5 = v3.attach(22, v4);"
171
185
  `;
@@ -298,6 +312,22 @@ exports[`THC Integration Test parses THC 1`] = `
298
312
  `;
299
313
 
300
314
  exports[`THC Integration Test generates valid code via toCode() 1`] = `
315
+ "export const v1 = Fragment('CCCCC');
316
+ export const v2 = Fragment('C1=CC(=CCC=C(CCCC(CC=C1)))');
317
+ export const v3 = Fragment('C1=CC(=CCC=C(CCCC(OC=C1)))');
318
+ export const v4 = Fragment('C');
319
+ export const v5 = v3.attach(11, v4, { sibling: true });
320
+ export const v6 = Ring({ atoms: 'C', size: 6, ringNumber: 2, offset: 3, branchDepths: [1, 1, 2, 2, 3, 3], leadingBond: '=' });
321
+ export const v7 = v6.substitute(5, 'O');
322
+ export const v8 = Fragment('C');
323
+ export const v9 = v7.attach(4, v8, { sibling: true });
324
+ export const v10 = Fragment('C3C=C(CCC3)');
325
+ export const v11 = FusedRing({ metadata: { rings: [{ ring: v5, start: 5, end: 18, atoms: [{ position: 5, depth: 0, value: 'C', rings: [1, 1] }, { position: 6, depth: 0, value: 'C', bond: '=', rings: [1] }, { position: 7, depth: 0, value: 'C', rings: [1] }, { position: 8, depth: 1, value: 'C', bond: '=', rings: [2, 2, 1], branchId: 10 }, { position: 9, depth: 1, value: 'C', rings: [3, 3, 2, 1], branchId: 10 }, { position: 10, depth: 1, value: 'C', rings: [3, 1], branchId: 10 }, { position: 11, depth: 1, value: 'C', bond: '=', rings: [3, 1], branchId: 10 }, { position: 12, depth: 2, value: 'C', rings: [3, 1], branchId: 19 }, { position: 13, depth: 2, value: 'C', rings: [3, 1], branchId: 19 }, { position: 14, depth: 2, value: 'C', rings: [3, 2, 1], branchId: 19 }, { position: 15, depth: 2, value: 'C', rings: [2, 1], branchId: 19 }, { position: 16, depth: 3, value: 'O', rings: [2, 1], branchId: 25 }, { position: 17, depth: 3, value: 'C', rings: [2, 1], branchId: 25 }, { position: 18, depth: 3, value: 'C', bond: '=', rings: [1], branchId: 25 }] }, { ring: v9, start: 8, end: 17, atoms: [{ position: 8, depth: 1, value: 'C', bond: '=', rings: [2, 2, 1], branchId: 10 }, { position: 9, depth: 1, value: 'C', rings: [3, 3, 2, 1], branchId: 10 }, { position: 14, depth: 2, value: 'C', rings: [3, 2, 1], branchId: 19 }, { position: 15, depth: 2, value: 'C', rings: [2, 1], branchId: 19 }, { position: 16, depth: 3, value: 'O', rings: [2, 1], branchId: 25 }, { position: 17, depth: 3, value: 'C', rings: [2, 1], branchId: 25 }] }, { ring: v10, start: 9, end: 14, atoms: [{ position: 9, depth: 1, value: 'C', rings: [3, 3, 2, 1], branchId: 10 }, { position: 10, depth: 1, value: 'C', rings: [3, 1], branchId: 10 }, { position: 11, depth: 1, value: 'C', bond: '=', rings: [3, 1], branchId: 10 }, { position: 12, depth: 2, value: 'C', rings: [3, 1], branchId: 19 }, { position: 13, depth: 2, value: 'C', rings: [3, 1], branchId: 19 }, { position: 14, depth: 2, value: 'C', rings: [3, 2, 1], branchId: 19 }] }], atoms: [{ position: 20, depth: 2, value: 'C', branchId: 19 }, { position: 21, depth: 1, value: 'C', branchId: 10 }] } });
326
+ export const v12 = Fragment('O');
327
+ export const v13 = Molecule([v1, v11, v12]);"
328
+ `;
329
+
330
+ exports[`THC Integration Test generates valid verbose code via toCode() 1`] = `
301
331
  "export const v1 = Linear(['C', 'C', 'C', 'C', 'C']);
302
332
  export const v2 = Ring({ atoms: 'C', size: 14, bonds: ['=', null, '=', null, null, '=', null, null, null, null, null, null, '=', null], branchDepths: [0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3] });
303
333
  export const v3 = v2.substitute(12, 'O');
@@ -437,6 +467,23 @@ exports[`CBD Integration Test parses CBD 1`] = `
437
467
  `;
438
468
 
439
469
  exports[`CBD Integration Test generates valid code via toCode() 1`] = `
470
+ "export const v1 = Fragment('CCCCC');
471
+ export const v2 = Fragment('C1=CC(=C(C(=C1)))');
472
+ export const v3 = Fragment('C2C=C(CCC2)');
473
+ export const v4 = Fragment('CC');
474
+ export const v5 = Linear(['C'], ['=']);
475
+ export const v6 = v4.attach(1, v5);
476
+ export const v7 = v3.attach(3, v6, { sibling: false });
477
+ export const v8 = Fragment('C');
478
+ export const v9 = Molecule([v7, v8]);
479
+ export const v10 = v2.attach(3, v9, { sibling: false });
480
+ export const v11 = Fragment('O');
481
+ export const v12 = v10.attach(4, v11, { sibling: false });
482
+ export const v13 = Fragment('O');
483
+ export const v14 = Molecule([v1, v12, v13]);"
484
+ `;
485
+
486
+ exports[`CBD Integration Test generates valid verbose code via toCode() 1`] = `
440
487
  "export const v1 = Linear(['C', 'C', 'C', 'C', 'C']);
441
488
  export const v2 = Ring({ atoms: 'C', size: 6, bonds: ['=', null, '=', null, '=', null], branchDepths: [0, 0, 0, 1, 2, 3] });
442
489
  export const v3 = Ring({ atoms: 'C', size: 6, ringNumber: 2, bonds: [null, '=', null, null, null, null], branchDepths: [1, 1, 1, 2, 2, 2] });
@@ -633,6 +680,30 @@ exports[`Nabilone Integration Test parses nabilone 1`] = `
633
680
  `;
634
681
 
635
682
  exports[`Nabilone Integration Test generates valid code via toCode() 1`] = `
683
+ "export const v1 = Fragment('CCCCCCC');
684
+ export const v2 = Fragment('C');
685
+ export const v3 = v1.attach(7, v2);
686
+ export const v4 = Fragment('C');
687
+ export const v5 = v3.attach(7, v4);
688
+ export const v6 = Fragment('C1=CC(=CCCCCCCC(CC=C1))');
689
+ export const v7 = Fragment('C1=CC(=CCCCCCCC(OC=C1))');
690
+ export const v8 = Linear(['O'], ['=']);
691
+ export const v9 = v7.attach(7, v8, { sibling: true });
692
+ export const v10 = Fragment('C');
693
+ export const v11 = v9.attach(11, v10, { sibling: true });
694
+ export const v12 = Ring({ atoms: 'C', size: 6, ringNumber: 2, offset: 3, branchDepths: [1, 1, 1, 1, 2, 2], leadingBond: '=' });
695
+ export const v13 = v12.substitute(5, 'O');
696
+ export const v14 = Fragment('C');
697
+ export const v15 = v13.attach(4, v14, { sibling: true });
698
+ export const v16 = Fragment('C3CCCCC3');
699
+ export const v17 = Linear(['O'], ['=']);
700
+ export const v18 = v16.attach(3, v17);
701
+ export const v19 = FusedRing({ metadata: { rings: [{ ring: v11, start: 9, end: 23, atoms: [{ position: 9, depth: 0, value: 'C', rings: [1, 1] }, { position: 10, depth: 0, value: 'C', bond: '=', rings: [1] }, { position: 11, depth: 0, value: 'C', rings: [1] }, { position: 12, depth: 1, value: 'C', bond: '=', rings: [2, 2, 1], branchId: 18 }, { position: 13, depth: 1, value: 'C', rings: [3, 3, 2, 1], branchId: 18 }, { position: 14, depth: 1, value: 'C', rings: [3, 1], branchId: 18 }, { position: 15, depth: 1, value: 'C', rings: [3, 1], branchId: 18 }, { position: 17, depth: 1, value: 'C', rings: [3, 1], branchId: 18 }, { position: 18, depth: 1, value: 'C', rings: [3, 1], branchId: 18 }, { position: 19, depth: 1, value: 'C', rings: [3, 2, 1], branchId: 18 }, { position: 20, depth: 1, value: 'C', rings: [2, 1], branchId: 18 }, { position: 21, depth: 2, value: 'O', rings: [2, 1], branchId: 35 }, { position: 22, depth: 2, value: 'C', rings: [2, 1], branchId: 35 }, { position: 23, depth: 2, value: 'C', bond: '=', rings: [1], branchId: 35 }] }, { ring: v15, start: 12, end: 22, atoms: [{ position: 12, depth: 1, value: 'C', bond: '=', rings: [2, 2, 1], branchId: 18 }, { position: 13, depth: 1, value: 'C', rings: [3, 3, 2, 1], branchId: 18 }, { position: 19, depth: 1, value: 'C', rings: [3, 2, 1], branchId: 18 }, { position: 20, depth: 1, value: 'C', rings: [2, 1], branchId: 18 }, { position: 21, depth: 2, value: 'O', rings: [2, 1], branchId: 35 }, { position: 22, depth: 2, value: 'C', rings: [2, 1], branchId: 35 }] }, { ring: v18, start: 13, end: 19, atoms: [{ position: 13, depth: 1, value: 'C', rings: [3, 3, 2, 1], branchId: 18 }, { position: 14, depth: 1, value: 'C', rings: [3, 1], branchId: 18 }, { position: 15, depth: 1, value: 'C', rings: [3, 1], branchId: 18 }, { position: 17, depth: 1, value: 'C', rings: [3, 1], branchId: 18 }, { position: 18, depth: 1, value: 'C', rings: [3, 1], branchId: 18 }, { position: 19, depth: 1, value: 'C', rings: [3, 2, 1], branchId: 18 }] }], atoms: [{ position: 25, depth: 1, value: 'C', branchId: 18 }] } });
702
+ export const v20 = Fragment('O');
703
+ export const v21 = Molecule([v5, v19, v20]);"
704
+ `;
705
+
706
+ exports[`Nabilone Integration Test generates valid verbose code via toCode() 1`] = `
636
707
  "export const v1 = Linear(['C', 'C', 'C', 'C', 'C', 'C', 'C']);
637
708
  export const v2 = Linear(['C']);
638
709
  export const v3 = v1.attach(7, v2);
@@ -720,6 +791,12 @@ exports[`Palmitoylethanolamide Integration Test parses palmitoylethanolamide 1`]
720
791
  `;
721
792
 
722
793
  exports[`Palmitoylethanolamide Integration Test generates valid code via toCode() 1`] = `
794
+ "export const v1 = Fragment('CCCCCCCCCCCCCCCCNCCO');
795
+ export const v2 = Linear(['O'], ['=']);
796
+ export const v3 = v1.attach(16, v2);"
797
+ `;
798
+
799
+ exports[`Palmitoylethanolamide Integration Test generates valid verbose code via toCode() 1`] = `
723
800
  "export const v1 = Linear(['C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'N', 'C', 'C', 'O']);
724
801
  export const v2 = Linear(['O'], ['=']);
725
802
  export const v3 = v1.attach(16, v2);"