sci-form-wasm 0.2.0 → 0.4.2

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "sci-form-wasm",
3
3
  "type": "module",
4
4
  "description": "WASM/TypeScript bindings for high-performance 3D molecular conformer generation",
5
- "version": "0.2.0",
5
+ "version": "0.4.2",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
@@ -11,13 +11,11 @@
11
11
  "files": [
12
12
  "sci_form_wasm_bg.wasm",
13
13
  "sci_form_wasm.js",
14
- "sci_form_wasm_bg.js",
15
14
  "sci_form_wasm.d.ts"
16
15
  ],
17
16
  "main": "sci_form_wasm.js",
18
17
  "types": "sci_form_wasm.d.ts",
19
18
  "sideEffects": [
20
- "./sci_form_wasm.js",
21
19
  "./snippets/*"
22
20
  ]
23
21
  }
@@ -1,6 +1,113 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
 
4
+ /**
5
+ * Assemble a framework crystal structure.
6
+ *
7
+ * `topology`: "pcu", "dia", or "sql"
8
+ * `metal`: atomic number of the metal center
9
+ * `geometry`: "linear", "tetrahedral", "octahedral", "square_planar", "trigonal"
10
+ * `lattice_a`: cubic lattice parameter in Å
11
+ * `supercell`: replication factor (1 = no replication)
12
+ */
13
+ export function assemble_framework(topology: string, metal: number, geometry: string, lattice_a: number, supercell: number): string;
14
+
15
+ /**
16
+ * Compute Gasteiger-Marsili partial charges from a SMILES string.
17
+ *
18
+ * Returns JSON with charges, iterations, total_charge.
19
+ */
20
+ export function compute_charges(smiles: string): string;
21
+
22
+ /**
23
+ * Compute molecular dipole moment.
24
+ */
25
+ export function compute_dipole(elements: string, coords_flat: string): string;
26
+
27
+ /**
28
+ * Compute DOS/PDOS from EHT orbital energies.
29
+ */
30
+ export function compute_dos(elements: string, coords_flat: string, sigma: number, e_min: number, e_max: number, n_points: number): string;
31
+
32
+ /**
33
+ * Get ESP grid metadata (origin, spacing, dimensions) as JSON.
34
+ */
35
+ export function compute_esp_grid_info(elements: string, coords_flat: string, spacing: number, padding: number): string;
36
+
37
+ /**
38
+ * Compute ESP grid and return values as Float64Array (typed-array transfer).
39
+ *
40
+ * Returns Float64Array of grid values. Grid metadata available via compute_esp_grid_info().
41
+ */
42
+ export function compute_esp_grid_typed(elements: string, coords_flat: string, spacing: number, padding: number): Float64Array;
43
+
44
+ /**
45
+ * Compute Mulliken & Löwdin population analysis.
46
+ * Elements: JSON array of atomic numbers. Coords: JSON array of flat xyz.
47
+ */
48
+ export function compute_population(elements: string, coords_flat: string): string;
49
+
50
+ /**
51
+ * Compute RMSD between two coordinate sets after Kabsch alignment.
52
+ */
53
+ export function compute_rmsd(coords: string, reference: string): string;
54
+
55
+ /**
56
+ * Compute solvent-accessible surface area from atomic numbers and coordinates.
57
+ *
58
+ * - `elements`: JSON array of atomic numbers, e.g. `[8,1,1]`
59
+ * - `coords_flat`: JSON array of flat xyz coordinates
60
+ * - `probe_radius`: probe radius in Å (pass 0.0 for default 1.4)
61
+ *
62
+ * Returns JSON with total_sasa, atom_sasa, probe_radius, num_points.
63
+ */
64
+ export function compute_sasa(elements: string, coords_flat: string, probe_radius: number): string;
65
+
66
+ /**
67
+ * Compute UFF force field energy.
68
+ */
69
+ export function compute_uff_energy(smiles: string, coords: string): string;
70
+
71
+ /**
72
+ * Create a unit cell and return parameters + volume as JSON.
73
+ */
74
+ export function create_unit_cell(a: number, b: number, c: number, alpha: number, beta: number, gamma: number): string;
75
+
76
+ /**
77
+ * Run an EHT calculation on a molecule given its elements and flat XYZ coordinates.
78
+ *
79
+ * - `elements`: JSON array of atomic numbers, e.g. `[8,1,1]`
80
+ * - `coords_flat`: JSON array of flat xyz coordinates `[x0,y0,z0,x1,y1,z1,...]`
81
+ * - `k`: Wolfsberg-Helmholtz constant (pass 0.0 for default 1.75)
82
+ *
83
+ * Returns JSON with energies, coefficients, HOMO/LUMO info.
84
+ */
85
+ export function eht_calculate(elements: string, coords_flat: string, k: number): string;
86
+
87
+ /**
88
+ * Compute orbital grid from precomputed EHT coefficients as Float32Array.
89
+ */
90
+ export function eht_orbital_grid_from_coefficients_typed(elements: string, coords_flat: string, coefficients_json: string, mo_index: number, spacing: number): Float32Array;
91
+
92
+ /**
93
+ * Compute orbital grid as Float32Array (typed-array transfer).
94
+ *
95
+ * Returns the flat volumetric grid as Float32Array for GPU volume rendering.
96
+ */
97
+ export function eht_orbital_grid_typed(elements: string, coords_flat: string, mo_index: number, spacing: number): Float32Array;
98
+
99
+ /**
100
+ * Generate an orbital volumetric grid and extract an isosurface mesh.
101
+ *
102
+ * - `elements`, `coords_flat`: same as `eht_calculate()`
103
+ * - `mo_index`: molecular orbital index (0-based)
104
+ * - `spacing`: grid spacing in Ångström (e.g. 0.2)
105
+ * - `isovalue`: isosurface cutoff (e.g. 0.02)
106
+ *
107
+ * Returns JSON with mesh vertices, normals, indices.
108
+ */
109
+ export function eht_orbital_mesh(elements: string, coords_flat: string, mo_index: number, spacing: number, isovalue: number): string;
110
+
4
111
  /**
5
112
  * Generate a 3D conformer from a SMILES string.
6
113
  *
@@ -22,12 +129,119 @@ export function embed_batch(smiles_list: string, seed: number): string;
22
129
  */
