@kent-tokyo/chematic 1.1.1 → 1.1.3
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 +7 -2
- package/chematic_wasm.d.ts +114 -2
- package/chematic_wasm.js +380 -19
- 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.1.
|
|
7
|
+
The current workspace line is 1.1.3. 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
|
|
|
@@ -18,7 +18,7 @@ npm install @kent-tokyo/chematic
|
|
|
18
18
|
|
|
19
19
|
- Parse SMILES strings into molecule handles
|
|
20
20
|
- Molecular descriptors: MW, TPSA, LogP, Fsp3, QED, exact mass, rotatable bonds, HBD/HBA, aromatic ring count, Labute ASA
|
|
21
|
-
- Drug-likeness filters: Lipinski, Veber, Egan, REOS, Ghose
|
|
21
|
+
- Drug-likeness filters: Lipinski, Veber, Egan, REOS, Ghose, PAINS, and Brenk
|
|
22
22
|
- EState indices (Hall & Kier 1991): per-atom values, sum/max/min
|
|
23
23
|
- Gasteiger-Marsili PEOE partial charges: per-heavy-atom charges
|
|
24
24
|
- VSA descriptors: SlogP_VSA (×12), SMR_VSA (×10), PEOE_VSA (×14)
|
|
@@ -91,6 +91,7 @@ import init, {
|
|
|
91
91
|
smr_vsa_json,
|
|
92
92
|
peoe_vsa_json,
|
|
93
93
|
identify_functional_groups,
|
|
94
|
+
brenk_report_json,
|
|
94
95
|
} from '@kent-tokyo/chematic';
|
|
95
96
|
|
|
96
97
|
await init();
|
|
@@ -113,6 +114,10 @@ console.log(mol.aromatic_ring_count()); // 1
|
|
|
113
114
|
console.log(mol.lipinski_passes()); // true
|
|
114
115
|
console.log(mol.canonical_smiles()); // canonical SMILES string
|
|
115
116
|
|
|
117
|
+
// Brenk alerts, fully local in the browser/Node runtime
|
|
118
|
+
console.log(JSON.parse(brenk_report_json('Oc1ccccc1')));
|
|
119
|
+
// { passes: false, alerts: ['phenol'] }
|
|
120
|
+
|
|
116
121
|
// BRICS fragmentation
|
|
117
122
|
console.log(brics_fragment_count(mol)); // ≥ 2
|
|
118
123
|
|
package/chematic_wasm.d.ts
CHANGED
|
@@ -182,6 +182,14 @@ export class MolHandle {
|
|
|
182
182
|
* Number of bonds.
|
|
183
183
|
*/
|
|
184
184
|
bond_count(): number;
|
|
185
|
+
/**
|
|
186
|
+
* Returns `true` if the molecule has no Brenk structural alerts.
|
|
187
|
+
*
|
|
188
|
+
* This uses the same conservative core contract as the Rust, Python, and
|
|
189
|
+
* MCP bindings: an alert-search budget exhaustion is not reported as a
|
|
190
|
+
* clean pass.
|
|
191
|
+
*/
|
|
192
|
+
brenk_passes(): boolean;
|
|
185
193
|
/**
|
|
186
194
|
* Palm (1997) Caco-2 intestinal permeability (logPCaco2).
|
|
187
195
|
* > −5.5 = high permeability.
|
|
@@ -253,6 +261,13 @@ export class MolHandle {
|
|
|
253
261
|
* (TPSA ≤ 131.6 Ų and LogP ≤ 5.88).
|
|
254
262
|
*/
|
|
255
263
|
egan_passes(): boolean;
|
|
264
|
+
/**
|
|
265
|
+
* Seeded ETKDGv3 coordinates using the exact sixth-order torsion
|
|
266
|
+
* gradient tracked by RDKit issue #8715. At most 512 atoms are accepted.
|
|
267
|
+
* The result may intentionally differ from `rdkit_embed_json` for
|
|
268
|
+
* molecules with a non-zero sixth-order experimental torsion term.
|
|
269
|
+
*/
|
|
270
|
+
etkdg_embed_corrected_json(random_seed: number, max_iterations: number): string;
|
|
256
271
|
/**
|
|
257
272
|
* Monoisotopic (exact) mass.
|
|
258
273
|
*/
|
|
@@ -740,6 +755,24 @@ export function batch_report_html(smiles_lines: string): string;
|
|
|
740
755
|
*/
|
|
741
756
|
export function boiled_egg_json(smiles: string): string;
|
|
742
757
|
|
|
758
|
+
/**
|
|
759
|
+
* Brenk structural-alert identifiers matched by `mol` as a JSON array.
|
|
760
|
+
*
|
|
761
|
+
* Returns `[]` when no alerts fire. Identifiers and ordering are identical to
|
|
762
|
+
* the Rust, Python, and MCP bindings.
|
|
763
|
+
*/
|
|
764
|
+
export function brenk_matches_json(mol: MolHandle): string;
|
|
765
|
+
|
|
766
|
+
/**
|
|
767
|
+
* Parse `smiles` and return a complete Brenk report as JSON.
|
|
768
|
+
*
|
|
769
|
+
* The stable result shape is `{"passes":boolean,"alerts":string[]}`.
|
|
770
|
+
* Invalid or oversized SMILES throw the same ordinary JavaScript input error
|
|
771
|
+
* as `parse_smiles`; this function never converts invalid input into a clean
|
|
772
|
+
* report.
|
|
773
|
+
*/
|
|
774
|
+
export function brenk_report_json(smiles: string): string;
|
|
775
|
+
|
|
743
776
|
/**
|
|
744
777
|
* Number of BRICS fragments produced by fragmenting the molecule.
|
|
745
778
|
*
|
|
@@ -788,6 +821,11 @@ export function canonical_tautomer(mol: MolHandle): MolHandle;
|
|
|
788
821
|
*/
|
|
789
822
|
export function canonical_tautomer_with_blocked_atoms_json(mol: MolHandle, blocked_atom_indices_json: string): string;
|
|
790
823
|
|
|
824
|
+
/**
|
|
825
|
+
* Return caller coordinates centered and aligned to their principal axes.
|
|
826
|
+
*/
|
|
827
|
+
export function canonicalize_conformer_from_coords_json(mol: MolHandle, coords_json: string, center_json: string | null | undefined, normalize_covar: boolean, ignore_hs: boolean): string;
|
|
828
|
+
|
|
791
829
|
/**
|
|
792
830
|
* Canonicalize a bounded delimiter-separated SMILES batch.
|
|
793
831
|
*
|
|
@@ -914,6 +952,14 @@ export function compare_molecules_batch_json(smiles_batch: string, delimiter: st
|
|
|
914
952
|
*/
|
|
915
953
|
export function compare_molecules_json(smiles1: string, smiles2: string): string;
|
|
916
954
|
|
|
955
|
+
/**
|
|
956
|
+
* Compute an RDKit-style principal-axis transform from caller coordinates.
|
|
957
|
+
*
|
|
958
|
+
* Returns a row-major 4x4 JSON matrix. `center_json`, when supplied, must be
|
|
959
|
+
* `[x,y,z]`; otherwise the selected-atom centroid is used.
|
|
960
|
+
*/
|
|
961
|
+
export function compute_canonical_transform_from_coords_json(mol: MolHandle, coords_json: string, center_json: string | null | undefined, normalize_covar: boolean, ignore_hs: boolean): string;
|
|
962
|
+
|
|
917
963
|
/**
|
|
918
964
|
* Generate multiple conformers with RMSD-based pruning.
|
|
919
965
|
* Returns JSON: `{"conformers": [[[x,y,z],...], ...], "count": int}`.
|
|
@@ -1121,6 +1167,15 @@ export function edit_cdxml_document_json_v1(document_json: string, edit_json: st
|
|
|
1121
1167
|
*/
|
|
1122
1168
|
export function edit_reaction_document_json_v1(document_json: string, edit_json: string): string;
|
|
1123
1169
|
|
|
1170
|
+
/**
|
|
1171
|
+
* EEM partial charges from caller-supplied 3D coordinates.
|
|
1172
|
+
*
|
|
1173
|
+
* Returns `{"charges":[...]}`. Unlike RDKit 2026.09.1 and earlier (issue
|
|
1174
|
+
* #9688), ionic charges sum to the molecule's formal charge rather than its
|
|
1175
|
+
* negation. Errors are returned as `{"error":"..."}`.
|
|
1176
|
+
*/
|
|
1177
|
+
export function eem_charges_json(mol: MolHandle, coords_json: string): string;
|
|
1178
|
+
|
|
1124
1179
|
/**
|
|
1125
1180
|
* Run `embed_ensemble_v2` on `mol`'s own atom order (never canonicalizes/
|
|
1126
1181
|
* reparses, same convention as `embed_pipeline_v2_json`). See the module doc
|
|
@@ -1346,6 +1401,11 @@ export function generic_murcko_scaffold(mol: MolHandle): MolHandle;
|
|
|
1346
1401
|
*/
|
|
1347
1402
|
export function get_atom_info(mol: MolHandle, idx: number): string;
|
|
1348
1403
|
|
|
1404
|
+
/**
|
|
1405
|
+
* Measure angle i-j-k in degrees from caller-supplied coordinates.
|
|
1406
|
+
*/
|
|
1407
|
+
export function get_bond_angle_from_coords_json(mol: MolHandle, coords_json: string, i: number, j: number, k: number): number;
|
|
1408
|
+
|
|
1349
1409
|
/**
|
|
1350
1410
|
* Return bond information as a JSON object, looked up by the two bonded atom indices.
|
|
1351
1411
|
*
|
|
@@ -1367,6 +1427,15 @@ export function get_bond_between(mol: MolHandle, atom1: number, atom2: number):
|
|
|
1367
1427
|
*/
|
|
1368
1428
|
export function get_bond_info(mol: MolHandle, idx: number): string;
|
|
1369
1429
|
|
|
1430
|
+
/**
|
|
1431
|
+
* Measure a bond length from caller-supplied coordinates.
|
|
1432
|
+
*
|
|
1433
|
+
* `coords_json` is `[[x,y,z], ...]` in molecule atom order. Unlike the
|
|
1434
|
+
* legacy SMILES convenience function, this does not generate a new
|
|
1435
|
+
* conformer, so callers can measure an imported or previously edited one.
|
|
1436
|
+
*/
|
|
1437
|
+
export function get_bond_length_from_coords_json(mol: MolHandle, coords_json: string, i: number, j: number): number;
|
|
1438
|
+
|
|
1370
1439
|
/**
|
|
1371
1440
|
* Get bond length in Ångströms between two atoms from a SMILES string.
|
|
1372
1441
|
* Returns -1.0 if parsing fails or atom indices are out of range.
|
|
@@ -1391,6 +1460,11 @@ export function get_bond_length_json(smiles: string, a: number, b: number): numb
|
|
|
1391
1460
|
*/
|
|
1392
1461
|
export function get_descriptors_json(mol: MolHandle): string;
|
|
1393
1462
|
|
|
1463
|
+
/**
|
|
1464
|
+
* Measure dihedral i-j-k-l in degrees from caller-supplied coordinates.
|
|
1465
|
+
*/
|
|
1466
|
+
export function get_dihedral_from_coords_json(mol: MolHandle, coords_json: string, i: number, j: number, k: number, l: number): number;
|
|
1467
|
+
|
|
1394
1468
|
/**
|
|
1395
1469
|
* Get dihedral angle A—B—C—D in degrees from a SMILES string.
|
|
1396
1470
|
* Returns null (JSON null) if any atom index is out of range or atoms are collinear.
|
|
@@ -2647,6 +2721,8 @@ export function roundtrip_mol_v3000_block(block: string): string;
|
|
|
2647
2721
|
* `reactants_smiles`: pipe-separated SMILES, one per reactant slot in the SMIRKS.
|
|
2648
2722
|
* Returns a JSON array of arrays: `[["product_smi", …], …]`.
|
|
2649
2723
|
* Returns a JS error on parse failure or arity mismatch.
|
|
2724
|
+
* Product-template E/Z is resolved after all reactants are assembled, so an
|
|
2725
|
+
* unspecified product double bond does not depend on reactant order.
|
|
2650
2726
|
*/
|
|
2651
2727
|
export function run_reactants(smirks: string, reactants_smiles: string): string;
|
|
2652
2728
|
|
|
@@ -2780,6 +2856,29 @@ export function semantic_expand_json_with_limits(base_smiles: string, model_json
|
|
|
2780
2856
|
*/
|
|
2781
2857
|
export function semantic_model_json(model_json: string): string;
|
|
2782
2858
|
|
|
2859
|
+
/**
|
|
2860
|
+
* Set angle i-j-k in degrees and return updated coordinate JSON.
|
|
2861
|
+
*
|
|
2862
|
+
* Atoms i and j stay fixed; atom k and its side of the graph rotate
|
|
2863
|
+
* together. If both angle bonds belong to a ring the operation is rejected.
|
|
2864
|
+
*/
|
|
2865
|
+
export function set_bond_angle_from_coords_json(mol: MolHandle, coords_json: string, i: number, j: number, k: number, angle_deg: number): string;
|
|
2866
|
+
|
|
2867
|
+
/**
|
|
2868
|
+
* Set bond length i-j in caller-supplied coordinates and return updated JSON.
|
|
2869
|
+
*
|
|
2870
|
+
* Atom i stays fixed; atom j and its side of the graph move together. Ring
|
|
2871
|
+
* bonds are rejected, following RDKit's `SetBondLength` contract.
|
|
2872
|
+
*/
|
|
2873
|
+
export function set_bond_length_from_coords_json(mol: MolHandle, coords_json: string, i: number, j: number, length: number): string;
|
|
2874
|
+
|
|
2875
|
+
/**
|
|
2876
|
+
* Set dihedral i-j-k-l in degrees and return updated coordinate JSON.
|
|
2877
|
+
*
|
|
2878
|
+
* The central j-k bond must exist and must not belong to a ring.
|
|
2879
|
+
*/
|
|
2880
|
+
export function set_dihedral_from_coords_json(mol: MolHandle, coords_json: string, i: number, j: number, k: number, l: number, angle_deg: number): string;
|
|
2881
|
+
|
|
2783
2882
|
/**
|
|
2784
2883
|
* Set dihedral angle A—B—C—D and return PDB block with modified coordinates.
|
|
2785
2884
|
* Rotates the D-side subtree around the B—C bond.
|
|
@@ -3251,11 +3350,14 @@ export interface InitOutput {
|
|
|
3251
3350
|
readonly balance_check_json: (a: number, b: number) => [number, number];
|
|
3252
3351
|
readonly batch_report_html: (a: number, b: number) => [number, number];
|
|
3253
3352
|
readonly boiled_egg_json: (a: number, b: number) => [number, number];
|
|
3353
|
+
readonly brenk_matches_json: (a: number) => [number, number];
|
|
3354
|
+
readonly brenk_report_json: (a: number, b: number) => [number, number, number, number];
|
|
3254
3355
|
readonly brics_fragment_count: (a: number) => number;
|
|
3255
3356
|
readonly brics_fragments_json: (a: number) => [number, number];
|
|
3256
3357
|
readonly butina_cluster_ecfp4_json: (a: number, b: number, c: number) => [number, number, number, number];
|
|
3257
3358
|
readonly canonical_tautomer: (a: number) => number;
|
|
3258
3359
|
readonly canonical_tautomer_with_blocked_atoms_json: (a: number, b: number, c: number) => [number, number];
|
|
3360
|
+
readonly canonicalize_conformer_from_coords_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
|
|
3259
3361
|
readonly canonicalize_smiles_batch_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
3260
3362
|
readonly cdxml_document_from_json_v1: (a: number, b: number) => [number, number, number, number];
|
|
3261
3363
|
readonly cdxml_document_json: (a: number, b: number) => [number, number, number, number];
|
|
@@ -3269,6 +3371,7 @@ export interface InitOutput {
|
|
|
3269
3371
|
readonly cip_unresolved_json: (a: number) => [number, number];
|
|
3270
3372
|
readonly compare_molecules_batch_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
3271
3373
|
readonly compare_molecules_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
3374
|
+
readonly compute_canonical_transform_from_coords_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
|
|
3272
3375
|
readonly conformer_ensemble_json: (a: number, b: number, c: number) => [number, number];
|
|
3273
3376
|
readonly conformerhandle_add_generated_conformer: (a: number) => number;
|
|
3274
3377
|
readonly conformerhandle_add_minimized_conformer: (a: number) => number;
|
|
@@ -3316,6 +3419,7 @@ export interface InitOutput {
|
|
|
3316
3419
|
readonly edit_cdxml_document_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
3317
3420
|
readonly edit_cdxml_document_json_v1: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
3318
3421
|
readonly edit_reaction_document_json_v1: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
3422
|
+
readonly eem_charges_json: (a: number, b: number, c: number) => [number, number];
|
|
3319
3423
|
readonly embed_ensemble_v2_json: (a: number, b: number, c: number) => [number, number];
|
|
3320
3424
|
readonly embed_pipeline_v2_json: (a: number, b: number, c: number) => [number, number];
|
|
3321
3425
|
readonly enumerate_library_2way: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
|
|
@@ -3340,10 +3444,13 @@ export interface InitOutput {
|
|
|
3340
3444
|
readonly generate_3d_pdb: (a: number) => [number, number];
|
|
3341
3445
|
readonly generic_murcko_scaffold: (a: number) => number;
|
|
3342
3446
|
readonly get_atom_info: (a: number, b: number) => [number, number];
|
|
3447
|
+
readonly get_bond_angle_from_coords_json: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
3343
3448
|
readonly get_bond_between: (a: number, b: number, c: number) => [number, number];
|
|
3344
3449
|
readonly get_bond_info: (a: number, b: number) => [number, number];
|
|
3450
|
+
readonly get_bond_length_from_coords_json: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
3345
3451
|
readonly get_bond_length_json: (a: number, b: number, c: number, d: number) => number;
|
|
3346
3452
|
readonly get_descriptors_json: (a: number) => [number, number];
|
|
3453
|
+
readonly get_dihedral_from_coords_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
|
|
3347
3454
|
readonly get_dihedral_json: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
3348
3455
|
readonly get_rdkit_descriptors_json: (a: number) => [number, number];
|
|
3349
3456
|
readonly getaway_descriptors_json: (a: number) => [number, number];
|
|
@@ -3423,11 +3530,13 @@ export interface InitOutput {
|
|
|
3423
3530
|
readonly molecule_report_json: (a: number, b: number) => [number, number, number, number];
|
|
3424
3531
|
readonly molhandle_aromatic_ring_count: (a: number) => number;
|
|
3425
3532
|
readonly molhandle_assign_cip_json: (a: number) => [number, number];
|
|
3533
|
+
readonly molhandle_atom_count: (a: number) => number;
|
|
3426
3534
|
readonly molhandle_atom_pseudo_labels_json: (a: number) => [number, number];
|
|
3427
3535
|
readonly molhandle_bbb_passes: (a: number) => number;
|
|
3428
3536
|
readonly molhandle_bbb_score: (a: number) => number;
|
|
3429
3537
|
readonly molhandle_bertz_ct: (a: number) => number;
|
|
3430
3538
|
readonly molhandle_bond_count: (a: number) => number;
|
|
3539
|
+
readonly molhandle_brenk_passes: (a: number) => number;
|
|
3431
3540
|
readonly molhandle_caco2_permeability: (a: number) => number;
|
|
3432
3541
|
readonly molhandle_canonical_smiles: (a: number) => [number, number];
|
|
3433
3542
|
readonly molhandle_chi0: (a: number) => number;
|
|
@@ -3445,6 +3554,7 @@ export interface InitOutput {
|
|
|
3445
3554
|
readonly molhandle_depict_svg: (a: number) => [number, number];
|
|
3446
3555
|
readonly molhandle_depict_svg_opts: (a: number, b: number) => [number, number];
|
|
3447
3556
|
readonly molhandle_egan_passes: (a: number) => number;
|
|
3557
|
+
readonly molhandle_etkdg_embed_corrected_json: (a: number, b: number, c: number) => [number, number, number, number];
|
|
3448
3558
|
readonly molhandle_exact_mass: (a: number) => number;
|
|
3449
3559
|
readonly molhandle_formal_charge_sum: (a: number) => number;
|
|
3450
3560
|
readonly molhandle_formula: (a: number) => [number, number];
|
|
@@ -3598,6 +3708,9 @@ export interface InitOutput {
|
|
|
3598
3708
|
readonly semantic_expand_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
3599
3709
|
readonly semantic_expand_json_with_limits: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
|
|
3600
3710
|
readonly semantic_model_json: (a: number, b: number) => [number, number, number, number];
|
|
3711
|
+
readonly set_bond_angle_from_coords_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
|
|
3712
|
+
readonly set_bond_length_from_coords_json: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
|
|
3713
|
+
readonly set_dihedral_from_coords_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
|
|
3601
3714
|
readonly set_dihedral_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
|
|
3602
3715
|
readonly shape_descriptors_json: (a: number) => [number, number];
|
|
3603
3716
|
readonly slogp_vsa_json: (a: number) => [number, number];
|
|
@@ -3616,6 +3729,7 @@ export interface InitOutput {
|
|
|
3616
3729
|
readonly sssr_rings_json: (a: number) => [number, number];
|
|
3617
3730
|
readonly standardize_smiles: (a: number, b: number) => [number, number];
|
|
3618
3731
|
readonly standardize_smiles_report_json: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
3732
|
+
readonly start: () => void;
|
|
3619
3733
|
readonly stereo_parent_json: (a: number) => [number, number];
|
|
3620
3734
|
readonly stoichiometry_report_json: (a: number, b: number) => [number, number];
|
|
3621
3735
|
readonly super_parent_json: (a: number, b: number, c: number, d: number, e: bigint) => [number, number];
|
|
@@ -3662,8 +3776,6 @@ export interface InitOutput {
|
|
|
3662
3776
|
readonly xlogp3_json: (a: number) => [number, number];
|
|
3663
3777
|
readonly xlogp3_per_atom_json: (a: number) => [number, number];
|
|
3664
3778
|
readonly xyz_frames_batch_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
3665
|
-
readonly molhandle_atom_count: (a: number) => number;
|
|
3666
|
-
readonly start: () => void;
|
|
3667
3779
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
3668
3780
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
3669
3781
|
readonly __externref_table_alloc: () => number;
|
package/chematic_wasm.js
CHANGED
|
@@ -104,7 +104,7 @@ export class ConformerHandle {
|
|
|
104
104
|
const ret = wasm.conformerhandle_get_conformer_pdb(this.__wbg_ptr, idx);
|
|
105
105
|
let v1;
|
|
106
106
|
if (ret[0] !== 0) {
|
|
107
|
-
v1 = getStringFromWasm0(ret[0], ret[1])
|
|
107
|
+
v1 = getStringFromWasm0(ret[0], ret[1]);
|
|
108
108
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
109
109
|
}
|
|
110
110
|
return v1;
|
|
@@ -456,6 +456,18 @@ export class MolHandle {
|
|
|
456
456
|
const ret = wasm.molhandle_bond_count(this.__wbg_ptr);
|
|
457
457
|
return ret >>> 0;
|
|
458
458
|
}
|
|
459
|
+
/**
|
|
460
|
+
* Returns `true` if the molecule has no Brenk structural alerts.
|
|
461
|
+
*
|
|
462
|
+
* This uses the same conservative core contract as the Rust, Python, and
|
|
463
|
+
* MCP bindings: an alert-search budget exhaustion is not reported as a
|
|
464
|
+
* clean pass.
|
|
465
|
+
* @returns {boolean}
|
|
466
|
+
*/
|
|
467
|
+
brenk_passes() {
|
|
468
|
+
const ret = wasm.molhandle_brenk_passes(this.__wbg_ptr);
|
|
469
|
+
return ret !== 0;
|
|
470
|
+
}
|
|
459
471
|
/**
|
|
460
472
|
* Palm (1997) Caco-2 intestinal permeability (logPCaco2).
|
|
461
473
|
* > −5.5 = high permeability.
|
|
@@ -623,6 +635,33 @@ export class MolHandle {
|
|
|
623
635
|
const ret = wasm.molhandle_egan_passes(this.__wbg_ptr);
|
|
624
636
|
return ret !== 0;
|
|
625
637
|
}
|
|
638
|
+
/**
|
|
639
|
+
* Seeded ETKDGv3 coordinates using the exact sixth-order torsion
|
|
640
|
+
* gradient tracked by RDKit issue #8715. At most 512 atoms are accepted.
|
|
641
|
+
* The result may intentionally differ from `rdkit_embed_json` for
|
|
642
|
+
* molecules with a non-zero sixth-order experimental torsion term.
|
|
643
|
+
* @param {number} random_seed
|
|
644
|
+
* @param {number} max_iterations
|
|
645
|
+
* @returns {string}
|
|
646
|
+
*/
|
|
647
|
+
etkdg_embed_corrected_json(random_seed, max_iterations) {
|
|
648
|
+
let deferred2_0;
|
|
649
|
+
let deferred2_1;
|
|
650
|
+
try {
|
|
651
|
+
const ret = wasm.molhandle_etkdg_embed_corrected_json(this.__wbg_ptr, random_seed, max_iterations);
|
|
652
|
+
var ptr1 = ret[0];
|
|
653
|
+
var len1 = ret[1];
|
|
654
|
+
if (ret[3]) {
|
|
655
|
+
ptr1 = 0; len1 = 0;
|
|
656
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
657
|
+
}
|
|
658
|
+
deferred2_0 = ptr1;
|
|
659
|
+
deferred2_1 = len1;
|
|
660
|
+
return getStringFromWasm0(ptr1, len1);
|
|
661
|
+
} finally {
|
|
662
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
626
665
|
/**
|
|
627
666
|
* Monoisotopic (exact) mass.
|
|
628
667
|
* @returns {number}
|
|
@@ -2039,6 +2078,59 @@ export function boiled_egg_json(smiles) {
|
|
|
2039
2078
|
}
|
|
2040
2079
|
}
|
|
2041
2080
|
|
|
2081
|
+
/**
|
|
2082
|
+
* Brenk structural-alert identifiers matched by `mol` as a JSON array.
|
|
2083
|
+
*
|
|
2084
|
+
* Returns `[]` when no alerts fire. Identifiers and ordering are identical to
|
|
2085
|
+
* the Rust, Python, and MCP bindings.
|
|
2086
|
+
* @param {MolHandle} mol
|
|
2087
|
+
* @returns {string}
|
|
2088
|
+
*/
|
|
2089
|
+
export function brenk_matches_json(mol) {
|
|
2090
|
+
let deferred1_0;
|
|
2091
|
+
let deferred1_1;
|
|
2092
|
+
try {
|
|
2093
|
+
_assertClass(mol, MolHandle);
|
|
2094
|
+
const ret = wasm.brenk_matches_json(mol.__wbg_ptr);
|
|
2095
|
+
deferred1_0 = ret[0];
|
|
2096
|
+
deferred1_1 = ret[1];
|
|
2097
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2098
|
+
} finally {
|
|
2099
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
|
|
2103
|
+
/**
|
|
2104
|
+
* Parse `smiles` and return a complete Brenk report as JSON.
|
|
2105
|
+
*
|
|
2106
|
+
* The stable result shape is `{"passes":boolean,"alerts":string[]}`.
|
|
2107
|
+
* Invalid or oversized SMILES throw the same ordinary JavaScript input error
|
|
2108
|
+
* as `parse_smiles`; this function never converts invalid input into a clean
|
|
2109
|
+
* report.
|
|
2110
|
+
* @param {string} smiles
|
|
2111
|
+
* @returns {string}
|
|
2112
|
+
*/
|
|
2113
|
+
export function brenk_report_json(smiles) {
|
|
2114
|
+
let deferred3_0;
|
|
2115
|
+
let deferred3_1;
|
|
2116
|
+
try {
|
|
2117
|
+
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2118
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2119
|
+
const ret = wasm.brenk_report_json(ptr0, len0);
|
|
2120
|
+
var ptr2 = ret[0];
|
|
2121
|
+
var len2 = ret[1];
|
|
2122
|
+
if (ret[3]) {
|
|
2123
|
+
ptr2 = 0; len2 = 0;
|
|
2124
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2125
|
+
}
|
|
2126
|
+
deferred3_0 = ptr2;
|
|
2127
|
+
deferred3_1 = len2;
|
|
2128
|
+
return getStringFromWasm0(ptr2, len2);
|
|
2129
|
+
} finally {
|
|
2130
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2042
2134
|
/**
|
|
2043
2135
|
* Number of BRICS fragments produced by fragmenting the molecule.
|
|
2044
2136
|
*
|
|
@@ -2152,6 +2244,39 @@ export function canonical_tautomer_with_blocked_atoms_json(mol, blocked_atom_ind
|
|
|
2152
2244
|
}
|
|
2153
2245
|
}
|
|
2154
2246
|
|
|
2247
|
+
/**
|
|
2248
|
+
* Return caller coordinates centered and aligned to their principal axes.
|
|
2249
|
+
* @param {MolHandle} mol
|
|
2250
|
+
* @param {string} coords_json
|
|
2251
|
+
* @param {string | null | undefined} center_json
|
|
2252
|
+
* @param {boolean} normalize_covar
|
|
2253
|
+
* @param {boolean} ignore_hs
|
|
2254
|
+
* @returns {string}
|
|
2255
|
+
*/
|
|
2256
|
+
export function canonicalize_conformer_from_coords_json(mol, coords_json, center_json, normalize_covar, ignore_hs) {
|
|
2257
|
+
let deferred4_0;
|
|
2258
|
+
let deferred4_1;
|
|
2259
|
+
try {
|
|
2260
|
+
_assertClass(mol, MolHandle);
|
|
2261
|
+
const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2262
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2263
|
+
var ptr1 = isLikeNone(center_json) ? 0 : passStringToWasm0(center_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2264
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2265
|
+
const ret = wasm.canonicalize_conformer_from_coords_json(mol.__wbg_ptr, ptr0, len0, ptr1, len1, normalize_covar, ignore_hs);
|
|
2266
|
+
var ptr3 = ret[0];
|
|
2267
|
+
var len3 = ret[1];
|
|
2268
|
+
if (ret[3]) {
|
|
2269
|
+
ptr3 = 0; len3 = 0;
|
|
2270
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2271
|
+
}
|
|
2272
|
+
deferred4_0 = ptr3;
|
|
2273
|
+
deferred4_1 = len3;
|
|
2274
|
+
return getStringFromWasm0(ptr3, len3);
|
|
2275
|
+
} finally {
|
|
2276
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2279
|
+
|
|
2155
2280
|
/**
|
|
2156
2281
|
* Canonicalize a bounded delimiter-separated SMILES batch.
|
|
2157
2282
|
*
|
|
@@ -2523,6 +2648,42 @@ export function compare_molecules_json(smiles1, smiles2) {
|
|
|
2523
2648
|
}
|
|
2524
2649
|
}
|
|
2525
2650
|
|
|
2651
|
+
/**
|
|
2652
|
+
* Compute an RDKit-style principal-axis transform from caller coordinates.
|
|
2653
|
+
*
|
|
2654
|
+
* Returns a row-major 4x4 JSON matrix. `center_json`, when supplied, must be
|
|
2655
|
+
* `[x,y,z]`; otherwise the selected-atom centroid is used.
|
|
2656
|
+
* @param {MolHandle} mol
|
|
2657
|
+
* @param {string} coords_json
|
|
2658
|
+
* @param {string | null | undefined} center_json
|
|
2659
|
+
* @param {boolean} normalize_covar
|
|
2660
|
+
* @param {boolean} ignore_hs
|
|
2661
|
+
* @returns {string}
|
|
2662
|
+
*/
|
|
2663
|
+
export function compute_canonical_transform_from_coords_json(mol, coords_json, center_json, normalize_covar, ignore_hs) {
|
|
2664
|
+
let deferred4_0;
|
|
2665
|
+
let deferred4_1;
|
|
2666
|
+
try {
|
|
2667
|
+
_assertClass(mol, MolHandle);
|
|
2668
|
+
const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2669
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2670
|
+
var ptr1 = isLikeNone(center_json) ? 0 : passStringToWasm0(center_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2671
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2672
|
+
const ret = wasm.compute_canonical_transform_from_coords_json(mol.__wbg_ptr, ptr0, len0, ptr1, len1, normalize_covar, ignore_hs);
|
|
2673
|
+
var ptr3 = ret[0];
|
|
2674
|
+
var len3 = ret[1];
|
|
2675
|
+
if (ret[3]) {
|
|
2676
|
+
ptr3 = 0; len3 = 0;
|
|
2677
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2678
|
+
}
|
|
2679
|
+
deferred4_0 = ptr3;
|
|
2680
|
+
deferred4_1 = len3;
|
|
2681
|
+
return getStringFromWasm0(ptr3, len3);
|
|
2682
|
+
} finally {
|
|
2683
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
2684
|
+
}
|
|
2685
|
+
}
|
|
2686
|
+
|
|
2526
2687
|
/**
|
|
2527
2688
|
* Generate multiple conformers with RMSD-based pruning.
|
|
2528
2689
|
* Returns JSON: `{"conformers": [[[x,y,z],...], ...], "count": int}`.
|
|
@@ -3101,6 +3262,32 @@ export function edit_reaction_document_json_v1(document_json, edit_json) {
|
|
|
3101
3262
|
}
|
|
3102
3263
|
}
|
|
3103
3264
|
|
|
3265
|
+
/**
|
|
3266
|
+
* EEM partial charges from caller-supplied 3D coordinates.
|
|
3267
|
+
*
|
|
3268
|
+
* Returns `{"charges":[...]}`. Unlike RDKit 2026.09.1 and earlier (issue
|
|
3269
|
+
* #9688), ionic charges sum to the molecule's formal charge rather than its
|
|
3270
|
+
* negation. Errors are returned as `{"error":"..."}`.
|
|
3271
|
+
* @param {MolHandle} mol
|
|
3272
|
+
* @param {string} coords_json
|
|
3273
|
+
* @returns {string}
|
|
3274
|
+
*/
|
|
3275
|
+
export function eem_charges_json(mol, coords_json) {
|
|
3276
|
+
let deferred2_0;
|
|
3277
|
+
let deferred2_1;
|
|
3278
|
+
try {
|
|
3279
|
+
_assertClass(mol, MolHandle);
|
|
3280
|
+
const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3281
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3282
|
+
const ret = wasm.eem_charges_json(mol.__wbg_ptr, ptr0, len0);
|
|
3283
|
+
deferred2_0 = ret[0];
|
|
3284
|
+
deferred2_1 = ret[1];
|
|
3285
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
3286
|
+
} finally {
|
|
3287
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
3288
|
+
}
|
|
3289
|
+
}
|
|
3290
|
+
|
|
3104
3291
|
/**
|
|
3105
3292
|
* Run `embed_ensemble_v2` on `mol`'s own atom order (never canonicalizes/
|
|
3106
3293
|
* reparses, same convention as `embed_pipeline_v2_json`). See the module doc
|
|
@@ -3699,6 +3886,26 @@ export function get_atom_info(mol, idx) {
|
|
|
3699
3886
|
}
|
|
3700
3887
|
}
|
|
3701
3888
|
|
|
3889
|
+
/**
|
|
3890
|
+
* Measure angle i-j-k in degrees from caller-supplied coordinates.
|
|
3891
|
+
* @param {MolHandle} mol
|
|
3892
|
+
* @param {string} coords_json
|
|
3893
|
+
* @param {number} i
|
|
3894
|
+
* @param {number} j
|
|
3895
|
+
* @param {number} k
|
|
3896
|
+
* @returns {number}
|
|
3897
|
+
*/
|
|
3898
|
+
export function get_bond_angle_from_coords_json(mol, coords_json, i, j, k) {
|
|
3899
|
+
_assertClass(mol, MolHandle);
|
|
3900
|
+
const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3901
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3902
|
+
const ret = wasm.get_bond_angle_from_coords_json(mol.__wbg_ptr, ptr0, len0, i, j, k);
|
|
3903
|
+
if (ret[2]) {
|
|
3904
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3905
|
+
}
|
|
3906
|
+
return ret[0];
|
|
3907
|
+
}
|
|
3908
|
+
|
|
3702
3909
|
/**
|
|
3703
3910
|
* Return bond information as a JSON object, looked up by the two bonded atom indices.
|
|
3704
3911
|
*
|
|
@@ -3751,6 +3958,29 @@ export function get_bond_info(mol, idx) {
|
|
|
3751
3958
|
}
|
|
3752
3959
|
}
|
|
3753
3960
|
|
|
3961
|
+
/**
|
|
3962
|
+
* Measure a bond length from caller-supplied coordinates.
|
|
3963
|
+
*
|
|
3964
|
+
* `coords_json` is `[[x,y,z], ...]` in molecule atom order. Unlike the
|
|
3965
|
+
* legacy SMILES convenience function, this does not generate a new
|
|
3966
|
+
* conformer, so callers can measure an imported or previously edited one.
|
|
3967
|
+
* @param {MolHandle} mol
|
|
3968
|
+
* @param {string} coords_json
|
|
3969
|
+
* @param {number} i
|
|
3970
|
+
* @param {number} j
|
|
3971
|
+
* @returns {number}
|
|
3972
|
+
*/
|
|
3973
|
+
export function get_bond_length_from_coords_json(mol, coords_json, i, j) {
|
|
3974
|
+
_assertClass(mol, MolHandle);
|
|
3975
|
+
const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3976
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3977
|
+
const ret = wasm.get_bond_length_from_coords_json(mol.__wbg_ptr, ptr0, len0, i, j);
|
|
3978
|
+
if (ret[2]) {
|
|
3979
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3980
|
+
}
|
|
3981
|
+
return ret[0];
|
|
3982
|
+
}
|
|
3983
|
+
|
|
3754
3984
|
/**
|
|
3755
3985
|
* Get bond length in Ångströms between two atoms from a SMILES string.
|
|
3756
3986
|
* Returns -1.0 if parsing fails or atom indices are out of range.
|
|
@@ -3798,6 +4028,27 @@ export function get_descriptors_json(mol) {
|
|
|
3798
4028
|
}
|
|
3799
4029
|
}
|
|
3800
4030
|
|
|
4031
|
+
/**
|
|
4032
|
+
* Measure dihedral i-j-k-l in degrees from caller-supplied coordinates.
|
|
4033
|
+
* @param {MolHandle} mol
|
|
4034
|
+
* @param {string} coords_json
|
|
4035
|
+
* @param {number} i
|
|
4036
|
+
* @param {number} j
|
|
4037
|
+
* @param {number} k
|
|
4038
|
+
* @param {number} l
|
|
4039
|
+
* @returns {number}
|
|
4040
|
+
*/
|
|
4041
|
+
export function get_dihedral_from_coords_json(mol, coords_json, i, j, k, l) {
|
|
4042
|
+
_assertClass(mol, MolHandle);
|
|
4043
|
+
const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4044
|
+
const len0 = WASM_VECTOR_LEN;
|
|
4045
|
+
const ret = wasm.get_dihedral_from_coords_json(mol.__wbg_ptr, ptr0, len0, i, j, k, l);
|
|
4046
|
+
if (ret[2]) {
|
|
4047
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4048
|
+
}
|
|
4049
|
+
return ret[0];
|
|
4050
|
+
}
|
|
4051
|
+
|
|
3801
4052
|
/**
|
|
3802
4053
|
* Get dihedral angle A—B—C—D in degrees from a SMILES string.
|
|
3803
4054
|
* Returns null (JSON null) if any atom index is out of range or atoms are collinear.
|
|
@@ -6255,7 +6506,7 @@ export function pqr_infer_element(group_pdb, res_name, atom_name) {
|
|
|
6255
6506
|
const ret = wasm.pqr_infer_element(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
6256
6507
|
let v4;
|
|
6257
6508
|
if (ret[0] !== 0) {
|
|
6258
|
-
v4 = getStringFromWasm0(ret[0], ret[1])
|
|
6509
|
+
v4 = getStringFromWasm0(ret[0], ret[1]);
|
|
6259
6510
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
6260
6511
|
}
|
|
6261
6512
|
return v4;
|
|
@@ -7118,6 +7369,8 @@ export function roundtrip_mol_v3000_block(block) {
|
|
|
7118
7369
|
* `reactants_smiles`: pipe-separated SMILES, one per reactant slot in the SMIRKS.
|
|
7119
7370
|
* Returns a JSON array of arrays: `[["product_smi", …], …]`.
|
|
7120
7371
|
* Returns a JS error on parse failure or arity mismatch.
|
|
7372
|
+
* Product-template E/Z is resolved after all reactants are assembled, so an
|
|
7373
|
+
* unspecified product double bond does not depend on reactant order.
|
|
7121
7374
|
* @param {string} smirks
|
|
7122
7375
|
* @param {string} reactants_smiles
|
|
7123
7376
|
* @returns {string}
|
|
@@ -7535,6 +7788,110 @@ export function semantic_model_json(model_json) {
|
|
|
7535
7788
|
}
|
|
7536
7789
|
}
|
|
7537
7790
|
|
|
7791
|
+
/**
|
|
7792
|
+
* Set angle i-j-k in degrees and return updated coordinate JSON.
|
|
7793
|
+
*
|
|
7794
|
+
* Atoms i and j stay fixed; atom k and its side of the graph rotate
|
|
7795
|
+
* together. If both angle bonds belong to a ring the operation is rejected.
|
|
7796
|
+
* @param {MolHandle} mol
|
|
7797
|
+
* @param {string} coords_json
|
|
7798
|
+
* @param {number} i
|
|
7799
|
+
* @param {number} j
|
|
7800
|
+
* @param {number} k
|
|
7801
|
+
* @param {number} angle_deg
|
|
7802
|
+
* @returns {string}
|
|
7803
|
+
*/
|
|
7804
|
+
export function set_bond_angle_from_coords_json(mol, coords_json, i, j, k, angle_deg) {
|
|
7805
|
+
let deferred3_0;
|
|
7806
|
+
let deferred3_1;
|
|
7807
|
+
try {
|
|
7808
|
+
_assertClass(mol, MolHandle);
|
|
7809
|
+
const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7810
|
+
const len0 = WASM_VECTOR_LEN;
|
|
7811
|
+
const ret = wasm.set_bond_angle_from_coords_json(mol.__wbg_ptr, ptr0, len0, i, j, k, angle_deg);
|
|
7812
|
+
var ptr2 = ret[0];
|
|
7813
|
+
var len2 = ret[1];
|
|
7814
|
+
if (ret[3]) {
|
|
7815
|
+
ptr2 = 0; len2 = 0;
|
|
7816
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
7817
|
+
}
|
|
7818
|
+
deferred3_0 = ptr2;
|
|
7819
|
+
deferred3_1 = len2;
|
|
7820
|
+
return getStringFromWasm0(ptr2, len2);
|
|
7821
|
+
} finally {
|
|
7822
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
7823
|
+
}
|
|
7824
|
+
}
|
|
7825
|
+
|
|
7826
|
+
/**
|
|
7827
|
+
* Set bond length i-j in caller-supplied coordinates and return updated JSON.
|
|
7828
|
+
*
|
|
7829
|
+
* Atom i stays fixed; atom j and its side of the graph move together. Ring
|
|
7830
|
+
* bonds are rejected, following RDKit's `SetBondLength` contract.
|
|
7831
|
+
* @param {MolHandle} mol
|
|
7832
|
+
* @param {string} coords_json
|
|
7833
|
+
* @param {number} i
|
|
7834
|
+
* @param {number} j
|
|
7835
|
+
* @param {number} length
|
|
7836
|
+
* @returns {string}
|
|
7837
|
+
*/
|
|
7838
|
+
export function set_bond_length_from_coords_json(mol, coords_json, i, j, length) {
|
|
7839
|
+
let deferred3_0;
|
|
7840
|
+
let deferred3_1;
|
|
7841
|
+
try {
|
|
7842
|
+
_assertClass(mol, MolHandle);
|
|
7843
|
+
const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7844
|
+
const len0 = WASM_VECTOR_LEN;
|
|
7845
|
+
const ret = wasm.set_bond_length_from_coords_json(mol.__wbg_ptr, ptr0, len0, i, j, length);
|
|
7846
|
+
var ptr2 = ret[0];
|
|
7847
|
+
var len2 = ret[1];
|
|
7848
|
+
if (ret[3]) {
|
|
7849
|
+
ptr2 = 0; len2 = 0;
|
|
7850
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
7851
|
+
}
|
|
7852
|
+
deferred3_0 = ptr2;
|
|
7853
|
+
deferred3_1 = len2;
|
|
7854
|
+
return getStringFromWasm0(ptr2, len2);
|
|
7855
|
+
} finally {
|
|
7856
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
7857
|
+
}
|
|
7858
|
+
}
|
|
7859
|
+
|
|
7860
|
+
/**
|
|
7861
|
+
* Set dihedral i-j-k-l in degrees and return updated coordinate JSON.
|
|
7862
|
+
*
|
|
7863
|
+
* The central j-k bond must exist and must not belong to a ring.
|
|
7864
|
+
* @param {MolHandle} mol
|
|
7865
|
+
* @param {string} coords_json
|
|
7866
|
+
* @param {number} i
|
|
7867
|
+
* @param {number} j
|
|
7868
|
+
* @param {number} k
|
|
7869
|
+
* @param {number} l
|
|
7870
|
+
* @param {number} angle_deg
|
|
7871
|
+
* @returns {string}
|
|
7872
|
+
*/
|
|
7873
|
+
export function set_dihedral_from_coords_json(mol, coords_json, i, j, k, l, angle_deg) {
|
|
7874
|
+
let deferred3_0;
|
|
7875
|
+
let deferred3_1;
|
|
7876
|
+
try {
|
|
7877
|
+
_assertClass(mol, MolHandle);
|
|
7878
|
+
const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7879
|
+
const len0 = WASM_VECTOR_LEN;
|
|
7880
|
+
const ret = wasm.set_dihedral_from_coords_json(mol.__wbg_ptr, ptr0, len0, i, j, k, l, angle_deg);
|
|
7881
|
+
var ptr2 = ret[0];
|
|
7882
|
+
var len2 = ret[1];
|
|
7883
|
+
if (ret[3]) {
|
|
7884
|
+
ptr2 = 0; len2 = 0;
|
|
7885
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
7886
|
+
}
|
|
7887
|
+
deferred3_0 = ptr2;
|
|
7888
|
+
deferred3_1 = len2;
|
|
7889
|
+
return getStringFromWasm0(ptr2, len2);
|
|
7890
|
+
} finally {
|
|
7891
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
7892
|
+
}
|
|
7893
|
+
}
|
|
7894
|
+
|
|
7538
7895
|
/**
|
|
7539
7896
|
* Set dihedral angle A—B—C—D and return PDB block with modified coordinates.
|
|
7540
7897
|
* Rotates the D-side subtree around the B—C bond.
|
|
@@ -8959,11 +9316,11 @@ export function xyz_frames_batch_json(text, offset, batch_size) {
|
|
|
8959
9316
|
function __wbg_get_imports() {
|
|
8960
9317
|
const import0 = {
|
|
8961
9318
|
__proto__: null,
|
|
8962
|
-
|
|
9319
|
+
__wbg___wbindgen_is_undefined_8865fb403f8fe9d8: function(arg0) {
|
|
8963
9320
|
const ret = arg0 === undefined;
|
|
8964
9321
|
return ret;
|
|
8965
9322
|
},
|
|
8966
|
-
|
|
9323
|
+
__wbg___wbindgen_string_get_0380ccaa2f57f0d9: function(arg0, arg1) {
|
|
8967
9324
|
const obj = arg1;
|
|
8968
9325
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
8969
9326
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -8971,18 +9328,18 @@ function __wbg_get_imports() {
|
|
|
8971
9328
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
8972
9329
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
8973
9330
|
},
|
|
8974
|
-
|
|
9331
|
+
__wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
|
|
8975
9332
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
8976
9333
|
},
|
|
8977
|
-
|
|
9334
|
+
__wbg_error_c9cf3fc2064683a9: function(arg0) {
|
|
8978
9335
|
console.error(arg0);
|
|
8979
9336
|
},
|
|
8980
|
-
|
|
8981
|
-
const ret = new
|
|
9337
|
+
__wbg_new_from_slice_37a3c3a194266cb8: function(arg0, arg1) {
|
|
9338
|
+
const ret = new Uint32Array(getArrayU32FromWasm0(arg0, arg1));
|
|
8982
9339
|
return ret;
|
|
8983
9340
|
},
|
|
8984
|
-
|
|
8985
|
-
const ret = new
|
|
9341
|
+
__wbg_new_from_slice_f545fd22ddc142b8: function(arg0, arg1) {
|
|
9342
|
+
const ret = new Float64Array(getArrayF64FromWasm0(arg0, arg1));
|
|
8986
9343
|
return ret;
|
|
8987
9344
|
},
|
|
8988
9345
|
__wbg_now_e7c6795a7f81e10f: function(arg0) {
|
|
@@ -8993,28 +9350,28 @@ function __wbg_get_imports() {
|
|
|
8993
9350
|
const ret = arg0.performance;
|
|
8994
9351
|
return ret;
|
|
8995
9352
|
},
|
|
8996
|
-
|
|
8997
|
-
const ret = typeof
|
|
9353
|
+
__wbg_static_accessor_GLOBAL_266715b9d96ba635: function() {
|
|
9354
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
8998
9355
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
8999
9356
|
},
|
|
9000
|
-
|
|
9001
|
-
const ret = typeof
|
|
9357
|
+
__wbg_static_accessor_GLOBAL_THIS_10fb7dc1ae063179: function() {
|
|
9358
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
9002
9359
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
9003
9360
|
},
|
|
9004
|
-
|
|
9361
|
+
__wbg_static_accessor_SELF_0b583911f537483a: function() {
|
|
9005
9362
|
const ret = typeof self === 'undefined' ? null : self;
|
|
9006
9363
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
9007
9364
|
},
|
|
9008
|
-
|
|
9365
|
+
__wbg_static_accessor_WINDOW_d7f903d1508cbdc4: function() {
|
|
9009
9366
|
const ret = typeof window === 'undefined' ? null : window;
|
|
9010
9367
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
9011
9368
|
},
|
|
9012
|
-
|
|
9369
|
+
__wbindgen_generic_0000000000000001: function(arg0) {
|
|
9013
9370
|
// Cast intrinsic for `F64 -> Externref`.
|
|
9014
9371
|
const ret = arg0;
|
|
9015
9372
|
return ret;
|
|
9016
9373
|
},
|
|
9017
|
-
|
|
9374
|
+
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
9018
9375
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
9019
9376
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
9020
9377
|
return ret;
|
|
@@ -9221,11 +9578,15 @@ function __wbg_finalize_init(instance, module) {
|
|
|
9221
9578
|
|
|
9222
9579
|
async function __wbg_load(module, imports) {
|
|
9223
9580
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
9581
|
+
if (!module.ok) {
|
|
9582
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
9583
|
+
}
|
|
9584
|
+
|
|
9224
9585
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
9225
9586
|
try {
|
|
9226
9587
|
return await WebAssembly.instantiateStreaming(module, imports);
|
|
9227
9588
|
} catch (e) {
|
|
9228
|
-
const validResponse =
|
|
9589
|
+
const validResponse = expectedResponseType(module.type);
|
|
9229
9590
|
|
|
9230
9591
|
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
9231
9592
|
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
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.1.
|
|
8
|
+
"version": "1.1.3",
|
|
9
9
|
"license": "MIT OR Apache-2.0",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|