@kent-tokyo/chematic 0.2.11 → 0.4.19

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/README.md CHANGED
@@ -116,6 +116,12 @@ console.log(ifg); // [{"atoms":[1,2,3],"types":"OC=O"}, ...]
116
116
  - True MHFP (structural fragment hashing)
117
117
  - True ERG (Ertl 2017 functional group detection)
118
118
 
119
+ ## Bundle Size
120
+
121
+ ~500 KB gzip / ~1.3 MB raw (reduced from ~819 KB gzip in v0.4.17, -38.5%).
122
+
123
+ PNG rasterization (`tiny_skia`) is excluded from the WASM build — use SVG output instead. All SVG depiction APIs remain fully available.
124
+
119
125
  ## Building from source
120
126
 
121
127
  ```sh
@@ -169,6 +169,15 @@ export class MolHandle {
169
169
  * Number of heavy atoms (explicit atoms in the graph; does not count implicit H).
170
170
  */
171
171
  atom_count(): number;
172
+ /**
173
+ * Returns true when TPSA < 90 Ų, MW < 400, HBD ≤ 3.
174
+ */
175
+ bbb_passes(): boolean;
176
+ /**
177
+ * Clark (2000) blood-brain barrier logBB score.
178
+ * logBB > −1.0 = likely CNS penetrant.
179
+ */
180
+ bbb_score(): number;
172
181
  /**
173
182
  * Bertz complexity index (BertzCT).
174
183
  */
@@ -177,6 +186,11 @@ export class MolHandle {
177
186
  * Number of bonds.
178
187
  */
179
188
  bond_count(): number;
189
+ /**
190
+ * Palm (1997) Caco-2 intestinal permeability (logPCaco2).
191
+ * > −5.5 = high permeability.
192
+ */
193
+ caco2_permeability(): number;
180
194
  /**
181
195
  * Canonical SMILES string.
182
196
  */
@@ -222,8 +236,12 @@ export class MolHandle {
222
236
  */
223
237
  chi4v(): number;
224
238
  /**
225
- * 2D PNG depiction (rasterized from SVG).
226
- * Returns PNG data as base64-encoded string for embedding in HTML/JS.
239
+ * CYP3A4 metabolic inhibition risk score (0.0–1.0).
240
+ */
241
+ cyp3a4_inhibition_risk(): number;
242
+ /**
243
+ * 2D PNG depiction — not available in the WASM build (PNG stack disabled to reduce bundle size).
244
+ * Use `depict_svg()` in browser contexts; rasterize client-side if needed.
227
245
  */
228
246
  depict_png(): Uint8Array;
229
247
  /**
@@ -272,6 +290,10 @@ export class MolHandle {
272
290
  * Number of non-hydrogen heavy atoms.
273
291
  */
274
292
  heavy_atom_count(): number;
293
+ /**
294
+ * hERG cardiac toxicity risk score (0.0–1.0).
295
+ */
296
+ herg_risk_score(): number;
275
297
  /**
276
298
  * Isotope distribution as JSON.
277
299
  *
@@ -390,6 +412,14 @@ export class MolHandle {
390
412
  * Returns `true` if the molecule has no PAINS structural alerts.
391
413
  */
392
414
  pains_passes(): boolean;
415
+ /**
416
+ * Most acidic pKa in the molecule, or NaN if no acidic site.
417
+ */
418
+ pka_acid_value(): number;
419
+ /**
420
+ * Most basic pKa in the molecule, or NaN if no basic site.
421
+ */
422
+ pka_base_value(): number;
393
423
  /**
394
424
  * Quantitative Estimate of Drug-likeness (QED); range [0, 1].
395
425
  */
@@ -448,6 +478,18 @@ export class MolHandle {
448
478
  */
449
479
  export function add_hydrogens(mol: MolHandle): MolHandle;
450
480
 
481
+ /**
482
+ * Compute a full ADMET property profile for a molecule.
483
+ *
484
+ * Returns a JSON object with fields:
485
+ * `bbb_score`, `bbb_passes`, `caco2`, `herg_risk`, `cyp3a4_risk`,
486
+ * `pka_acid` (null if absent), `pka_base` (null if absent),
487
+ * `esol`, `logd74`, `mw`, `logp`, `tpsa`, `hbd`, `hba`, `rotatable_bonds`
488
+ *
489
+ * Returns `{"error":"..."}` on parse failure.
490
+ */
491
+ export function admet_profile_json(smiles: string): string;
492
+
451
493
  /**
452
494
  * AtomPair fingerprint as a bit-packed byte vector (256 bytes = 2048 bits).
453
495
  */
@@ -472,6 +514,14 @@ export function autocorr_3d_json(mol: MolHandle): string;
472
514
  */
473
515
  export function balance_check_json(reaction_smiles: string): string;
474
516
 
517
+ /**
518
+ * Predict GI absorption and BBB penetration using the BOILED-Egg method
519
+ * (Daina & Zoete 2016).
520
+ *
521
+ * Returns JSON: `{"gi_absorbed":bool,"bbb_penetrant":bool,"logp":f64,"tpsa":f64}`
522
+ */
523
+ export function boiled_egg_json(smiles: string): string;
524
+
475
525
  /**
476
526
  * Number of BRICS fragments produced by fragmenting the molecule.
477
527
  *
@@ -566,21 +616,10 @@ export function compare_molecules_batch_json(smiles_batch: string, delimiter: st
566
616
  export function compare_molecules_json(smiles1: string, smiles2: string): string;
567
617
 
568
618
  /**
569
- * Compute direct Coulomb energy for a molecule with Gasteiger partial charges.
570
- *
571
- * Returns JSON object: `{ "coulomb_energy": E, "unit": "kcal/mol" }`
572
- *
573
- * # Arguments
574
- * * `mol` - Molecule to evaluate
575
- *
576
- * # Example (JavaScript)
577
- * ```js
578
- * const mol = parse_smiles("CCO");
579
- * const result = coulomb_energy_json(mol);
580
- * // { "coulomb_energy": -12.34, "unit": "kcal/mol" }
581
- * ```
619
+ * Generate multiple conformers with RMSD-based pruning.
620
+ * Returns JSON: `{"conformers": [[[x,y,z],...], ...], "count": int}`.
582
621
  */
583
- export function coulomb_energy_json(mol: MolHandle): string;
622
+ export function conformer_ensemble_json(mol: MolHandle, n: number, rmsd_threshold: number): string;
584
623
 
585
624
  /**
586
625
  * Return the CPK color (CSS hex string) for the given element symbol.
@@ -660,21 +699,6 @@ export function depict_svg_grid_highlighted(smiles_block: string, cols: number,
660
699
  */
661
700
  export function detect_functional_groups(mol: MolHandle): string;
662
701
 
663
- /**
664
- * Infer bond connectivity and bond orders from an XYZ-format string.
665
- *
666
- * Explicit hydrogen atoms must be present in the XYZ for reliable bond-order
667
- * assignment (without H, carbonyl C=O cannot be distinguished from C-O).
668
- *
669
- * Returns JSON on success: `{"smiles":"CCO","atom_count":3,"bond_count":2}`.
670
- * `atom_count` and `bond_count` refer to the heavy-atom skeleton (H removed).
671
- *
672
- * Returns JSON on error: `{"error":"molecule has 450 atoms; maximum is 300"}`.
673
- *
674
- * Safe: never freezes. All internal loops are O(n²). Capped at 300 atoms.
675
- */
676
- export function determine_bonds_from_xyz_json(xyz_str: string): string;
677
-
678
702
  /**
679
703
  * Dice similarity between `a` and `b` using ECFP4 fingerprints.
680
704
  */
@@ -805,6 +829,19 @@ export function find_reaction_center_json(reaction_smiles: string): string;
805
829
  */
806
830
  export function gasteiger_charges_json(mol: MolHandle): string;
807
831
 
832
+ /**
833
+ * Generate 3D coordinates as raw JSON array [[x,y,z], ...].
834
+ *
835
+ * Unlike `generate_3d_pdb`, this returns coordinates that can be passed
836
+ * to descriptor functions like `whim_descriptors_json` or `shape_descriptors_json`.
837
+ */
838
+ export function generate_3d_coords_json(mol: MolHandle): string;
839
+
840
+ /**
841
+ * Generate 3D coordinates using ETKDG as raw JSON array [[x,y,z], ...].
842
+ */
843
+ export function generate_3d_etkdg_coords_json(mol: MolHandle): string;
844
+
808
845
  /**
809
846
  * Generate 3D coordinates using ETKDG and minimize with DREIDING force field.
810
847
  */
@@ -941,10 +978,15 @@ export function get_descriptors_json(mol: MolHandle): string;
941
978
  export function get_dihedral_json(smiles: string, a: number, b: number, c: number, d: number): any;
942
979
 
943
980
  /**
944
- * Compute GETAWAY descriptors (GEometric, Topologic And wAveleT descriptors) from 3D coordinates.
945
- * Returns JSON array of 9 values: [G1, G2, G3, D1, D2, D3, T, V, A]
946
- * where G* = geometric autocorrelations (lag-1,2,3), D* = topologic distances,
947
- * T = total pairwise distance, V = bounding-box volume, A = anisotropy ratio.
981
+ * Compute GETAWAY descriptors (GEometry, Topology and Atom-Weights AssemblY) from 3D coords.
982
+ *
983
+ * Returns a JSON array of **19** values:
984
+ * - `[0..7]` H[1..8] — leverage autocorrelation at topological lags 1–8
985
+ * - `[8..15]` R[1..8] — H[k] normalised by pair count W_k
986
+ * - `[16]` Hmax, `[17]` Hmean, `[18]` Htot — per-atom leverage statistics
987
+ *
988
+ * Note: requires 3D coordinates (non-planar); for flat/2D structures the hat matrix
989
+ * is degenerate and descriptors reflect squared centroid distances, not true leverage.
948
990
  */
949
991
  export function getaway_descriptors_json(mol: MolHandle): string;
950
992
 
@@ -1036,6 +1078,16 @@ export function maxmin_picks_ecfp4_json(smiles_json: string, n: number): string;
1036
1078
  */
1037
1079
  export function mcs_smiles_json(smiles_json: string): string;
1038
1080
 
1081
+ /**
1082
+ * MCS with ring-awareness constraints.
1083
+ *
1084
+ * `smiles_json` — JSON array of at least 2 SMILES strings.
1085
+ * `ring_matches_ring_only` — ring atoms may only match ring atoms.
1086
+ * `complete_rings_only` — partial ring inclusion is removed from the result.
1087
+ * Returns the MCS SMILES, or `"null"` when no common substructure was found.
1088
+ */
1089
+ export function mcs_smiles_json_with_ring_config(smiles_json: string, ring_matches_ring_only: boolean, complete_rings_only: boolean): string;
1090
+
1039
1091
  /**
1040
1092
  * MinHash fingerprint (128 hashes) as JSON.
1041
1093
  *
@@ -1071,6 +1123,17 @@ export function minimize_mmff94_json(mol: MolHandle, max_iter: number): string;
1071
1123
  */
1072
1124
  export function minimize_mmff94_lbfgs_json(mol: MolHandle, max_iter: number): string;
1073
1125
 
1126
+ /**
1127
+ * Minimise a molecule's geometry using the Universal Force Field (UFF).
1128
+ *
1129
+ * `coords_json` — JSON array of `[x,y,z]` arrays (Å), one per atom.
1130
+ * `max_iter` — maximum iterations (0 = default 500).
1131
+ *
1132
+ * Returns JSON: `{"coords":[[x,y,z],...], "energy":float, "iterations":int, "converged":bool}`
1133
+ * or `{"error":"<msg>"}` on failure.
1134
+ */
1135
+ export function minimize_uff_json(smiles: string, coords_json: string, max_iter: number): string;
1136
+
1074
1137
  /**
1075
1138
  * MMFF94 partial charges (BCI table, ±0.1e accuracy) as a JSON array of f64.
1076
1139
  *
@@ -1357,6 +1420,15 @@ export function pharmacophore_fp_2d_summary(mol: MolHandle): string;
1357
1420
  */
1358
1421
  export function pharmacophore_fp_3d_summary(mol: MolHandle): string;
1359
1422
 
1423
+ /**
1424
+ * Predict pKa for all ionizable sites in a molecule.
1425
+ *
1426
+ * Returns a JSON array: `[{"atom_idx":8,"pka":4.0,"type":"acid","group":"carboxylic_acid"},...]`
1427
+ *
1428
+ * Returns `[]` if no ionizable sites are found, or `{"error":"..."}` on parse failure.
1429
+ */
1430
+ export function predict_pka_json(smiles: string): string;
1431
+
1360
1432
  /**
1361
1433
  * Generate `count` random SMILES from a SMILES string using the given seed.
1362
1434
  * Atoms are permuted based on xorshift64 RNG. Each variant should parse back
@@ -1409,15 +1481,6 @@ export function rgroup_decompose_json(smiles_json: string, core_smarts: string):
1409
1481
  */
1410
1482
  export function ring_families_json(mol: MolHandle): string;
1411
1483
 
1412
- /**
1413
- * Run molecular dynamics simulation and return trajectory as JSON.
1414
- *
1415
- * Returns JSON object with trajectory frames: `{ "frames": [{ "step": N, "potential": E, "kinetic": K, "temp": T }, …] }`
1416
- * Uses NVT ensemble (Berendsen thermostat) at 300 K by default.
1417
- * Note: Limited to molecules with ~50 atoms or fewer for practical WASM performance.
1418
- */
1419
- export function run_md_json(mol: MolHandle, steps: number, temp_k: number): string;
1420
-
1421
1484
  /**
1422
1485
  * Apply a SMIRKS reaction template and return product SMILES as a JSON string.
1423
1486
  *
@@ -1551,6 +1614,17 @@ export function smiles_array_to_sdf(smiles_json: string): string;
1551
1614
  */
1552
1615
  export function smiles_to_mol2(smiles: string): string;
1553
1616
 
1617
+ /**
1618
+ * Write a molecule to AutoDock PDBQT format.
1619
+ *
1620
+ * `coords_json` — JSON array of `[x,y,z]` arrays (Å). Pass `"[]"` for zero coords.
1621
+ * `charges_json` — JSON array of partial charges. Pass `"[]"` to write zeros.
1622
+ * `name` — ligand name for the REMARK header.
1623
+ *
1624
+ * Returns the PDBQT string, or `"error:<msg>"` on failure.
1625
+ */
1626
+ export function smiles_to_pdbqt(smiles: string, coords_json: string, charges_json: string, name: string): string;
1627
+
1554
1628
  /**
1555
1629
  * Render a highlighted SVG from a SMILES string in one call.
1556
1630
  *
@@ -1688,12 +1762,6 @@ export function to_xyz(mol: MolHandle): string;
1688
1762
  */
1689
1763
  export function torsion_bitvec(mol: MolHandle): Uint8Array;
1690
1764
 
1691
- /**
1692
- * Scan a torsion dihedral i-j-k-l from 0° to 360° in `steps` increments.
1693
- * Returns JSON array: [{"angle":0.0,"energy":E},...] or {"error":"..."}.
1694
- */
1695
- export function torsion_scan_json(mol: MolHandle, i: number, j: number, k: number, l: number, steps: number): string;
1696
-
1697
1765
  /**
1698
1766
  * Virtual screen a query SMILES against a database of SMILES using ECFP4 Tanimoto.
1699
1767
  *
@@ -1707,14 +1775,15 @@ export function virtual_screen_ecfp4_json(query_smi: string, db_smiles_json: str
1707
1775
 
1708
1776
  /**
1709
1777
  * Compute WHIM descriptors (Weighted Holistic Invariant Molecular) from 3D coordinates.
1710
- * Returns JSON array of 10 values: [L1, L2, L3, P1, P2, P3, ALPHA, BETA, GAMMA, DELTA]
1711
- * where L* = inertia tensor eigenvalues, P* = principal moments, ALPHA = sum of moments,
1712
- * BETA = average pairwise interaction, GAMMA = geometric mean, DELTA = anisotropy.
1778
+ * Returns JSON array of 22 values: 11 unit-weight descriptors followed by 11 mass-weight
1779
+ * descriptors. Each 11-element block is [λ₁, λ₂, λ₃, ν₁, ν₂, ν₃, T, A, V, K, D].
1713
1780
  */
1714
1781
  export function whim_descriptors_json(mol: MolHandle): string;
1715
1782
 
1716
1783
  /**
1717
- * Compute combined WHIM + GETAWAY descriptors (19 values total) as JSON array.
1784
+ * Compute combined WHIM + GETAWAY descriptors (**41** values total) as JSON array.
1785
+ *
1786
+ * Returns WHIM[0..21] (22 values) followed by GETAWAY[0..18] (19 values) = 41 total.
1718
1787
  * Useful for ML pipelines requiring both shape and topologic features.
1719
1788
  */
1720
1789
  export function whim_getaway_combined_json(mol: MolHandle): string;
@@ -1728,6 +1797,18 @@ export function whim_getaway_combined_json(mol: MolHandle): string;
1728
1797
  */
1729
1798
  export function write_smiles(mol: MolHandle): string;
1730
1799
 
1800
+ /**
1801
+ * XLogP3 partition coefficient (alternative to Crippen LogP).
1802
+ * Returns JSON: `{"xlogp3": float}`.
1803
+ */
1804
+ export function xlogp3_json(mol: MolHandle): string;
1805
+
1806
+ /**
1807
+ * Per-atom XLogP3 contributions.
1808
+ * Returns JSON array of floats (one per heavy atom).
1809
+ */
1810
+ export function xlogp3_per_atom_json(mol: MolHandle): string;
1811
+
1731
1812
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
1732
1813
 
1733
1814
  export interface InitOutput {
@@ -1737,10 +1818,12 @@ export interface InitOutput {
1737
1818
  readonly __wbg_mhfplshhandle_free: (a: number, b: number) => void;
1738
1819
  readonly __wbg_molhandle_free: (a: number, b: number) => void;
1739
1820
  readonly add_hydrogens: (a: number) => number;
1821
+ readonly admet_profile_json: (a: number, b: number) => [number, number];
1740
1822
  readonly atom_pair_bitvec: (a: number) => [number, number];
1741
1823
  readonly autocorr_2d_json: (a: number) => [number, number];
1742
1824
  readonly autocorr_3d_json: (a: number) => [number, number];
1743
1825
  readonly balance_check_json: (a: number, b: number) => [number, number];
1826
+ readonly boiled_egg_json: (a: number, b: number) => [number, number];
1744
1827
  readonly brics_fragment_count: (a: number) => number;
1745
1828
  readonly brics_fragments_json: (a: number) => [number, number];
1746
1829
  readonly butina_cluster_ecfp4_json: (a: number, b: number, c: number) => [number, number, number, number];
@@ -1748,6 +1831,9 @@ export interface InitOutput {
1748
1831
  readonly canonical_tautomer_with_blocked_atoms_json: (a: number, b: number, c: number) => [number, number];
1749
1832
  readonly cdxml_to_smiles_json: (a: number, b: number) => [number, number, number, number];
1750
1833
  readonly cip_assignments_json: (a: number) => [number, number];
1834
+ readonly compare_molecules_batch_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
1835
+ readonly compare_molecules_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
1836
+ readonly conformer_ensemble_json: (a: number, b: number, c: number) => [number, number];
1751
1837
  readonly conformerhandle_add_generated_conformer: (a: number) => number;
1752
1838
  readonly conformerhandle_add_minimized_conformer: (a: number) => number;
1753
1839
  readonly conformerhandle_cluster_conformers_json: (a: number, b: number) => [number, number];
@@ -1758,7 +1844,6 @@ export interface InitOutput {
1758
1844
  readonly conformerhandle_mol: (a: number) => number;
1759
1845
  readonly conformerhandle_new: (a: number, b: number) => [number, number, number];
1760
1846
  readonly conformerhandle_remove_conformer: (a: number, b: number) => number;
1761
- readonly coulomb_energy_json: (a: number) => [number, number];
1762
1847
  readonly cpk_color: (a: number, b: number) => [number, number];
1763
1848
  readonly depict_data_json: (a: number) => [number, number];
1764
1849
  readonly depict_data_with_coords_json: (a: number, b: number, c: number) => [number, number];
@@ -1779,7 +1864,6 @@ export interface InitOutput {
1779
1864
  readonly depictoptions_set_show_atom_indices: (a: number, b: number) => void;
1780
1865
  readonly depictoptions_set_width: (a: number, b: number) => void;
1781
1866
  readonly detect_functional_groups: (a: number) => [number, number];
1782
- readonly determine_bonds_from_xyz_json: (a: number, b: number) => [number, number];
1783
1867
  readonly dice_ecfp4: (a: number, b: number) => number;
1784
1868
  readonly dice_ecfp6: (a: number, b: number) => number;
1785
1869
  readonly dice_maccs: (a: number, b: number) => number;
@@ -1797,9 +1881,13 @@ export interface InitOutput {
1797
1881
  readonly fcfp6_bitvec: (a: number) => [number, number];
1798
1882
  readonly find_reaction_center_json: (a: number, b: number) => [number, number];
1799
1883
  readonly gasteiger_charges_json: (a: number) => [number, number];
1884
+ readonly generate_3d_coords_json: (a: number) => [number, number];
1885
+ readonly generate_3d_etkdg_coords_json: (a: number) => [number, number];
1800
1886
  readonly generate_3d_etkdg_minimized_pdb: (a: number) => [number, number];
1801
1887
  readonly generate_3d_etkdg_pdb: (a: number) => [number, number];
1888
+ readonly generate_3d_from_smiles: (a: number, b: number) => [number, number, number, number];
1802
1889
  readonly generate_3d_minimized_pdb: (a: number) => [number, number];
1890
+ readonly generate_3d_optimized_pdb: (a: number, b: number) => [number, number, number, number];
1803
1891
  readonly generate_3d_pdb: (a: number) => [number, number];
1804
1892
  readonly generic_murcko_scaffold: (a: number) => number;
1805
1893
  readonly get_atom_info: (a: number, b: number) => [number, number];
@@ -1821,6 +1909,7 @@ export interface InitOutput {
1821
1909
  readonly match_smarts_smiles: (a: number, b: number, c: number, d: number) => [number, number, number, number];
1822
1910
  readonly maxmin_picks_ecfp4_json: (a: number, b: number, c: number) => [number, number, number, number];
1823
1911
  readonly mcs_smiles_json: (a: number, b: number) => [number, number, number, number];
1912
+ readonly mcs_smiles_json_with_ring_config: (a: number, b: number, c: number, d: number) => [number, number, number, number];
1824
1913
  readonly mhfp_hashes_json: (a: number) => [number, number];
1825
1914
  readonly mhfplshhandle_add_smiles: (a: number, b: number, c: number) => [number, number, number];
1826
1915
  readonly mhfplshhandle_is_empty: (a: number) => number;
@@ -1830,6 +1919,7 @@ export interface InitOutput {
1830
1919
  readonly minimize_dreiding_json: (a: number) => [number, number];
1831
1920
  readonly minimize_mmff94_json: (a: number, b: number) => [number, number];
1832
1921
  readonly minimize_mmff94_lbfgs_json: (a: number, b: number) => [number, number];
1922
+ readonly minimize_uff_json: (a: number, b: number, c: number, d: number, e: number) => [number, number];
1833
1923
  readonly mmff94_charges_json: (a: number) => [number, number];
1834
1924
  readonly mmff94_charges_typed_json: (a: number) => [number, number];
1835
1925
  readonly mmff94_energy_breakdown_json: (a: number) => [number, number];
@@ -1851,10 +1941,15 @@ export interface InitOutput {
1851
1941
  readonly mol_with_atom_removed: (a: number, b: number) => [number, number, number];
1852
1942
  readonly mol_with_bond_added: (a: number, b: number, c: number, d: number) => [number, number, number];
1853
1943
  readonly mol_with_bond_removed: (a: number, b: number) => [number, number, number];
1944
+ readonly molecule_report_json: (a: number, b: number) => [number, number, number, number];
1854
1945
  readonly molhandle_aromatic_ring_count: (a: number) => number;
1855
1946
  readonly molhandle_assign_cip_json: (a: number) => [number, number];
1947
+ readonly molhandle_atom_count: (a: number) => number;
1948
+ readonly molhandle_bbb_passes: (a: number) => number;
1949
+ readonly molhandle_bbb_score: (a: number) => number;
1856
1950
  readonly molhandle_bertz_ct: (a: number) => number;
1857
1951
  readonly molhandle_bond_count: (a: number) => number;
1952
+ readonly molhandle_caco2_permeability: (a: number) => number;
1858
1953
  readonly molhandle_canonical_smiles: (a: number) => [number, number];
1859
1954
  readonly molhandle_chi0: (a: number) => number;
1860
1955
  readonly molhandle_chi0v: (a: number) => number;
@@ -1866,6 +1961,7 @@ export interface InitOutput {
1866
1961
  readonly molhandle_chi3v: (a: number) => number;
1867
1962
  readonly molhandle_chi4: (a: number) => number;
1868
1963
  readonly molhandle_chi4v: (a: number) => number;
1964
+ readonly molhandle_cyp3a4_inhibition_risk: (a: number) => number;
1869
1965
  readonly molhandle_depict_png: (a: number) => [number, number];
1870
1966
  readonly molhandle_depict_svg: (a: number) => [number, number];
1871
1967
  readonly molhandle_depict_svg_opts: (a: number, b: number) => [number, number];
@@ -1878,6 +1974,7 @@ export interface InitOutput {
1878
1974
  readonly molhandle_hba_count: (a: number) => number;
1879
1975
  readonly molhandle_hbd_count: (a: number) => number;
1880
1976
  readonly molhandle_heavy_atom_count: (a: number) => number;
1977
+ readonly molhandle_herg_risk_score: (a: number) => number;
1881
1978
  readonly molhandle_isotope_distribution_json: (a: number, b: number) => [number, number];
1882
1979
  readonly molhandle_iupac_name: (a: number) => [number, number];
1883
1980
  readonly molhandle_kappa1: (a: number) => number;
@@ -1904,6 +2001,8 @@ export interface InitOutput {
1904
2001
  readonly molhandle_num_stereocenters: (a: number) => number;
1905
2002
  readonly molhandle_num_unspecified_stereocenters: (a: number) => number;
1906
2003
  readonly molhandle_pains_passes: (a: number) => number;
2004
+ readonly molhandle_pka_acid_value: (a: number) => number;
2005
+ readonly molhandle_pka_base_value: (a: number) => number;
1907
2006
  readonly molhandle_qed: (a: number) => number;
1908
2007
  readonly molhandle_randic_index: (a: number) => number;
1909
2008
  readonly molhandle_reos_passes: (a: number) => number;
@@ -1931,13 +2030,14 @@ export interface InitOutput {
1931
2030
  readonly pharmacophore_features_json: (a: number) => [number, number];
1932
2031
  readonly pharmacophore_fp_2d_summary: (a: number) => [number, number];
1933
2032
  readonly pharmacophore_fp_3d_summary: (a: number) => [number, number];
2033
+ readonly predict_pka_json: (a: number, b: number) => [number, number];
1934
2034
  readonly random_smiles_json: (a: number, b: number, c: number, d: bigint) => [number, number, number, number];
1935
2035
  readonly remove_hydrogens: (a: number) => number;
1936
2036
  readonly rgroup_decompose_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
1937
2037
  readonly ring_families_json: (a: number) => [number, number, number, number];
1938
- readonly run_md_json: (a: number, b: number, c: number) => [number, number];
1939
2038
  readonly run_reactants: (a: number, b: number, c: number, d: number) => [number, number, number, number];
1940
2039
  readonly sa_score: (a: number) => number;
2040
+ readonly screen_smiles_json: (a: number, b: number, c: number, d: number) => [number, number];
1941
2041
  readonly sdf_from_records_json: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
1942
2042
  readonly sdf_to_records_json: (a: number, b: number) => [number, number];
1943
2043
  readonly sdf_to_smiles_json: (a: number, b: number) => [number, number];
@@ -1948,11 +2048,13 @@ export interface InitOutput {
1948
2048
  readonly smarts_match_atoms_with_chirality: (a: number, b: number, c: number, d: number) => [number, number, number, number];
1949
2049
  readonly smiles_array_to_sdf: (a: number, b: number) => [number, number, number, number];
1950
2050
  readonly smiles_to_mol2: (a: number, b: number) => [number, number];
2051
+ readonly smiles_to_pdbqt: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number];
1951
2052
  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];
1952
2053
  readonly smr_vsa_json: (a: number) => [number, number];
1953
2054
  readonly sssr_rings_json: (a: number) => [number, number];
1954
2055
  readonly standardize_smiles: (a: number, b: number) => [number, number];
1955
2056
  readonly standardize_smiles_report_json: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
2057
+ readonly start: () => void;
1956
2058
  readonly tanimoto_atom_pair: (a: number, b: number) => number;
1957
2059
  readonly tanimoto_ecfp4: (a: number, b: number) => number;
1958
2060
  readonly tanimoto_ecfp6: (a: number, b: number) => number;
@@ -1969,25 +2071,16 @@ export interface InitOutput {
1969
2071
  readonly to_mol_v3000_block: (a: number) => [number, number];
1970
2072
  readonly to_xyz: (a: number) => [number, number];
1971
2073
  readonly torsion_bitvec: (a: number) => [number, number];
1972
- readonly torsion_scan_json: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
1973
2074
  readonly virtual_screen_ecfp4_json: (a: number, b: number, c: number, d: number, e: number) => [number, number];
1974
2075
  readonly whim_descriptors_json: (a: number) => [number, number];
1975
2076
  readonly whim_getaway_combined_json: (a: number) => [number, number];
1976
2077
  readonly write_smiles: (a: number) => [number, number];
1977
- readonly start: () => void;
1978
- readonly molhandle_atom_count: (a: number) => number;
1979
- readonly compare_molecules_batch_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
1980
- readonly compare_molecules_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
1981
- readonly generate_3d_from_smiles: (a: number, b: number) => [number, number, number, number];
1982
- readonly generate_3d_optimized_pdb: (a: number, b: number) => [number, number, number, number];
1983
- readonly molecule_report_json: (a: number, b: number) => [number, number, number, number];
1984
- readonly screen_smiles_json: (a: number, b: number, c: number, d: number) => [number, number];
2078
+ readonly xlogp3_json: (a: number) => [number, number];
2079
+ readonly xlogp3_per_atom_json: (a: number) => [number, number];
1985
2080
  readonly __wbindgen_malloc: (a: number, b: number) => number;
1986
2081
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
1987
- readonly __wbindgen_free: (a: number, b: number, c: number) => void;
1988
- readonly __wbindgen_exn_store: (a: number) => void;
1989
- readonly __externref_table_alloc: () => number;
1990
2082
  readonly __wbindgen_externrefs: WebAssembly.Table;
2083
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
1991
2084
  readonly __externref_table_dealloc: (a: number) => void;
1992
2085
  readonly __wbindgen_start: () => void;
1993
2086
  }
package/chematic_wasm.js CHANGED
@@ -415,6 +415,23 @@ export class MolHandle {
415
415
  const ret = wasm.molhandle_atom_count(this.__wbg_ptr);
416
416
  return ret >>> 0;
417
417
  }
418
+ /**
419
+ * Returns true when TPSA < 90 Ų, MW < 400, HBD ≤ 3.
420
+ * @returns {boolean}
421
+ */
422
+ bbb_passes() {
423
+ const ret = wasm.molhandle_bbb_passes(this.__wbg_ptr);
424
+ return ret !== 0;
425
+ }
426
+ /**
427
+ * Clark (2000) blood-brain barrier logBB score.
428
+ * logBB > −1.0 = likely CNS penetrant.
429
+ * @returns {number}
430
+ */
431
+ bbb_score() {
432
+ const ret = wasm.molhandle_bbb_score(this.__wbg_ptr);
433
+ return ret;
434
+ }
418
435
  /**
419
436
  * Bertz complexity index (BertzCT).
420
437
  * @returns {number}
@@ -431,6 +448,15 @@ export class MolHandle {
431
448
  const ret = wasm.molhandle_bond_count(this.__wbg_ptr);
432
449
  return ret >>> 0;
433
450
  }
451
+ /**
452
+ * Palm (1997) Caco-2 intestinal permeability (logPCaco2).
453
+ * > −5.5 = high permeability.
454
+ * @returns {number}
455
+ */
456
+ caco2_permeability() {
457
+ const ret = wasm.molhandle_caco2_permeability(this.__wbg_ptr);
458
+ return ret;
459
+ }
434
460
  /**
435
461
  * Canonical SMILES string.
436
462
  * @returns {string}
@@ -528,8 +554,16 @@ export class MolHandle {
528
554
  return ret;
529
555
  }
530
556
  /**
531
- * 2D PNG depiction (rasterized from SVG).
532
- * Returns PNG data as base64-encoded string for embedding in HTML/JS.
557
+ * CYP3A4 metabolic inhibition risk score (0.0–1.0).
558
+ * @returns {number}
559
+ */
560
+ cyp3a4_inhibition_risk() {
561
+ const ret = wasm.molhandle_cyp3a4_inhibition_risk(this.__wbg_ptr);
562
+ return ret;
563
+ }
564
+ /**
565
+ * 2D PNG depiction — not available in the WASM build (PNG stack disabled to reduce bundle size).
566
+ * Use `depict_svg()` in browser contexts; rasterize client-side if needed.
533
567
  * @returns {Uint8Array}
534
568
  */
535
569
  depict_png() {
@@ -654,6 +688,14 @@ export class MolHandle {
654
688
  const ret = wasm.molhandle_heavy_atom_count(this.__wbg_ptr);
655
689
  return ret >>> 0;
656
690
  }
691
+ /**
692
+ * hERG cardiac toxicity risk score (0.0–1.0).
693
+ * @returns {number}
694
+ */
695
+ herg_risk_score() {
696
+ const ret = wasm.molhandle_herg_risk_score(this.__wbg_ptr);
697
+ return ret;
698
+ }
657
699
  /**
658
700
  * Isotope distribution as JSON.
659
701
  *
@@ -914,6 +956,22 @@ export class MolHandle {
914
956
  const ret = wasm.molhandle_pains_passes(this.__wbg_ptr);
915
957
  return ret !== 0;
916
958
  }
959
+ /**
960
+ * Most acidic pKa in the molecule, or NaN if no acidic site.
961
+ * @returns {number}
962
+ */
963
+ pka_acid_value() {
964
+ const ret = wasm.molhandle_pka_acid_value(this.__wbg_ptr);
965
+ return ret;
966
+ }
967
+ /**
968
+ * Most basic pKa in the molecule, or NaN if no basic site.
969
+ * @returns {number}
970
+ */
971
+ pka_base_value() {
972
+ const ret = wasm.molhandle_pka_base_value(this.__wbg_ptr);
973
+ return ret;
974
+ }
917
975
  /**
918
976
  * Quantitative Estimate of Drug-likeness (QED); range [0, 1].
919
977
  * @returns {number}
@@ -1043,6 +1101,33 @@ export function add_hydrogens(mol) {
1043
1101
  return MolHandle.__wrap(ret);
1044
1102
  }
1045
1103
 
1104
+ /**
1105
+ * Compute a full ADMET property profile for a molecule.
1106
+ *
1107
+ * Returns a JSON object with fields:
1108
+ * `bbb_score`, `bbb_passes`, `caco2`, `herg_risk`, `cyp3a4_risk`,
1109
+ * `pka_acid` (null if absent), `pka_base` (null if absent),
1110
+ * `esol`, `logd74`, `mw`, `logp`, `tpsa`, `hbd`, `hba`, `rotatable_bonds`
1111
+ *
1112
+ * Returns `{"error":"..."}` on parse failure.
1113
+ * @param {string} smiles
1114
+ * @returns {string}
1115
+ */
1116
+ export function admet_profile_json(smiles) {
1117
+ let deferred2_0;
1118
+ let deferred2_1;
1119
+ try {
1120
+ const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1121
+ const len0 = WASM_VECTOR_LEN;
1122
+ const ret = wasm.admet_profile_json(ptr0, len0);
1123
+ deferred2_0 = ret[0];
1124
+ deferred2_1 = ret[1];
1125
+ return getStringFromWasm0(ret[0], ret[1]);
1126
+ } finally {
1127
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1128
+ }
1129
+ }
1130
+
1046
1131
  /**
1047
1132
  * AtomPair fingerprint as a bit-packed byte vector (256 bytes = 2048 bits).
1048
1133
  * @param {MolHandle} mol
@@ -1118,6 +1203,29 @@ export function balance_check_json(reaction_smiles) {
1118
1203
  }
1119
1204
  }
1120
1205
 
1206
+ /**
1207
+ * Predict GI absorption and BBB penetration using the BOILED-Egg method
1208
+ * (Daina & Zoete 2016).
1209
+ *
1210
+ * Returns JSON: `{"gi_absorbed":bool,"bbb_penetrant":bool,"logp":f64,"tpsa":f64}`
1211
+ * @param {string} smiles
1212
+ * @returns {string}
1213
+ */
1214
+ export function boiled_egg_json(smiles) {
1215
+ let deferred2_0;
1216
+ let deferred2_1;
1217
+ try {
1218
+ const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1219
+ const len0 = WASM_VECTOR_LEN;
1220
+ const ret = wasm.boiled_egg_json(ptr0, len0);
1221
+ deferred2_0 = ret[0];
1222
+ deferred2_1 = ret[1];
1223
+ return getStringFromWasm0(ret[0], ret[1]);
1224
+ } finally {
1225
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1226
+ }
1227
+ }
1228
+
1121
1229
  /**
1122
1230
  * Number of BRICS fragments produced by fragmenting the molecule.
1123
1231
  *
@@ -1360,28 +1468,19 @@ export function compare_molecules_json(smiles1, smiles2) {
1360
1468
  }
1361
1469
 
1362
1470
  /**
1363
- * Compute direct Coulomb energy for a molecule with Gasteiger partial charges.
1364
- *
1365
- * Returns JSON object: `{ "coulomb_energy": E, "unit": "kcal/mol" }`
1366
- *
1367
- * # Arguments
1368
- * * `mol` - Molecule to evaluate
1369
- *
1370
- * # Example (JavaScript)
1371
- * ```js
1372
- * const mol = parse_smiles("CCO");
1373
- * const result = coulomb_energy_json(mol);
1374
- * // { "coulomb_energy": -12.34, "unit": "kcal/mol" }
1375
- * ```
1471
+ * Generate multiple conformers with RMSD-based pruning.
1472
+ * Returns JSON: `{"conformers": [[[x,y,z],...], ...], "count": int}`.
1376
1473
  * @param {MolHandle} mol
1474
+ * @param {number} n
1475
+ * @param {number} rmsd_threshold
1377
1476
  * @returns {string}
1378
1477
  */
1379
- export function coulomb_energy_json(mol) {
1478
+ export function conformer_ensemble_json(mol, n, rmsd_threshold) {
1380
1479
  let deferred1_0;
1381
1480
  let deferred1_1;
1382
1481
  try {
1383
1482
  _assertClass(mol, MolHandle);
1384
- const ret = wasm.coulomb_energy_json(mol.__wbg_ptr);
1483
+ const ret = wasm.conformer_ensemble_json(mol.__wbg_ptr, n, rmsd_threshold);
1385
1484
  deferred1_0 = ret[0];
1386
1485
  deferred1_1 = ret[1];
1387
1486
  return getStringFromWasm0(ret[0], ret[1]);
@@ -1584,36 +1683,6 @@ export function detect_functional_groups(mol) {
1584
1683
  }
1585
1684
  }
1586
1685
 
1587
- /**
1588
- * Infer bond connectivity and bond orders from an XYZ-format string.
1589
- *
1590
- * Explicit hydrogen atoms must be present in the XYZ for reliable bond-order
1591
- * assignment (without H, carbonyl C=O cannot be distinguished from C-O).
1592
- *
1593
- * Returns JSON on success: `{"smiles":"CCO","atom_count":3,"bond_count":2}`.
1594
- * `atom_count` and `bond_count` refer to the heavy-atom skeleton (H removed).
1595
- *
1596
- * Returns JSON on error: `{"error":"molecule has 450 atoms; maximum is 300"}`.
1597
- *
1598
- * Safe: never freezes. All internal loops are O(n²). Capped at 300 atoms.
1599
- * @param {string} xyz_str
1600
- * @returns {string}
1601
- */
1602
- export function determine_bonds_from_xyz_json(xyz_str) {
1603
- let deferred2_0;
1604
- let deferred2_1;
1605
- try {
1606
- const ptr0 = passStringToWasm0(xyz_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1607
- const len0 = WASM_VECTOR_LEN;
1608
- const ret = wasm.determine_bonds_from_xyz_json(ptr0, len0);
1609
- deferred2_0 = ret[0];
1610
- deferred2_1 = ret[1];
1611
- return getStringFromWasm0(ret[0], ret[1]);
1612
- } finally {
1613
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1614
- }
1615
- }
1616
-
1617
1686
  /**
1618
1687
  * Dice similarity between `a` and `b` using ECFP4 fingerprints.
1619
1688
  * @param {MolHandle} a
@@ -1947,6 +2016,47 @@ export function gasteiger_charges_json(mol) {
1947
2016
  }
1948
2017
  }
1949
2018
 
2019
+ /**
2020
+ * Generate 3D coordinates as raw JSON array [[x,y,z], ...].
2021
+ *
2022
+ * Unlike `generate_3d_pdb`, this returns coordinates that can be passed
2023
+ * to descriptor functions like `whim_descriptors_json` or `shape_descriptors_json`.
2024
+ * @param {MolHandle} mol
2025
+ * @returns {string}
2026
+ */
2027
+ export function generate_3d_coords_json(mol) {
2028
+ let deferred1_0;
2029
+ let deferred1_1;
2030
+ try {
2031
+ _assertClass(mol, MolHandle);
2032
+ const ret = wasm.generate_3d_coords_json(mol.__wbg_ptr);
2033
+ deferred1_0 = ret[0];
2034
+ deferred1_1 = ret[1];
2035
+ return getStringFromWasm0(ret[0], ret[1]);
2036
+ } finally {
2037
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2038
+ }
2039
+ }
2040
+
2041
+ /**
2042
+ * Generate 3D coordinates using ETKDG as raw JSON array [[x,y,z], ...].
2043
+ * @param {MolHandle} mol
2044
+ * @returns {string}
2045
+ */
2046
+ export function generate_3d_etkdg_coords_json(mol) {
2047
+ let deferred1_0;
2048
+ let deferred1_1;
2049
+ try {
2050
+ _assertClass(mol, MolHandle);
2051
+ const ret = wasm.generate_3d_etkdg_coords_json(mol.__wbg_ptr);
2052
+ deferred1_0 = ret[0];
2053
+ deferred1_1 = ret[1];
2054
+ return getStringFromWasm0(ret[0], ret[1]);
2055
+ } finally {
2056
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2057
+ }
2058
+ }
2059
+
1950
2060
  /**
1951
2061
  * Generate 3D coordinates using ETKDG and minimize with DREIDING force field.
1952
2062
  * @param {MolHandle} mol
@@ -2267,10 +2377,15 @@ export function get_dihedral_json(smiles, a, b, c, d) {
2267
2377
  }
2268
2378
 
2269
2379
  /**
2270
- * Compute GETAWAY descriptors (GEometric, Topologic And wAveleT descriptors) from 3D coordinates.
2271
- * Returns JSON array of 9 values: [G1, G2, G3, D1, D2, D3, T, V, A]
2272
- * where G* = geometric autocorrelations (lag-1,2,3), D* = topologic distances,
2273
- * T = total pairwise distance, V = bounding-box volume, A = anisotropy ratio.
2380
+ * Compute GETAWAY descriptors (GEometry, Topology and Atom-Weights AssemblY) from 3D coords.
2381
+ *
2382
+ * Returns a JSON array of **19** values:
2383
+ * - `[0..7]` H[1..8] — leverage autocorrelation at topological lags 1–8
2384
+ * - `[8..15]` R[1..8] — H[k] normalised by pair count W_k
2385
+ * - `[16]` Hmax, `[17]` Hmean, `[18]` Htot — per-atom leverage statistics
2386
+ *
2387
+ * Note: requires 3D coordinates (non-planar); for flat/2D structures the hat matrix
2388
+ * is degenerate and descriptors reflect squared centroid distances, not true leverage.
2274
2389
  * @param {MolHandle} mol
2275
2390
  * @returns {string}
2276
2391
  */
@@ -2546,6 +2661,39 @@ export function mcs_smiles_json(smiles_json) {
2546
2661
  }
2547
2662
  }
2548
2663
 
2664
+ /**
2665
+ * MCS with ring-awareness constraints.
2666
+ *
2667
+ * `smiles_json` — JSON array of at least 2 SMILES strings.
2668
+ * `ring_matches_ring_only` — ring atoms may only match ring atoms.
2669
+ * `complete_rings_only` — partial ring inclusion is removed from the result.
2670
+ * Returns the MCS SMILES, or `"null"` when no common substructure was found.
2671
+ * @param {string} smiles_json
2672
+ * @param {boolean} ring_matches_ring_only
2673
+ * @param {boolean} complete_rings_only
2674
+ * @returns {string}
2675
+ */
2676
+ export function mcs_smiles_json_with_ring_config(smiles_json, ring_matches_ring_only, complete_rings_only) {
2677
+ let deferred3_0;
2678
+ let deferred3_1;
2679
+ try {
2680
+ const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2681
+ const len0 = WASM_VECTOR_LEN;
2682
+ const ret = wasm.mcs_smiles_json_with_ring_config(ptr0, len0, ring_matches_ring_only, complete_rings_only);
2683
+ var ptr2 = ret[0];
2684
+ var len2 = ret[1];
2685
+ if (ret[3]) {
2686
+ ptr2 = 0; len2 = 0;
2687
+ throw takeFromExternrefTable0(ret[2]);
2688
+ }
2689
+ deferred3_0 = ptr2;
2690
+ deferred3_1 = len2;
2691
+ return getStringFromWasm0(ptr2, len2);
2692
+ } finally {
2693
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
2694
+ }
2695
+ }
2696
+
2549
2697
  /**
2550
2698
  * MinHash fingerprint (128 hashes) as JSON.
2551
2699
  *
@@ -2639,6 +2787,36 @@ export function minimize_mmff94_lbfgs_json(mol, max_iter) {
2639
2787
  }
2640
2788
  }
2641
2789
 
2790
+ /**
2791
+ * Minimise a molecule's geometry using the Universal Force Field (UFF).
2792
+ *
2793
+ * `coords_json` — JSON array of `[x,y,z]` arrays (Å), one per atom.
2794
+ * `max_iter` — maximum iterations (0 = default 500).
2795
+ *
2796
+ * Returns JSON: `{"coords":[[x,y,z],...], "energy":float, "iterations":int, "converged":bool}`
2797
+ * or `{"error":"<msg>"}` on failure.
2798
+ * @param {string} smiles
2799
+ * @param {string} coords_json
2800
+ * @param {number} max_iter
2801
+ * @returns {string}
2802
+ */
2803
+ export function minimize_uff_json(smiles, coords_json, max_iter) {
2804
+ let deferred3_0;
2805
+ let deferred3_1;
2806
+ try {
2807
+ const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2808
+ const len0 = WASM_VECTOR_LEN;
2809
+ const ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2810
+ const len1 = WASM_VECTOR_LEN;
2811
+ const ret = wasm.minimize_uff_json(ptr0, len0, ptr1, len1, max_iter);
2812
+ deferred3_0 = ret[0];
2813
+ deferred3_1 = ret[1];
2814
+ return getStringFromWasm0(ret[0], ret[1]);
2815
+ } finally {
2816
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
2817
+ }
2818
+ }
2819
+
2642
2820
  /**
2643
2821
  * MMFF94 partial charges (BCI table, ±0.1e accuracy) as a JSON array of f64.
2644
2822
  *
@@ -3434,6 +3612,30 @@ export function pharmacophore_fp_3d_summary(mol) {
3434
3612
  }
3435
3613
  }
3436
3614
 
3615
+ /**
3616
+ * Predict pKa for all ionizable sites in a molecule.
3617
+ *
3618
+ * Returns a JSON array: `[{"atom_idx":8,"pka":4.0,"type":"acid","group":"carboxylic_acid"},...]`
3619
+ *
3620
+ * Returns `[]` if no ionizable sites are found, or `{"error":"..."}` on parse failure.
3621
+ * @param {string} smiles
3622
+ * @returns {string}
3623
+ */
3624
+ export function predict_pka_json(smiles) {
3625
+ let deferred2_0;
3626
+ let deferred2_1;
3627
+ try {
3628
+ const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3629
+ const len0 = WASM_VECTOR_LEN;
3630
+ const ret = wasm.predict_pka_json(ptr0, len0);
3631
+ deferred2_0 = ret[0];
3632
+ deferred2_1 = ret[1];
3633
+ return getStringFromWasm0(ret[0], ret[1]);
3634
+ } finally {
3635
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
3636
+ }
3637
+ }
3638
+
3437
3639
  /**
3438
3640
  * Generate `count` random SMILES from a SMILES string using the given seed.
3439
3641
  * Atoms are permuted based on xorshift64 RNG. Each variant should parse back
@@ -3559,31 +3761,6 @@ export function ring_families_json(mol) {
3559
3761
  }
3560
3762
  }
3561
3763
 
3562
- /**
3563
- * Run molecular dynamics simulation and return trajectory as JSON.
3564
- *
3565
- * Returns JSON object with trajectory frames: `{ "frames": [{ "step": N, "potential": E, "kinetic": K, "temp": T }, …] }`
3566
- * Uses NVT ensemble (Berendsen thermostat) at 300 K by default.
3567
- * Note: Limited to molecules with ~50 atoms or fewer for practical WASM performance.
3568
- * @param {MolHandle} mol
3569
- * @param {number} steps
3570
- * @param {number} temp_k
3571
- * @returns {string}
3572
- */
3573
- export function run_md_json(mol, steps, temp_k) {
3574
- let deferred1_0;
3575
- let deferred1_1;
3576
- try {
3577
- _assertClass(mol, MolHandle);
3578
- const ret = wasm.run_md_json(mol.__wbg_ptr, steps, temp_k);
3579
- deferred1_0 = ret[0];
3580
- deferred1_1 = ret[1];
3581
- return getStringFromWasm0(ret[0], ret[1]);
3582
- } finally {
3583
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
3584
- }
3585
- }
3586
-
3587
3764
  /**
3588
3765
  * Apply a SMIRKS reaction template and return product SMILES as a JSON string.
3589
3766
  *
@@ -3959,6 +4136,41 @@ export function smiles_to_mol2(smiles) {
3959
4136
  }
3960
4137
  }
3961
4138
 
4139
+ /**
4140
+ * Write a molecule to AutoDock PDBQT format.
4141
+ *
4142
+ * `coords_json` — JSON array of `[x,y,z]` arrays (Å). Pass `"[]"` for zero coords.
4143
+ * `charges_json` — JSON array of partial charges. Pass `"[]"` to write zeros.
4144
+ * `name` — ligand name for the REMARK header.
4145
+ *
4146
+ * Returns the PDBQT string, or `"error:<msg>"` on failure.
4147
+ * @param {string} smiles
4148
+ * @param {string} coords_json
4149
+ * @param {string} charges_json
4150
+ * @param {string} name
4151
+ * @returns {string}
4152
+ */
4153
+ export function smiles_to_pdbqt(smiles, coords_json, charges_json, name) {
4154
+ let deferred5_0;
4155
+ let deferred5_1;
4156
+ try {
4157
+ const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4158
+ const len0 = WASM_VECTOR_LEN;
4159
+ const ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4160
+ const len1 = WASM_VECTOR_LEN;
4161
+ const ptr2 = passStringToWasm0(charges_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4162
+ const len2 = WASM_VECTOR_LEN;
4163
+ const ptr3 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4164
+ const len3 = WASM_VECTOR_LEN;
4165
+ const ret = wasm.smiles_to_pdbqt(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
4166
+ deferred5_0 = ret[0];
4167
+ deferred5_1 = ret[1];
4168
+ return getStringFromWasm0(ret[0], ret[1]);
4169
+ } finally {
4170
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
4171
+ }
4172
+ }
4173
+
3962
4174
  /**
3963
4175
  * Render a highlighted SVG from a SMILES string in one call.
3964
4176
  *
@@ -4362,31 +4574,6 @@ export function torsion_bitvec(mol) {
4362
4574
  return v1;
4363
4575
  }
4364
4576
 
4365
- /**
4366
- * Scan a torsion dihedral i-j-k-l from 0° to 360° in `steps` increments.
4367
- * Returns JSON array: [{"angle":0.0,"energy":E},...] or {"error":"..."}.
4368
- * @param {MolHandle} mol
4369
- * @param {number} i
4370
- * @param {number} j
4371
- * @param {number} k
4372
- * @param {number} l
4373
- * @param {number} steps
4374
- * @returns {string}
4375
- */
4376
- export function torsion_scan_json(mol, i, j, k, l, steps) {
4377
- let deferred1_0;
4378
- let deferred1_1;
4379
- try {
4380
- _assertClass(mol, MolHandle);
4381
- const ret = wasm.torsion_scan_json(mol.__wbg_ptr, i, j, k, l, steps);
4382
- deferred1_0 = ret[0];
4383
- deferred1_1 = ret[1];
4384
- return getStringFromWasm0(ret[0], ret[1]);
4385
- } finally {
4386
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
4387
- }
4388
- }
4389
-
4390
4577
  /**
4391
4578
  * Virtual screen a query SMILES against a database of SMILES using ECFP4 Tanimoto.
4392
4579
  *
@@ -4419,9 +4606,8 @@ export function virtual_screen_ecfp4_json(query_smi, db_smiles_json, k) {
4419
4606
 
4420
4607
  /**
4421
4608
  * Compute WHIM descriptors (Weighted Holistic Invariant Molecular) from 3D coordinates.
4422
- * Returns JSON array of 10 values: [L1, L2, L3, P1, P2, P3, ALPHA, BETA, GAMMA, DELTA]
4423
- * where L* = inertia tensor eigenvalues, P* = principal moments, ALPHA = sum of moments,
4424
- * BETA = average pairwise interaction, GAMMA = geometric mean, DELTA = anisotropy.
4609
+ * Returns JSON array of 22 values: 11 unit-weight descriptors followed by 11 mass-weight
4610
+ * descriptors. Each 11-element block is [λ₁, λ₂, λ₃, ν₁, ν₂, ν₃, T, A, V, K, D].
4425
4611
  * @param {MolHandle} mol
4426
4612
  * @returns {string}
4427
4613
  */
@@ -4440,7 +4626,9 @@ export function whim_descriptors_json(mol) {
4440
4626
  }
4441
4627
 
4442
4628
  /**
4443
- * Compute combined WHIM + GETAWAY descriptors (19 values total) as JSON array.
4629
+ * Compute combined WHIM + GETAWAY descriptors (**41** values total) as JSON array.
4630
+ *
4631
+ * Returns WHIM[0..21] (22 values) followed by GETAWAY[0..18] (19 values) = 41 total.
4444
4632
  * Useful for ML pipelines requiring both shape and topologic features.
4445
4633
  * @param {MolHandle} mol
4446
4634
  * @returns {string}
@@ -4481,10 +4669,50 @@ export function write_smiles(mol) {
4481
4669
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
4482
4670
  }
4483
4671
  }
4672
+
4673
+ /**
4674
+ * XLogP3 partition coefficient (alternative to Crippen LogP).
4675
+ * Returns JSON: `{"xlogp3": float}`.
4676
+ * @param {MolHandle} mol
4677
+ * @returns {string}
4678
+ */
4679
+ export function xlogp3_json(mol) {
4680
+ let deferred1_0;
4681
+ let deferred1_1;
4682
+ try {
4683
+ _assertClass(mol, MolHandle);
4684
+ const ret = wasm.xlogp3_json(mol.__wbg_ptr);
4685
+ deferred1_0 = ret[0];
4686
+ deferred1_1 = ret[1];
4687
+ return getStringFromWasm0(ret[0], ret[1]);
4688
+ } finally {
4689
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
4690
+ }
4691
+ }
4692
+
4693
+ /**
4694
+ * Per-atom XLogP3 contributions.
4695
+ * Returns JSON array of floats (one per heavy atom).
4696
+ * @param {MolHandle} mol
4697
+ * @returns {string}
4698
+ */
4699
+ export function xlogp3_per_atom_json(mol) {
4700
+ let deferred1_0;
4701
+ let deferred1_1;
4702
+ try {
4703
+ _assertClass(mol, MolHandle);
4704
+ const ret = wasm.xlogp3_per_atom_json(mol.__wbg_ptr);
4705
+ deferred1_0 = ret[0];
4706
+ deferred1_1 = ret[1];
4707
+ return getStringFromWasm0(ret[0], ret[1]);
4708
+ } finally {
4709
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
4710
+ }
4711
+ }
4484
4712
  function __wbg_get_imports() {
4485
4713
  const import0 = {
4486
4714
  __proto__: null,
4487
- __wbg___wbindgen_string_get_72bdf95d3ae505b1: function(arg0, arg1) {
4715
+ __wbg___wbindgen_string_get_71bb4348194e31f0: function(arg0, arg1) {
4488
4716
  const obj = arg1;
4489
4717
  const ret = typeof(obj) === 'string' ? obj : undefined;
4490
4718
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -4492,33 +4720,11 @@ function __wbg_get_imports() {
4492
4720
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
4493
4721
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
4494
4722
  },
4495
- __wbg___wbindgen_throw_1506f2235d1bdba0: function(arg0, arg1) {
4723
+ __wbg___wbindgen_throw_ea4887a5f8f9a9db: function(arg0, arg1) {
4496
4724
  throw new Error(getStringFromWasm0(arg0, arg1));
4497
4725
  },
4498
- __wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
4499
- let deferred0_0;
4500
- let deferred0_1;
4501
- try {
4502
- deferred0_0 = arg0;
4503
- deferred0_1 = arg1;
4504
- console.error(getStringFromWasm0(arg0, arg1));
4505
- } finally {
4506
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
4507
- }
4508
- },
4509
- __wbg_getRandomValues_3f44b700395062e5: function() { return handleError(function (arg0, arg1) {
4510
- globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
4511
- }, arguments); },
4512
- __wbg_new_227d7c05414eb861: function() {
4513
- const ret = new Error();
4514
- return ret;
4515
- },
4516
- __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
4517
- const ret = arg1.stack;
4518
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4519
- const len1 = WASM_VECTOR_LEN;
4520
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
4521
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
4726
+ __wbg_error_933f449d72fef598: function(arg0) {
4727
+ console.error(arg0);
4522
4728
  },
4523
4729
  __wbindgen_cast_0000000000000001: function(arg0) {
4524
4730
  // Cast intrinsic for `F64 -> Externref`.
@@ -4559,12 +4765,6 @@ const MolHandleFinalization = (typeof FinalizationRegistry === 'undefined')
4559
4765
  ? { register: () => {}, unregister: () => {} }
4560
4766
  : new FinalizationRegistry(ptr => wasm.__wbg_molhandle_free(ptr, 1));
4561
4767
 
4562
- function addToExternrefTable0(obj) {
4563
- const idx = wasm.__externref_table_alloc();
4564
- wasm.__wbindgen_externrefs.set(idx, obj);
4565
- return idx;
4566
- }
4567
-
4568
4768
  function _assertClass(instance, klass) {
4569
4769
  if (!(instance instanceof klass)) {
4570
4770
  throw new Error(`expected instance of ${klass.name}`);
@@ -4604,15 +4804,6 @@ function getUint8ArrayMemory0() {
4604
4804
  return cachedUint8ArrayMemory0;
4605
4805
  }
4606
4806
 
4607
- function handleError(f, args) {
4608
- try {
4609
- return f.apply(this, args);
4610
- } catch (e) {
4611
- const idx = addToExternrefTable0(e);
4612
- wasm.__wbindgen_exn_store(idx);
4613
- }
4614
- }
4615
-
4616
4807
  function isLikeNone(x) {
4617
4808
  return x === undefined || x === null;
4618
4809
  }
Binary file
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "kent-tokyo <kent-tokyo@users.noreply.github.com>"
6
6
  ],
7
7
  "description": "WebAssembly bindings for chematic — use chematic from JavaScript/TypeScript",
8
- "version": "0.2.11",
8
+ "version": "0.4.19",
9
9
  "license": "MIT OR Apache-2.0",
10
10
  "repository": {
11
11
  "type": "git",
@@ -29,4 +29,4 @@
29
29
  "smiles",
30
30
  "chemistry"
31
31
  ]
32
- }
32
+ }