23
130
  export function embed_coords(smiles: string, seed: number): string;
24
131
 
132
+ /**
133
+ * Generate 3D coordinates as a Float64Array (typed-array transfer).
134
+ *
135
+ * Returns a Float64Array [x0,y0,z0, x1,y1,z1,...] or empty on failure.
136
+ */
137
+ export function embed_coords_typed(smiles: string, seed: number): Float64Array;
138
+
139
+ /**
140
+ * Estimate optimal number of Web Workers for a batch size.
141
+ */
142
+ export function estimate_workers(n_items: number, max_workers: number): number;
143
+
144
+ export function initThreadPool(num_threads: number): Promise<any>;
145
+
146
+ /**
147
+ * Pack a batch of conformer results into Arrow-compatible columnar format.
148
+ *
149
+ * Input: JSON array of ConformerResult objects.
150
+ * Output: JSON RecordBatch with typed columns for zero-copy transfer.
151
+ */
152
+ export function pack_batch_arrow(results_json: string): string;
153
+
25
154
  /**
26
155
  * Parse a SMILES string and return molecular info (no 3D).
27
156
  */
28
157
  export function parse_smiles(smiles: string): string;
29
158
 
159
+ /**
160
+ * Split a batch of SMILES into worker tasks for Web Worker dispatch.
161
+ *
162
+ * Input: JSON array of SMILES strings.
163
+ * Output: JSON array of WorkerTask objects.
164
+ */
165
+ export function split_worker_tasks(smiles_json: string, n_workers: number, seed: number): string;
166
+
30
167
  /**
31
168
  * Library version.
32
169
  */
33
170
  export function version(): string;
