@kent-tokyo/chematic 1.0.42 → 1.1.1
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 +34 -1
- package/chematic_wasm.d.ts +186 -3
- package/chematic_wasm.js +714 -3
- package/chematic_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ WebAssembly bindings for [chematic](https://github.com/kent-tokyo/chematic), a p
|
|
|
4
4
|
|
|
5
5
|
Published to npm as [`@kent-tokyo/chematic`](https://www.npmjs.com/package/@kent-tokyo/chematic).
|
|
6
6
|
|
|
7
|
-
The current workspace line is 1.
|
|
7
|
+
The current workspace line is 1.1.1. The binding keeps bounded parsing,
|
|
8
8
|
typed failures, and opt-in `embed_pipeline_v2_json`; 3D/MMFF94 behavior remains
|
|
9
9
|
Experimental and is not a claim of full RDKit parity.
|
|
10
10
|
|
|
@@ -25,6 +25,9 @@ npm install @kent-tokyo/chematic
|
|
|
25
25
|
- SA score: synthetic accessibility estimate [1, 10]
|
|
26
26
|
- Functional group identification (Ertl 2017 IFG)
|
|
27
27
|
- Canonical SMILES generation
|
|
28
|
+
- Separately named RDKit 2026.03.1 compatibility bindings for SMARTS/PDB,
|
|
29
|
+
format readers, Murcko/stereo/hash/Morgan inspection, bounded alignment,
|
|
30
|
+
seeded ETKDG, and distance bounds
|
|
28
31
|
- ECFP4/6, AtomPair, Torsion, path, and RDKit-compatible RDK fingerprints
|
|
29
32
|
with Tanimoto similarity
|
|
30
33
|
- BRICS fragment count
|
|
@@ -40,6 +43,11 @@ npm install @kent-tokyo/chematic
|
|
|
40
43
|
`MolHandle.atom_pseudo_labels_json()` and immutable edits through
|
|
41
44
|
`mol_with_atom_pseudo_label`; labels are bounded to `*`, `R`, and
|
|
42
45
|
`R1..R9999`
|
|
46
|
+
- Label-stable R-group decomposition through
|
|
47
|
+
`rgroup_decompose_columns_json(smilesJson, coreSmarts)`. The returned JSON
|
|
48
|
+
contains input-aligned `Core`, `R1`, `R2`, ... columns and uses `null` for
|
|
49
|
+
unmatched molecules or substituents absent from a matched row. The legacy
|
|
50
|
+
`rgroup_decompose_json` row API is unchanged.
|
|
43
51
|
- PDBx/mmCIF, PQR, QCSchema JSON, ORCA input/output, Gaussian Cube, OpenDX,
|
|
44
52
|
and LAMMPS data/dump I/O (JSON-based bindings; see `format_io.rs`)
|
|
45
53
|
- Topological descriptors: Wiener index, Hall-Kier κ, χ connectivity indices, Bertz CT
|
|
@@ -47,6 +55,8 @@ npm install @kent-tokyo/chematic
|
|
|
47
55
|
- 2D SVG depiction with CPK colors and atom/bond highlighting
|
|
48
56
|
- SVG grid layout for multiple molecules
|
|
49
57
|
- Reaction SMILES/SMIRKS parsing and transform
|
|
58
|
+
(`run_reactants_checked` includes typed native and RDKit-profile rejection
|
|
59
|
+
diagnostics without returning rejected products as successes)
|
|
50
60
|
- Add/remove explicit hydrogens
|
|
51
61
|
- `embed_pipeline_v2_json`: torsion-knowledge-aware 3D embedding + stereo
|
|
52
62
|
verification/repair + policy-gated force field, mirroring the Python
|
|
@@ -71,6 +81,7 @@ libraries):
|
|
|
71
81
|
```js
|
|
72
82
|
import init, {
|
|
73
83
|
parse_smiles,
|
|
84
|
+
add_hydrogens,
|
|
74
85
|
tanimoto_ecfp4,
|
|
75
86
|
tanimoto_atom_pair,
|
|
76
87
|
tanimoto_torsion,
|
|
@@ -112,6 +123,28 @@ console.log(tanimoto_atom_pair(mol, caffeine)); // AtomPair Tanimoto
|
|
|
112
123
|
console.log(tanimoto_torsion(mol, caffeine)); // Torsion Tanimoto
|
|
113
124
|
```
|
|
114
125
|
|
|
126
|
+
### RDKit-compatible interoperability
|
|
127
|
+
|
|
128
|
+
The `rdkit_*` methods are opt-in compatibility paths and do not replace the
|
|
129
|
+
native browser APIs. JSON atom indices and coordinate rows are zero-based in
|
|
130
|
+
`MolHandle` atom order:
|
|
131
|
+
|
|
132
|
+
```js
|
|
133
|
+
const smarts = mol.rdkit_smarts(true);
|
|
134
|
+
const centers = JSON.parse(mol.rdkit_chiral_centers_json(true));
|
|
135
|
+
const bitInfo = JSON.parse(mol.rdkit_morgan_bit_info_json(2, 2048, false));
|
|
136
|
+
|
|
137
|
+
const withH = add_hydrogens(parse_smiles('CCO'));
|
|
138
|
+
const coords = JSON.parse(withH.rdkit_embed_json(42, 0));
|
|
139
|
+
const bounds = JSON.parse(withH.rdkit_bounds_matrix_json(true, true, false));
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
PDB, XYZ, and MOL2 readers return `RdkitReadResult`; call `molecule()` for a
|
|
143
|
+
handle and `coords_json()` for index-aligned coordinates. Browser limits are
|
|
144
|
+
explicit: at most 512 atoms for ETKDG/bounds, 4,096 stereoisomers, and
|
|
145
|
+
1,000,000 alignment matches. Invalid or unsupported inputs throw a stable JS
|
|
146
|
+
error instead of being silently coerced.
|
|
147
|
+
|
|
115
148
|
### Node.js
|
|
116
149
|
|
|
117
150
|
The published package is built with wasm-pack's `web` target. In a browser,
|
package/chematic_wasm.d.ts
CHANGED
|
@@ -384,6 +384,10 @@ export class MolHandle {
|
|
|
384
384
|
* Number of heteroatoms (non-C, non-H heavy atoms).
|
|
385
385
|
*/
|
|
386
386
|
num_heteroatoms(): number;
|
|
387
|
+
/**
|
|
388
|
+
* Number of rings using RDKit's symmetrized-SSSR semantics.
|
|
389
|
+
*/
|
|
390
|
+
num_rings(): number;
|
|
387
391
|
/**
|
|
388
392
|
* Number of fully saturated rings containing at least one heteroatom.
|
|
389
393
|
*/
|
|
@@ -430,6 +434,63 @@ export class MolHandle {
|
|
|
430
434
|
* χ₀ = Σ 1/√(d_i × d_j) over all bonds, where d is heavy-atom degree.
|
|
431
435
|
*/
|
|
432
436
|
randic_index(): number;
|
|
437
|
+
/**
|
|
438
|
+
* RDKit `AlignMol` result JSON. Coordinates and optional atom map and
|
|
439
|
+
* weights use zero-based molecule atom order.
|
|
440
|
+
*/
|
|
441
|
+
rdkit_align_json(probe_coords_json: string, reference_coords_json: string, atom_map_json: string | null | undefined, weights_json: string | null | undefined, reflect: boolean, max_iterations: number): string;
|
|
442
|
+
/**
|
|
443
|
+
* RDKit `GetBestAlignmentTransform` as JSON, bounded by `max_matches`.
|
|
444
|
+
*/
|
|
445
|
+
rdkit_best_alignment_json(probe_coords_json: string, reference_coords_json: string, max_matches: number, symmetrize: boolean, weights_json?: string | null): string;
|
|
446
|
+
/**
|
|
447
|
+
* RDKit `GetBestRMS`, bounded by `max_matches <= 1_000_000`.
|
|
448
|
+
*/
|
|
449
|
+
rdkit_best_rms(probe_coords_json: string, reference_coords_json: string, max_matches: number, symmetrize: boolean, weights_json?: string | null): number;
|
|
450
|
+
/**
|
|
451
|
+
* RDKit distance-geometry bounds matrix JSON. Row and column `i`
|
|
452
|
+
* refer to zero-based molecule atom `i`; upper bounds are above the
|
|
453
|
+
* diagonal and lower bounds below it. At most 512 atoms are accepted.
|
|
454
|
+
*/
|
|
455
|
+
rdkit_bounds_matrix_json(set15bounds: boolean, do_triangle_smoothing: boolean, use_macrocycle_14_config: boolean): string;
|
|
456
|
+
/**
|
|
457
|
+
* RDKit `CalcRMS`, bounded by `max_matches <= 1_000_000`.
|
|
458
|
+
*/
|
|
459
|
+
rdkit_calc_rms(probe_coords_json: string, reference_coords_json: string, max_matches: number, symmetrize: boolean, weights_json?: string | null): number;
|
|
460
|
+
/**
|
|
461
|
+
* Chiral centres as `[[atomIndex,"R"|"S"|"?"], ...]` JSON.
|
|
462
|
+
*/
|
|
463
|
+
rdkit_chiral_centers_json(include_unassigned: boolean): string;
|
|
464
|
+
/**
|
|
465
|
+
* RDKit-compatible CXSMARTS.
|
|
466
|
+
*/
|
|
467
|
+
rdkit_cx_smarts(): string;
|
|
468
|
+
/**
|
|
469
|
+
* Seeded RDKit ETKDGv3 coordinates as JSON. Call on an
|
|
470
|
+
* explicit-hydrogen molecule. At most 512 atoms are accepted.
|
|
471
|
+
*/
|
|
472
|
+
rdkit_embed_json(random_seed: number, max_iterations: number): string;
|
|
473
|
+
/**
|
|
474
|
+
* RDKit MolHash by case-insensitive function name.
|
|
475
|
+
*/
|
|
476
|
+
rdkit_mol_hash(_function: string, use_cx_smiles: boolean): string;
|
|
477
|
+
/**
|
|
478
|
+
* RDKit Morgan folded bitInfo as `{bit:[[atomIndex,radius],...]}` JSON.
|
|
479
|
+
*/
|
|
480
|
+
rdkit_morgan_bit_info_json(radius: number, n_bits: number, include_chirality: boolean): string;
|
|
481
|
+
/**
|
|
482
|
+
* RDKit-compatible Murcko scaffold SMILES.
|
|
483
|
+
*/
|
|
484
|
+
rdkit_murcko_scaffold(): string;
|
|
485
|
+
/**
|
|
486
|
+
* RDKit-compatible PDB block. Optional coordinates are a JSON array in
|
|
487
|
+
* zero-based molecule atom order; omit them to write zero coordinates.
|
|
488
|
+
*/
|
|
489
|
+
rdkit_pdb_block(coords_json?: string | null): string;
|
|
490
|
+
/**
|
|
491
|
+
* RDKit-compatible SMARTS in input atom order.
|
|
492
|
+
*/
|
|
493
|
+
rdkit_smarts(isomeric: boolean, rooted_at_atom?: number | null): string;
|
|
433
494
|
/**
|
|
434
495
|
* Canonical SMILES exactly as RDKit 2026.03.1 writes it
|
|
435
496
|
* (`Chem.MolToSmiles(Chem.MolFromSmiles(s))` for a molecule parsed
|
|
@@ -438,6 +499,15 @@ export class MolHandle {
|
|
|
438
499
|
* rejects; `canonical_smiles` is unchanged.
|
|
439
500
|
*/
|
|
440
501
|
rdkit_smiles(): string;
|
|
502
|
+
/**
|
|
503
|
+
* Number of default RDKit stereoisomers as a decimal string (u128-safe).
|
|
504
|
+
*/
|
|
505
|
+
rdkit_stereoisomer_count(): string;
|
|
506
|
+
/**
|
|
507
|
+
* Sorted RDKit stereoisomer SMILES JSON. `max_isomers` is required and
|
|
508
|
+
* must be between 1 and 4096 so browser work remains bounded.
|
|
509
|
+
*/
|
|
510
|
+
rdkit_stereoisomer_smiles_json(max_isomers: number): string;
|
|
441
511
|
/**
|
|
442
512
|
* Returns `true` if the molecule passes the REOS (Rapid Elimination Of Swill) filter.
|
|
443
513
|
*/
|
|
@@ -497,6 +567,30 @@ export class PreparedRdkitEcfp4Handle {
|
|
|
497
567
|
bitvec(): Uint8Array;
|
|
498
568
|
}
|
|
499
569
|
|
|
570
|
+
/**
|
|
571
|
+
* Result of an RDKit-compatible PDB, XYZ, or MOL2 reader.
|
|
572
|
+
*
|
|
573
|
+
* `coords_json()` is a JSON array with one `[x,y,z]` row per zero-based
|
|
574
|
+
* molecule atom. `smiles` is empty for XYZ and unsanitized readers.
|
|
575
|
+
*/
|
|
576
|
+
export class RdkitReadResult {
|
|
577
|
+
private constructor();
|
|
578
|
+
free(): void;
|
|
579
|
+
[Symbol.dispose](): void;
|
|
580
|
+
/**
|
|
581
|
+
* Coordinates as JSON, in zero-based molecule atom order.
|
|
582
|
+
*/
|
|
583
|
+
coords_json(): string;
|
|
584
|
+
/**
|
|
585
|
+
* A cloned handle to the parsed molecule.
|
|
586
|
+
*/
|
|
587
|
+
molecule(): MolHandle;
|
|
588
|
+
/**
|
|
589
|
+
* RDKit canonical SMILES when the reader sanitized the molecule.
|
|
590
|
+
*/
|
|
591
|
+
readonly smiles: string;
|
|
592
|
+
}
|
|
593
|
+
|
|
500
594
|
/**
|
|
501
595
|
* Reusable prepared index for the RDKit-compatible Morgan profile.
|
|
502
596
|
*
|
|
@@ -831,12 +925,16 @@ export function conformer_ensemble_json(mol: MolHandle, n: number, rmsd_threshol
|
|
|
831
925
|
*
|
|
832
926
|
* This is the WASM counterpart of Python's `convert_format`. It supports
|
|
833
927
|
* SMILES, MOL/SDF, MOL V3000, MOL2, CML, ChemicalJSON, MolJSON, and CDXML.
|
|
834
|
-
*
|
|
835
|
-
*
|
|
836
|
-
* when those fields must be preserved.
|
|
928
|
+
* MOL2-to-MOL2 validates and retains the exact source. Other conversions use
|
|
929
|
+
* the topology-only bridge and do not carry format-specific metadata.
|
|
837
930
|
*/
|
|
838
931
|
export function convert_common_format(text: string, input_format: string, output_format: string): string;
|
|
839
932
|
|
|
933
|
+
/**
|
|
934
|
+
* Checked MOL2/CJSON conversion using the shared report schema.
|
|
935
|
+
*/
|
|
936
|
+
export function convert_with_report_json(text: string, input_format: string, output_format: string, policy: string): string;
|
|
937
|
+
|
|
840
938
|
/**
|
|
841
939
|
* Return the CPK color (CSS hex string) for the given element symbol.
|
|
842
940
|
*
|
|
@@ -1647,6 +1745,14 @@ export function mmcif_coords_json(text: string): string;
|
|
|
1647
1745
|
*/
|
|
1648
1746
|
export function mmcif_to_json(text: string): string;
|
|
1649
1747
|
|
|
1748
|
+
/**
|
|
1749
|
+
* Checked legacy MMFF94 charges.
|
|
1750
|
+
*
|
|
1751
|
+
* Returns `{"charges":[...]}` or a typed `{"error":"unsupported_element",...}`
|
|
1752
|
+
* object instead of silently returning zeros for an unparameterized atom.
|
|
1753
|
+
*/
|
|
1754
|
+
export function mmff94_charges_checked_json(mol: MolHandle): string;
|
|
1755
|
+
|
|
1650
1756
|
/**
|
|
1651
1757
|
* MMFF94 partial charges (BCI table, ±0.1e accuracy) as a JSON array of f64.
|
|
1652
1758
|
*
|
|
@@ -2117,6 +2223,11 @@ export function orca_output_to_json(text: string): string;
|
|
|
2117
2223
|
*/
|
|
2118
2224
|
export function pains_matches_json(mol: MolHandle): string;
|
|
2119
2225
|
|
|
2226
|
+
/**
|
|
2227
|
+
* Inspect strictly validated CJSON with exact source and opaque field paths.
|
|
2228
|
+
*/
|
|
2229
|
+
export function parse_cjson_record_json(text: string): string;
|
|
2230
|
+
|
|
2120
2231
|
/**
|
|
2121
2232
|
* Parse CXSMARTS and return preserved metadata as JSON.
|
|
2122
2233
|
* Returns error if atom count exceeds 10,000.
|
|
@@ -2133,6 +2244,11 @@ export function parse_cxsmarts_json(s: string): string;
|
|
|
2133
2244
|
*/
|
|
2134
2245
|
export function parse_cxsmiles_json(s: string): string;
|
|
2135
2246
|
|
|
2247
|
+
/**
|
|
2248
|
+
* Inspect partial charges, atom types and source retention for MOL2.
|
|
2249
|
+
*/
|
|
2250
|
+
export function parse_mol2_record_json(text: string): string;
|
|
2251
|
+
|
|
2136
2252
|
/**
|
|
2137
2253
|
* Parse a SMILES string into a `MolHandle`.
|
|
2138
2254
|
*
|
|
@@ -2359,6 +2475,21 @@ export function rdkit_ecfp_config_chiral_detail_json(mol: MolHandle, radius: num
|
|
|
2359
2475
|
*/
|
|
2360
2476
|
export function rdkit_ecfp_config_detail_json(mol: MolHandle, radius: number, nbits: number): string;
|
|
2361
2477
|
|
|
2478
|
+
/**
|
|
2479
|
+
* RDKit-compatible `MolFromMol2Block` with molecule and coordinates.
|
|
2480
|
+
*/
|
|
2481
|
+
export function rdkit_from_mol2_block(text: string, sanitize: boolean, remove_hs: boolean, cleanup_substructures: boolean): RdkitReadResult;
|
|
2482
|
+
|
|
2483
|
+
/**
|
|
2484
|
+
* RDKit-compatible `MolFromPDBBlock` with molecule and coordinates.
|
|
2485
|
+
*/
|
|
2486
|
+
export function rdkit_from_pdb_block(text: string, sanitize: boolean, remove_hs: boolean, flavor: number, proximity_bonding: boolean): RdkitReadResult;
|
|
2487
|
+
|
|
2488
|
+
/**
|
|
2489
|
+
* RDKit-compatible `MolFromXYZBlock`; the molecule has atoms but no bonds.
|
|
2490
|
+
*/
|
|
2491
|
+
export function rdkit_from_xyz_block(text: string): RdkitReadResult;
|
|
2492
|
+
|
|
2362
2493
|
/**
|
|
2363
2494
|
* Find the k nearest neighbours using the RDKit-compatible Morgan/ECFP4
|
|
2364
2495
|
* profile. This is intentionally separate from [`nearest_neighbors_json`],
|
|
@@ -2448,6 +2579,18 @@ export function remove_hydrogens(mol: MolHandle): MolHandle;
|
|
|
2448
2579
|
*/
|
|
2449
2580
|
export function retro_disconnect_json(mol: MolHandle, max_results: number, reaction_class: string): string;
|
|
2450
2581
|
|
|
2582
|
+
/**
|
|
2583
|
+
* Label-stable R-group decomposition returned as RDKit-style table columns.
|
|
2584
|
+
*
|
|
2585
|
+
* `core_smarts` accepts the bounded mapped-core contract used by Rust and
|
|
2586
|
+
* Python: terminal mapped wildcards such as `[*:2]`, or mapped core atoms.
|
|
2587
|
+
* The returned JSON object contains `Core`, `R1`, `R2`, ... arrays parallel
|
|
2588
|
+
* to the input rows. Unmatched rows and absent substituents are `null`.
|
|
2589
|
+
* Output fragments retain their mapped attachment wildcard. The legacy
|
|
2590
|
+
* [`super::rgroup_decompose_json`] function is unchanged.
|
|
2591
|
+
*/
|
|
2592
|
+
export function rgroup_decompose_columns_json(smiles_json: string, core_smarts: string): string;
|
|
2593
|
+
|
|
2451
2594
|
/**
|
|
2452
2595
|
* Decompose a set of molecules against a core SMARTS, returning R-group SMILES.
|
|
2453
2596
|
*
|
|
@@ -2477,6 +2620,16 @@ export function rgroup_decompose_json(smiles_json: string, core_smarts: string):
|
|
|
2477
2620
|
*/
|
|
2478
2621
|
export function ring_families_json(mol: MolHandle): string;
|
|
2479
2622
|
|
|
2623
|
+
/**
|
|
2624
|
+
* Validate the local CJSON profile and retain the exact UTF-8 source.
|
|
2625
|
+
*/
|
|
2626
|
+
export function roundtrip_cjson_record(text: string): string;
|
|
2627
|
+
|
|
2628
|
+
/**
|
|
2629
|
+
* Validate one MOL2 record and preserve its exact source, including metadata.
|
|
2630
|
+
*/
|
|
2631
|
+
export function roundtrip_mol2_record(text: string): string;
|
|
2632
|
+
|
|
2480
2633
|
/**
|
|
2481
2634
|
* Parse and serialize a V3000 block while preserving V3000 metadata.
|
|
2482
2635
|
*
|
|
@@ -3087,6 +3240,7 @@ export interface InitOutput {
|
|
|
3087
3240
|
readonly __wbg_mhfplshhandle_free: (a: number, b: number) => void;
|
|
3088
3241
|
readonly __wbg_molhandle_free: (a: number, b: number) => void;
|
|
3089
3242
|
readonly __wbg_preparedrdkitecfp4handle_free: (a: number, b: number) => void;
|
|
3243
|
+
readonly __wbg_rdkitreadresult_free: (a: number, b: number) => void;
|
|
3090
3244
|
readonly __wbg_rdkitsearchindex_free: (a: number, b: number) => void;
|
|
3091
3245
|
readonly __wbg_smilesbatchstreamhandle_free: (a: number, b: number) => void;
|
|
3092
3246
|
readonly add_hydrogens: (a: number) => number;
|
|
@@ -3127,6 +3281,7 @@ export interface InitOutput {
|
|
|
3127
3281
|
readonly conformerhandle_new: (a: number, b: number) => [number, number, number];
|
|
3128
3282
|
readonly conformerhandle_remove_conformer: (a: number, b: number) => number;
|
|
3129
3283
|
readonly convert_common_format: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
|
|
3284
|
+
readonly convert_with_report_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
|
|
3130
3285
|
readonly cpk_color: (a: number, b: number) => [number, number];
|
|
3131
3286
|
readonly cube_grid_json: (a: number, b: number) => [number, number, number, number];
|
|
3132
3287
|
readonly cube_shape_u32: (a: number, b: number) => [number, number, number];
|
|
@@ -3226,6 +3381,7 @@ export interface InitOutput {
|
|
|
3226
3381
|
readonly minimize_uff_json: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
3227
3382
|
readonly mmcif_coords_json: (a: number, b: number) => [number, number, number, number];
|
|
3228
3383
|
readonly mmcif_to_json: (a: number, b: number) => [number, number, number, number];
|
|
3384
|
+
readonly mmff94_charges_checked_json: (a: number) => [number, number];
|
|
3229
3385
|
readonly mmff94_charges_json: (a: number) => [number, number];
|
|
3230
3386
|
readonly mmff94_charges_typed_json: (a: number) => [number, number];
|
|
3231
3387
|
readonly mmff94_energy_breakdown_from_coords_json: (a: number, b: number, c: number) => [number, number];
|
|
@@ -3318,6 +3474,7 @@ export interface InitOutput {
|
|
|
3318
3474
|
readonly molhandle_num_aromatic_heterocycles: (a: number) => number;
|
|
3319
3475
|
readonly molhandle_num_bridgehead_atoms: (a: number) => number;
|
|
3320
3476
|
readonly molhandle_num_heteroatoms: (a: number) => number;
|
|
3477
|
+
readonly molhandle_num_rings: (a: number) => number;
|
|
3321
3478
|
readonly molhandle_num_saturated_heterocycles: (a: number) => number;
|
|
3322
3479
|
readonly molhandle_num_saturated_rings: (a: number) => number;
|
|
3323
3480
|
readonly molhandle_num_spiro_atoms: (a: number) => number;
|
|
@@ -3329,7 +3486,22 @@ export interface InitOutput {
|
|
|
3329
3486
|
readonly molhandle_potential_stereocenter_indices: (a: number) => [number, number];
|
|
3330
3487
|
readonly molhandle_qed: (a: number) => number;
|
|
3331
3488
|
readonly molhandle_randic_index: (a: number) => number;
|
|
3489
|
+
readonly molhandle_rdkit_align_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number, number, number];
|
|
3490
|
+
readonly molhandle_rdkit_best_alignment_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number, number];
|
|
3491
|
+
readonly molhandle_rdkit_best_rms: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
|
|
3492
|
+
readonly molhandle_rdkit_bounds_matrix_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
3493
|
+
readonly molhandle_rdkit_calc_rms: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
|
|
3494
|
+
readonly molhandle_rdkit_chiral_centers_json: (a: number, b: number) => [number, number, number, number];
|
|
3495
|
+
readonly molhandle_rdkit_cx_smarts: (a: number) => [number, number, number, number];
|
|
3496
|
+
readonly molhandle_rdkit_embed_json: (a: number, b: number, c: number) => [number, number, number, number];
|
|
3497
|
+
readonly molhandle_rdkit_mol_hash: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
3498
|
+
readonly molhandle_rdkit_morgan_bit_info_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
3499
|
+
readonly molhandle_rdkit_murcko_scaffold: (a: number) => [number, number, number, number];
|
|
3500
|
+
readonly molhandle_rdkit_pdb_block: (a: number, b: number, c: number) => [number, number, number, number];
|
|
3501
|
+
readonly molhandle_rdkit_smarts: (a: number, b: number, c: number) => [number, number, number, number];
|
|
3332
3502
|
readonly molhandle_rdkit_smiles: (a: number) => [number, number, number, number];
|
|
3503
|
+
readonly molhandle_rdkit_stereoisomer_count: (a: number) => [number, number, number, number];
|
|
3504
|
+
readonly molhandle_rdkit_stereoisomer_smiles_json: (a: number, b: number) => [number, number, number, number];
|
|
3333
3505
|
readonly molhandle_reos_passes: (a: number) => number;
|
|
3334
3506
|
readonly molhandle_ring_count: (a: number) => number;
|
|
3335
3507
|
readonly molhandle_rotatable_bond_count: (a: number) => number;
|
|
@@ -3356,8 +3528,10 @@ export interface InitOutput {
|
|
|
3356
3528
|
readonly orca_input_to_json: (a: number, b: number) => [number, number, number, number];
|
|
3357
3529
|
readonly orca_output_to_json: (a: number, b: number) => [number, number, number, number];
|
|
3358
3530
|
readonly pains_matches_json: (a: number) => [number, number];
|
|
3531
|
+
readonly parse_cjson_record_json: (a: number, b: number) => [number, number, number, number];
|
|
3359
3532
|
readonly parse_cxsmarts_json: (a: number, b: number) => [number, number, number, number];
|
|
3360
3533
|
readonly parse_cxsmiles_json: (a: number, b: number) => [number, number, number, number];
|
|
3534
|
+
readonly parse_mol2_record_json: (a: number, b: number) => [number, number, number, number];
|
|
3361
3535
|
readonly parse_smiles: (a: number, b: number) => [number, number, number];
|
|
3362
3536
|
readonly pdb_coords_json: (a: number, b: number) => [number, number];
|
|
3363
3537
|
readonly peoe_vsa_json: (a: number) => [number, number];
|
|
@@ -3383,10 +3557,16 @@ export interface InitOutput {
|
|
|
3383
3557
|
readonly rdkit_ecfp_config_chiral_bitvec: (a: number, b: number, c: number) => [number, number, number, number];
|
|
3384
3558
|
readonly rdkit_ecfp_config_chiral_detail_json: (a: number, b: number, c: number) => [number, number, number, number];
|
|
3385
3559
|
readonly rdkit_ecfp_config_detail_json: (a: number, b: number, c: number) => [number, number, number, number];
|
|
3560
|
+
readonly rdkit_from_mol2_block: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
3561
|
+
readonly rdkit_from_pdb_block: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
3562
|
+
readonly rdkit_from_xyz_block: (a: number, b: number) => [number, number, number];
|
|
3386
3563
|
readonly rdkit_nearest_neighbors_json: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
3387
3564
|
readonly rdkit_path_bitvec: (a: number) => [number, number];
|
|
3388
3565
|
readonly rdkit_rdk_bitvec: (a: number) => [number, number];
|
|
3389
3566
|
readonly rdkit_torsion_bitvec: (a: number) => [number, number];
|
|
3567
|
+
readonly rdkitreadresult_coords_json: (a: number) => [number, number, number, number];
|
|
3568
|
+
readonly rdkitreadresult_molecule: (a: number) => number;
|
|
3569
|
+
readonly rdkitreadresult_smiles: (a: number) => [number, number];
|
|
3390
3570
|
readonly rdkitsearchindex_is_empty: (a: number) => number;
|
|
3391
3571
|
readonly rdkitsearchindex_len: (a: number) => number;
|
|
3392
3572
|
readonly rdkitsearchindex_new: (a: number, b: number) => [number, number, number];
|
|
@@ -3398,8 +3578,11 @@ export interface InitOutput {
|
|
|
3398
3578
|
readonly reaction_smarts_match: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
3399
3579
|
readonly remove_hydrogens: (a: number) => number;
|
|
3400
3580
|
readonly retro_disconnect_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
3581
|
+
readonly rgroup_decompose_columns_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
3401
3582
|
readonly rgroup_decompose_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
3402
3583
|
readonly ring_families_json: (a: number) => [number, number, number, number];
|
|
3584
|
+
readonly roundtrip_cjson_record: (a: number, b: number) => [number, number, number, number];
|
|
3585
|
+
readonly roundtrip_mol2_record: (a: number, b: number) => [number, number, number, number];
|
|
3403
3586
|
readonly roundtrip_mol_v3000_block: (a: number, b: number) => [number, number, number, number];
|
|
3404
3587
|
readonly run_reactants: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
3405
3588
|
readonly run_reactants_checked: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
package/chematic_wasm.js
CHANGED
|
@@ -916,6 +916,14 @@ export class MolHandle {
|
|
|
916
916
|
const ret = wasm.molhandle_num_heteroatoms(this.__wbg_ptr);
|
|
917
917
|
return ret >>> 0;
|
|
918
918
|
}
|
|
919
|
+
/**
|
|
920
|
+
* Number of rings using RDKit's symmetrized-SSSR semantics.
|
|
921
|
+
* @returns {number}
|
|
922
|
+
*/
|
|
923
|
+
num_rings() {
|
|
924
|
+
const ret = wasm.molhandle_num_rings(this.__wbg_ptr);
|
|
925
|
+
return ret >>> 0;
|
|
926
|
+
}
|
|
919
927
|
/**
|
|
920
928
|
* Number of fully saturated rings containing at least one heteroatom.
|
|
921
929
|
* @returns {number}
|
|
@@ -1008,6 +1016,340 @@ export class MolHandle {
|
|
|
1008
1016
|
const ret = wasm.molhandle_randic_index(this.__wbg_ptr);
|
|
1009
1017
|
return ret;
|
|
1010
1018
|
}
|
|
1019
|
+
/**
|
|
1020
|
+
* RDKit `AlignMol` result JSON. Coordinates and optional atom map and
|
|
1021
|
+
* weights use zero-based molecule atom order.
|
|
1022
|
+
* @param {string} probe_coords_json
|
|
1023
|
+
* @param {string} reference_coords_json
|
|
1024
|
+
* @param {string | null | undefined} atom_map_json
|
|
1025
|
+
* @param {string | null | undefined} weights_json
|
|
1026
|
+
* @param {boolean} reflect
|
|
1027
|
+
* @param {number} max_iterations
|
|
1028
|
+
* @returns {string}
|
|
1029
|
+
*/
|
|
1030
|
+
rdkit_align_json(probe_coords_json, reference_coords_json, atom_map_json, weights_json, reflect, max_iterations) {
|
|
1031
|
+
let deferred6_0;
|
|
1032
|
+
let deferred6_1;
|
|
1033
|
+
try {
|
|
1034
|
+
const ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1035
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1036
|
+
const ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1037
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1038
|
+
var ptr2 = isLikeNone(atom_map_json) ? 0 : passStringToWasm0(atom_map_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1039
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1040
|
+
var ptr3 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1041
|
+
var len3 = WASM_VECTOR_LEN;
|
|
1042
|
+
const ret = wasm.molhandle_rdkit_align_json(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, reflect, max_iterations);
|
|
1043
|
+
var ptr5 = ret[0];
|
|
1044
|
+
var len5 = ret[1];
|
|
1045
|
+
if (ret[3]) {
|
|
1046
|
+
ptr5 = 0; len5 = 0;
|
|
1047
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1048
|
+
}
|
|
1049
|
+
deferred6_0 = ptr5;
|
|
1050
|
+
deferred6_1 = len5;
|
|
1051
|
+
return getStringFromWasm0(ptr5, len5);
|
|
1052
|
+
} finally {
|
|
1053
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
/**
|
|
1057
|
+
* RDKit `GetBestAlignmentTransform` as JSON, bounded by `max_matches`.
|
|
1058
|
+
* @param {string} probe_coords_json
|
|
1059
|
+
* @param {string} reference_coords_json
|
|
1060
|
+
* @param {number} max_matches
|
|
1061
|
+
* @param {boolean} symmetrize
|
|
1062
|
+
* @param {string | null} [weights_json]
|
|
1063
|
+
* @returns {string}
|
|
1064
|
+
*/
|
|
1065
|
+
rdkit_best_alignment_json(probe_coords_json, reference_coords_json, max_matches, symmetrize, weights_json) {
|
|
1066
|
+
let deferred5_0;
|
|
1067
|
+
let deferred5_1;
|
|
1068
|
+
try {
|
|
1069
|
+
const ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1070
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1071
|
+
const ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1072
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1073
|
+
var ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1074
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1075
|
+
const ret = wasm.molhandle_rdkit_best_alignment_json(this.__wbg_ptr, ptr0, len0, ptr1, len1, max_matches, symmetrize, ptr2, len2);
|
|
1076
|
+
var ptr4 = ret[0];
|
|
1077
|
+
var len4 = ret[1];
|
|
1078
|
+
if (ret[3]) {
|
|
1079
|
+
ptr4 = 0; len4 = 0;
|
|
1080
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1081
|
+
}
|
|
1082
|
+
deferred5_0 = ptr4;
|
|
1083
|
+
deferred5_1 = len4;
|
|
1084
|
+
return getStringFromWasm0(ptr4, len4);
|
|
1085
|
+
} finally {
|
|
1086
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* RDKit `GetBestRMS`, bounded by `max_matches <= 1_000_000`.
|
|
1091
|
+
* @param {string} probe_coords_json
|
|
1092
|
+
* @param {string} reference_coords_json
|
|
1093
|
+
* @param {number} max_matches
|
|
1094
|
+
* @param {boolean} symmetrize
|
|
1095
|
+
* @param {string | null} [weights_json]
|
|
1096
|
+
* @returns {number}
|
|
1097
|
+
*/
|
|
1098
|
+
rdkit_best_rms(probe_coords_json, reference_coords_json, max_matches, symmetrize, weights_json) {
|
|
1099
|
+
const ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1100
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1101
|
+
const ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1102
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1103
|
+
var ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1104
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1105
|
+
const ret = wasm.molhandle_rdkit_best_rms(this.__wbg_ptr, ptr0, len0, ptr1, len1, max_matches, symmetrize, ptr2, len2);
|
|
1106
|
+
if (ret[2]) {
|
|
1107
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1108
|
+
}
|
|
1109
|
+
return ret[0];
|
|
1110
|
+
}
|
|
1111
|
+
/**
|
|
1112
|
+
* RDKit distance-geometry bounds matrix JSON. Row and column `i`
|
|
1113
|
+
* refer to zero-based molecule atom `i`; upper bounds are above the
|
|
1114
|
+
* diagonal and lower bounds below it. At most 512 atoms are accepted.
|
|
1115
|
+
* @param {boolean} set15bounds
|
|
1116
|
+
* @param {boolean} do_triangle_smoothing
|
|
1117
|
+
* @param {boolean} use_macrocycle_14_config
|
|
1118
|
+
* @returns {string}
|
|
1119
|
+
*/
|
|
1120
|
+
rdkit_bounds_matrix_json(set15bounds, do_triangle_smoothing, use_macrocycle_14_config) {
|
|
1121
|
+
let deferred2_0;
|
|
1122
|
+
let deferred2_1;
|
|
1123
|
+
try {
|
|
1124
|
+
const ret = wasm.molhandle_rdkit_bounds_matrix_json(this.__wbg_ptr, set15bounds, do_triangle_smoothing, use_macrocycle_14_config);
|
|
1125
|
+
var ptr1 = ret[0];
|
|
1126
|
+
var len1 = ret[1];
|
|
1127
|
+
if (ret[3]) {
|
|
1128
|
+
ptr1 = 0; len1 = 0;
|
|
1129
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1130
|
+
}
|
|
1131
|
+
deferred2_0 = ptr1;
|
|
1132
|
+
deferred2_1 = len1;
|
|
1133
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1134
|
+
} finally {
|
|
1135
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
/**
|
|
1139
|
+
* RDKit `CalcRMS`, bounded by `max_matches <= 1_000_000`.
|
|
1140
|
+
* @param {string} probe_coords_json
|
|
1141
|
+
* @param {string} reference_coords_json
|
|
1142
|
+
* @param {number} max_matches
|
|
1143
|
+
* @param {boolean} symmetrize
|
|
1144
|
+
* @param {string | null} [weights_json]
|
|
1145
|
+
* @returns {number}
|
|
1146
|
+
*/
|
|
1147
|
+
rdkit_calc_rms(probe_coords_json, reference_coords_json, max_matches, symmetrize, weights_json) {
|
|
1148
|
+
const ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1149
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1150
|
+
const ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1151
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1152
|
+
var ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1153
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1154
|
+
const ret = wasm.molhandle_rdkit_calc_rms(this.__wbg_ptr, ptr0, len0, ptr1, len1, max_matches, symmetrize, ptr2, len2);
|
|
1155
|
+
if (ret[2]) {
|
|
1156
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1157
|
+
}
|
|
1158
|
+
return ret[0];
|
|
1159
|
+
}
|
|
1160
|
+
/**
|
|
1161
|
+
* Chiral centres as `[[atomIndex,"R"|"S"|"?"], ...]` JSON.
|
|
1162
|
+
* @param {boolean} include_unassigned
|
|
1163
|
+
* @returns {string}
|
|
1164
|
+
*/
|
|
1165
|
+
rdkit_chiral_centers_json(include_unassigned) {
|
|
1166
|
+
let deferred2_0;
|
|
1167
|
+
let deferred2_1;
|
|
1168
|
+
try {
|
|
1169
|
+
const ret = wasm.molhandle_rdkit_chiral_centers_json(this.__wbg_ptr, include_unassigned);
|
|
1170
|
+
var ptr1 = ret[0];
|
|
1171
|
+
var len1 = ret[1];
|
|
1172
|
+
if (ret[3]) {
|
|
1173
|
+
ptr1 = 0; len1 = 0;
|
|
1174
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1175
|
+
}
|
|
1176
|
+
deferred2_0 = ptr1;
|
|
1177
|
+
deferred2_1 = len1;
|
|
1178
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1179
|
+
} finally {
|
|
1180
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
/**
|
|
1184
|
+
* RDKit-compatible CXSMARTS.
|
|
1185
|
+
* @returns {string}
|
|
1186
|
+
*/
|
|
1187
|
+
rdkit_cx_smarts() {
|
|
1188
|
+
let deferred2_0;
|
|
1189
|
+
let deferred2_1;
|
|
1190
|
+
try {
|
|
1191
|
+
const ret = wasm.molhandle_rdkit_cx_smarts(this.__wbg_ptr);
|
|
1192
|
+
var ptr1 = ret[0];
|
|
1193
|
+
var len1 = ret[1];
|
|
1194
|
+
if (ret[3]) {
|
|
1195
|
+
ptr1 = 0; len1 = 0;
|
|
1196
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1197
|
+
}
|
|
1198
|
+
deferred2_0 = ptr1;
|
|
1199
|
+
deferred2_1 = len1;
|
|
1200
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1201
|
+
} finally {
|
|
1202
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
/**
|
|
1206
|
+
* Seeded RDKit ETKDGv3 coordinates as JSON. Call on an
|
|
1207
|
+
* explicit-hydrogen molecule. At most 512 atoms are accepted.
|
|
1208
|
+
* @param {number} random_seed
|
|
1209
|
+
* @param {number} max_iterations
|
|
1210
|
+
* @returns {string}
|
|
1211
|
+
*/
|
|
1212
|
+
rdkit_embed_json(random_seed, max_iterations) {
|
|
1213
|
+
let deferred2_0;
|
|
1214
|
+
let deferred2_1;
|
|
1215
|
+
try {
|
|
1216
|
+
const ret = wasm.molhandle_rdkit_embed_json(this.__wbg_ptr, random_seed, max_iterations);
|
|
1217
|
+
var ptr1 = ret[0];
|
|
1218
|
+
var len1 = ret[1];
|
|
1219
|
+
if (ret[3]) {
|
|
1220
|
+
ptr1 = 0; len1 = 0;
|
|
1221
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1222
|
+
}
|
|
1223
|
+
deferred2_0 = ptr1;
|
|
1224
|
+
deferred2_1 = len1;
|
|
1225
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1226
|
+
} finally {
|
|
1227
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
/**
|
|
1231
|
+
* RDKit MolHash by case-insensitive function name.
|
|
1232
|
+
* @param {string} _function
|
|
1233
|
+
* @param {boolean} use_cx_smiles
|
|
1234
|
+
* @returns {string}
|
|
1235
|
+
*/
|
|
1236
|
+
rdkit_mol_hash(_function, use_cx_smiles) {
|
|
1237
|
+
let deferred3_0;
|
|
1238
|
+
let deferred3_1;
|
|
1239
|
+
try {
|
|
1240
|
+
const ptr0 = passStringToWasm0(_function, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1241
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1242
|
+
const ret = wasm.molhandle_rdkit_mol_hash(this.__wbg_ptr, ptr0, len0, use_cx_smiles);
|
|
1243
|
+
var ptr2 = ret[0];
|
|
1244
|
+
var len2 = ret[1];
|
|
1245
|
+
if (ret[3]) {
|
|
1246
|
+
ptr2 = 0; len2 = 0;
|
|
1247
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1248
|
+
}
|
|
1249
|
+
deferred3_0 = ptr2;
|
|
1250
|
+
deferred3_1 = len2;
|
|
1251
|
+
return getStringFromWasm0(ptr2, len2);
|
|
1252
|
+
} finally {
|
|
1253
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
/**
|
|
1257
|
+
* RDKit Morgan folded bitInfo as `{bit:[[atomIndex,radius],...]}` JSON.
|
|
1258
|
+
* @param {number} radius
|
|
1259
|
+
* @param {number} n_bits
|
|
1260
|
+
* @param {boolean} include_chirality
|
|
1261
|
+
* @returns {string}
|
|
1262
|
+
*/
|
|
1263
|
+
rdkit_morgan_bit_info_json(radius, n_bits, include_chirality) {
|
|
1264
|
+
let deferred2_0;
|
|
1265
|
+
let deferred2_1;
|
|
1266
|
+
try {
|
|
1267
|
+
const ret = wasm.molhandle_rdkit_morgan_bit_info_json(this.__wbg_ptr, radius, n_bits, include_chirality);
|
|
1268
|
+
var ptr1 = ret[0];
|
|
1269
|
+
var len1 = ret[1];
|
|
1270
|
+
if (ret[3]) {
|
|
1271
|
+
ptr1 = 0; len1 = 0;
|
|
1272
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1273
|
+
}
|
|
1274
|
+
deferred2_0 = ptr1;
|
|
1275
|
+
deferred2_1 = len1;
|
|
1276
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1277
|
+
} finally {
|
|
1278
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
/**
|
|
1282
|
+
* RDKit-compatible Murcko scaffold SMILES.
|
|
1283
|
+
* @returns {string}
|
|
1284
|
+
*/
|
|
1285
|
+
rdkit_murcko_scaffold() {
|
|
1286
|
+
let deferred2_0;
|
|
1287
|
+
let deferred2_1;
|
|
1288
|
+
try {
|
|
1289
|
+
const ret = wasm.molhandle_rdkit_murcko_scaffold(this.__wbg_ptr);
|
|
1290
|
+
var ptr1 = ret[0];
|
|
1291
|
+
var len1 = ret[1];
|
|
1292
|
+
if (ret[3]) {
|
|
1293
|
+
ptr1 = 0; len1 = 0;
|
|
1294
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1295
|
+
}
|
|
1296
|
+
deferred2_0 = ptr1;
|
|
1297
|
+
deferred2_1 = len1;
|
|
1298
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1299
|
+
} finally {
|
|
1300
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
/**
|
|
1304
|
+
* RDKit-compatible PDB block. Optional coordinates are a JSON array in
|
|
1305
|
+
* zero-based molecule atom order; omit them to write zero coordinates.
|
|
1306
|
+
* @param {string | null} [coords_json]
|
|
1307
|
+
* @returns {string}
|
|
1308
|
+
*/
|
|
1309
|
+
rdkit_pdb_block(coords_json) {
|
|
1310
|
+
let deferred3_0;
|
|
1311
|
+
let deferred3_1;
|
|
1312
|
+
try {
|
|
1313
|
+
var ptr0 = isLikeNone(coords_json) ? 0 : passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1314
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1315
|
+
const ret = wasm.molhandle_rdkit_pdb_block(this.__wbg_ptr, ptr0, len0);
|
|
1316
|
+
var ptr2 = ret[0];
|
|
1317
|
+
var len2 = ret[1];
|
|
1318
|
+
if (ret[3]) {
|
|
1319
|
+
ptr2 = 0; len2 = 0;
|
|
1320
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1321
|
+
}
|
|
1322
|
+
deferred3_0 = ptr2;
|
|
1323
|
+
deferred3_1 = len2;
|
|
1324
|
+
return getStringFromWasm0(ptr2, len2);
|
|
1325
|
+
} finally {
|
|
1326
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
/**
|
|
1330
|
+
* RDKit-compatible SMARTS in input atom order.
|
|
1331
|
+
* @param {boolean} isomeric
|
|
1332
|
+
* @param {number | null} [rooted_at_atom]
|
|
1333
|
+
* @returns {string}
|
|
1334
|
+
*/
|
|
1335
|
+
rdkit_smarts(isomeric, rooted_at_atom) {
|
|
1336
|
+
let deferred2_0;
|
|
1337
|
+
let deferred2_1;
|
|
1338
|
+
try {
|
|
1339
|
+
const ret = wasm.molhandle_rdkit_smarts(this.__wbg_ptr, isomeric, isLikeNone(rooted_at_atom) ? Number.MAX_SAFE_INTEGER : (rooted_at_atom) >>> 0);
|
|
1340
|
+
var ptr1 = ret[0];
|
|
1341
|
+
var len1 = ret[1];
|
|
1342
|
+
if (ret[3]) {
|
|
1343
|
+
ptr1 = 0; len1 = 0;
|
|
1344
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1345
|
+
}
|
|
1346
|
+
deferred2_0 = ptr1;
|
|
1347
|
+
deferred2_1 = len1;
|
|
1348
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1349
|
+
} finally {
|
|
1350
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1011
1353
|
/**
|
|
1012
1354
|
* Canonical SMILES exactly as RDKit 2026.03.1 writes it
|
|
1013
1355
|
* (`Chem.MolToSmiles(Chem.MolFromSmiles(s))` for a molecule parsed
|
|
@@ -1034,6 +1376,52 @@ export class MolHandle {
|
|
|
1034
1376
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1035
1377
|
}
|
|
1036
1378
|
}
|
|
1379
|
+
/**
|
|
1380
|
+
* Number of default RDKit stereoisomers as a decimal string (u128-safe).
|
|
1381
|
+
* @returns {string}
|
|
1382
|
+
*/
|
|
1383
|
+
rdkit_stereoisomer_count() {
|
|
1384
|
+
let deferred2_0;
|
|
1385
|
+
let deferred2_1;
|
|
1386
|
+
try {
|
|
1387
|
+
const ret = wasm.molhandle_rdkit_stereoisomer_count(this.__wbg_ptr);
|
|
1388
|
+
var ptr1 = ret[0];
|
|
1389
|
+
var len1 = ret[1];
|
|
1390
|
+
if (ret[3]) {
|
|
1391
|
+
ptr1 = 0; len1 = 0;
|
|
1392
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1393
|
+
}
|
|
1394
|
+
deferred2_0 = ptr1;
|
|
1395
|
+
deferred2_1 = len1;
|
|
1396
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1397
|
+
} finally {
|
|
1398
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
/**
|
|
1402
|
+
* Sorted RDKit stereoisomer SMILES JSON. `max_isomers` is required and
|
|
1403
|
+
* must be between 1 and 4096 so browser work remains bounded.
|
|
1404
|
+
* @param {number} max_isomers
|
|
1405
|
+
* @returns {string}
|
|
1406
|
+
*/
|
|
1407
|
+
rdkit_stereoisomer_smiles_json(max_isomers) {
|
|
1408
|
+
let deferred2_0;
|
|
1409
|
+
let deferred2_1;
|
|
1410
|
+
try {
|
|
1411
|
+
const ret = wasm.molhandle_rdkit_stereoisomer_smiles_json(this.__wbg_ptr, max_isomers);
|
|
1412
|
+
var ptr1 = ret[0];
|
|
1413
|
+
var len1 = ret[1];
|
|
1414
|
+
if (ret[3]) {
|
|
1415
|
+
ptr1 = 0; len1 = 0;
|
|
1416
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1417
|
+
}
|
|
1418
|
+
deferred2_0 = ptr1;
|
|
1419
|
+
deferred2_1 = len1;
|
|
1420
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1421
|
+
} finally {
|
|
1422
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1037
1425
|
/**
|
|
1038
1426
|
* Returns `true` if the molecule passes the REOS (Rapid Elimination Of Swill) filter.
|
|
1039
1427
|
* @returns {boolean}
|
|
@@ -1170,6 +1558,78 @@ export class PreparedRdkitEcfp4Handle {
|
|
|
1170
1558
|
}
|
|
1171
1559
|
if (Symbol.dispose) PreparedRdkitEcfp4Handle.prototype[Symbol.dispose] = PreparedRdkitEcfp4Handle.prototype.free;
|
|
1172
1560
|
|
|
1561
|
+
/**
|
|
1562
|
+
* Result of an RDKit-compatible PDB, XYZ, or MOL2 reader.
|
|
1563
|
+
*
|
|
1564
|
+
* `coords_json()` is a JSON array with one `[x,y,z]` row per zero-based
|
|
1565
|
+
* molecule atom. `smiles` is empty for XYZ and unsanitized readers.
|
|
1566
|
+
*/
|
|
1567
|
+
export class RdkitReadResult {
|
|
1568
|
+
static __wrap(ptr) {
|
|
1569
|
+
const obj = Object.create(RdkitReadResult.prototype);
|
|
1570
|
+
obj.__wbg_ptr = ptr;
|
|
1571
|
+
RdkitReadResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1572
|
+
return obj;
|
|
1573
|
+
}
|
|
1574
|
+
__destroy_into_raw() {
|
|
1575
|
+
const ptr = this.__wbg_ptr;
|
|
1576
|
+
this.__wbg_ptr = 0;
|
|
1577
|
+
RdkitReadResultFinalization.unregister(this);
|
|
1578
|
+
return ptr;
|
|
1579
|
+
}
|
|
1580
|
+
free() {
|
|
1581
|
+
const ptr = this.__destroy_into_raw();
|
|
1582
|
+
wasm.__wbg_rdkitreadresult_free(ptr, 0);
|
|
1583
|
+
}
|
|
1584
|
+
/**
|
|
1585
|
+
* Coordinates as JSON, in zero-based molecule atom order.
|
|
1586
|
+
* @returns {string}
|
|
1587
|
+
*/
|
|
1588
|
+
coords_json() {
|
|
1589
|
+
let deferred2_0;
|
|
1590
|
+
let deferred2_1;
|
|
1591
|
+
try {
|
|
1592
|
+
const ret = wasm.rdkitreadresult_coords_json(this.__wbg_ptr);
|
|
1593
|
+
var ptr1 = ret[0];
|
|
1594
|
+
var len1 = ret[1];
|
|
1595
|
+
if (ret[3]) {
|
|
1596
|
+
ptr1 = 0; len1 = 0;
|
|
1597
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1598
|
+
}
|
|
1599
|
+
deferred2_0 = ptr1;
|
|
1600
|
+
deferred2_1 = len1;
|
|
1601
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1602
|
+
} finally {
|
|
1603
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
/**
|
|
1607
|
+
* A cloned handle to the parsed molecule.
|
|
1608
|
+
* @returns {MolHandle}
|
|
1609
|
+
*/
|
|
1610
|
+
molecule() {
|
|
1611
|
+
const ret = wasm.rdkitreadresult_molecule(this.__wbg_ptr);
|
|
1612
|
+
return MolHandle.__wrap(ret);
|
|
1613
|
+
}
|
|
1614
|
+
/**
|
|
1615
|
+
* RDKit canonical SMILES when the reader sanitized the molecule.
|
|
1616
|
+
* @returns {string}
|
|
1617
|
+
*/
|
|
1618
|
+
get smiles() {
|
|
1619
|
+
let deferred1_0;
|
|
1620
|
+
let deferred1_1;
|
|
1621
|
+
try {
|
|
1622
|
+
const ret = wasm.rdkitreadresult_smiles(this.__wbg_ptr);
|
|
1623
|
+
deferred1_0 = ret[0];
|
|
1624
|
+
deferred1_1 = ret[1];
|
|
1625
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1626
|
+
} finally {
|
|
1627
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
if (Symbol.dispose) RdkitReadResult.prototype[Symbol.dispose] = RdkitReadResult.prototype.free;
|
|
1632
|
+
|
|
1173
1633
|
/**
|
|
1174
1634
|
* Reusable prepared index for the RDKit-compatible Morgan profile.
|
|
1175
1635
|
*
|
|
@@ -2090,9 +2550,8 @@ export function conformer_ensemble_json(mol, n, rmsd_threshold) {
|
|
|
2090
2550
|
*
|
|
2091
2551
|
* This is the WASM counterpart of Python's `convert_format`. It supports
|
|
2092
2552
|
* SMILES, MOL/SDF, MOL V3000, MOL2, CML, ChemicalJSON, MolJSON, and CDXML.
|
|
2093
|
-
*
|
|
2094
|
-
*
|
|
2095
|
-
* when those fields must be preserved.
|
|
2553
|
+
* MOL2-to-MOL2 validates and retains the exact source. Other conversions use
|
|
2554
|
+
* the topology-only bridge and do not carry format-specific metadata.
|
|
2096
2555
|
* @param {string} text
|
|
2097
2556
|
* @param {string} input_format
|
|
2098
2557
|
* @param {string} output_format
|
|
@@ -2123,6 +2582,41 @@ export function convert_common_format(text, input_format, output_format) {
|
|
|
2123
2582
|
}
|
|
2124
2583
|
}
|
|
2125
2584
|
|
|
2585
|
+
/**
|
|
2586
|
+
* Checked MOL2/CJSON conversion using the shared report schema.
|
|
2587
|
+
* @param {string} text
|
|
2588
|
+
* @param {string} input_format
|
|
2589
|
+
* @param {string} output_format
|
|
2590
|
+
* @param {string} policy
|
|
2591
|
+
* @returns {string}
|
|
2592
|
+
*/
|
|
2593
|
+
export function convert_with_report_json(text, input_format, output_format, policy) {
|
|
2594
|
+
let deferred6_0;
|
|
2595
|
+
let deferred6_1;
|
|
2596
|
+
try {
|
|
2597
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2598
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2599
|
+
const ptr1 = passStringToWasm0(input_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2600
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2601
|
+
const ptr2 = passStringToWasm0(output_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2602
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2603
|
+
const ptr3 = passStringToWasm0(policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2604
|
+
const len3 = WASM_VECTOR_LEN;
|
|
2605
|
+
const ret = wasm.convert_with_report_json(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
2606
|
+
var ptr5 = ret[0];
|
|
2607
|
+
var len5 = ret[1];
|
|
2608
|
+
if (ret[3]) {
|
|
2609
|
+
ptr5 = 0; len5 = 0;
|
|
2610
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2611
|
+
}
|
|
2612
|
+
deferred6_0 = ptr5;
|
|
2613
|
+
deferred6_1 = len5;
|
|
2614
|
+
return getStringFromWasm0(ptr5, len5);
|
|
2615
|
+
} finally {
|
|
2616
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
|
|
2126
2620
|
/**
|
|
2127
2621
|
* Return the CPK color (CSS hex string) for the given element symbol.
|
|
2128
2622
|
*
|
|
@@ -4171,6 +4665,28 @@ export function mmcif_to_json(text) {
|
|
|
4171
4665
|
}
|
|
4172
4666
|
}
|
|
4173
4667
|
|
|
4668
|
+
/**
|
|
4669
|
+
* Checked legacy MMFF94 charges.
|
|
4670
|
+
*
|
|
4671
|
+
* Returns `{"charges":[...]}` or a typed `{"error":"unsupported_element",...}`
|
|
4672
|
+
* object instead of silently returning zeros for an unparameterized atom.
|
|
4673
|
+
* @param {MolHandle} mol
|
|
4674
|
+
* @returns {string}
|
|
4675
|
+
*/
|
|
4676
|
+
export function mmff94_charges_checked_json(mol) {
|
|
4677
|
+
let deferred1_0;
|
|
4678
|
+
let deferred1_1;
|
|
4679
|
+
try {
|
|
4680
|
+
_assertClass(mol, MolHandle);
|
|
4681
|
+
const ret = wasm.mmff94_charges_checked_json(mol.__wbg_ptr);
|
|
4682
|
+
deferred1_0 = ret[0];
|
|
4683
|
+
deferred1_1 = ret[1];
|
|
4684
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
4685
|
+
} finally {
|
|
4686
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
4687
|
+
}
|
|
4688
|
+
}
|
|
4689
|
+
|
|
4174
4690
|
/**
|
|
4175
4691
|
* MMFF94 partial charges (BCI table, ±0.1e accuracy) as a JSON array of f64.
|
|
4176
4692
|
*
|
|
@@ -5393,6 +5909,32 @@ export function pains_matches_json(mol) {
|
|
|
5393
5909
|
}
|
|
5394
5910
|
}
|
|
5395
5911
|
|
|
5912
|
+
/**
|
|
5913
|
+
* Inspect strictly validated CJSON with exact source and opaque field paths.
|
|
5914
|
+
* @param {string} text
|
|
5915
|
+
* @returns {string}
|
|
5916
|
+
*/
|
|
5917
|
+
export function parse_cjson_record_json(text) {
|
|
5918
|
+
let deferred3_0;
|
|
5919
|
+
let deferred3_1;
|
|
5920
|
+
try {
|
|
5921
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5922
|
+
const len0 = WASM_VECTOR_LEN;
|
|
5923
|
+
const ret = wasm.parse_cjson_record_json(ptr0, len0);
|
|
5924
|
+
var ptr2 = ret[0];
|
|
5925
|
+
var len2 = ret[1];
|
|
5926
|
+
if (ret[3]) {
|
|
5927
|
+
ptr2 = 0; len2 = 0;
|
|
5928
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
5929
|
+
}
|
|
5930
|
+
deferred3_0 = ptr2;
|
|
5931
|
+
deferred3_1 = len2;
|
|
5932
|
+
return getStringFromWasm0(ptr2, len2);
|
|
5933
|
+
} finally {
|
|
5934
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
5935
|
+
}
|
|
5936
|
+
}
|
|
5937
|
+
|
|
5396
5938
|
/**
|
|
5397
5939
|
* Parse CXSMARTS and return preserved metadata as JSON.
|
|
5398
5940
|
* Returns error if atom count exceeds 10,000.
|
|
@@ -5451,6 +5993,32 @@ export function parse_cxsmiles_json(s) {
|
|
|
5451
5993
|
}
|
|
5452
5994
|
}
|
|
5453
5995
|
|
|
5996
|
+
/**
|
|
5997
|
+
* Inspect partial charges, atom types and source retention for MOL2.
|
|
5998
|
+
* @param {string} text
|
|
5999
|
+
* @returns {string}
|
|
6000
|
+
*/
|
|
6001
|
+
export function parse_mol2_record_json(text) {
|
|
6002
|
+
let deferred3_0;
|
|
6003
|
+
let deferred3_1;
|
|
6004
|
+
try {
|
|
6005
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6006
|
+
const len0 = WASM_VECTOR_LEN;
|
|
6007
|
+
const ret = wasm.parse_mol2_record_json(ptr0, len0);
|
|
6008
|
+
var ptr2 = ret[0];
|
|
6009
|
+
var len2 = ret[1];
|
|
6010
|
+
if (ret[3]) {
|
|
6011
|
+
ptr2 = 0; len2 = 0;
|
|
6012
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
6013
|
+
}
|
|
6014
|
+
deferred3_0 = ptr2;
|
|
6015
|
+
deferred3_1 = len2;
|
|
6016
|
+
return getStringFromWasm0(ptr2, len2);
|
|
6017
|
+
} finally {
|
|
6018
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
6019
|
+
}
|
|
6020
|
+
}
|
|
6021
|
+
|
|
5454
6022
|
/**
|
|
5455
6023
|
* Parse a SMILES string into a `MolHandle`.
|
|
5456
6024
|
*
|
|
@@ -6082,6 +6650,58 @@ export function rdkit_ecfp_config_detail_json(mol, radius, nbits) {
|
|
|
6082
6650
|
}
|
|
6083
6651
|
}
|
|
6084
6652
|
|
|
6653
|
+
/**
|
|
6654
|
+
* RDKit-compatible `MolFromMol2Block` with molecule and coordinates.
|
|
6655
|
+
* @param {string} text
|
|
6656
|
+
* @param {boolean} sanitize
|
|
6657
|
+
* @param {boolean} remove_hs
|
|
6658
|
+
* @param {boolean} cleanup_substructures
|
|
6659
|
+
* @returns {RdkitReadResult}
|
|
6660
|
+
*/
|
|
6661
|
+
export function rdkit_from_mol2_block(text, sanitize, remove_hs, cleanup_substructures) {
|
|
6662
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6663
|
+
const len0 = WASM_VECTOR_LEN;
|
|
6664
|
+
const ret = wasm.rdkit_from_mol2_block(ptr0, len0, sanitize, remove_hs, cleanup_substructures);
|
|
6665
|
+
if (ret[2]) {
|
|
6666
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
6667
|
+
}
|
|
6668
|
+
return RdkitReadResult.__wrap(ret[0]);
|
|
6669
|
+
}
|
|
6670
|
+
|
|
6671
|
+
/**
|
|
6672
|
+
* RDKit-compatible `MolFromPDBBlock` with molecule and coordinates.
|
|
6673
|
+
* @param {string} text
|
|
6674
|
+
* @param {boolean} sanitize
|
|
6675
|
+
* @param {boolean} remove_hs
|
|
6676
|
+
* @param {number} flavor
|
|
6677
|
+
* @param {boolean} proximity_bonding
|
|
6678
|
+
* @returns {RdkitReadResult}
|
|
6679
|
+
*/
|
|
6680
|
+
export function rdkit_from_pdb_block(text, sanitize, remove_hs, flavor, proximity_bonding) {
|
|
6681
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6682
|
+
const len0 = WASM_VECTOR_LEN;
|
|
6683
|
+
const ret = wasm.rdkit_from_pdb_block(ptr0, len0, sanitize, remove_hs, flavor, proximity_bonding);
|
|
6684
|
+
if (ret[2]) {
|
|
6685
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
6686
|
+
}
|
|
6687
|
+
return RdkitReadResult.__wrap(ret[0]);
|
|
6688
|
+
}
|
|
6689
|
+
|
|
6690
|
+
/**
|
|
6691
|
+
* RDKit-compatible `MolFromXYZBlock`; the molecule has atoms but no bonds.
|
|
6692
|
+
* @param {string} text
|
|
6693
|
+
* @returns {RdkitReadResult}
|
|
6694
|
+
*/
|
|
6695
|
+
export function rdkit_from_xyz_block(text) {
|
|
6696
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6697
|
+
const len0 = WASM_VECTOR_LEN;
|
|
6698
|
+
const ret = wasm.rdkit_from_xyz_block(ptr0, len0);
|
|
6699
|
+
if (ret[2]) {
|
|
6700
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
6701
|
+
}
|
|
6702
|
+
return RdkitReadResult.__wrap(ret[0]);
|
|
6703
|
+
}
|
|
6704
|
+
|
|
6085
6705
|
/**
|
|
6086
6706
|
* Find the k nearest neighbours using the RDKit-compatible Morgan/ECFP4
|
|
6087
6707
|
* profile. This is intentionally separate from [`nearest_neighbors_json`],
|
|
@@ -6299,6 +6919,42 @@ export function retro_disconnect_json(mol, max_results, reaction_class) {
|
|
|
6299
6919
|
}
|
|
6300
6920
|
}
|
|
6301
6921
|
|
|
6922
|
+
/**
|
|
6923
|
+
* Label-stable R-group decomposition returned as RDKit-style table columns.
|
|
6924
|
+
*
|
|
6925
|
+
* `core_smarts` accepts the bounded mapped-core contract used by Rust and
|
|
6926
|
+
* Python: terminal mapped wildcards such as `[*:2]`, or mapped core atoms.
|
|
6927
|
+
* The returned JSON object contains `Core`, `R1`, `R2`, ... arrays parallel
|
|
6928
|
+
* to the input rows. Unmatched rows and absent substituents are `null`.
|
|
6929
|
+
* Output fragments retain their mapped attachment wildcard. The legacy
|
|
6930
|
+
* [`super::rgroup_decompose_json`] function is unchanged.
|
|
6931
|
+
* @param {string} smiles_json
|
|
6932
|
+
* @param {string} core_smarts
|
|
6933
|
+
* @returns {string}
|
|
6934
|
+
*/
|
|
6935
|
+
export function rgroup_decompose_columns_json(smiles_json, core_smarts) {
|
|
6936
|
+
let deferred4_0;
|
|
6937
|
+
let deferred4_1;
|
|
6938
|
+
try {
|
|
6939
|
+
const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6940
|
+
const len0 = WASM_VECTOR_LEN;
|
|
6941
|
+
const ptr1 = passStringToWasm0(core_smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6942
|
+
const len1 = WASM_VECTOR_LEN;
|
|
6943
|
+
const ret = wasm.rgroup_decompose_columns_json(ptr0, len0, ptr1, len1);
|
|
6944
|
+
var ptr3 = ret[0];
|
|
6945
|
+
var len3 = ret[1];
|
|
6946
|
+
if (ret[3]) {
|
|
6947
|
+
ptr3 = 0; len3 = 0;
|
|
6948
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
6949
|
+
}
|
|
6950
|
+
deferred4_0 = ptr3;
|
|
6951
|
+
deferred4_1 = len3;
|
|
6952
|
+
return getStringFromWasm0(ptr3, len3);
|
|
6953
|
+
} finally {
|
|
6954
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
6955
|
+
}
|
|
6956
|
+
}
|
|
6957
|
+
|
|
6302
6958
|
/**
|
|
6303
6959
|
* Decompose a set of molecules against a core SMARTS, returning R-group SMILES.
|
|
6304
6960
|
*
|
|
@@ -6372,6 +7028,58 @@ export function ring_families_json(mol) {
|
|
|
6372
7028
|
}
|
|
6373
7029
|
}
|
|
6374
7030
|
|
|
7031
|
+
/**
|
|
7032
|
+
* Validate the local CJSON profile and retain the exact UTF-8 source.
|
|
7033
|
+
* @param {string} text
|
|
7034
|
+
* @returns {string}
|
|
7035
|
+
*/
|
|
7036
|
+
export function roundtrip_cjson_record(text) {
|
|
7037
|
+
let deferred3_0;
|
|
7038
|
+
let deferred3_1;
|
|
7039
|
+
try {
|
|
7040
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7041
|
+
const len0 = WASM_VECTOR_LEN;
|
|
7042
|
+
const ret = wasm.roundtrip_cjson_record(ptr0, len0);
|
|
7043
|
+
var ptr2 = ret[0];
|
|
7044
|
+
var len2 = ret[1];
|
|
7045
|
+
if (ret[3]) {
|
|
7046
|
+
ptr2 = 0; len2 = 0;
|
|
7047
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
7048
|
+
}
|
|
7049
|
+
deferred3_0 = ptr2;
|
|
7050
|
+
deferred3_1 = len2;
|
|
7051
|
+
return getStringFromWasm0(ptr2, len2);
|
|
7052
|
+
} finally {
|
|
7053
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
7054
|
+
}
|
|
7055
|
+
}
|
|
7056
|
+
|
|
7057
|
+
/**
|
|
7058
|
+
* Validate one MOL2 record and preserve its exact source, including metadata.
|
|
7059
|
+
* @param {string} text
|
|
7060
|
+
* @returns {string}
|
|
7061
|
+
*/
|
|
7062
|
+
export function roundtrip_mol2_record(text) {
|
|
7063
|
+
let deferred3_0;
|
|
7064
|
+
let deferred3_1;
|
|
7065
|
+
try {
|
|
7066
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7067
|
+
const len0 = WASM_VECTOR_LEN;
|
|
7068
|
+
const ret = wasm.roundtrip_mol2_record(ptr0, len0);
|
|
7069
|
+
var ptr2 = ret[0];
|
|
7070
|
+
var len2 = ret[1];
|
|
7071
|
+
if (ret[3]) {
|
|
7072
|
+
ptr2 = 0; len2 = 0;
|
|
7073
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
7074
|
+
}
|
|
7075
|
+
deferred3_0 = ptr2;
|
|
7076
|
+
deferred3_1 = len2;
|
|
7077
|
+
return getStringFromWasm0(ptr2, len2);
|
|
7078
|
+
} finally {
|
|
7079
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
7080
|
+
}
|
|
7081
|
+
}
|
|
7082
|
+
|
|
6375
7083
|
/**
|
|
6376
7084
|
* Parse and serialize a V3000 block while preserving V3000 metadata.
|
|
6377
7085
|
*
|
|
@@ -8342,6 +9050,9 @@ const MolHandleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
8342
9050
|
const PreparedRdkitEcfp4HandleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
8343
9051
|
? { register: () => {}, unregister: () => {} }
|
|
8344
9052
|
: new FinalizationRegistry(ptr => wasm.__wbg_preparedrdkitecfp4handle_free(ptr, 1));
|
|
9053
|
+
const RdkitReadResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
9054
|
+
? { register: () => {}, unregister: () => {} }
|
|
9055
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_rdkitreadresult_free(ptr, 1));
|
|
8345
9056
|
const RdkitSearchIndexFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
8346
9057
|
? { register: () => {}, unregister: () => {} }
|
|
8347
9058
|
: new FinalizationRegistry(ptr => wasm.__wbg_rdkitsearchindex_free(ptr, 1));
|
package/chematic_wasm_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"Kentaro Tanabe (kent-tokyo) <kent-tokyo@users.noreply.github.com>"
|
|
6
6
|
],
|
|
7
7
|
"description": "WebAssembly bindings for chematic — use chematic from JavaScript/TypeScript",
|
|
8
|
-
"version": "1.
|
|
8
|
+
"version": "1.1.1",
|
|
9
9
|
"license": "MIT OR Apache-2.0",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|