@kent-tokyo/chematic 0.1.19 → 0.1.20

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,6 +1,64 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
 
4
+ /**
5
+ * A conformer ensemble: one molecule geometry with multiple 3D coordinate sets.
6
+ *
7
+ * Create with `new(smiles)`, then add conformers with `add_generated_conformer`
8
+ * or `add_minimized_conformer`. Retrieve coordinates as PDB strings via
9
+ * `get_conformer_pdb(idx)`. Compare conformers with `conformer_rmsd`.
10
+ */
11
+ export class ConformerHandle {
12
+ free(): void;
13
+ [Symbol.dispose](): void;
14
+ /**
15
+ * Generate a new 3D conformer using distance-geometry and add it to the ensemble.
16
+ *
17
+ * Returns the index of the newly added conformer.
18
+ */
19
+ add_generated_conformer(): number;
20
+ /**
21
+ * Generate a new 3D conformer, run force-field minimization, and add it.
22
+ *
23
+ * Returns the index of the newly added conformer.
24
+ */
25
+ add_minimized_conformer(): number;
26
+ /**
27
+ * Number of conformers currently stored.
28
+ */
29
+ conformer_count(): number;
30
+ /**
31
+ * Kabsch-aligned RMSD (Å) between conformers `a` and `b`.
32
+ *
33
+ * Returns `NaN` if either index is out of range.
34
+ */
35
+ conformer_rmsd(a: number, b: number): number;
36
+ /**
37
+ * Un-aligned (translation + rotation NOT removed) RMSD (Å) between conformers `a` and `b`.
38
+ *
39
+ * Returns `NaN` if either index is out of range.
40
+ */
41
+ conformer_rmsd_no_align(a: number, b: number): number;
42
+ /**
43
+ * Return conformer `idx` as a PDB string, or `null` if `idx` is out of range.
44
+ */
45
+ get_conformer_pdb(idx: number): string | undefined;
46
+ /**
47
+ * The ensemble's molecule as a `MolHandle`.
48
+ */
49
+ mol(): MolHandle;
50
+ /**
51
+ * Create a new empty ensemble for the molecule given by `smiles`.
52
+ *
53
+ * Returns a JS error on SMILES parse failure.
54
+ */
55
+ constructor(smiles: string);
56
+ /**
57
+ * Remove conformer `idx` and return `true`, or `false` if `idx` is out of range.
58
+ */
59
+ remove_conformer(idx: number): boolean;
60
+ }
61
+
4
62
  /**
5
63
  * Style options for [`MolHandle::depict_svg_opts`].
6
64
  *
@@ -200,6 +258,10 @@ export class MolHandle {
200
258
  * Number of non-aromatic rings containing at least one heteroatom.
201
259
  */
202
260
  num_aliphatic_heterocycles(): number;
261
+ /**
262
+ * Count of aliphatic (non-aromatic) rings in the SSSR.
263
+ */
264
+ num_aliphatic_rings(): number;
203
265
  /**
204
266
  * Number of aromatic rings containing at least one heteroatom (N, O, S, …).
205
267
  */
