sci-form-wasm 0.7.0 → 0.9.0
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 +8 -5
- package/package.json +1 -1
- package/sci_form_wasm.d.ts +200 -147
- package/sci_form_wasm.js +550 -115
- package/sci_form_wasm_bg.wasm +0 -0
package/sci_form_wasm.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { startWorkers } from './snippets/wasm-bindgen-rayon-38edf6e439f6d70d/src/workerHelpers.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Analyze aromaticity and graph-level stereocenters from
|
|
5
|
+
* Analyze aromaticity and graph-level stereocenters from SMILES.
|
|
6
6
|
* @param {string} smiles
|
|
7
7
|
* @returns {string}
|
|
8
8
|
*/
|
|
@@ -25,14 +25,44 @@ export function analyze_graph_features(smiles) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Analyze stereochemistry: detect R/S stereocenters and E/Z double bonds.
|
|
30
|
+
*
|
|
31
|
+
* `coords_flat` is a JSON array of flat coordinates (may be empty `"[]"` for topology-only).
|
|
32
|
+
* Returns JSON `StereoAnalysis`.
|
|
33
|
+
* @param {string} smiles
|
|
34
|
+
* @param {string} coords_flat
|
|
35
|
+
* @returns {string}
|
|
36
|
+
*/
|
|
37
|
+
export function analyze_stereo(smiles, coords_flat) {
|
|
38
|
+
let deferred3_0;
|
|
39
|
+
let deferred3_1;
|
|
40
|
+
try {
|
|
41
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
42
|
+
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
43
|
+
const len0 = WASM_VECTOR_LEN;
|
|
44
|
+
const ptr1 = passStringToWasm0(coords_flat, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
45
|
+
const len1 = WASM_VECTOR_LEN;
|
|
46
|
+
wasm.analyze_stereo(retptr, ptr0, len0, ptr1, len1);
|
|
47
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
48
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
49
|
+
deferred3_0 = r0;
|
|
50
|
+
deferred3_1 = r1;
|
|
51
|
+
return getStringFromWasm0(r0, r1);
|
|
52
|
+
} finally {
|
|
53
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
54
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
28
58
|
/**
|
|
29
59
|
* Assemble a framework crystal structure.
|
|
30
60
|
*
|
|
31
|
-
* `topology`: "pcu", "dia", or "sql"
|
|
32
|
-
* `metal`: atomic number of the metal center
|
|
33
|
-
* `geometry`: "linear", "tetrahedral", "octahedral", "square_planar", "trigonal"
|
|
34
|
-
* `lattice_a`: cubic lattice parameter in
|
|
35
|
-
* `supercell`: replication factor (1 = no replication)
|
|
61
|
+
* `topology`: "pcu", "dia", or "sql".
|
|
62
|
+
* `metal`: atomic number of the metal center.
|
|
63
|
+
* `geometry`: "linear", "tetrahedral", "octahedral", "square_planar", "trigonal".
|
|
64
|
+
* `lattice_a`: cubic lattice parameter in Å.
|
|
65
|
+
* `supercell`: replication factor (1 = no replication).
|
|
36
66
|
* @param {string} topology
|
|
37
67
|
* @param {number} metal
|
|
38
68
|
* @param {string} geometry
|
|
@@ -61,6 +91,34 @@ export function assemble_framework(topology, metal, geometry, lattice_a, superce
|
|
|
61
91
|
}
|
|
62
92
|
}
|
|
63
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Butina clustering on conformers (flat coordinate arrays in JSON).
|
|
96
|
+
*
|
|
97
|
+
* `conformers_json`: JSON array of arrays, e.g. `[[x0,y0,z0,...], [x0,y0,z0,...]]`.
|
|
98
|
+
* Returns JSON `ClusterResult`.
|
|
99
|
+
* @param {string} conformers_json
|
|
100
|
+
* @param {number} rmsd_cutoff
|
|
101
|
+
* @returns {string}
|
|
102
|
+
*/
|
|
103
|
+
export function butina_cluster(conformers_json, rmsd_cutoff) {
|
|
104
|
+
let deferred2_0;
|
|
105
|
+
let deferred2_1;
|
|
106
|
+
try {
|
|
107
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
108
|
+
const ptr0 = passStringToWasm0(conformers_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
109
|
+
const len0 = WASM_VECTOR_LEN;
|
|
110
|
+
wasm.butina_cluster(retptr, ptr0, len0, rmsd_cutoff);
|
|
111
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
112
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
113
|
+
deferred2_0 = r0;
|
|
114
|
+
deferred2_1 = r1;
|
|
115
|
+
return getStringFromWasm0(r0, r1);
|
|
116
|
+
} finally {
|
|
117
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
118
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
64
122
|
/**
|
|
65
123
|
* Compare available methods on the same system/geometry.
|
|
66
124
|
* @param {string} smiles
|
|
@@ -92,6 +150,33 @@ export function compare_methods(smiles, elements, coords_flat, allow_experimenta
|
|
|
92
150
|
}
|
|
93
151
|
}
|
|
94
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Compute ANI neural-network potential energy.
|
|
155
|
+
* @param {string} elements_json
|
|
156
|
+
* @param {string} coords_flat_json
|
|
157
|
+
* @returns {string}
|
|
158
|
+
*/
|
|
159
|
+
export function compute_ani(elements_json, coords_flat_json) {
|
|
160
|
+
let deferred3_0;
|
|
161
|
+
let deferred3_1;
|
|
162
|
+
try {
|
|
163
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
164
|
+
const ptr0 = passStringToWasm0(elements_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
165
|
+
const len0 = WASM_VECTOR_LEN;
|
|
166
|
+
const ptr1 = passStringToWasm0(coords_flat_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
167
|
+
const len1 = WASM_VECTOR_LEN;
|
|
168
|
+
wasm.compute_ani(retptr, ptr0, len0, ptr1, len1);
|
|
169
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
170
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
171
|
+
deferred3_0 = r0;
|
|
172
|
+
deferred3_1 = r1;
|
|
173
|
+
return getStringFromWasm0(r0, r1);
|
|
174
|
+
} finally {
|
|
175
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
176
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
95
180
|
/**
|
|
96
181
|
* Compute Wiberg-like and Mayer-like bond orders.
|
|
97
182
|
* @param {string} elements
|
|
@@ -120,9 +205,7 @@ export function compute_bond_orders(elements, coords_flat) {
|
|
|
120
205
|
}
|
|
121
206
|
|
|
122
207
|
/**
|
|
123
|
-
* Compute Gasteiger-Marsili partial charges from
|
|
124
|
-
*
|
|
125
|
-
* Returns JSON with charges, iterations, total_charge.
|
|
208
|
+
* Compute Gasteiger-Marsili partial charges from SMILES.
|
|
126
209
|
* @param {string} smiles
|
|
127
210
|
* @returns {string}
|
|
128
211
|
*/
|
|
@@ -203,6 +286,34 @@ export function compute_dos(elements, coords_flat, sigma, e_min, e_max, n_points
|
|
|
203
286
|
}
|
|
204
287
|
}
|
|
205
288
|
|
|
289
|
+
/**
|
|
290
|
+
* Compute ECFP fingerprint for a SMILES string.
|
|
291
|
+
*
|
|
292
|
+
* radius=2 → ECFP4. Returns JSON `ECFPFingerprint`.
|
|
293
|
+
* @param {string} smiles
|
|
294
|
+
* @param {number} radius
|
|
295
|
+
* @param {number} n_bits
|
|
296
|
+
* @returns {string}
|
|
297
|
+
*/
|
|
298
|
+
export function compute_ecfp(smiles, radius, n_bits) {
|
|
299
|
+
let deferred2_0;
|
|
300
|
+
let deferred2_1;
|
|
301
|
+
try {
|
|
302
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
303
|
+
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
304
|
+
const len0 = WASM_VECTOR_LEN;
|
|
305
|
+
wasm.compute_ecfp(retptr, ptr0, len0, radius, n_bits);
|
|
306
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
307
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
308
|
+
deferred2_0 = r0;
|
|
309
|
+
deferred2_1 = r1;
|
|
310
|
+
return getStringFromWasm0(r0, r1);
|
|
311
|
+
} finally {
|
|
312
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
313
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
206
317
|
/**
|
|
207
318
|
* Estimate acidic/basic pKa sites from graph and charge heuristics.
|
|
208
319
|
* @param {string} smiles
|
|
@@ -227,6 +338,35 @@ export function compute_empirical_pka(smiles) {
|
|
|
227
338
|
}
|
|
228
339
|
}
|
|
229
340
|
|
|
341
|
+
/**
|
|
342
|
+
* Compute the full electrostatic potential grid as JSON.
|
|
343
|
+
* @param {string} elements
|
|
344
|
+
* @param {string} coords_flat
|
|
345
|
+
* @param {number} spacing
|
|
346
|
+
* @param {number} padding
|
|
347
|
+
* @returns {string}
|
|
348
|
+
*/
|
|
349
|
+
export function compute_esp(elements, coords_flat, spacing, padding) {
|
|
350
|
+
let deferred3_0;
|
|
351
|
+
let deferred3_1;
|
|
352
|
+
try {
|
|
353
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
354
|
+
const ptr0 = passStringToWasm0(elements, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
355
|
+
const len0 = WASM_VECTOR_LEN;
|
|
356
|
+
const ptr1 = passStringToWasm0(coords_flat, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
357
|
+
const len1 = WASM_VECTOR_LEN;
|
|
358
|
+
wasm.compute_esp(retptr, ptr0, len0, ptr1, len1, spacing, padding);
|
|
359
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
360
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
361
|
+
deferred3_0 = r0;
|
|
362
|
+
deferred3_1 = r1;
|
|
363
|
+
return getStringFromWasm0(r0, r1);
|
|
364
|
+
} finally {
|
|
365
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
366
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
230
370
|
/**
|
|
231
371
|
* Get ESP grid metadata (origin, spacing, dimensions) as JSON.
|
|
232
372
|
* @param {string} elements
|
|
@@ -257,9 +397,7 @@ export function compute_esp_grid_info(elements, coords_flat, spacing, padding) {
|
|
|
257
397
|
}
|
|
258
398
|
|
|
259
399
|
/**
|
|
260
|
-
* Compute ESP grid
|
|
261
|
-
*
|
|
262
|
-
* Returns Float64Array of grid values. Grid metadata available via compute_esp_grid_info().
|
|
400
|
+
* Compute ESP grid values as Float64Array (typed-array transfer).
|
|
263
401
|
* @param {string} elements
|
|
264
402
|
* @param {string} coords_flat
|
|
265
403
|
* @param {number} spacing
|
|
@@ -330,12 +468,100 @@ export function compute_fukui_descriptors(elements, coords_flat) {
|
|
|
330
468
|
}
|
|
331
469
|
|
|
332
470
|
/**
|
|
333
|
-
*
|
|
471
|
+
* Generalized Born solvation energy (electrostatic + non-polar).
|
|
334
472
|
*
|
|
335
|
-
* `
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
473
|
+
* `charges` is a JSON array of partial charges.
|
|
474
|
+
* Returns JSON `GbSolvation`.
|
|
475
|
+
* @param {string} elements
|
|
476
|
+
* @param {string} coords_flat
|
|
477
|
+
* @param {string} charges
|
|
478
|
+
* @param {number} solvent_dielectric
|
|
479
|
+
* @param {number} solute_dielectric
|
|
480
|
+
* @param {number} probe_radius
|
|
481
|
+
* @returns {string}
|
|
482
|
+
*/
|
|
483
|
+
export function compute_gb_solvation(elements, coords_flat, charges, solvent_dielectric, solute_dielectric, probe_radius) {
|
|
484
|
+
let deferred4_0;
|
|
485
|
+
let deferred4_1;
|
|
486
|
+
try {
|
|
487
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
488
|
+
const ptr0 = passStringToWasm0(elements, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
489
|
+
const len0 = WASM_VECTOR_LEN;
|
|
490
|
+
const ptr1 = passStringToWasm0(coords_flat, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
491
|
+
const len1 = WASM_VECTOR_LEN;
|
|
492
|
+
const ptr2 = passStringToWasm0(charges, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
493
|
+
const len2 = WASM_VECTOR_LEN;
|
|
494
|
+
wasm.compute_gb_solvation(retptr, ptr0, len0, ptr1, len1, ptr2, len2, solvent_dielectric, solute_dielectric, probe_radius);
|
|
495
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
496
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
497
|
+
deferred4_0 = r0;
|
|
498
|
+
deferred4_1 = r1;
|
|
499
|
+
return getStringFromWasm0(r0, r1);
|
|
500
|
+
} finally {
|
|
501
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
502
|
+
wasm.__wbindgen_export3(deferred4_0, deferred4_1, 1);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Run a HF-3c calculation with default configuration.
|
|
508
|
+
* @param {string} elements_json
|
|
509
|
+
* @param {string} coords_flat_json
|
|
510
|
+
* @returns {string}
|
|
511
|
+
*/
|
|
512
|
+
export function compute_hf3c(elements_json, coords_flat_json) {
|
|
513
|
+
let deferred3_0;
|
|
514
|
+
let deferred3_1;
|
|
515
|
+
try {
|
|
516
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
517
|
+
const ptr0 = passStringToWasm0(elements_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
518
|
+
const len0 = WASM_VECTOR_LEN;
|
|
519
|
+
const ptr1 = passStringToWasm0(coords_flat_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
520
|
+
const len1 = WASM_VECTOR_LEN;
|
|
521
|
+
wasm.compute_hf3c(retptr, ptr0, len0, ptr1, len1);
|
|
522
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
523
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
524
|
+
deferred3_0 = r0;
|
|
525
|
+
deferred3_1 = r1;
|
|
526
|
+
return getStringFromWasm0(r0, r1);
|
|
527
|
+
} finally {
|
|
528
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
529
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* Run a HF-3c calculation with custom configuration.
|
|
535
|
+
* @param {string} elements_json
|
|
536
|
+
* @param {string} coords_flat_json
|
|
537
|
+
* @param {number} max_scf_iter
|
|
538
|
+
* @param {number} n_cis_states
|
|
539
|
+
* @param {boolean} corrections
|
|
540
|
+
* @returns {string}
|
|
541
|
+
*/
|
|
542
|
+
export function compute_hf3c_custom(elements_json, coords_flat_json, max_scf_iter, n_cis_states, corrections) {
|
|
543
|
+
let deferred3_0;
|
|
544
|
+
let deferred3_1;
|
|
545
|
+
try {
|
|
546
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
547
|
+
const ptr0 = passStringToWasm0(elements_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
548
|
+
const len0 = WASM_VECTOR_LEN;
|
|
549
|
+
const ptr1 = passStringToWasm0(coords_flat_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
550
|
+
const len1 = WASM_VECTOR_LEN;
|
|
551
|
+
wasm.compute_hf3c_custom(retptr, ptr0, len0, ptr1, len1, max_scf_iter, n_cis_states, corrections);
|
|
552
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
553
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
554
|
+
deferred3_0 = r0;
|
|
555
|
+
deferred3_1 = r1;
|
|
556
|
+
return getStringFromWasm0(r0, r1);
|
|
557
|
+
} finally {
|
|
558
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
559
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Generate HOSE codes for all atoms in a molecule.
|
|
339
565
|
* @param {string} smiles
|
|
340
566
|
* @param {number} max_radius
|
|
341
567
|
* @returns {string}
|
|
@@ -361,13 +587,6 @@ export function compute_hose_codes(smiles, max_radius) {
|
|
|
361
587
|
|
|
362
588
|
/**
|
|
363
589
|
* Generate a Lorentzian-broadened IR spectrum from vibrational analysis JSON.
|
|
364
|
-
*
|
|
365
|
-
* `analysis_json`: JSON VibrationalAnalysis (from compute_vibrational_analysis).
|
|
366
|
-
* `gamma`: line width in cm⁻¹.
|
|
367
|
-
* `wn_min`, `wn_max`: wavenumber range in cm⁻¹.
|
|
368
|
-
* `n_points`: grid resolution.
|
|
369
|
-
*
|
|
370
|
-
* Returns: JSON IrSpectrum with wavenumbers, intensities, peaks.
|
|
371
590
|
* @param {string} analysis_json
|
|
372
591
|
* @param {number} gamma
|
|
373
592
|
* @param {number} wn_min
|
|
@@ -395,12 +614,80 @@ export function compute_ir_spectrum(analysis_json, gamma, wn_min, wn_max, n_poin
|
|
|
395
614
|
}
|
|
396
615
|
|
|
397
616
|
/**
|
|
398
|
-
*
|
|
617
|
+
* Run short NVE molecular dynamics with UFF force field.
|
|
399
618
|
*
|
|
400
|
-
* `smiles`: SMILES string.
|
|
619
|
+
* `smiles`: SMILES string for topology.
|
|
620
|
+
* `coords_json`: JSON array of flat xyz coords.
|
|
621
|
+
* `n_steps`: number of MD steps.
|
|
622
|
+
* `dt_fs`: time step in femtoseconds.
|
|
623
|
+
* `seed`: random seed for initial velocities.
|
|
624
|
+
*
|
|
625
|
+
* Returns JSON MdTrajectory with frames, energies, temperatures.
|
|
626
|
+
* @param {string} smiles
|
|
627
|
+
* @param {string} coords_json
|
|
628
|
+
* @param {number} n_steps
|
|
629
|
+
* @param {number} dt_fs
|
|
630
|
+
* @param {number} seed
|
|
631
|
+
* @returns {string}
|
|
632
|
+
*/
|
|
633
|
+
export function compute_md_trajectory(smiles, coords_json, n_steps, dt_fs, seed) {
|
|
634
|
+
let deferred3_0;
|
|
635
|
+
let deferred3_1;
|
|
636
|
+
try {
|
|
637
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
638
|
+
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
639
|
+
const len0 = WASM_VECTOR_LEN;
|
|
640
|
+
const ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
641
|
+
const len1 = WASM_VECTOR_LEN;
|
|
642
|
+
wasm.compute_md_trajectory(retptr, ptr0, len0, ptr1, len1, n_steps, dt_fs, seed);
|
|
643
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
644
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
645
|
+
deferred3_0 = r0;
|
|
646
|
+
deferred3_1 = r1;
|
|
647
|
+
return getStringFromWasm0(r0, r1);
|
|
648
|
+
} finally {
|
|
649
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
650
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* Run short NVT molecular dynamics with Berendsen thermostat.
|
|
401
656
|
*
|
|
402
|
-
*
|
|
403
|
-
*
|
|
657
|
+
* `target_temp_k`: target temperature in Kelvin.
|
|
658
|
+
* `thermostat_tau_fs`: thermostat coupling time in fs.
|
|
659
|
+
* @param {string} smiles
|
|
660
|
+
* @param {string} coords_json
|
|
661
|
+
* @param {number} n_steps
|
|
662
|
+
* @param {number} dt_fs
|
|
663
|
+
* @param {number} seed
|
|
664
|
+
* @param {number} target_temp_k
|
|
665
|
+
* @param {number} thermostat_tau_fs
|
|
666
|
+
* @returns {string}
|
|
667
|
+
*/
|
|
668
|
+
export function compute_md_trajectory_nvt(smiles, coords_json, n_steps, dt_fs, seed, target_temp_k, thermostat_tau_fs) {
|
|
669
|
+
let deferred3_0;
|
|
670
|
+
let deferred3_1;
|
|
671
|
+
try {
|
|
672
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
673
|
+
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
674
|
+
const len0 = WASM_VECTOR_LEN;
|
|
675
|
+
const ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
676
|
+
const len1 = WASM_VECTOR_LEN;
|
|
677
|
+
wasm.compute_md_trajectory_nvt(retptr, ptr0, len0, ptr1, len1, n_steps, dt_fs, seed, target_temp_k, thermostat_tau_fs);
|
|
678
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
679
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
680
|
+
deferred3_0 = r0;
|
|
681
|
+
deferred3_1 = r1;
|
|
682
|
+
return getStringFromWasm0(r0, r1);
|
|
683
|
+
} finally {
|
|
684
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
685
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Predict molecular properties using ML proxy models.
|
|
404
691
|
* @param {string} smiles
|
|
405
692
|
* @returns {string}
|
|
406
693
|
*/
|
|
@@ -425,11 +712,6 @@ export function compute_ml_properties(smiles) {
|
|
|
425
712
|
|
|
426
713
|
/**
|
|
427
714
|
* Compute MMFF94 force field energy.
|
|
428
|
-
*
|
|
429
|
-
* `smiles`: SMILES string for bond topology.
|
|
430
|
-
* `coords`: JSON array of flat xyz coords [x0,y0,z0, ...] in Å.
|
|
431
|
-
*
|
|
432
|
-
* Returns: JSON `{"energy": <kcal/mol>}`
|
|
433
715
|
* @param {string} smiles
|
|
434
716
|
* @param {string} coords
|
|
435
717
|
* @returns {string}
|
|
@@ -456,10 +738,7 @@ export function compute_mmff94_energy(smiles, coords) {
|
|
|
456
738
|
}
|
|
457
739
|
|
|
458
740
|
/**
|
|
459
|
-
* Compute molecular descriptors from
|
|
460
|
-
*
|
|
461
|
-
* Returns: JSON with molecular_weight, n_heavy_atoms, n_hbd, n_hba, fsp3,
|
|
462
|
-
* n_rotatable_bonds, n_rings, n_aromatic, wiener_index, etc.
|
|
741
|
+
* Compute molecular descriptors from SMILES.
|
|
463
742
|
* @param {string} smiles
|
|
464
743
|
* @returns {string}
|
|
465
744
|
*/
|
|
@@ -483,15 +762,9 @@ export function compute_molecular_descriptors(smiles) {
|
|
|
483
762
|
}
|
|
484
763
|
|
|
485
764
|
/**
|
|
486
|
-
* Generate a complete NMR spectrum
|
|
487
|
-
*
|
|
488
|
-
* `smiles`: SMILES string.
|
|
489
|
-
* `nucleus`: "1H" or "13C".
|
|
490
|
-
* `gamma`: Lorentzian line width in ppm.
|
|
491
|
-
* `ppm_min`, `ppm_max`: spectral window.
|
|
492
|
-
* `n_points`: grid resolution.
|
|
765
|
+
* Generate a complete NMR spectrum.
|
|
493
766
|
*
|
|
494
|
-
*
|
|
767
|
+
* `nucleus`: "1H", "13C", "19F", "31P", "15N", "11B", "29Si", "77Se", "17O", or "33S".
|
|
495
768
|
* @param {string} smiles
|
|
496
769
|
* @param {string} nucleus
|
|
497
770
|
* @param {number} gamma
|
|
@@ -522,13 +795,78 @@ export function compute_nmr_spectrum(smiles, nucleus, gamma, ppm_min, ppm_max, n
|
|
|
522
795
|
}
|
|
523
796
|
|
|
524
797
|
/**
|
|
525
|
-
*
|
|
798
|
+
* Non-polar solvation energy from SASA with atomic solvation parameters.
|
|
526
799
|
*
|
|
527
|
-
*
|
|
528
|
-
*
|
|
800
|
+
* Returns JSON `NonPolarSolvation`.
|
|
801
|
+
* @param {string} elements
|
|
802
|
+
* @param {string} coords_flat
|
|
803
|
+
* @param {number} probe_radius
|
|
804
|
+
* @returns {string}
|
|
805
|
+
*/
|
|
806
|
+
export function compute_nonpolar_solvation(elements, coords_flat, probe_radius) {
|
|
807
|
+
let deferred3_0;
|
|
808
|
+
let deferred3_1;
|
|
809
|
+
try {
|
|
810
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
811
|
+
const ptr0 = passStringToWasm0(elements, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
812
|
+
const len0 = WASM_VECTOR_LEN;
|
|
813
|
+
const ptr1 = passStringToWasm0(coords_flat, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
814
|
+
const len1 = WASM_VECTOR_LEN;
|
|
815
|
+
wasm.compute_nonpolar_solvation(retptr, ptr0, len0, ptr1, len1, probe_radius);
|
|
816
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
817
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
818
|
+
deferred3_0 = r0;
|
|
819
|
+
deferred3_1 = r1;
|
|
820
|
+
return getStringFromWasm0(r0, r1);
|
|
821
|
+
} finally {
|
|
822
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
823
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
* Compute an orbital isosurface mesh using any implemented method.
|
|
829
|
+
*
|
|
830
|
+
* `method`: "eht", "pm3", "xtb", or "hf3c".
|
|
831
|
+
* `mo_index`: molecular orbital index (0-based).
|
|
832
|
+
* `spacing`: grid spacing in Å (e.g. 0.2).
|
|
833
|
+
* `isovalue`: isosurface cutoff (e.g. 0.02).
|
|
529
834
|
*
|
|
530
|
-
* Returns
|
|
531
|
-
*
|
|
835
|
+
* Returns JSON OrbitalMeshResult with mesh, grid, orbital energies, HOMO-LUMO gap.
|
|
836
|
+
* @param {string} elements_json
|
|
837
|
+
* @param {string} coords_flat_json
|
|
838
|
+
* @param {string} method
|
|
839
|
+
* @param {number} mo_index
|
|
840
|
+
* @param {number} spacing
|
|
841
|
+
* @param {number} padding
|
|
842
|
+
* @param {number} isovalue
|
|
843
|
+
* @returns {string}
|
|
844
|
+
*/
|
|
845
|
+
export function compute_orbital_mesh(elements_json, coords_flat_json, method, mo_index, spacing, padding, isovalue) {
|
|
846
|
+
let deferred4_0;
|
|
847
|
+
let deferred4_1;
|
|
848
|
+
try {
|
|
849
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
850
|
+
const ptr0 = passStringToWasm0(elements_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
851
|
+
const len0 = WASM_VECTOR_LEN;
|
|
852
|
+
const ptr1 = passStringToWasm0(coords_flat_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
853
|
+
const len1 = WASM_VECTOR_LEN;
|
|
854
|
+
const ptr2 = passStringToWasm0(method, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
855
|
+
const len2 = WASM_VECTOR_LEN;
|
|
856
|
+
wasm.compute_orbital_mesh(retptr, ptr0, len0, ptr1, len1, ptr2, len2, mo_index, spacing, padding, isovalue);
|
|
857
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
858
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
859
|
+
deferred4_0 = r0;
|
|
860
|
+
deferred4_1 = r1;
|
|
861
|
+
return getStringFromWasm0(r0, r1);
|
|
862
|
+
} finally {
|
|
863
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
864
|
+
wasm.__wbindgen_export3(deferred4_0, deferred4_1, 1);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* Run a PM3 semi-empirical calculation.
|
|
532
870
|
* @param {string} elements_json
|
|
533
871
|
* @param {string} coords_flat_json
|
|
534
872
|
* @returns {string}
|
|
@@ -556,7 +894,6 @@ export function compute_pm3(elements_json, coords_flat_json) {
|
|
|
556
894
|
|
|
557
895
|
/**
|
|
558
896
|
* Compute Mulliken & Löwdin population analysis.
|
|
559
|
-
* Elements: JSON array of atomic numbers. Coords: JSON array of flat xyz.
|
|
560
897
|
* @param {string} elements
|
|
561
898
|
* @param {string} coords_flat
|
|
562
899
|
* @returns {string}
|
|
@@ -583,7 +920,7 @@ export function compute_population(elements, coords_flat) {
|
|
|
583
920
|
}
|
|
584
921
|
|
|
585
922
|
/**
|
|
586
|
-
* Build empirical local-reactivity rankings
|
|
923
|
+
* Build empirical local-reactivity rankings.
|
|
587
924
|
* @param {string} elements
|
|
588
925
|
* @param {string} coords_flat
|
|
589
926
|
* @returns {string}
|
|
@@ -637,13 +974,33 @@ export function compute_rmsd(coords, reference) {
|
|
|
637
974
|
}
|
|
638
975
|
|
|
639
976
|
/**
|
|
640
|
-
* Compute
|
|
977
|
+
* Compute all-pairs RMSD matrix for conformers.
|
|
641
978
|
*
|
|
642
|
-
*
|
|
643
|
-
*
|
|
644
|
-
*
|
|
645
|
-
|
|
646
|
-
|
|
979
|
+
* Returns JSON 2D array.
|
|
980
|
+
* @param {string} conformers_json
|
|
981
|
+
* @returns {string}
|
|
982
|
+
*/
|
|
983
|
+
export function compute_rmsd_matrix(conformers_json) {
|
|
984
|
+
let deferred2_0;
|
|
985
|
+
let deferred2_1;
|
|
986
|
+
try {
|
|
987
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
988
|
+
const ptr0 = passStringToWasm0(conformers_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
989
|
+
const len0 = WASM_VECTOR_LEN;
|
|
990
|
+
wasm.compute_rmsd_matrix(retptr, ptr0, len0);
|
|
991
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
992
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
993
|
+
deferred2_0 = r0;
|
|
994
|
+
deferred2_1 = r1;
|
|
995
|
+
return getStringFromWasm0(r0, r1);
|
|
996
|
+
} finally {
|
|
997
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
998
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
/**
|
|
1003
|
+
* Compute solvent-accessible surface area.
|
|
647
1004
|
* @param {string} elements
|
|
648
1005
|
* @param {string} coords_flat
|
|
649
1006
|
* @param {number} probe_radius
|
|
@@ -671,17 +1028,73 @@ export function compute_sasa(elements, coords_flat, probe_radius) {
|
|
|
671
1028
|
}
|
|
672
1029
|
|
|
673
1030
|
/**
|
|
674
|
-
*
|
|
1031
|
+
* Build a simplified NEB path between two geometries.
|
|
675
1032
|
*
|
|
676
|
-
* `
|
|
677
|
-
* `
|
|
678
|
-
* `
|
|
679
|
-
* `
|
|
680
|
-
* `
|
|
681
|
-
*
|
|
1033
|
+
* `start_coords_json`, `end_coords_json`: JSON flat xyz coords.
|
|
1034
|
+
* `n_images`: number of intermediate images.
|
|
1035
|
+
* `n_iter`: optimization iterations.
|
|
1036
|
+
* `spring_k`: spring constant.
|
|
1037
|
+
* `step_size`: optimization step size.
|
|
1038
|
+
* @param {string} smiles
|
|
1039
|
+
* @param {string} start_coords_json
|
|
1040
|
+
* @param {string} end_coords_json
|
|
1041
|
+
* @param {number} n_images
|
|
1042
|
+
* @param {number} n_iter
|
|
1043
|
+
* @param {number} spring_k
|
|
1044
|
+
* @param {number} step_size
|
|
1045
|
+
* @returns {string}
|
|
1046
|
+
*/
|
|
1047
|
+
export function compute_simplified_neb_path(smiles, start_coords_json, end_coords_json, n_images, n_iter, spring_k, step_size) {
|
|
1048
|
+
let deferred4_0;
|
|
1049
|
+
let deferred4_1;
|
|
1050
|
+
try {
|
|
1051
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1052
|
+
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1053
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1054
|
+
const ptr1 = passStringToWasm0(start_coords_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1055
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1056
|
+
const ptr2 = passStringToWasm0(end_coords_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1057
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1058
|
+
wasm.compute_simplified_neb_path(retptr, ptr0, len0, ptr1, len1, ptr2, len2, n_images, n_iter, spring_k, step_size);
|
|
1059
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1060
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1061
|
+
deferred4_0 = r0;
|
|
1062
|
+
deferred4_1 = r1;
|
|
1063
|
+
return getStringFromWasm0(r0, r1);
|
|
1064
|
+
} finally {
|
|
1065
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1066
|
+
wasm.__wbindgen_export3(deferred4_0, deferred4_1, 1);
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
/**
|
|
1071
|
+
* Compute the Smallest Set of Smallest Rings (SSSR) for a SMILES string.
|
|
682
1072
|
*
|
|
683
|
-
* Returns
|
|
684
|
-
*
|
|
1073
|
+
* Returns JSON `SssrResult`.
|
|
1074
|
+
* @param {string} smiles
|
|
1075
|
+
* @returns {string}
|
|
1076
|
+
*/
|
|
1077
|
+
export function compute_sssr(smiles) {
|
|
1078
|
+
let deferred2_0;
|
|
1079
|
+
let deferred2_1;
|
|
1080
|
+
try {
|
|
1081
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1082
|
+
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1083
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1084
|
+
wasm.compute_sssr(retptr, ptr0, len0);
|
|
1085
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1086
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1087
|
+
deferred2_0 = r0;
|
|
1088
|
+
deferred2_1 = r1;
|
|
1089
|
+
return getStringFromWasm0(r0, r1);
|
|
1090
|
+
} finally {
|
|
1091
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1092
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
/**
|
|
1097
|
+
* Compute an sTDA UV-Vis spectrum with proper oscillator strengths.
|
|
685
1098
|
* @param {string} elements_json
|
|
686
1099
|
* @param {string} coords_flat_json
|
|
687
1100
|
* @param {number} sigma
|
|
@@ -715,7 +1128,36 @@ export function compute_stda_uvvis(elements_json, coords_flat_json, sigma, e_min
|
|
|
715
1128
|
}
|
|
716
1129
|
|
|
717
1130
|
/**
|
|
718
|
-
*
|
|
1131
|
+
* Compute Tanimoto similarity between two ECFP fingerprint JSON objects.
|
|
1132
|
+
*
|
|
1133
|
+
* Returns JSON `{"tanimoto": 0.85}`.
|
|
1134
|
+
* @param {string} fp1_json
|
|
1135
|
+
* @param {string} fp2_json
|
|
1136
|
+
* @returns {string}
|
|
1137
|
+
*/
|
|
1138
|
+
export function compute_tanimoto(fp1_json, fp2_json) {
|
|
1139
|
+
let deferred3_0;
|
|
1140
|
+
let deferred3_1;
|
|
1141
|
+
try {
|
|
1142
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1143
|
+
const ptr0 = passStringToWasm0(fp1_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1144
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1145
|
+
const ptr1 = passStringToWasm0(fp2_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1146
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1147
|
+
wasm.compute_tanimoto(retptr, ptr0, len0, ptr1, len1);
|
|
1148
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1149
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1150
|
+
deferred3_0 = r0;
|
|
1151
|
+
deferred3_1 = r1;
|
|
1152
|
+
return getStringFromWasm0(r0, r1);
|
|
1153
|
+
} finally {
|
|
1154
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1155
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
/**
|
|
1160
|
+
* Detect metal coordination geometry and return topology.
|
|
719
1161
|
* @param {string} elements
|
|
720
1162
|
* @param {string} coords_flat
|
|
721
1163
|
* @returns {string}
|
|
@@ -828,13 +1270,6 @@ export function compute_uv_vis_spectrum(elements, coords_flat, sigma, e_min, e_m
|
|
|
828
1270
|
|
|
829
1271
|
/**
|
|
830
1272
|
* Perform vibrational analysis via numerical Hessian.
|
|
831
|
-
*
|
|
832
|
-
* `elements_json`: JSON array of atomic numbers.
|
|
833
|
-
* `coords_flat_json`: JSON array of flat xyz coords in Å.
|
|
834
|
-
* `method`: "eht", "pm3", or "xtb".
|
|
835
|
-
* `step_size`: finite-difference step in Å (0 = default 0.005).
|
|
836
|
-
*
|
|
837
|
-
* Returns: JSON VibrationalAnalysis with modes, frequencies, IR intensities, ZPVE.
|
|
838
1273
|
* @param {string} elements_json
|
|
839
1274
|
* @param {string} coords_flat_json
|
|
840
1275
|
* @param {string} method
|
|
@@ -866,12 +1301,6 @@ export function compute_vibrational_analysis(elements_json, coords_flat_json, me
|
|
|
866
1301
|
|
|
867
1302
|
/**
|
|
868
1303
|
* Run an xTB tight-binding calculation.
|
|
869
|
-
*
|
|
870
|
-
* `elements_json`: JSON array of atomic numbers, e.g. `"[26,6,6]"`.
|
|
871
|
-
* `coords_flat_json`: JSON array of flat xyz coords [x0,y0,z0, ...] in Å.
|
|
872
|
-
*
|
|
873
|
-
* Returns: JSON XtbResult with orbital_energies, total_energy, gap,
|
|
874
|
-
* homo_energy, lumo_energy, mulliken_charges, converged.
|
|
875
1304
|
* @param {string} elements_json
|
|
876
1305
|
* @param {string} coords_flat_json
|
|
877
1306
|
* @returns {string}
|
|
@@ -925,13 +1354,11 @@ export function create_unit_cell(a, b, c, alpha, beta, gamma) {
|
|
|
925
1354
|
}
|
|
926
1355
|
|
|
927
1356
|
/**
|
|
928
|
-
* Run an EHT calculation on a molecule
|
|
929
|
-
*
|
|
930
|
-
* - `elements`: JSON array of atomic numbers, e.g. `[8,1,1]`
|
|
931
|
-
* - `coords_flat`: JSON array of flat xyz coordinates `[x0,y0,z0,x1,y1,z1,...]`
|
|
932
|
-
* - `k`: Wolfsberg-Helmholtz constant (pass 0.0 for default 1.75)
|
|
1357
|
+
* Run an EHT calculation on a molecule.
|
|
933
1358
|
*
|
|
934
|
-
*
|
|
1359
|
+
* - `elements`: JSON array of atomic numbers
|
|
1360
|
+
* - `coords_flat`: JSON array of flat xyz coords
|
|
1361
|
+
* - `k`: Wolfsberg-Helmholtz constant (0.0 for default 1.75)
|
|
935
1362
|
* @param {string} elements
|
|
936
1363
|
* @param {string} coords_flat
|
|
937
1364
|
* @param {number} k
|
|
@@ -1011,8 +1438,6 @@ export function eht_orbital_grid_from_coefficients_typed(elements, coords_flat,
|
|
|
1011
1438
|
|
|
1012
1439
|
/**
|
|
1013
1440
|
* Compute orbital grid as Float32Array (typed-array transfer).
|
|
1014
|
-
*
|
|
1015
|
-
* Returns the flat volumetric grid as Float32Array for GPU volume rendering.
|
|
1016
1441
|
* @param {string} elements
|
|
1017
1442
|
* @param {string} coords_flat
|
|
1018
1443
|
* @param {number} mo_index
|
|
@@ -1029,14 +1454,7 @@ export function eht_orbital_grid_typed(elements, coords_flat, mo_index, spacing)
|
|
|
1029
1454
|
}
|
|
1030
1455
|
|
|
1031
1456
|
/**
|
|
1032
|
-
* Generate an orbital
|
|
1033
|
-
*
|
|
1034
|
-
* - `elements`, `coords_flat`: same as `eht_calculate()`
|
|
1035
|
-
* - `mo_index`: molecular orbital index (0-based)
|
|
1036
|
-
* - `spacing`: grid spacing in Ångström (e.g. 0.2)
|
|
1037
|
-
* - `isovalue`: isosurface cutoff (e.g. 0.02)
|
|
1038
|
-
*
|
|
1039
|
-
* Returns JSON with mesh vertices, normals, indices.
|
|
1457
|
+
* Generate an orbital isosurface mesh from EHT.
|
|
1040
1458
|
* @param {string} elements
|
|
1041
1459
|
* @param {string} coords_flat
|
|
1042
1460
|
* @param {number} mo_index
|
|
@@ -1066,7 +1484,7 @@ export function eht_orbital_mesh(elements, coords_flat, mo_index, spacing, isova
|
|
|
1066
1484
|
}
|
|
1067
1485
|
|
|
1068
1486
|
/**
|
|
1069
|
-
* Query EHT support metadata
|
|
1487
|
+
* Query EHT support metadata.
|
|
1070
1488
|
* @param {string} elements
|
|
1071
1489
|
* @returns {string}
|
|
1072
1490
|
*/
|
|
@@ -1146,7 +1564,7 @@ export function embed_batch(smiles_list, seed) {
|
|
|
1146
1564
|
/**
|
|
1147
1565
|
* Generate 3D coordinates only (compact format).
|
|
1148
1566
|
*
|
|
1149
|
-
* Returns JSON: {"coords": [x0,y0,z0,...], "num_atoms": N} or {"error": "..."}
|
|
1567
|
+
* Returns JSON: `{"coords": [x0,y0,z0,...], "num_atoms": N}` or `{"error": "..."}`.
|
|
1150
1568
|
* @param {string} smiles
|
|
1151
1569
|
* @param {number} seed
|
|
1152
1570
|
* @returns {string}
|
|
@@ -1173,7 +1591,7 @@ export function embed_coords(smiles, seed) {
|
|
|
1173
1591
|
/**
|
|
1174
1592
|
* Generate 3D coordinates as a Float64Array (typed-array transfer).
|
|
1175
1593
|
*
|
|
1176
|
-
* Returns a Float64Array [x0,y0,z0, x1,y1,z1,...] or empty on failure.
|
|
1594
|
+
* Returns a Float64Array `[x0,y0,z0, x1,y1,z1,...]` or empty on failure.
|
|
1177
1595
|
* @param {string} smiles
|
|
1178
1596
|
* @param {number} seed
|
|
1179
1597
|
* @returns {Float64Array}
|
|
@@ -1207,9 +1625,6 @@ export function initThreadPool(num_threads) {
|
|
|
1207
1625
|
|
|
1208
1626
|
/**
|
|
1209
1627
|
* Pack a batch of conformer results into Arrow-compatible columnar format.
|
|
1210
|
-
*
|
|
1211
|
-
* Input: JSON array of ConformerResult objects.
|
|
1212
|
-
* Output: JSON RecordBatch with typed columns for zero-copy transfer.
|
|
1213
1628
|
* @param {string} results_json
|
|
1214
1629
|
* @returns {string}
|
|
1215
1630
|
*/
|
|
@@ -1258,11 +1673,6 @@ export function parse_smiles(smiles) {
|
|
|
1258
1673
|
|
|
1259
1674
|
/**
|
|
1260
1675
|
* Predict J-coupling constants.
|
|
1261
|
-
*
|
|
1262
|
-
* `smiles`: SMILES string.
|
|
1263
|
-
* `coords_flat_json`: JSON flat xyz coords (or "[]" for topological estimate).
|
|
1264
|
-
*
|
|
1265
|
-
* Returns: JSON array of JCoupling objects.
|
|
1266
1676
|
* @param {string} smiles
|
|
1267
1677
|
* @param {string} coords_flat_json
|
|
1268
1678
|
* @returns {string}
|
|
@@ -1289,9 +1699,7 @@ export function predict_nmr_couplings(smiles, coords_flat_json) {
|
|
|
1289
1699
|
}
|
|
1290
1700
|
|
|
1291
1701
|
/**
|
|
1292
|
-
* Predict
|
|
1293
|
-
*
|
|
1294
|
-
* Returns: JSON NmrShiftResult with h_shifts, c_shifts arrays.
|
|
1702
|
+
* Predict NMR chemical shifts for all active nuclei.
|
|
1295
1703
|
* @param {string} smiles
|
|
1296
1704
|
* @returns {string}
|
|
1297
1705
|
*/
|
|
@@ -1315,10 +1723,37 @@ export function predict_nmr_shifts(smiles) {
|
|
|
1315
1723
|
}
|
|
1316
1724
|
|
|
1317
1725
|
/**
|
|
1318
|
-
*
|
|
1726
|
+
* Search conformers by sampling, torsion refinement, and UFF ranking.
|
|
1319
1727
|
*
|
|
1320
|
-
*
|
|
1321
|
-
*
|
|
1728
|
+
* `n_samples`: number of initial conformer samples.
|
|
1729
|
+
* `rmsd_threshold`: RMSD cutoff for duplicate filtering (Å).
|
|
1730
|
+
* @param {string} smiles
|
|
1731
|
+
* @param {number} n_samples
|
|
1732
|
+
* @param {number} seed
|
|
1733
|
+
* @param {number} rmsd_threshold
|
|
1734
|
+
* @returns {string}
|
|
1735
|
+
*/
|
|
1736
|
+
export function search_conformers_with_uff(smiles, n_samples, seed, rmsd_threshold) {
|
|
1737
|
+
let deferred2_0;
|
|
1738
|
+
let deferred2_1;
|
|
1739
|
+
try {
|
|
1740
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1741
|
+
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1742
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1743
|
+
wasm.search_conformers_with_uff(retptr, ptr0, len0, n_samples, seed, rmsd_threshold);
|
|
1744
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1745
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1746
|
+
deferred2_0 = r0;
|
|
1747
|
+
deferred2_1 = r1;
|
|
1748
|
+
return getStringFromWasm0(r0, r1);
|
|
1749
|
+
} finally {
|
|
1750
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1751
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
/**
|
|
1756
|
+
* Split a batch of SMILES into worker tasks for Web Worker dispatch.
|
|
1322
1757
|
* @param {string} smiles_json
|
|
1323
1758
|
* @param {number} n_workers
|
|
1324
1759
|
* @param {number} seed
|
|
@@ -1534,7 +1969,7 @@ function __wbg_get_imports(memory) {
|
|
|
1534
1969
|
__wbindgen_object_drop_ref: function(arg0) {
|
|
1535
1970
|
takeObject(arg0);
|
|
1536
1971
|
},
|
|
1537
|
-
memory: memory || new WebAssembly.Memory({initial:
|
|
1972
|
+
memory: memory || new WebAssembly.Memory({initial:21,maximum:16384,shared:true}),
|
|
1538
1973
|
};
|
|
1539
1974
|
return {
|
|
1540
1975
|
__proto__: null,
|