171
+
172
+ export class wbg_rayon_PoolBuilder {
173
+ private constructor();
174
+ free(): void;
175
+ [Symbol.dispose](): void;
176
+ build(): void;
177
+ numThreads(): number;
178
+ receiver(): number;
179
+ }
180
+
181
+ export function wbg_rayon_start_worker(receiver: number): void;
182
+
183
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
184
+
185
+ export interface InitOutput {
186
+ readonly embed_coords_typed: (a: number, b: number, c: number) => number;
187
+ readonly compute_esp_grid_typed: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
188
+ readonly compute_esp_grid_info: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
189
+ readonly eht_orbital_grid_typed: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
190
+ readonly eht_orbital_grid_from_coefficients_typed: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
191
+ readonly version: (a: number) => void;
192
+ readonly embed: (a: number, b: number, c: number, d: number) => void;
193
+ readonly embed_coords: (a: number, b: number, c: number, d: number) => void;
194
+ readonly embed_batch: (a: number, b: number, c: number, d: number) => void;
195
+ readonly parse_smiles: (a: number, b: number, c: number) => void;
196
+ readonly eht_calculate: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
197
+ readonly eht_orbital_mesh: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
198
+ readonly compute_charges: (a: number, b: number, c: number) => void;
199
+ readonly compute_sasa: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
200
+ readonly compute_population: (a: number, b: number, c: number, d: number, e: number) => void;
201
+ readonly compute_dipole: (a: number, b: number, c: number, d: number, e: number) => void;
202
+ readonly compute_dos: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
203
+ readonly compute_rmsd: (a: number, b: number, c: number, d: number, e: number) => void;
204
+ readonly compute_uff_energy: (a: number, b: number, c: number, d: number, e: number) => void;
205
+ readonly create_unit_cell: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
206
+ readonly assemble_framework: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
207
+ readonly pack_batch_arrow: (a: number, b: number, c: number) => void;
208
+ readonly split_worker_tasks: (a: number, b: number, c: number, d: number, e: number) => void;
209
+ readonly estimate_workers: (a: number, b: number) => number;
210
+ readonly __wbg_wbg_rayon_poolbuilder_free: (a: number, b: number) => void;
211
+ readonly wbg_rayon_poolbuilder_numThreads: (a: number) => number;
212
+ readonly wbg_rayon_poolbuilder_receiver: (a: number) => number;
213
+ readonly wbg_rayon_poolbuilder_build: (a: number) => void;
214
+ readonly initThreadPool: (a: number) => number;
215
+ readonly wbg_rayon_start_worker: (a: number) => void;
216
+ readonly memory: WebAssembly.Memory;
217
+ readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
218
+ readonly __wbindgen_export: (a: number, b: number) => number;
219
+ readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
220
+ readonly __wbindgen_export3: (a: number, b: number, c: number) => void;
221
+ readonly __wbindgen_thread_destroy: (a?: number, b?: number, c?: number) => void;
222
+ readonly __wbindgen_start: (a: number) => void;
223
+ }
224
+
225
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
226
+
227
+ /**
228
+ * Instantiates the given `module`, which can either be bytes or
229
+ * a precompiled `WebAssembly.Module`.
230
+ *
231
+ * @param {{ module: SyncInitInput, memory?: WebAssembly.Memory, thread_stack_size?: number }} module - Passing `SyncInitInput` directly is deprecated.
232
+ * @param {WebAssembly.Memory} memory - Deprecated.
233
+ *
234
+ * @returns {InitOutput}
235
+ */
236
+ export function initSync(module: { module: SyncInitInput, memory?: WebAssembly.Memory, thread_stack_size?: number } | SyncInitInput, memory?: WebAssembly.Memory): InitOutput;
237
+
238
+ /**
239
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
240
+ * for everything else, calls `WebAssembly.instantiate` directly.
241
+ *
242
+ * @param {{ module_or_path: InitInput | Promise<InitInput>, memory?: WebAssembly.Memory, thread_stack_size?: number }} module_or_path - Passing `InitInput` directly is deprecated.
243
+ * @param {WebAssembly.Memory} memory - Deprecated.
244
+ *
245
+ * @returns {Promise<InitOutput>}
246
+ */
247
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput>, memory?: WebAssembly.Memory, thread_stack_size?: number } | InitInput | Promise<InitInput>, memory?: WebAssembly.Memory): Promise<InitOutput>;