@@ -216,6 +278,10 @@ export class MolHandle {
216
278
  * Number of fully saturated rings containing at least one heteroatom.
217
279
  */
218
280
  num_saturated_heterocycles(): number;
281
+ /**
282
+ * Count of fully saturated rings in the SSSR.
283
+ */
284
+ num_saturated_rings(): number;
219
285
  /**
220
286
  * Number of spiro atoms (sole shared atom between exactly 2 rings).
221
287
  */
@@ -224,6 +290,10 @@ export class MolHandle {
224
290
  * Number of assigned stereocenters (R/S).
225
291
  */
226
292
  num_stereocenters(): number;
293
+ /**
294
+ * Count of tetrahedral stereocenters with unspecified configuration.
295
+ */
296
+ num_unspecified_stereocenters(): number;
227
297
  /**
228
298
  * Returns `true` if the molecule has no PAINS structural alerts.
229
299
  */
@@ -268,6 +338,11 @@ export class MolHandle {
268
338
  */
269
339
  export function add_hydrogens(mol: MolHandle): MolHandle;
270
340
 
341
+ /**
342
+ * AtomPair fingerprint as a bit-packed byte vector (256 bytes = 2048 bits).
343
+ */
344
+ export function atom_pair_bitvec(mol: MolHandle): Uint8Array;
345
+
271
346
  /**
272
347
  * Number of BRICS fragments produced by fragmenting the molecule.
273
348
  *
@@ -275,6 +350,74 @@ export function add_hydrogens(mol: MolHandle): MolHandle;
275
350
  */
276
351
  export function brics_fragment_count(mol: MolHandle): number;
277
352
 
353
+ /**
354
+ * BRICS fragment SMILES as a JSON array.
355
+ *
356
+ * Applies the BRICS fragmentation rules and returns the canonical SMILES of
357
+ * every resulting fragment. Returns `[]` for molecules with no BRICS-breakable
358
+ * bonds (e.g. benzene).
359
+ *
360
+ * The count of fragments equals `brics_fragment_count`.
361
+ */
362
+ export function brics_fragments_json(mol: MolHandle): string;
363
+
364
+ /**
365
+ * Cluster molecules by structural similarity (Butina algorithm, ECFP4 Tanimoto).
366
+ *
367
+ * `smiles_json` — a JSON array of SMILES strings.
368
+ * `cutoff` — Tanimoto similarity threshold (0.0–1.0); molecules within this
369
+ * distance of a cluster centre are assigned to that cluster.
370
+ * Returns a JSON array of clusters, each cluster being an array of 0-based input indices.
371
+ * Returns a JS error if any SMILES fails to parse.
372
+ */
373
+ export function butina_cluster_ecfp4_json(smiles_json: string, cutoff: number): string;
374
+
375
+ /**
376
+ * Canonical tautomer of `mol`.
377
+ *
378
+ * Applies a rule-based tautomer normalisation and returns the canonical form
379
+ * as a new `MolHandle`.
380
+ */
381
+ export function canonical_tautomer(mol: MolHandle): MolHandle;
382
+
383
+ /**
384
+ * CIP stereo assignments as a JSON array of `{atomIdx, cipCode}` objects.
385
+ *
386
+ * `cipCode` is one of `"R"`, `"S"`, `"E"`, or `"Z"`.
387
+ * Returns `[]` for molecules with no specified stereocenters.
388
+ */
389
+ export function cip_assignments_json(mol: MolHandle): string;
390
+
391
+ /**
392
+ * Return the CPK color (CSS hex string) for the given element symbol.
393
+ *
394
+ * Returns `"#000000"` (black) for carbon and unknown elements.
395
+ */
396
+ export function cpk_color(element_symbol: string): string;
397
+
398
+ /**
399
+ * Compute structured depiction data for `mol` as a JSON object.
400
+ *
401
+ * Returns:
402
+ * ```json
403
+ * {
404
+ * "atoms": [
405
+ * {"idx": 0, "element": "C", "x": 1.5, "y": 0.0, "charge": 0,
406
+ * "label": null, "color": "#000000"},
407
+ * ...
408
+ * ],
409
+ * "bonds": [
410
+ * {"idx": 0, "atom1": 0, "atom2": 1, "kind": "Single"},
411
+ * ...
412
+ * ]
413
+ * }
414
+ * ```
415
+ *
416
+ * `label` is `null` for carbon atoms in skeletal structures (label suppressed).
417
+ * `kind` is one of `"Single"`, `"Double"`, `"Triple"`, `"Aromatic"`, `"Up"`, `"Down"`.
418
+ */
419
+ export function depict_data_json(mol: MolHandle): string;
420
+
278
421
  /**
279
422
  * Render a reaction SMILES string (e.g. `"CC(=O)O.CCO>>CC(=O)OCC.O"`) as a
280
423
  * single SVG showing reactants → products with `+` separators.
@@ -291,6 +434,19 @@ export function depict_reaction_svg(rxn_smiles: string): string;
291
434
  */
292
435
  export function depict_svg_grid(smiles_block: string, cols: number): string;
293
436
 
437
+ /**
438
+ * Render a molecule grid with SMARTS-based atom highlighting.
439
+ *
440
+ * `smiles_block` — newline-separated SMILES strings (same format as `depict_svg_grid`).
441
+ * `cols` — number of grid columns.
442
+ * `match_smarts` — SMARTS pattern; matched atoms in each molecule are highlighted.
443
+ * Pass an empty string `""` to render without any highlighting.
444
+ *
445
+ * Invalid SMILES are rendered as empty cells; SMARTS parse failure returns an
446
+ * unhighlighted grid (the SMARTS is silently ignored).
447
+ */
448
+ export function depict_svg_grid_highlighted(smiles_block: string, cols: number, match_smarts: string): string;
449
+
294
450
  /**
295
451
  * Detect named functional groups in `mol`.
296
452
  *
@@ -301,11 +457,63 @@ export function depict_svg_grid(smiles_block: string, cols: number): string;
301
457
  */
302
458
  export function detect_functional_groups(mol: MolHandle): string;
303
459
 
460
+ /**
461
+ * Dice similarity between `a` and `b` using ECFP4 fingerprints.
462
+ */
463
+ export function dice_ecfp4(a: MolHandle, b: MolHandle): number;
464
+
465
+ /**
466
+ * Dice similarity between `a` and `b` using ECFP6 fingerprints.
467
+ */
468
+ export function dice_ecfp6(a: MolHandle, b: MolHandle): number;
469
+
470
+ /**
471
+ * Dice similarity between `a` and `b` using MACCS 166-bit fingerprints.
472
+ */
473
+ export function dice_maccs(a: MolHandle, b: MolHandle): number;
474
+
304
475
  /**
305
476
  * Compute the ECFP4 fingerprint as a bit-packed byte vector (256 bytes = 2048 bits).
306
477
  */
307
478
  export function ecfp4_bitvec(mol: MolHandle): Uint8Array;
308
479
 
480
+ /**
481
+ * ECFP6 (radius-3) fingerprint as a bit-packed byte vector (256 bytes = 2048 bits).
482
+ */
483
+ export function ecfp6_bitvec(mol: MolHandle): Uint8Array;
484
+
485
+ /**
486
+ * Compute a fingerprint bit-vector with configurable ECFP radius and bit width.
487
+ *
488
+ * `radius` — Morgan radius (1 = ECFP2, 2 = ECFP4, 3 = ECFP6).
489
+ * `nbits` — bit width; must be one of 256, 512, 1024, or 2048.
490
+ * Returns a `Uint8Array` of `nbits/8` bytes.
491
+ *
492
+ * The hash modulo is applied at fingerprint-generation time (`id % nbits`),
493
+ * so no post-processing fold is needed.
494
+ */
495
+ export function ecfp_bitvec_custom(mol: MolHandle, radius: number, nbits: number): Uint8Array;
496
+
497
+ /**
498
+ * Enumerate all stereoisomers arising from unspecified tetrahedral stereocenters.
499
+ *
500
+ * Only considers carbon stereocenters without explicit `@`/`@@` annotation.
501
+ * Already-specified centers and E/Z double-bond geometry are unchanged.
502
+ * Returns a JSON array of canonical SMILES strings.
503
+ *
504
+ * At most 2^6 = 64 combinations are enumerated; if more than 6 unspecified
505
+ * centers are present this function returns a JS error to avoid combinatorial
506
+ * explosion.
507
+ */
508
+ export function enumerate_stereo_isomers_json(mol: MolHandle): string;
509
+
510
+ /**
511
+ * All enumerated tautomers of `mol` as a JSON array of canonical SMILES strings.
512
+ *
513
+ * Example return value: `["Oc1cccc2ccccc12","O=C1C=CC=Cc2ccccc21"]`
514
+ */
515
+ export function enumerate_tautomers_json(mol: MolHandle): string;
516
+
309
517
  /**
310
518
  * Per-atom EState values as a JSON array of f64.
311
519
  *
@@ -313,11 +521,30 @@ export function ecfp4_bitvec(mol: MolHandle): Uint8Array;
313
521
  */
314
522
  export function estate_indices_json(mol: MolHandle): string;
315
523
 
524
+ /**
525
+ * FCFP4 (pharmacophore, radius-2) fingerprint as a bit-packed byte vector (256 bytes).
526
+ */
527
+ export function fcfp4_bitvec(mol: MolHandle): Uint8Array;
528
+
529
+ /**
530
+ * FCFP6 (pharmacophore, radius-3) fingerprint as a bit-packed byte vector (256 bytes).
531
+ */
532
+ export function fcfp6_bitvec(mol: MolHandle): Uint8Array;
533
+
316
534
  /**
317
535
  * Gasteiger-Marsili PEOE partial charges as a JSON array of f64.
318
536
  */
319
537
  export function gasteiger_charges_json(mol: MolHandle): string;
320
538
 
539
+ /**
540
+ * Generate energy-minimized 3D coordinates and return a PDB string.
541
+ *
542
+ * Runs distance-geometry placement followed by gradient-descent force-field
543
+ * minimization. Geometry quality is better than `generate_3d_pdb` for
544
+ * flexible molecules; the force field is approximate (not MMFF94/UFF).
545
+ */
546
+ export function generate_3d_minimized_pdb(mol: MolHandle): string;
547
+
321
548
  /**
322
549
  * Generate 3D coordinates for the molecule and return a PDB string.
323
550
  *
@@ -326,6 +553,14 @@ export function gasteiger_charges_json(mol: MolHandle): string;
326
553
  */
327
554
  export function generate_3d_pdb(mol: MolHandle): string;
328
555
 
556
+ /**
557
+ * Generic (atom-type-erased) Murcko scaffold of `mol`.
558
+ *
559
+ * All atoms become carbon and all bonds become single bonds, giving the pure
560
+ * graph topology of the scaffold.
561
+ */
562
+ export function generic_murcko_scaffold(mol: MolHandle): MolHandle;
563
+
329
564
  /**
330
565
  * Return information about a single atom as a JSON object.
331
566
  *
@@ -360,6 +595,14 @@ export function get_bond_between(mol: MolHandle, atom1: number, atom2: number):
360
595
  */
361
596
  export function get_bond_info(mol: MolHandle, idx: number): string;
362
597
 
598
+ /**
599
+ * All scalar molecular descriptors as a single JSON object.
600
+ *
601
+ * Keys use camelCase and match the individual `MolHandle` method names.
602
+ * Drug-likeness rule outcomes are included as boolean fields.
603
+ */
604
+ export function get_descriptors_json(mol: MolHandle): string;
605
+
363
606
  /**
364
607
  * Identify functional groups. Returns a JSON array of objects:
365
608
  * `[{"atoms":[0,2,3],"type":"C,N,O"}, …]`
@@ -371,6 +614,34 @@ export function identify_functional_groups(mol: MolHandle): string;
371
614
  */
372
615
  export function is_valid_smiles(s: string): boolean;
373
616
 
617
+ /**
618
+ * Per-atom Labute approximate surface area contributions as a JSON array of f64.
619
+ *
620
+ * Non-finite values (single-atom molecules etc.) are emitted as JSON `null`.
621
+ */
622
+ export function labute_asa_per_atom_json(mol: MolHandle): string;
623
+
624
+ /**
625
+ * Return the largest fragment of `mol` (salt/solvent stripping).
626
+ *
627
+ * For single-component molecules returns a copy of the same molecule.
628
+ */
629
+ export function largest_fragment(mol: MolHandle): MolHandle;
630
+
631
+ /**
632
+ * Per-atom Crippen LogP contributions as a JSON array of f64.
633
+ *
634
+ * Index `i` corresponds to atom `i` in `mol.atoms()` order.
635
+ */
636
+ export function logp_per_atom_json(mol: MolHandle): string;
637
+
638
+ /**
639
+ * MACCS 166-bit structural keys fingerprint as a byte array (21 bytes, LSB-first).
640
+ *
641
+ * Bit `i` (0-indexed) corresponds to MACCS key `i+1`.
642
+ */
643
+ export function maccs_bitvec(mol: MolHandle): Uint8Array;
644
+
374
645
  /**
375
646
  * Find all SMARTS matches in a molecule given only SMILES strings.
376
647
  *
@@ -381,13 +652,78 @@ export function is_valid_smiles(s: string): boolean;
381
652
  export function match_smarts_smiles(smiles: string, smarts: string): string;
382
653
 
383
654
  /**
384
- * Serialize a SMILES string directly to a MOL V2000 block.
655
+ * Select `n` maximally-diverse molecules (MaxMin algorithm, ECFP4 Tanimoto).
656
+ *
657
+ * `smiles_json` — a JSON array of SMILES strings, e.g. `["CC","c1ccccc1","CCO"]`.
658
+ * Returns a JSON array of 0-based indices into the input array.
659
+ * Returns a JS error if any SMILES fails to parse (indices would otherwise shift).
660
+ */
661
+ export function maxmin_picks_ecfp4_json(smiles_json: string, n: number): string;
662
+
663
+ /**
664
+ * Maximum Common Substructure of a set of molecules, returned as a canonical SMILES string.
665
+ *
666
+ * `smiles_json` — a JSON array of at least 2 SMILES strings.
667
+ * Returns the MCS SMILES, or `"null"` when no common substructure was found.
668
+ * Returns a JS error on SMILES parse failure.
669
+ */
670
+ export function mcs_smiles_json(smiles_json: string): string;
671
+
672
+ /**
673
+ * Find matched molecular pairs in a set of molecules as JSON.
674
+ *
675
+ * `smiles_json` — JSON array of SMILES strings to analyze.
676
+ *
677
+ * Returns a JSON array of matched pairs:
678
+ * ```json
679
+ * [
680
+ * {
681
+ * "mol_a": "CC(=O)Oc1ccccc1",
682
+ * "mol_b": "CC(=O)Nc1ccccc1",
683
+ * "core": "c1ccccc1[*]",
684
+ * "fragment_a": "[*]OC(C)=O",
685
+ * "fragment_b": "[*]NC(C)=O"
686
+ * }
687
+ * ]
688
+ * ```
689
+ *
690
+ * Each pair represents molecules that share a common core scaffold but differ
691
+ * by exactly one structural fragment at a single BRICS-breakable bond cut.
692
+ *
693
+ * Returns a JS error if any SMILES fails to parse.
694
+ */
695
+ export function mmp_pairs_json(smiles_json: string): string;
696
+
697
+ /**
698
+ * Serialize a SMILES string directly to a MOL V2000 block with 2D coordinates.
385
699
  *
386
- * Convenience wrapper; all atom coordinates are 0.0.
387
700
  * Returns a JS error on SMILES parse failure.
388
701
  */
389
702
  export function mol_block_from_smiles(smiles: string): string;
390
703
 
704
+ /**
705
+ * Parse a ChemDraw XML (CDXML) string into a `MolHandle`.
706
+ *
707
+ * Only the first molecular fragment in the document is returned.
708
+ * Returns a JS error if the document cannot be parsed.
709
+ */
710
+ export function mol_from_cdxml(cdxml: string): MolHandle;
711
+
712
+ /**
713
+ * Parse a CML string into a `MolHandle`.
714
+ *
715
+ * Returns a JS error if the CML is invalid (unknown element, bad bond, etc.).
716
+ */
717
+ export function mol_from_cml(cml: string): MolHandle;
718
+
719
+ /**
720
+ * Parse a PDB file and return a `MolHandle` (topology only; coordinates are discarded).
721
+ *
722
+ * Uses CONECT records for connectivity if present; otherwise infers bonds from
723
+ * atom distances (the same heuristic as the internal `pdb_to_molecule` function).
724
+ */
725
+ export function mol_from_pdb(pdb: string): MolHandle;
726
+
391
727
  /**
392
728
  * Parse a MOL V2000 block and return a `MolHandle`.
393
729
  *
@@ -395,6 +731,92 @@ export function mol_block_from_smiles(smiles: string): string;
395
731
  */
396
732
  export function mol_from_sdf_block(block: string): MolHandle;
397
733
 
734
+ /**
735
+ * Parse a MOL V3000 block and return a `MolHandle`.
736
+ *
737
+ * Returns a JS error string on parse failure.
738
+ */
739
+ export function mol_from_v3000_block(block: string): MolHandle;
740
+
741
+ /**
742
+ * Parse an XYZ file and return a `MolHandle` (topology only; coordinates are discarded).
743
+ *
744
+ * Returns a JS error on parse failure.
745
+ */
746
+ export function mol_from_xyz(xyz: string): MolHandle;
747
+
748
+ /**
749
+ * Return the index that would be assigned to an atom appended to `mol`.
750
+ */
751
+ export function mol_next_atom_idx(mol: MolHandle): number;
752
+
753
+ /**
754
+ * Return a new `MolHandle` with one atom appended.
755
+ *
756
+ * The second return value is the new atom's index (as a JS number).
757
+ * Use `with_atom_added_idx` to retrieve the index.
758
+ */
759
+ export function mol_with_atom_added(mol: MolHandle, element_symbol: string): MolHandle;
760
+
761
+ /**
762
+ * Return a new `MolHandle` with atom `idx` and all its bonds removed.
763
+ *
764
+ * Atom indices above `idx` shift down by 1. Returns a JS error if `idx`
765
+ * is out of range.
766
+ */
767
+ export function mol_with_atom_removed(mol: MolHandle, idx: number): MolHandle;
768
+
769
+ /**
770
+ * Return a new `MolHandle` with one bond added between `a` and `b`.
771
+ *
772
+ * `order` — 1 = single, 2 = double, 3 = triple.
773
+ * Returns a JS error if the bond already exists or `a == b`.
774
+ */
775
+ export function mol_with_bond_added(mol: MolHandle, a: number, b: number, order: number): MolHandle;
776
+
777
+ /**
778
+ * Return a new `MolHandle` with bond `idx` removed.
779
+ *
780
+ * Atom indices are unchanged; bond indices above `idx` shift down.
781
+ * Returns a JS error if `idx` is out of range.
782
+ */
783
+ export function mol_with_bond_removed(mol: MolHandle, idx: number): MolHandle;
784
+
785
+ /**
786
+ * Per-atom molar refractivity contributions as a JSON array of f64.
787
+ */
788
+ export function mr_per_atom_json(mol: MolHandle): string;
789
+
790
+ /**
791
+ * Murcko scaffold of `mol` — the ring system plus linkers, side-chains removed.
792
+ *
793
+ * Returns a new `MolHandle`. For acyclic molecules returns an empty molecule.
794
+ */
795
+ export function murcko_scaffold(mol: MolHandle): MolHandle;
796
+
797
+ /**
798
+ * Neutralize formal charges on `mol` by proton addition/removal.
799
+ *
800
+ * Returns a new `MolHandle` with all formal charges set to zero where possible.
801
+ */
802
+ export function neutralize_charges(mol: MolHandle): MolHandle;
803
+
804
+ /**
805
+ * Parse and re-serialise a reaction SMILES string, returning the normalised form.
806
+ *
807
+ * Useful for validating reaction SMILES and obtaining a canonical representation.
808
+ * Returns a JS error on parse failure.
809
+ */
810
+ export function normalize_reaction_smiles(rxn_smiles: string): string;
811
+
812
+ /**
813
+ * PAINS structural alert names matched by `mol` as a JSON array.
814
+ *
815
+ * Returns `[]` when no alerts fire, or e.g. `["ene_six_het_A(483)"]`.
816
+ * Use alongside `pains_passes()` to know *which* alerts triggered.
817
+ */
818
+ export function pains_matches_json(mol: MolHandle): string;
819
+
398
820
  /**
399
821
  * Parse a SMILES string into a `MolHandle`.
400
822
  *
@@ -412,6 +834,29 @@ export function peoe_vsa_json(mol: MolHandle): string;
412
834
  */
413
835
  export function remove_hydrogens(mol: MolHandle): MolHandle;
414
836
 
837
+ /**
838
+ * Decompose a set of molecules against a core SMARTS, returning R-group SMILES.
839
+ *
840
+ * `smiles_json` — JSON array of SMILES strings.
841
+ * `core_smarts` — SMARTS pattern with `*` (wildcard) atoms marking R-group
842
+ * attachment points. For example `c1ccc(*)cc1` for para-substituted benzene.
843
+ *
844
+ * Returns a JSON array with one entry per input molecule:
845
+ * ```json
846
+ * [
847
+ * {"matched":true, "r1":"C"},
848
+ * {"matched":true, "r1":"CC"},
849
+ * {"matched":false}
850
+ * ]
851
+ * ```
852
+ * R-group keys are `"r1"`, `"r2"`, … in the order the `*` atoms appear in
853
+ * the SMARTS pattern. A molecule that does not contain the core gets
854
+ * `"matched": false` and no R-group keys.
855
+ *
856
+ * Returns a JS error if the SMARTS fails to parse or any SMILES is invalid.
857
+ */
858
+ export function rgroup_decompose_json(smiles_json: string, core_smarts: string): string;
859
+
415
860
  /**
416
861
  * Apply a SMIRKS reaction template and return product SMILES as a JSON string.
417
862
  *
@@ -426,6 +871,37 @@ export function run_reactants(smirks: string, reactants_smiles: string): string;
426
871
  */
427
872
  export function sa_score(mol: MolHandle): number;
428
873
 
874
+ /**
875
+ * Serialize multiple molecules with properties to an SDF string.
876
+ *
877
+ * # Arguments
878
+ * * `smiles_json` — JSON array of SMILES strings, e.g. `["CC(=O)O","c1ccccc1"]`
879
+ * * `names_json` — JSON array of molecule names (same length as `smiles_json`)
880
+ * * `props_json` — JSON array where each element encodes one molecule's SD data fields
881
+ * as `"key1\tvalue1\nkey2\tvalue2"` (tab-separated key/value, `\n`-separated pairs;
882
+ * pass `""` for a molecule with no properties)
883
+ *
884
+ * Returns the SDF string, or a JS error if any SMILES fails to parse or the
885
+ * arrays have mismatched lengths.
886
+ *
887
+ * The `\n` and `\t` sequences in `props_json` are JSON-escaped — they are
888
+ * decoded to the actual characters before SDF formatting.
889
+ */
890
+ export function sdf_from_records_json(smiles_json: string, names_json: string, props_json: string): string;
891
+
892
+ /**
893
+ * Parse an SDF string and return a JSON array of record objects.
894
+ *
895
+ * Each record has the shape:
896
+ * ```json
897
+ * {"smiles":"CC(=O)O","name":"aspirin","properties":{"MW":"180.2","Activity":"high"}}
898
+ * ```
899
+ *
900
+ * Invalid records are represented as `null`. SD data fields are included in
901
+ * `properties`; multi-line values are joined with `\n`.
902
+ */
903
+ export function sdf_to_records_json(sdf: string): string;
904
+
429
905
  /**
430
906
  * Parse an SDF string and return a JSON array of canonical SMILES strings.
431
907
  *
@@ -433,6 +909,15 @@ export function sa_score(mol: MolHandle): number;
433
909
  */
434
910
  export function sdf_to_smiles_json(sdf: string): string;
435
911
 
912
+ /**
913
+ * 3D shape descriptors as a JSON object.
914
+ *
915
+ * Keys: `pmi1`, `pmi2`, `pmi3`, `npr1`, `npr2`, `asphericity`, `eccentricity`,
916
+ * `radiusOfGyration`, `planeOfBestFit`. Non-finite values (e.g. single-atom
917
+ * molecules where pmi3 = 0) are serialised as JSON `null`.
918
+ */
919
+ export function shape_descriptors_json(mol: MolHandle): string;
920
+
436
921
  /**
437
922
  * SlogP_VSA descriptors (12 bins) as a JSON array.
438
923
  */
@@ -447,6 +932,14 @@ export function slogp_vsa_json(mol: MolHandle): string;
447
932
  */
448
933
  export function smarts_match_atoms(smarts: string, mol: MolHandle): string;
449
934
 
935
+ /**
936
+ * Serialise a JSON array of SMILES to an SDF string.
937
+ *
938
+ * Generates 2D coordinates for each molecule. Property data can be
939
+ * included by using `sdf_from_records_json` instead.
940
+ */
941
+ export function smiles_array_to_sdf(smiles_json: string): string;
942
+
450
943
  /**
451
944
  * Render a highlighted SVG from a SMILES string in one call.
452
945
  *
@@ -463,6 +956,14 @@ export function smiles_to_svg_highlighted(smiles: string, atoms: Uint32Array, bo
463
956
  */
464
957
  export function smr_vsa_json(mol: MolHandle): string;
465
958
 
959
+ /**
960
+ * Smallest Set of Smallest Rings (SSSR) as a JSON array of atom-index arrays.
961
+ *
962
+ * Example return value for naphthalene:
963
+ * `[[0,1,2,3,4,5],[5,6,7,8,9,4]]`
964
+ */
965
+ export function sssr_rings_json(mol: MolHandle): string;
966
+
466
967
  export function start(): void;
467
968
 
468
969
  /**
@@ -475,11 +976,26 @@ export function tanimoto_atom_pair(a: MolHandle, b: MolHandle): number;
475
976
  */
476
977
  export function tanimoto_ecfp4(a: MolHandle, b: MolHandle): number;
477
978
 
979
+ /**
980
+ * Tanimoto similarity between `a` and `b` using ECFP6 fingerprints.
981
+ */
982
+ export function tanimoto_ecfp6(a: MolHandle, b: MolHandle): number;
983
+
478
984
  /**
479
985
  * Tanimoto similarity between two molecules using FCFP4 fingerprints (pharmacophore-based).
480
986
  */
481
987
  export function tanimoto_fcfp4(a: MolHandle, b: MolHandle): number;
482
988
 
989
+ /**
990
+ * Tanimoto similarity between `a` and `b` using FCFP6 (radius-3 pharmacophore) fingerprints.
991
+ */
992
+ export function tanimoto_fcfp6(a: MolHandle, b: MolHandle): number;
993
+
994
+ /**
995
+ * Tanimoto similarity between `a` and `b` using MACCS 166-bit fingerprints.
996
+ */
997
+ export function tanimoto_maccs(a: MolHandle, b: MolHandle): number;
998
+
483
999
  /**
484
1000
  * Tanimoto similarity between two molecules given only SMILES strings (ECFP4).
485
1001
  *
@@ -498,23 +1014,74 @@ export function tanimoto_topo_path(a: MolHandle, b: MolHandle): number;
498
1014
  export function tanimoto_torsion(a: MolHandle, b: MolHandle): number;
499
1015
 
500
1016
  /**
501
- * Serialize a molecule to a MOL V2000 block.
1017
+ * Serialise a `MolHandle` to a CML string with 2D coordinates.
1018
+ *
1019
+ * Coordinates are generated using the same 2D layout engine as `to_mol_block`.
1020
+ */
1021
+ export function to_cml(mol: MolHandle): string;
1022
+
1023
+ /**
1024
+ * Serialize a molecule to a MOL V2000 block with 2D coordinates.
502
1025
  *
503
- * All atom coordinates are written as 0.0 (the `Molecule` type has no 2D
504
- * coordinate storage; real coordinates would require a separate layout pass).
1026
+ * Atom positions are computed via the same layout engine used for SVG depiction
1027
+ * and converted to Ångström units (`1.5 Å` per bond).
505
1028
  */
506
1029
  export function to_mol_block(mol: MolHandle): string;
507
1030
 
1031
+ /**
1032
+ * Serialise a `MolHandle` to MOL V3000 format with 2D coordinates.
1033
+ */
1034
+ export function to_mol_v3000_block(mol: MolHandle): string;
1035
+
1036
+ /**
1037
+ * Serialize a molecule to XYZ format.
1038
+ *
1039
+ * 3D coordinates are generated via distance-geometry placement.
1040
+ */
1041
+ export function to_xyz(mol: MolHandle): string;
1042
+
1043
+ /**
1044
+ * Torsion fingerprint as a bit-packed byte vector (256 bytes = 2048 bits).
1045
+ */
1046
+ export function torsion_bitvec(mol: MolHandle): Uint8Array;
1047
+
1048
+ /**
1049
+ * Non-canonical SMILES for `mol`.
1050
+ *
1051
+ * Unlike `canonical_smiles`, the output depends on the internal atom ordering
1052
+ * and is not normalised. Useful when round-trip fidelity (preserving atom
1053
+ * order) matters more than a canonical form.
1054
+ */
1055
+ export function write_smiles(mol: MolHandle): string;
1056
+
508
1057
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
509
1058
 
510
1059
  export interface InitOutput {
511
1060
  readonly memory: WebAssembly.Memory;
1061
+ readonly __wbg_conformerhandle_free: (a: number, b: number) => void;
512
1062
  readonly __wbg_depictoptions_free: (a: number, b: number) => void;
513
1063
  readonly __wbg_molhandle_free: (a: number, b: number) => void;
514
1064
  readonly add_hydrogens: (a: number) => number;
1065
+ readonly atom_pair_bitvec: (a: number) => [number, number];
515
1066
  readonly brics_fragment_count: (a: number) => number;
1067
+ readonly brics_fragments_json: (a: number) => [number, number];
1068
+ readonly butina_cluster_ecfp4_json: (a: number, b: number, c: number) => [number, number, number, number];
1069
+ readonly canonical_tautomer: (a: number) => number;
1070
+ readonly cip_assignments_json: (a: number) => [number, number];
1071
+ readonly conformerhandle_add_generated_conformer: (a: number) => number;
1072
+ readonly conformerhandle_add_minimized_conformer: (a: number) => number;
1073
+ readonly conformerhandle_conformer_count: (a: number) => number;
1074
+ readonly conformerhandle_conformer_rmsd: (a: number, b: number, c: number) => number;
1075
+ readonly conformerhandle_conformer_rmsd_no_align: (a: number, b: number, c: number) => number;
1076
+ readonly conformerhandle_get_conformer_pdb: (a: number, b: number) => [number, number];
1077
+ readonly conformerhandle_mol: (a: number) => number;
1078
+ readonly conformerhandle_new: (a: number, b: number) => [number, number, number];
1079
+ readonly conformerhandle_remove_conformer: (a: number, b: number) => number;
1080
+ readonly cpk_color: (a: number, b: number) => [number, number];
1081
+ readonly depict_data_json: (a: number) => [number, number];
516
1082
  readonly depict_reaction_svg: (a: number, b: number) => [number, number, number, number];
517
1083
  readonly depict_svg_grid: (a: number, b: number, c: number) => [number, number];
1084
+ readonly depict_svg_grid_highlighted: (a: number, b: number, c: number, d: number, e: number) => [number, number];
518
1085
  readonly depictoptions_new: () => number;
519
1086
  readonly depictoptions_set_atom_color: (a: number, b: number, c: number, d: number) => void;
520
1087
  readonly depictoptions_set_atom_ids: (a: number, b: number) => void;
@@ -529,20 +1096,48 @@ export interface InitOutput {
529
1096
  readonly depictoptions_set_show_atom_indices: (a: number, b: number) => void;
530
1097
  readonly depictoptions_set_width: (a: number, b: number) => void;
531
1098
  readonly detect_functional_groups: (a: number) => [number, number];
1099
+ readonly dice_ecfp4: (a: number, b: number) => number;
1100
+ readonly dice_ecfp6: (a: number, b: number) => number;
1101
+ readonly dice_maccs: (a: number, b: number) => number;
532
1102
  readonly ecfp4_bitvec: (a: number) => [number, number];
1103
+ readonly ecfp6_bitvec: (a: number) => [number, number];
1104
+ readonly ecfp_bitvec_custom: (a: number, b: number, c: number) => [number, number];
1105
+ readonly enumerate_stereo_isomers_json: (a: number) => [number, number, number, number];
1106
+ readonly enumerate_tautomers_json: (a: number) => [number, number];
533
1107
  readonly estate_indices_json: (a: number) => [number, number];
1108
+ readonly fcfp4_bitvec: (a: number) => [number, number];
1109
+ readonly fcfp6_bitvec: (a: number) => [number, number];
534
1110
  readonly gasteiger_charges_json: (a: number) => [number, number];
1111
+ readonly generate_3d_minimized_pdb: (a: number) => [number, number];
535
1112
  readonly generate_3d_pdb: (a: number) => [number, number];
1113
+ readonly generic_murcko_scaffold: (a: number) => number;
536
1114
  readonly get_atom_info: (a: number, b: number) => [number, number];
537
1115
  readonly get_bond_between: (a: number, b: number, c: number) => [number, number];
538
1116
  readonly get_bond_info: (a: number, b: number) => [number, number];
1117
+ readonly get_descriptors_json: (a: number) => [number, number];
539
1118
  readonly identify_functional_groups: (a: number) => [number, number];
540
1119
  readonly is_valid_smiles: (a: number, b: number) => number;
1120
+ readonly labute_asa_per_atom_json: (a: number) => [number, number];
1121
+ readonly largest_fragment: (a: number) => number;
1122
+ readonly logp_per_atom_json: (a: number) => [number, number];
1123
+ readonly maccs_bitvec: (a: number) => [number, number];
541
1124
  readonly match_smarts_smiles: (a: number, b: number, c: number, d: number) => [number, number, number, number];
1125
+ readonly maxmin_picks_ecfp4_json: (a: number, b: number, c: number) => [number, number, number, number];
1126
+ readonly mcs_smiles_json: (a: number, b: number) => [number, number, number, number];
1127
+ readonly mmp_pairs_json: (a: number, b: number) => [number, number, number, number];
542
1128
  readonly mol_block_from_smiles: (a: number, b: number) => [number, number, number, number];
1129
+ readonly mol_from_cdxml: (a: number, b: number) => [number, number, number];
1130
+ readonly mol_from_cml: (a: number, b: number) => [number, number, number];
1131
+ readonly mol_from_pdb: (a: number, b: number) => number;
543
1132
  readonly mol_from_sdf_block: (a: number, b: number) => [number, number, number];
1133
+ readonly mol_from_v3000_block: (a: number, b: number) => [number, number, number];
1134
+ readonly mol_from_xyz: (a: number, b: number) => [number, number, number];
1135
+ readonly mol_next_atom_idx: (a: number) => number;
1136
+ readonly mol_with_atom_added: (a: number, b: number, c: number) => [number, number, number];
1137
+ readonly mol_with_atom_removed: (a: number, b: number) => [number, number, number];
1138
+ readonly mol_with_bond_added: (a: number, b: number, c: number, d: number) => [number, number, number];
1139
+ readonly mol_with_bond_removed: (a: number, b: number) => [number, number, number];
544
1140
  readonly molhandle_aromatic_ring_count: (a: number) => number;
545
- readonly molhandle_atom_count: (a: number) => number;
546
1141
  readonly molhandle_bertz_ct: (a: number) => number;
547
1142
  readonly molhandle_bond_count: (a: number) => number;
548
1143
  readonly molhandle_canonical_smiles: (a: number) => [number, number];
@@ -579,12 +1174,15 @@ export interface InitOutput {
579
1174
  readonly molhandle_molecular_weight: (a: number) => number;
580
1175
  readonly molhandle_morgan_fp_counts_json: (a: number, b: number) => [number, number];
581
1176
  readonly molhandle_num_aliphatic_heterocycles: (a: number) => number;
1177
+ readonly molhandle_num_aliphatic_rings: (a: number) => number;
582
1178
  readonly molhandle_num_aromatic_heterocycles: (a: number) => number;
583
1179
  readonly molhandle_num_bridgehead_atoms: (a: number) => number;
584
1180
  readonly molhandle_num_heteroatoms: (a: number) => number;
585
1181
  readonly molhandle_num_saturated_heterocycles: (a: number) => number;
1182
+ readonly molhandle_num_saturated_rings: (a: number) => number;
586
1183
  readonly molhandle_num_spiro_atoms: (a: number) => number;
587
1184
  readonly molhandle_num_stereocenters: (a: number) => number;
1185
+ readonly molhandle_num_unspecified_stereocenters: (a: number) => number;
588
1186
  readonly molhandle_pains_passes: (a: number) => number;
589
1187
  readonly molhandle_qed: (a: number) => number;
590
1188
  readonly molhandle_reos_passes: (a: number) => number;
@@ -594,24 +1192,44 @@ export interface InitOutput {
594
1192
  readonly molhandle_tpsa: (a: number) => number;
595
1193
  readonly molhandle_veber_passes: (a: number) => number;
596
1194
  readonly molhandle_wiener_index: (a: number) => number;
1195
+ readonly mr_per_atom_json: (a: number) => [number, number];
1196
+ readonly murcko_scaffold: (a: number) => number;
1197
+ readonly neutralize_charges: (a: number) => number;
1198
+ readonly normalize_reaction_smiles: (a: number, b: number) => [number, number, number, number];
1199
+ readonly pains_matches_json: (a: number) => [number, number];
597
1200
  readonly parse_smiles: (a: number, b: number) => [number, number, number];
598
1201
  readonly peoe_vsa_json: (a: number) => [number, number];
599
1202
  readonly remove_hydrogens: (a: number) => number;
1203
+ readonly rgroup_decompose_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
600
1204
  readonly run_reactants: (a: number, b: number, c: number, d: number) => [number, number, number, number];
601
1205
  readonly sa_score: (a: number) => number;
1206
+ readonly sdf_from_records_json: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
1207
+ readonly sdf_to_records_json: (a: number, b: number) => [number, number];
602
1208
  readonly sdf_to_smiles_json: (a: number, b: number) => [number, number];
1209
+ readonly shape_descriptors_json: (a: number) => [number, number];
603
1210
  readonly slogp_vsa_json: (a: number) => [number, number];
604
1211
  readonly smarts_match_atoms: (a: number, b: number, c: number) => [number, number, number, number];
1212
+ readonly smiles_array_to_sdf: (a: number, b: number) => [number, number, number, number];
605
1213
  readonly smiles_to_svg_highlighted: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
606
1214
  readonly smr_vsa_json: (a: number) => [number, number];
1215
+ readonly sssr_rings_json: (a: number) => [number, number];
607
1216
  readonly tanimoto_atom_pair: (a: number, b: number) => number;
608
1217
  readonly tanimoto_ecfp4: (a: number, b: number) => number;
1218
+ readonly tanimoto_ecfp6: (a: number, b: number) => number;
609
1219
  readonly tanimoto_fcfp4: (a: number, b: number) => number;
1220
+ readonly tanimoto_fcfp6: (a: number, b: number) => number;
1221
+ readonly tanimoto_maccs: (a: number, b: number) => number;
610
1222
  readonly tanimoto_smiles: (a: number, b: number, c: number, d: number) => [number, number, number];
611
1223
  readonly tanimoto_topo_path: (a: number, b: number) => number;
612
1224
  readonly tanimoto_torsion: (a: number, b: number) => number;
1225
+ readonly to_cml: (a: number) => [number, number];
613
1226
  readonly to_mol_block: (a: number) => [number, number];
1227
+ readonly to_mol_v3000_block: (a: number) => [number, number];
1228
+ readonly to_xyz: (a: number) => [number, number];
1229
+ readonly torsion_bitvec: (a: number) => [number, number];
1230
+ readonly write_smiles: (a: number) => [number, number];
614
1231
  readonly start: () => void;
1232
+ readonly molhandle_atom_count: (a: number) => number;
615
1233
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
616
1234
  readonly __wbindgen_malloc: (a: number, b: number) => number;
617
1235
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;