@kent-tokyo/chematic 0.2.11 → 0.4.28
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 +6 -0
- package/chematic_wasm.d.ts +219 -81
- package/chematic_wasm.js +447 -159
- package/chematic_wasm_bg.wasm +0 -0
- package/package.json +2 -2
package/chematic_wasm.js
CHANGED
|
@@ -264,17 +264,6 @@ export class DepictOptions {
|
|
|
264
264
|
}
|
|
265
265
|
if (Symbol.dispose) DepictOptions.prototype[Symbol.dispose] = DepictOptions.prototype.free;
|
|
266
266
|
|
|
267
|
-
/**
|
|
268
|
-
* MinHash LSH index: insert MHFP fingerprints and query by approximate similarity.
|
|
269
|
-
*
|
|
270
|
-
* ```js
|
|
271
|
-
* const idx = new MhfpLshHandle(128);
|
|
272
|
-
* const i0 = idx.add_smiles("c1ccccc1"); // benzene → index 0
|
|
273
|
-
* const i1 = idx.add_smiles("Cc1ccccc1"); // toluene → index 1
|
|
274
|
-
* const hits = JSON.parse(idx.query_json("c1ccccc1", 0.5));
|
|
275
|
-
* // hits: [{index:0,similarity:1.0}, {index:1,similarity:0.xxx}]
|
|
276
|
-
* ```
|
|
277
|
-
*/
|
|
278
267
|
export class MhfpLshHandle {
|
|
279
268
|
__destroy_into_raw() {
|
|
280
269
|
const ptr = this.__wbg_ptr;
|
|
@@ -415,6 +404,23 @@ export class MolHandle {
|
|
|
415
404
|
const ret = wasm.molhandle_atom_count(this.__wbg_ptr);
|
|
416
405
|
return ret >>> 0;
|
|
417
406
|
}
|
|
407
|
+
/**
|
|
408
|
+
* Returns true when TPSA < 90 Ų, MW < 400, HBD ≤ 3.
|
|
409
|
+
* @returns {boolean}
|
|
410
|
+
*/
|
|
411
|
+
bbb_passes() {
|
|
412
|
+
const ret = wasm.molhandle_bbb_passes(this.__wbg_ptr);
|
|
413
|
+
return ret !== 0;
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Clark (2000) blood-brain barrier logBB score.
|
|
417
|
+
* logBB > −1.0 = likely CNS penetrant.
|
|
418
|
+
* @returns {number}
|
|
419
|
+
*/
|
|
420
|
+
bbb_score() {
|
|
421
|
+
const ret = wasm.molhandle_bbb_score(this.__wbg_ptr);
|
|
422
|
+
return ret;
|
|
423
|
+
}
|
|
418
424
|
/**
|
|
419
425
|
* Bertz complexity index (BertzCT).
|
|
420
426
|
* @returns {number}
|
|
@@ -431,6 +437,15 @@ export class MolHandle {
|
|
|
431
437
|
const ret = wasm.molhandle_bond_count(this.__wbg_ptr);
|
|
432
438
|
return ret >>> 0;
|
|
433
439
|
}
|
|
440
|
+
/**
|
|
441
|
+
* Palm (1997) Caco-2 intestinal permeability (logPCaco2).
|
|
442
|
+
* > −5.5 = high permeability.
|
|
443
|
+
* @returns {number}
|
|
444
|
+
*/
|
|
445
|
+
caco2_permeability() {
|
|
446
|
+
const ret = wasm.molhandle_caco2_permeability(this.__wbg_ptr);
|
|
447
|
+
return ret;
|
|
448
|
+
}
|
|
434
449
|
/**
|
|
435
450
|
* Canonical SMILES string.
|
|
436
451
|
* @returns {string}
|
|
@@ -528,8 +543,16 @@ export class MolHandle {
|
|
|
528
543
|
return ret;
|
|
529
544
|
}
|
|
530
545
|
/**
|
|
531
|
-
*
|
|
532
|
-
*
|
|
546
|
+
* CYP3A4 metabolic inhibition risk score (0.0–1.0).
|
|
547
|
+
* @returns {number}
|
|
548
|
+
*/
|
|
549
|
+
cyp3a4_inhibition_risk() {
|
|
550
|
+
const ret = wasm.molhandle_cyp3a4_inhibition_risk(this.__wbg_ptr);
|
|
551
|
+
return ret;
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* 2D PNG depiction — not available in the WASM build (PNG stack disabled to reduce bundle size).
|
|
555
|
+
* Use `depict_svg()` in browser contexts; rasterize client-side if needed.
|
|
533
556
|
* @returns {Uint8Array}
|
|
534
557
|
*/
|
|
535
558
|
depict_png() {
|
|
@@ -654,6 +677,14 @@ export class MolHandle {
|
|
|
654
677
|
const ret = wasm.molhandle_heavy_atom_count(this.__wbg_ptr);
|
|
655
678
|
return ret >>> 0;
|
|
656
679
|
}
|
|
680
|
+
/**
|
|
681
|
+
* hERG cardiac toxicity risk score (0.0–1.0).
|
|
682
|
+
* @returns {number}
|
|
683
|
+
*/
|
|
684
|
+
herg_risk_score() {
|
|
685
|
+
const ret = wasm.molhandle_herg_risk_score(this.__wbg_ptr);
|
|
686
|
+
return ret;
|
|
687
|
+
}
|
|
657
688
|
/**
|
|
658
689
|
* Isotope distribution as JSON.
|
|
659
690
|
*
|
|
@@ -914,6 +945,22 @@ export class MolHandle {
|
|
|
914
945
|
const ret = wasm.molhandle_pains_passes(this.__wbg_ptr);
|
|
915
946
|
return ret !== 0;
|
|
916
947
|
}
|
|
948
|
+
/**
|
|
949
|
+
* Most acidic pKa in the molecule, or NaN if no acidic site.
|
|
950
|
+
* @returns {number}
|
|
951
|
+
*/
|
|
952
|
+
pka_acid_value() {
|
|
953
|
+
const ret = wasm.molhandle_pka_acid_value(this.__wbg_ptr);
|
|
954
|
+
return ret;
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* Most basic pKa in the molecule, or NaN if no basic site.
|
|
958
|
+
* @returns {number}
|
|
959
|
+
*/
|
|
960
|
+
pka_base_value() {
|
|
961
|
+
const ret = wasm.molhandle_pka_base_value(this.__wbg_ptr);
|
|
962
|
+
return ret;
|
|
963
|
+
}
|
|
917
964
|
/**
|
|
918
965
|
* Quantitative Estimate of Drug-likeness (QED); range [0, 1].
|
|
919
966
|
* @returns {number}
|
|
@@ -1043,6 +1090,33 @@ export function add_hydrogens(mol) {
|
|
|
1043
1090
|
return MolHandle.__wrap(ret);
|
|
1044
1091
|
}
|
|
1045
1092
|
|
|
1093
|
+
/**
|
|
1094
|
+
* Compute a full ADMET property profile for a molecule.
|
|
1095
|
+
*
|
|
1096
|
+
* Returns a JSON object with fields:
|
|
1097
|
+
* `bbb_score`, `bbb_passes`, `caco2`, `herg_risk`, `cyp3a4_risk`,
|
|
1098
|
+
* `pka_acid` (null if absent), `pka_base` (null if absent),
|
|
1099
|
+
* `esol`, `logd74`, `mw`, `logp`, `tpsa`, `hbd`, `hba`, `rotatable_bonds`
|
|
1100
|
+
*
|
|
1101
|
+
* Returns `{"error":"..."}` on parse failure.
|
|
1102
|
+
* @param {string} smiles
|
|
1103
|
+
* @returns {string}
|
|
1104
|
+
*/
|
|
1105
|
+
export function admet_profile_json(smiles) {
|
|
1106
|
+
let deferred2_0;
|
|
1107
|
+
let deferred2_1;
|
|
1108
|
+
try {
|
|
1109
|
+
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1110
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1111
|
+
const ret = wasm.admet_profile_json(ptr0, len0);
|
|
1112
|
+
deferred2_0 = ret[0];
|
|
1113
|
+
deferred2_1 = ret[1];
|
|
1114
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1115
|
+
} finally {
|
|
1116
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1046
1120
|
/**
|
|
1047
1121
|
* AtomPair fingerprint as a bit-packed byte vector (256 bytes = 2048 bits).
|
|
1048
1122
|
* @param {MolHandle} mol
|
|
@@ -1118,6 +1192,67 @@ export function balance_check_json(reaction_smiles) {
|
|
|
1118
1192
|
}
|
|
1119
1193
|
}
|
|
1120
1194
|
|
|
1195
|
+
/**
|
|
1196
|
+
* MinHash LSH index: insert MHFP fingerprints and query by approximate similarity.
|
|
1197
|
+
*
|
|
1198
|
+
* ```js
|
|
1199
|
+
* const idx = new MhfpLshHandle(128);
|
|
1200
|
+
* const i0 = idx.add_smiles("c1ccccc1"); // benzene → index 0
|
|
1201
|
+
* const i1 = idx.add_smiles("Cc1ccccc1"); // toluene → index 1
|
|
1202
|
+
* const hits = JSON.parse(idx.query_json("c1ccccc1", 0.5));
|
|
1203
|
+
* // hits: [{index:0,similarity:1.0}, {index:1,similarity:0.xxx}]
|
|
1204
|
+
* ```
|
|
1205
|
+
* Generate a self-contained HTML report for a newline-separated list of SMILES.
|
|
1206
|
+
*
|
|
1207
|
+
* Empty lines and invalid SMILES are silently skipped.
|
|
1208
|
+
* Returns the same card-grid HTML as Python's `chematic.report()`.
|
|
1209
|
+
*
|
|
1210
|
+
* ```js
|
|
1211
|
+
* const html = mod.batch_report_html("CCO\nc1ccccc1\nCC(=O)O");
|
|
1212
|
+
* const blob = new Blob([html], {type:'text/html'});
|
|
1213
|
+
* const url = URL.createObjectURL(blob);
|
|
1214
|
+
* ```
|
|
1215
|
+
* @param {string} smiles_lines
|
|
1216
|
+
* @returns {string}
|
|
1217
|
+
*/
|
|
1218
|
+
export function batch_report_html(smiles_lines) {
|
|
1219
|
+
let deferred2_0;
|
|
1220
|
+
let deferred2_1;
|
|
1221
|
+
try {
|
|
1222
|
+
const ptr0 = passStringToWasm0(smiles_lines, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1223
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1224
|
+
const ret = wasm.batch_report_html(ptr0, len0);
|
|
1225
|
+
deferred2_0 = ret[0];
|
|
1226
|
+
deferred2_1 = ret[1];
|
|
1227
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1228
|
+
} finally {
|
|
1229
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
/**
|
|
1234
|
+
* Predict GI absorption and BBB penetration using the BOILED-Egg method
|
|
1235
|
+
* (Daina & Zoete 2016).
|
|
1236
|
+
*
|
|
1237
|
+
* Returns JSON: `{"gi_absorbed":bool,"bbb_penetrant":bool,"logp":f64,"tpsa":f64}`
|
|
1238
|
+
* @param {string} smiles
|
|
1239
|
+
* @returns {string}
|
|
1240
|
+
*/
|
|
1241
|
+
export function boiled_egg_json(smiles) {
|
|
1242
|
+
let deferred2_0;
|
|
1243
|
+
let deferred2_1;
|
|
1244
|
+
try {
|
|
1245
|
+
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1246
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1247
|
+
const ret = wasm.boiled_egg_json(ptr0, len0);
|
|
1248
|
+
deferred2_0 = ret[0];
|
|
1249
|
+
deferred2_1 = ret[1];
|
|
1250
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1251
|
+
} finally {
|
|
1252
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1121
1256
|
/**
|
|
1122
1257
|
* Number of BRICS fragments produced by fragmenting the molecule.
|
|
1123
1258
|
*
|
|
@@ -1360,28 +1495,19 @@ export function compare_molecules_json(smiles1, smiles2) {
|
|
|
1360
1495
|
}
|
|
1361
1496
|
|
|
1362
1497
|
/**
|
|
1363
|
-
*
|
|
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
|
-
* ```
|
|
1498
|
+
* Generate multiple conformers with RMSD-based pruning.
|
|
1499
|
+
* Returns JSON: `{"conformers": [[[x,y,z],...], ...], "count": int}`.
|
|
1376
1500
|
* @param {MolHandle} mol
|
|
1501
|
+
* @param {number} n
|
|
1502
|
+
* @param {number} rmsd_threshold
|
|
1377
1503
|
* @returns {string}
|
|
1378
1504
|
*/
|
|
1379
|
-
export function
|
|
1505
|
+
export function conformer_ensemble_json(mol, n, rmsd_threshold) {
|
|
1380
1506
|
let deferred1_0;
|
|
1381
1507
|
let deferred1_1;
|
|
1382
1508
|
try {
|
|
1383
1509
|
_assertClass(mol, MolHandle);
|
|
1384
|
-
const ret = wasm.
|
|
1510
|
+
const ret = wasm.conformer_ensemble_json(mol.__wbg_ptr, n, rmsd_threshold);
|
|
1385
1511
|
deferred1_0 = ret[0];
|
|
1386
1512
|
deferred1_1 = ret[1];
|
|
1387
1513
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -1584,36 +1710,6 @@ export function detect_functional_groups(mol) {
|
|
|
1584
1710
|
}
|
|
1585
1711
|
}
|
|
1586
1712
|
|
|
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
1713
|
/**
|
|
1618
1714
|
* Dice similarity between `a` and `b` using ECFP4 fingerprints.
|
|
1619
1715
|
* @param {MolHandle} a
|
|
@@ -1947,6 +2043,47 @@ export function gasteiger_charges_json(mol) {
|
|
|
1947
2043
|
}
|
|
1948
2044
|
}
|
|
1949
2045
|
|
|
2046
|
+
/**
|
|
2047
|
+
* Generate 3D coordinates as raw JSON array [[x,y,z], ...].
|
|
2048
|
+
*
|
|
2049
|
+
* Unlike `generate_3d_pdb`, this returns coordinates that can be passed
|
|
2050
|
+
* to descriptor functions like `whim_descriptors_json` or `shape_descriptors_json`.
|
|
2051
|
+
* @param {MolHandle} mol
|
|
2052
|
+
* @returns {string}
|
|
2053
|
+
*/
|
|
2054
|
+
export function generate_3d_coords_json(mol) {
|
|
2055
|
+
let deferred1_0;
|
|
2056
|
+
let deferred1_1;
|
|
2057
|
+
try {
|
|
2058
|
+
_assertClass(mol, MolHandle);
|
|
2059
|
+
const ret = wasm.generate_3d_coords_json(mol.__wbg_ptr);
|
|
2060
|
+
deferred1_0 = ret[0];
|
|
2061
|
+
deferred1_1 = ret[1];
|
|
2062
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2063
|
+
} finally {
|
|
2064
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2065
|
+
}
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
/**
|
|
2069
|
+
* Generate 3D coordinates using ETKDG as raw JSON array [[x,y,z], ...].
|
|
2070
|
+
* @param {MolHandle} mol
|
|
2071
|
+
* @returns {string}
|
|
2072
|
+
*/
|
|
2073
|
+
export function generate_3d_etkdg_coords_json(mol) {
|
|
2074
|
+
let deferred1_0;
|
|
2075
|
+
let deferred1_1;
|
|
2076
|
+
try {
|
|
2077
|
+
_assertClass(mol, MolHandle);
|
|
2078
|
+
const ret = wasm.generate_3d_etkdg_coords_json(mol.__wbg_ptr);
|
|
2079
|
+
deferred1_0 = ret[0];
|
|
2080
|
+
deferred1_1 = ret[1];
|
|
2081
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2082
|
+
} finally {
|
|
2083
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
|
|
1950
2087
|
/**
|
|
1951
2088
|
* Generate 3D coordinates using ETKDG and minimize with DREIDING force field.
|
|
1952
2089
|
* @param {MolHandle} mol
|
|
@@ -2267,10 +2404,15 @@ export function get_dihedral_json(smiles, a, b, c, d) {
|
|
|
2267
2404
|
}
|
|
2268
2405
|
|
|
2269
2406
|
/**
|
|
2270
|
-
* Compute GETAWAY descriptors (
|
|
2271
|
-
*
|
|
2272
|
-
*
|
|
2273
|
-
*
|
|
2407
|
+
* Compute GETAWAY descriptors (GEometry, Topology and Atom-Weights AssemblY) from 3D coords.
|
|
2408
|
+
*
|
|
2409
|
+
* Returns a JSON array of **19** values:
|
|
2410
|
+
* - `[0..7]` H[1..8] — leverage autocorrelation at topological lags 1–8
|
|
2411
|
+
* - `[8..15]` R[1..8] — H[k] normalised by pair count W_k
|
|
2412
|
+
* - `[16]` Hmax, `[17]` Hmean, `[18]` Htot — per-atom leverage statistics
|
|
2413
|
+
*
|
|
2414
|
+
* Note: requires 3D coordinates (non-planar); for flat/2D structures the hat matrix
|
|
2415
|
+
* is degenerate and descriptors reflect squared centroid distances, not true leverage.
|
|
2274
2416
|
* @param {MolHandle} mol
|
|
2275
2417
|
* @returns {string}
|
|
2276
2418
|
*/
|
|
@@ -2288,6 +2430,38 @@ export function getaway_descriptors_json(mol) {
|
|
|
2288
2430
|
}
|
|
2289
2431
|
}
|
|
2290
2432
|
|
|
2433
|
+
/**
|
|
2434
|
+
* Parse a ChemDraw XML (CDXML) string into a `MolHandle`.
|
|
2435
|
+
*
|
|
2436
|
+
* Compute an HDF fingerprint and return it as a JSON array of float32 values.
|
|
2437
|
+
*
|
|
2438
|
+
* Returns a unit-norm vector of length `dim` as a JSON number array.
|
|
2439
|
+
* Use cosine dot product for similarity: `a · b = sum(a[i]*b[i])`.
|
|
2440
|
+
*
|
|
2441
|
+
* ```js
|
|
2442
|
+
* const fp = JSON.parse(hdf_json(mol)); // float[] of length 1024
|
|
2443
|
+
* const sim = fp.reduce((s, v, i) => s + v * fp2[i], 0); // cosine similarity
|
|
2444
|
+
* ```
|
|
2445
|
+
* @param {MolHandle} mol
|
|
2446
|
+
* @param {number} dim
|
|
2447
|
+
* @param {number} radius
|
|
2448
|
+
* @param {bigint} seed
|
|
2449
|
+
* @returns {string}
|
|
2450
|
+
*/
|
|
2451
|
+
export function hdf_json(mol, dim, radius, seed) {
|
|
2452
|
+
let deferred1_0;
|
|
2453
|
+
let deferred1_1;
|
|
2454
|
+
try {
|
|
2455
|
+
_assertClass(mol, MolHandle);
|
|
2456
|
+
const ret = wasm.hdf_json(mol.__wbg_ptr, dim, radius, seed);
|
|
2457
|
+
deferred1_0 = ret[0];
|
|
2458
|
+
deferred1_1 = ret[1];
|
|
2459
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2460
|
+
} finally {
|
|
2461
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2462
|
+
}
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2291
2465
|
/**
|
|
2292
2466
|
* Identify functional groups. Returns a JSON array of objects:
|
|
2293
2467
|
* `[{"atoms":[0,2,3],"type":"C,N,O"}, …]`
|
|
@@ -2546,6 +2720,39 @@ export function mcs_smiles_json(smiles_json) {
|
|
|
2546
2720
|
}
|
|
2547
2721
|
}
|
|
2548
2722
|
|
|
2723
|
+
/**
|
|
2724
|
+
* MCS with ring-awareness constraints.
|
|
2725
|
+
*
|
|
2726
|
+
* `smiles_json` — JSON array of at least 2 SMILES strings.
|
|
2727
|
+
* `ring_matches_ring_only` — ring atoms may only match ring atoms.
|
|
2728
|
+
* `complete_rings_only` — partial ring inclusion is removed from the result.
|
|
2729
|
+
* Returns the MCS SMILES, or `"null"` when no common substructure was found.
|
|
2730
|
+
* @param {string} smiles_json
|
|
2731
|
+
* @param {boolean} ring_matches_ring_only
|
|
2732
|
+
* @param {boolean} complete_rings_only
|
|
2733
|
+
* @returns {string}
|
|
2734
|
+
*/
|
|
2735
|
+
export function mcs_smiles_json_with_ring_config(smiles_json, ring_matches_ring_only, complete_rings_only) {
|
|
2736
|
+
let deferred3_0;
|
|
2737
|
+
let deferred3_1;
|
|
2738
|
+
try {
|
|
2739
|
+
const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2740
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2741
|
+
const ret = wasm.mcs_smiles_json_with_ring_config(ptr0, len0, ring_matches_ring_only, complete_rings_only);
|
|
2742
|
+
var ptr2 = ret[0];
|
|
2743
|
+
var len2 = ret[1];
|
|
2744
|
+
if (ret[3]) {
|
|
2745
|
+
ptr2 = 0; len2 = 0;
|
|
2746
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2747
|
+
}
|
|
2748
|
+
deferred3_0 = ptr2;
|
|
2749
|
+
deferred3_1 = len2;
|
|
2750
|
+
return getStringFromWasm0(ptr2, len2);
|
|
2751
|
+
} finally {
|
|
2752
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
2753
|
+
}
|
|
2754
|
+
}
|
|
2755
|
+
|
|
2549
2756
|
/**
|
|
2550
2757
|
* MinHash fingerprint (128 hashes) as JSON.
|
|
2551
2758
|
*
|
|
@@ -2639,6 +2846,36 @@ export function minimize_mmff94_lbfgs_json(mol, max_iter) {
|
|
|
2639
2846
|
}
|
|
2640
2847
|
}
|
|
2641
2848
|
|
|
2849
|
+
/**
|
|
2850
|
+
* Minimise a molecule's geometry using the Universal Force Field (UFF).
|
|
2851
|
+
*
|
|
2852
|
+
* `coords_json` — JSON array of `[x,y,z]` arrays (Å), one per atom.
|
|
2853
|
+
* `max_iter` — maximum iterations (0 = default 500).
|
|
2854
|
+
*
|
|
2855
|
+
* Returns JSON: `{"coords":[[x,y,z],...], "energy":float, "iterations":int, "converged":bool}`
|
|
2856
|
+
* or `{"error":"<msg>"}` on failure.
|
|
2857
|
+
* @param {string} smiles
|
|
2858
|
+
* @param {string} coords_json
|
|
2859
|
+
* @param {number} max_iter
|
|
2860
|
+
* @returns {string}
|
|
2861
|
+
*/
|
|
2862
|
+
export function minimize_uff_json(smiles, coords_json, max_iter) {
|
|
2863
|
+
let deferred3_0;
|
|
2864
|
+
let deferred3_1;
|
|
2865
|
+
try {
|
|
2866
|
+
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2867
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2868
|
+
const ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2869
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2870
|
+
const ret = wasm.minimize_uff_json(ptr0, len0, ptr1, len1, max_iter);
|
|
2871
|
+
deferred3_0 = ret[0];
|
|
2872
|
+
deferred3_1 = ret[1];
|
|
2873
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2874
|
+
} finally {
|
|
2875
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
2876
|
+
}
|
|
2877
|
+
}
|
|
2878
|
+
|
|
2642
2879
|
/**
|
|
2643
2880
|
* MMFF94 partial charges (BCI table, ±0.1e accuracy) as a JSON array of f64.
|
|
2644
2881
|
*
|
|
@@ -2850,8 +3087,6 @@ export function mol_block_from_smiles(smiles) {
|
|
|
2850
3087
|
}
|
|
2851
3088
|
|
|
2852
3089
|
/**
|
|
2853
|
-
* Parse a ChemDraw XML (CDXML) string into a `MolHandle`.
|
|
2854
|
-
*
|
|
2855
3090
|
* Only the first molecular fragment in the document is returned.
|
|
2856
3091
|
* Returns a JS error if the document cannot be parsed.
|
|
2857
3092
|
* @param {string} cdxml
|
|
@@ -2884,6 +3119,24 @@ export function mol_from_cml(cml) {
|
|
|
2884
3119
|
return MolHandle.__wrap(ret[0]);
|
|
2885
3120
|
}
|
|
2886
3121
|
|
|
3122
|
+
/**
|
|
3123
|
+
* Parse a MolJSON string into a `MolHandle`.
|
|
3124
|
+
*
|
|
3125
|
+
* MolJSON is a JSON-based molecular representation designed for LLM
|
|
3126
|
+
* (large language model) compatibility. Returns a JS error on invalid input.
|
|
3127
|
+
* @param {string} json
|
|
3128
|
+
* @returns {MolHandle}
|
|
3129
|
+
*/
|
|
3130
|
+
export function mol_from_moljson(json) {
|
|
3131
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3132
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3133
|
+
const ret = wasm.mol_from_moljson(ptr0, len0);
|
|
3134
|
+
if (ret[2]) {
|
|
3135
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3136
|
+
}
|
|
3137
|
+
return MolHandle.__wrap(ret[0]);
|
|
3138
|
+
}
|
|
3139
|
+
|
|
2887
3140
|
/**
|
|
2888
3141
|
* Parse a PDB file and return a `MolHandle` (topology only; coordinates are discarded).
|
|
2889
3142
|
*
|
|
@@ -3434,6 +3687,30 @@ export function pharmacophore_fp_3d_summary(mol) {
|
|
|
3434
3687
|
}
|
|
3435
3688
|
}
|
|
3436
3689
|
|
|
3690
|
+
/**
|
|
3691
|
+
* Predict pKa for all ionizable sites in a molecule.
|
|
3692
|
+
*
|
|
3693
|
+
* Returns a JSON array: `[{"atom_idx":8,"pka":4.0,"type":"acid","group":"carboxylic_acid"},...]`
|
|
3694
|
+
*
|
|
3695
|
+
* Returns `[]` if no ionizable sites are found, or `{"error":"..."}` on parse failure.
|
|
3696
|
+
* @param {string} smiles
|
|
3697
|
+
* @returns {string}
|
|
3698
|
+
*/
|
|
3699
|
+
export function predict_pka_json(smiles) {
|
|
3700
|
+
let deferred2_0;
|
|
3701
|
+
let deferred2_1;
|
|
3702
|
+
try {
|
|
3703
|
+
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3704
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3705
|
+
const ret = wasm.predict_pka_json(ptr0, len0);
|
|
3706
|
+
deferred2_0 = ret[0];
|
|
3707
|
+
deferred2_1 = ret[1];
|
|
3708
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
3709
|
+
} finally {
|
|
3710
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
3711
|
+
}
|
|
3712
|
+
}
|
|
3713
|
+
|
|
3437
3714
|
/**
|
|
3438
3715
|
* Generate `count` random SMILES from a SMILES string using the given seed.
|
|
3439
3716
|
* Atoms are permuted based on xorshift64 RNG. Each variant should parse back
|
|
@@ -3559,31 +3836,6 @@ export function ring_families_json(mol) {
|
|
|
3559
3836
|
}
|
|
3560
3837
|
}
|
|
3561
3838
|
|
|
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
3839
|
/**
|
|
3588
3840
|
* Apply a SMIRKS reaction template and return product SMILES as a JSON string.
|
|
3589
3841
|
*
|
|
@@ -3959,6 +4211,41 @@ export function smiles_to_mol2(smiles) {
|
|
|
3959
4211
|
}
|
|
3960
4212
|
}
|
|
3961
4213
|
|
|
4214
|
+
/**
|
|
4215
|
+
* Write a molecule to AutoDock PDBQT format.
|
|
4216
|
+
*
|
|
4217
|
+
* `coords_json` — JSON array of `[x,y,z]` arrays (Å). Pass `"[]"` for zero coords.
|
|
4218
|
+
* `charges_json` — JSON array of partial charges. Pass `"[]"` to write zeros.
|
|
4219
|
+
* `name` — ligand name for the REMARK header.
|
|
4220
|
+
*
|
|
4221
|
+
* Returns the PDBQT string, or `"error:<msg>"` on failure.
|
|
4222
|
+
* @param {string} smiles
|
|
4223
|
+
* @param {string} coords_json
|
|
4224
|
+
* @param {string} charges_json
|
|
4225
|
+
* @param {string} name
|
|
4226
|
+
* @returns {string}
|
|
4227
|
+
*/
|
|
4228
|
+
export function smiles_to_pdbqt(smiles, coords_json, charges_json, name) {
|
|
4229
|
+
let deferred5_0;
|
|
4230
|
+
let deferred5_1;
|
|
4231
|
+
try {
|
|
4232
|
+
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4233
|
+
const len0 = WASM_VECTOR_LEN;
|
|
4234
|
+
const ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4235
|
+
const len1 = WASM_VECTOR_LEN;
|
|
4236
|
+
const ptr2 = passStringToWasm0(charges_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4237
|
+
const len2 = WASM_VECTOR_LEN;
|
|
4238
|
+
const ptr3 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4239
|
+
const len3 = WASM_VECTOR_LEN;
|
|
4240
|
+
const ret = wasm.smiles_to_pdbqt(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
4241
|
+
deferred5_0 = ret[0];
|
|
4242
|
+
deferred5_1 = ret[1];
|
|
4243
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
4244
|
+
} finally {
|
|
4245
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
4246
|
+
}
|
|
4247
|
+
}
|
|
4248
|
+
|
|
3962
4249
|
/**
|
|
3963
4250
|
* Render a highlighted SVG from a SMILES string in one call.
|
|
3964
4251
|
*
|
|
@@ -4328,6 +4615,28 @@ export function to_mol_v3000_block(mol) {
|
|
|
4328
4615
|
}
|
|
4329
4616
|
}
|
|
4330
4617
|
|
|
4618
|
+
/**
|
|
4619
|
+
* Serialise a `MolHandle` to a MolJSON string (pretty-printed).
|
|
4620
|
+
*
|
|
4621
|
+
* Atom IDs are assigned as `"a1"`, `"a2"`, … in molecule atom order.
|
|
4622
|
+
* The `hydrogens` field reflects computed implicit H count.
|
|
4623
|
+
* @param {MolHandle} mol
|
|
4624
|
+
* @returns {string}
|
|
4625
|
+
*/
|
|
4626
|
+
export function to_moljson(mol) {
|
|
4627
|
+
let deferred1_0;
|
|
4628
|
+
let deferred1_1;
|
|
4629
|
+
try {
|
|
4630
|
+
_assertClass(mol, MolHandle);
|
|
4631
|
+
const ret = wasm.to_moljson(mol.__wbg_ptr);
|
|
4632
|
+
deferred1_0 = ret[0];
|
|
4633
|
+
deferred1_1 = ret[1];
|
|
4634
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
4635
|
+
} finally {
|
|
4636
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
4637
|
+
}
|
|
4638
|
+
}
|
|
4639
|
+
|
|
4331
4640
|
/**
|
|
4332
4641
|
* Serialize a molecule to XYZ format.
|
|
4333
4642
|
*
|
|
@@ -4362,31 +4671,6 @@ export function torsion_bitvec(mol) {
|
|
|
4362
4671
|
return v1;
|
|
4363
4672
|
}
|
|
4364
4673
|
|
|
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
4674
|
/**
|
|
4391
4675
|
* Virtual screen a query SMILES against a database of SMILES using ECFP4 Tanimoto.
|
|
4392
4676
|
*
|
|
@@ -4419,9 +4703,8 @@ export function virtual_screen_ecfp4_json(query_smi, db_smiles_json, k) {
|
|
|
4419
4703
|
|
|
4420
4704
|
/**
|
|
4421
4705
|
* Compute WHIM descriptors (Weighted Holistic Invariant Molecular) from 3D coordinates.
|
|
4422
|
-
* Returns JSON array of
|
|
4423
|
-
*
|
|
4424
|
-
* BETA = average pairwise interaction, GAMMA = geometric mean, DELTA = anisotropy.
|
|
4706
|
+
* Returns JSON array of 22 values: 11 unit-weight descriptors followed by 11 mass-weight
|
|
4707
|
+
* descriptors. Each 11-element block is [λ₁, λ₂, λ₃, ν₁, ν₂, ν₃, T, A, V, K, D].
|
|
4425
4708
|
* @param {MolHandle} mol
|
|
4426
4709
|
* @returns {string}
|
|
4427
4710
|
*/
|
|
@@ -4440,7 +4723,9 @@ export function whim_descriptors_json(mol) {
|
|
|
4440
4723
|
}
|
|
4441
4724
|
|
|
4442
4725
|
/**
|
|
4443
|
-
* Compute combined WHIM + GETAWAY descriptors (
|
|
4726
|
+
* Compute combined WHIM + GETAWAY descriptors (**41** values total) as JSON array.
|
|
4727
|
+
*
|
|
4728
|
+
* Returns WHIM[0..21] (22 values) followed by GETAWAY[0..18] (19 values) = 41 total.
|
|
4444
4729
|
* Useful for ML pipelines requiring both shape and topologic features.
|
|
4445
4730
|
* @param {MolHandle} mol
|
|
4446
4731
|
* @returns {string}
|
|
@@ -4481,10 +4766,50 @@ export function write_smiles(mol) {
|
|
|
4481
4766
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
4482
4767
|
}
|
|
4483
4768
|
}
|
|
4769
|
+
|
|
4770
|
+
/**
|
|
4771
|
+
* XLogP3 partition coefficient (alternative to Crippen LogP).
|
|
4772
|
+
* Returns JSON: `{"xlogp3": float}`.
|
|
4773
|
+
* @param {MolHandle} mol
|
|
4774
|
+
* @returns {string}
|
|
4775
|
+
*/
|
|
4776
|
+
export function xlogp3_json(mol) {
|
|
4777
|
+
let deferred1_0;
|
|
4778
|
+
let deferred1_1;
|
|
4779
|
+
try {
|
|
4780
|
+
_assertClass(mol, MolHandle);
|
|
4781
|
+
const ret = wasm.xlogp3_json(mol.__wbg_ptr);
|
|
4782
|
+
deferred1_0 = ret[0];
|
|
4783
|
+
deferred1_1 = ret[1];
|
|
4784
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
4785
|
+
} finally {
|
|
4786
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
4787
|
+
}
|
|
4788
|
+
}
|
|
4789
|
+
|
|
4790
|
+
/**
|
|
4791
|
+
* Per-atom XLogP3 contributions.
|
|
4792
|
+
* Returns JSON array of floats (one per heavy atom).
|
|
4793
|
+
* @param {MolHandle} mol
|
|
4794
|
+
* @returns {string}
|
|
4795
|
+
*/
|
|
4796
|
+
export function xlogp3_per_atom_json(mol) {
|
|
4797
|
+
let deferred1_0;
|
|
4798
|
+
let deferred1_1;
|
|
4799
|
+
try {
|
|
4800
|
+
_assertClass(mol, MolHandle);
|
|
4801
|
+
const ret = wasm.xlogp3_per_atom_json(mol.__wbg_ptr);
|
|
4802
|
+
deferred1_0 = ret[0];
|
|
4803
|
+
deferred1_1 = ret[1];
|
|
4804
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
4805
|
+
} finally {
|
|
4806
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
4807
|
+
}
|
|
4808
|
+
}
|
|
4484
4809
|
function __wbg_get_imports() {
|
|
4485
4810
|
const import0 = {
|
|
4486
4811
|
__proto__: null,
|
|
4487
|
-
|
|
4812
|
+
__wbg___wbindgen_string_get_b0ca35b86a603356: function(arg0, arg1) {
|
|
4488
4813
|
const obj = arg1;
|
|
4489
4814
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
4490
4815
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -4492,33 +4817,11 @@ function __wbg_get_imports() {
|
|
|
4492
4817
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
4493
4818
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
4494
4819
|
},
|
|
4495
|
-
|
|
4820
|
+
__wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
|
|
4496
4821
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
4497
4822
|
},
|
|
4498
|
-
|
|
4499
|
-
|
|
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);
|
|
4823
|
+
__wbg_error_744744ff0c9861e6: function(arg0) {
|
|
4824
|
+
console.error(arg0);
|
|
4522
4825
|
},
|
|
4523
4826
|
__wbindgen_cast_0000000000000001: function(arg0) {
|
|
4524
4827
|
// Cast intrinsic for `F64 -> Externref`.
|
|
@@ -4559,12 +4862,6 @@ const MolHandleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
4559
4862
|
? { register: () => {}, unregister: () => {} }
|
|
4560
4863
|
: new FinalizationRegistry(ptr => wasm.__wbg_molhandle_free(ptr, 1));
|
|
4561
4864
|
|
|
4562
|
-
function addToExternrefTable0(obj) {
|
|
4563
|
-
const idx = wasm.__externref_table_alloc();
|
|
4564
|
-
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
4565
|
-
return idx;
|
|
4566
|
-
}
|
|
4567
|
-
|
|
4568
4865
|
function _assertClass(instance, klass) {
|
|
4569
4866
|
if (!(instance instanceof klass)) {
|
|
4570
4867
|
throw new Error(`expected instance of ${klass.name}`);
|
|
@@ -4604,15 +4901,6 @@ function getUint8ArrayMemory0() {
|
|
|
4604
4901
|
return cachedUint8ArrayMemory0;
|
|
4605
4902
|
}
|
|
4606
4903
|
|
|
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
4904
|
function isLikeNone(x) {
|
|
4617
4905
|
return x === undefined || x === null;
|
|
4618
4906
|
}
|