@kent-tokyo/chematic 0.17.0 → 0.19.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 CHANGED
@@ -24,6 +24,8 @@ npm install @kent-tokyo/chematic
24
24
  - ECFP4/6, AtomPair, Torsion, and path fingerprints with Tanimoto similarity
25
25
  - BRICS fragment count
26
26
  - SDF/MOL block parsing
27
+ - PDBx/mmCIF, PQR, QCSchema JSON, ORCA input/output, Gaussian Cube, OpenDX,
28
+ and LAMMPS data/dump I/O (JSON-based bindings; see `format_io.rs`)
27
29
  - Topological descriptors: Wiener index, Hall-Kier κ, χ connectivity indices, Bertz CT
28
30
  - Shape descriptors (with 3D coordinates): PMI, NPR, radius of gyration, asphericity
29
31
  - 2D SVG depiction with CPK colors and atom/bond highlighting
@@ -593,6 +593,15 @@ export function canonical_tautomer_with_blocked_atoms_json(mol: MolHandle, block
593
593
  */
594
594
  export function cdxml_to_smiles_json(cdxml: string): string;
595
595
 
596
+ /**
597
+ * The `chematic-wasm` crate version (matches the workspace release version).
598
+ *
599
+ * Lets callers (e.g. the browser playground demo) display the running
600
+ * version without hardcoding it — `demo/index.html` previously had a
601
+ * static version string that silently went stale across releases.
602
+ */
603
+ export function chematic_version(): string;
604
+
596
605
  /**
597
606
  * CIP stereo assignments via the accurate hierarchical-digraph engine, as a JSON
598
607
  * array of `{atomIdx, cipCode}` objects -- same shape as [`cip_assignments_json`],
@@ -660,6 +669,30 @@ export function conformer_ensemble_json(mol: MolHandle, n: number, rmsd_threshol
660
669
  */
661
670
  export function cpk_color(element_symbol: string): string;
662
671
 
672
+ /**
673
+ * Parse a Gaussian Cube file and return its full [`chematic_mol::VolumetricGrid`]
674
+ * as JSON: `{"origin":[x,y,z],"axes":[[..],[..],[..]],"shape":[nx,ny,nz],
675
+ * "values":[...flat, row-major third-axis-fastest...],
676
+ * "atoms":[{"element":"C","charge":6.0,"position":[x,y,z]}],
677
+ * "units":"bohr"|"angstrom"}`. See module docs for the perf tradeoff of a
678
+ * full `values` JSON round trip on a large grid.
679
+ */
680
+ export function cube_grid_json(text: string): string;
681
+
682
+ /**
683
+ * `[nx, ny, nz]` for a Gaussian Cube file's grid, as a `Uint32Array`.
684
+ */
685
+ export function cube_shape_u32(text: string): Uint32Array;
686
+
687
+ /**
688
+ * Flat `values` from a Gaussian Cube file's grid, as a `Float64Array` --
689
+ * same data [`cube_grid_json`]'s `"values"` field carries (row-major,
690
+ * third-axis-fastest order -- see `chematic_mol::volumetric`'s module
691
+ * docs for the exact index formula), as a real typed array instead of a
692
+ * JSON number array.
693
+ */
694
+ export function cube_values_f64(text: string): Float64Array;
695
+
663
696
  /**
664
697
  * Compute structured depiction data for `mol` as a JSON object.
665
698
  *
@@ -1118,6 +1151,114 @@ export function is_valid_smiles(s: string): boolean;
1118
1151
  */
1119
1152
  export function labute_asa_per_atom_json(mol: MolHandle): string;
1120
1153
 
1154
+ /**
1155
+ * Parse a LAMMPS data file (`read_data` format) and return every section
1156
+ * as JSON: `{"counts":[["atoms",120],["atom types",4],...],
1157
+ * "atom_style":"atomic"|"charge"|"molecular"|"full"|"<other>",
1158
+ * "simulation_box":{"lo":[x,y,z],"hi":[x,y,z],"tilt":[xy,xz,yz]|null},
1159
+ * "masses":[{"atom_type":N,"mass":N}],
1160
+ * "atoms":[{"id":N,"molecule_id":N|null,"atom_type":N,"charge":N|null,"x":N,"y":N,"z":N,"image":[ix,iy,iz]|null}],
1161
+ * "velocities":[{"atom_id":N,"vx":N,"vy":N,"vz":N}],
1162
+ * "bonds":[{"id":N,"bond_type":N,"atom1":N,"atom2":N}],
1163
+ * "unparsed_sections":[["Angles","<raw row text>"],...]}`. `atom_type`
1164
+ * must be exactly `"atomic"`/`"charge"`/`"molecular"`/`"full"` -- LAMMPS's
1165
+ * atom style is not recoverable from the file itself (see
1166
+ * [`chematic_mol::LammpsData`]'s module doc comment); any other value is
1167
+ * rejected with a JS error, matching
1168
+ * [`chematic_mol::LammpsDataError::UnsupportedAtomStyle`].
1169
+ *
1170
+ * This module has no bond-perception step of its own: `Angles`/
1171
+ * `Dihedrals`/`Impropers`/`*Coeffs`/any other section not listed above
1172
+ * are preserved verbatim (byte-for-byte, `#` comments included) in
1173
+ * `unparsed_sections`, not modeled field-by-field.
1174
+ */
1175
+ export function lammps_data_to_json(text: string, atom_style: string): string;
1176
+
1177
+ /**
1178
+ * Like [`lammps_dump_cartesian_positions_json`], but returns a flat
1179
+ * `Float64Array` (`[x0,y0,z0,x1,y1,z1,...]`, 3 values per atom) instead
1180
+ * of a JSON `[[x,y,z],...]` array.
1181
+ *
1182
+ * **Behavioral difference from the JSON sibling**: when the frame has no
1183
+ * recognized coordinate columns, [`lammps_dump_cartesian_positions_json`]
1184
+ * returns JSON `null`; a `Float64Array` has no `null`, so this function
1185
+ * returns `Err` instead, with a message naming the columns it looked for.
1186
+ */
1187
+ export function lammps_dump_cartesian_positions_f64(frame_json: string): Float64Array;
1188
+
1189
+ /**
1190
+ * Real Cartesian positions for a LAMMPS dump frame (in the JSON shape
1191
+ * [`lammps_dump_frame_to_json_str`] returns), resolved by delegating
1192
+ * directly to [`chematic_mol::LammpsDumpFrame::cartesian_positions`] --
1193
+ * this function does not reimplement any part of the box-bounds or
1194
+ * scaled-coordinate math itself; that method is the single place this
1195
+ * crate gets the (orthogonal or triclinic) transform right, and every
1196
+ * WASM caller must go through it rather than re-deriving the transform in
1197
+ * JS (the same reasoning behind this crate's OpenDX fail-closed unit
1198
+ * handling and QCSchema's single Bohr<->Ångström conversion point).
1199
+ *
1200
+ * - `x y z` columns: passed straight through.
1201
+ * - `xs ys zs` columns: transformed through `frame.box_bounds` (including
1202
+ * the triclinic shear terms when a tilt is present).
1203
+ * - Neither present (including an `xu yu zu`-only frame -- "unwrapped" is
1204
+ * a materially different physical quantity from a scaled coordinate,
1205
+ * never resolved by this method): returns JSON `null`, not an error and
1206
+ * not an empty array, matching
1207
+ * [`chematic_mol::LammpsDumpFrame::cartesian_positions`]'s own
1208
+ * `Option` semantics exactly.
1209
+ *
1210
+ * Returns JSON `[[x,y,z],...]` on success, in the same atom order as
1211
+ * `frame.rows`. See [`lammps_dump_cartesian_positions_f64`] for a flat
1212
+ * `Float64Array` sibling -- note its `null` case becomes an `Err` there
1213
+ * instead, a disclosed, real API-shape difference (a typed array has no
1214
+ * `null`).
1215
+ */
1216
+ export function lammps_dump_cartesian_positions_json(frame_json: string): string;
1217
+
1218
+ /**
1219
+ * Parse a single LAMMPS dump/trajectory frame and return it as JSON:
1220
+ * `{"timestep":N,"num_atoms":N,
1221
+ * "box_bounds":{"lo":[x,y,z],"hi":[x,y,z],"tilt":[xy,xz,yz]|null},
1222
+ * "boundary_flags":["pp","pp","pp"],"column_names":[...],
1223
+ * "rows":[[...values, one per column_names entry...],...]}`.
1224
+ * `box_bounds` is already the resolved TRUE simulation box (the parser
1225
+ * applies [`chematic_mol::box_bounds_to_true`] internally before
1226
+ * `LammpsDumpFrame` is ever built) -- not the file's raw
1227
+ * `xlo_bound`/`xhi_bound`/... values. `rows` is the raw per-atom column
1228
+ * data as declared by `column_names`, which may be `x y z`
1229
+ * (already-Cartesian), `xs ys zs` (box-scaled), `xu yu zu` (unwrapped), or
1230
+ * any other dump-command column -- use
1231
+ * [`lammps_dump_cartesian_positions_json`] to resolve real Cartesian
1232
+ * positions from whichever convention is present, rather than
1233
+ * reimplementing that resolution/transform in JS.
1234
+ */
1235
+ export function lammps_dump_frame_to_json_str(text: string): string;
1236
+
1237
+ /**
1238
+ * Flattens a LAMMPS dump frame's `rows` (JSON shape
1239
+ * [`lammps_dump_frame_to_json_str`] returns) into a single flat
1240
+ * `Float64Array`, row-major (atom 0's `column_names.len()` values, then
1241
+ * atom 1's, ...). The caller already has `column_names` from
1242
+ * [`lammps_dump_frame_to_json_str`] and can compute the row length
1243
+ * itself (`column_names.length`); no separate row-length accessor is
1244
+ * provided here.
1245
+ */
1246
+ export function lammps_dump_rows_f64(frame_json: string): Float64Array;
1247
+
1248
+ /**
1249
+ * Parse every frame of a LAMMPS dump/trajectory file and return them as a
1250
+ * JSON array (same per-frame shape as [`lammps_dump_frame_to_json_str`]).
1251
+ *
1252
+ * This reads the whole input, parses it fully, and returns every frame at
1253
+ * once -- [`chematic_mol::LammpsDumpReader`]'s per-frame streaming
1254
+ * iteration (reading one frame at a time from a `BufRead` without holding
1255
+ * the whole trajectory in memory) has no natural equivalent across the
1256
+ * JS/WASM boundary in this first pass and is deliberately not exposed
1257
+ * here, not silently dropped: a JS caller with a truly large trajectory
1258
+ * that needs bounded memory should process it server-side instead.
1259
+ */
1260
+ export function lammps_trajectory_to_json(text: string): string;
1261
+
1121
1262
  /**
1122
1263
  * Return the largest fragment of `mol` (salt/solvent stripping).
1123
1264
  *
@@ -1217,11 +1358,34 @@ export function minimize_mmff94_lbfgs_json(mol: MolHandle, max_iter: number): st
1217
1358
  * `coords_json` — JSON array of `[x,y,z]` arrays (Å), one per atom.
1218
1359
  * `max_iter` — maximum iterations (0 = default 500).
1219
1360
  *
1220
- * Returns JSON: `{"coords":[[x,y,z],...], "energy":float, "iterations":int, "converged":bool}`
1221
- * or `{"error":"<msg>"}` on failure.
1361
+ * Returns JSON: `{"coords":[[x,y,z],...], "energy":float, "iterations":int, "converged":bool, "sound":bool}`
1362
+ * or `{"error":"<msg>"}` on failure. `sound` is all-finite coordinates and
1363
+ * no bond stretched past a sane covalent-bond length — independent of
1364
+ * `converged`, since steepest descent often reports `converged:false` on
1365
+ * geometries that are perfectly fine but simply haven't hit the tight
1366
+ * RMS-gradient threshold yet. Check `sound`, not just `converged`, before
1367
+ * trusting a result.
1222
1368
  */
1223
1369
  export function minimize_uff_json(smiles: string, coords_json: string, max_iter: number): string;
1224
1370
 
1371
+ /**
1372
+ * Cartesian coordinates from an mmCIF file, in the SAME atom order
1373
+ * [`mol_from_mmcif`] returns topology for. Returns JSON `[[x,y,z],...]`
1374
+ * (Å).
1375
+ */
1376
+ export function mmcif_coords_json(text: string): string;
1377
+
1378
+ /**
1379
+ * Parse an mmCIF file and return every `_atom_site` field (occupancy,
1380
+ * B-factor, chain/residue bookkeeping, formal charge, model number, ...),
1381
+ * the unit cell, space group, and any loop column this reader saw but
1382
+ * does not model, as JSON: `{"atoms":[{...}],"cell":{...}|null,
1383
+ * "space_group":"..."|null,"unhandled_columns":[...]}`. See
1384
+ * [`chematic_mol::MmcifAtomRecord`]'s doc comment for each atom field's
1385
+ * exact source column and defaulting rule.
1386
+ */
1387
+ export function mmcif_to_json(text: string): string;
1388
+
1225
1389
  /**
1226
1390
  * MMFF94 partial charges (BCI table, ±0.1e accuracy) as a JSON array of f64.
1227
1391
  *
@@ -1348,6 +1512,14 @@ export function mol_from_cdxml(cdxml: string): MolHandle;
1348
1512
  */
1349
1513
  export function mol_from_cml(cml: string): MolHandle;
1350
1514
 
1515
+ /**
1516
+ * Parse a Gaussian Cube file and return a `MolHandle` (topology only --
1517
+ * element list, no bonds; Cube carries no bond table). Use
1518
+ * [`cube_grid_json`] to recover coordinates, the scalar field, and the
1519
+ * grid geometry.
1520
+ */
1521
+ export function mol_from_cube(text: string): MolHandle;
1522
+
1351
1523
  /**
1352
1524
  * Parse an Extended XYZ (extxyz) frame and return a `MolHandle` (topology +
1353
1525
  * element/position only; use [`extxyz_frame_json`] to recover coordinates,
@@ -1361,6 +1533,15 @@ export function mol_from_cml(cml: string): MolHandle;
1361
1533
  */
1362
1534
  export function mol_from_extxyz(text: string): MolHandle;
1363
1535
 
1536
+ /**
1537
+ * Parse an mmCIF file and return a `MolHandle` (topology only -- element
1538
+ * list, no bonds; mmCIF's `_atom_site` category carries no connectivity).
1539
+ * Includes every model's atoms if the file has more than one -- use
1540
+ * [`mmcif_to_json`] to get each atom's `model_num` for filtering. Use
1541
+ * [`mmcif_coords_json`] to recover coordinates in the same atom order.
1542
+ */
1543
+ export function mol_from_mmcif(text: string): MolHandle;
1544
+
1364
1545
  /**
1365
1546
  * Parse a MolJSON string into a `MolHandle`.
1366
1547
  *
@@ -1369,6 +1550,18 @@ export function mol_from_extxyz(text: string): MolHandle;
1369
1550
  */
1370
1551
  export function mol_from_moljson(json: string): MolHandle;
1371
1552
 
1553
+ /**
1554
+ * Parse an ORCA input file (`.inp`) and return a `MolHandle` (topology
1555
+ * only -- element list, no bonds; ORCA input carries no bond table).
1556
+ * Returns a JS error unless the file's coordinate block is an embedded
1557
+ * `* xyz ... *` block -- `xyzfile`/`gzmtfile`/`int` (Z-matrix) blocks
1558
+ * carry no atom list to convert, or none is present at all. Use
1559
+ * [`orca_input_coords_json`] to recover coordinates + charge +
1560
+ * multiplicity in the same atom order, or [`orca_input_to_json`] for the
1561
+ * full input (comments/keywords/blocks/any coordinate-block kind).
1562
+ */
1563
+ export function mol_from_orca_input(text: string): MolHandle;
1564
+
1372
1565
  /**
1373
1566
  * Parse a PDB file and return a `MolHandle` (topology only; coordinates are
1374
1567
  * discarded -- use [`pdb_coords_json`] to recover them in the SAME atom
@@ -1380,6 +1573,24 @@ export function mol_from_moljson(json: string): MolHandle;
1380
1573
  */
1381
1574
  export function mol_from_pdb(pdb: string): MolHandle;
1382
1575
 
1576
+ /**
1577
+ * Parse a PQR file and return a `MolHandle` (topology only -- element
1578
+ * list inferred per-atom, no bonds; PQR carries no connectivity). Use
1579
+ * [`pqr_coords_json`] to recover coordinates in the same atom order.
1580
+ */
1581
+ export function mol_from_pqr(text: string): MolHandle;
1582
+
1583
+ /**
1584
+ * Parse a QCSchema `qcschema_molecule` JSON document and return a
1585
+ * `MolHandle` (topology + `atomic_numbers`-derived isotopes -- no bonds
1586
+ * unless the document's optional `connectivity` list is present, in which
1587
+ * case those bond orders are mapped onto the nearest
1588
+ * [`chematic_core::BondOrder`]). Use [`qcschema_molecule_coords_json`] to
1589
+ * recover coordinates (converted Bohr -> Å) plus molecular
1590
+ * charge/multiplicity, in the same atom order.
1591
+ */
1592
+ export function mol_from_qcschema_molecule(json: string): MolHandle;
1593
+
1383
1594
  /**
1384
1595
  * Parse a MOL V2000 block and return a `MolHandle`.
1385
1596
  *
@@ -1519,6 +1730,58 @@ export function normalize_cxsmiles(s: string): string;
1519
1730
  */
1520
1731
  export function normalize_reaction_smiles(rxn_smiles: string): string;
1521
1732
 
1733
+ /**
1734
+ * Parse an OpenDX (APBS scalar-field subset) file and return its full
1735
+ * [`chematic_mol::VolumetricGrid`] as JSON (same shape as
1736
+ * [`cube_grid_json`]; `atoms` is always empty -- OpenDX has no atom
1737
+ * section). No `mol_from_opendx` is provided: an OpenDX grid never carries
1738
+ * atoms, so a `MolHandle` from one would always be empty and is not a
1739
+ * useful binding.
1740
+ */
1741
+ export function opendx_grid_json(text: string): string;
1742
+
1743
+ /**
1744
+ * `[nx, ny, nz]` for an OpenDX file's grid, as a `Uint32Array`.
1745
+ */
1746
+ export function opendx_shape_u32(text: string): Uint32Array;
1747
+
1748
+ /**
1749
+ * Flat `values` from an OpenDX file's grid, as a `Float64Array` -- same
1750
+ * data [`opendx_grid_json`]'s `"values"` field carries.
1751
+ */
1752
+ export function opendx_values_f64(text: string): Float64Array;
1753
+
1754
+ /**
1755
+ * Coordinates + charge + multiplicity from an ORCA input file's embedded
1756
+ * `* xyz ... *` block, in the SAME atom order [`mol_from_orca_input`]
1757
+ * returns topology for. Returns JSON
1758
+ * `{"coords":[[x,y,z],...],"charge":0,"multiplicity":1}`, or a JS error
1759
+ * under the same conditions as [`mol_from_orca_input`].
1760
+ */
1761
+ export function orca_input_coords_json(text: string): string;
1762
+
1763
+ /**
1764
+ * Parse an ORCA input file and return every field as JSON:
1765
+ * `{"comments":[...],"keywords":[...],
1766
+ * "blocks":[{"name":"scf","raw":"...","has_end":true},...],
1767
+ * "coords":{"type":"xyz"|"xyzfile"|"gzmtfile"|"internal",...}|null}`.
1768
+ * See [`chematic_mol::OrcaInput`]'s doc comment for each field's meaning.
1769
+ */
1770
+ export function orca_input_to_json(text: string): string;
1771
+
1772
+ /**
1773
+ * Parse an ORCA output file (`.out`/`.log`) and return every extracted
1774
+ * field as JSON: `{"charge":N|null,"multiplicity":N|null,
1775
+ * "final_energy_hartree":N|null,
1776
+ * "trajectory":[{"elements":[...],"coords":[[x,y,z],...]},...],
1777
+ * "frequencies_cm1":[...],
1778
+ * "termination":{"kind":"normal"|"error"|"incomplete","detail":"..."?},
1779
+ * "optimization_convergence":"not_requested"|"converged"|"not_converged"|"unknown"}`.
1780
+ * No writer is provided -- an ORCA output file is a job log, not a
1781
+ * document this crate constructs.
1782
+ */
1783
+ export function orca_output_to_json(text: string): string;
1784
+
1522
1785
  /**
1523
1786
  * PAINS structural alert names matched by `mol` as a JSON array.
1524
1787
  *
@@ -1586,6 +1849,26 @@ export function pharmacophore_fp_2d_summary(mol: MolHandle): string;
1586
1849
  */
1587
1850
  export function pharmacophore_fp_3d_summary(mol: MolHandle): string;
1588
1851
 
1852
+ /**
1853
+ * Cartesian coordinates from a PQR file, in the SAME atom order
1854
+ * [`mol_from_pqr`] returns topology for. Returns JSON `[[x,y,z],...]` (Å).
1855
+ */
1856
+ export function pqr_coords_json(text: string): string;
1857
+
1858
+ /**
1859
+ * Infer an element from a PQR atom name (see
1860
+ * [`chematic_mol::infer_element`]'s doc comment for the heuristic).
1861
+ * Returns `undefined` (JS) / `None` if no element could be inferred.
1862
+ */
1863
+ export function pqr_infer_element(group_pdb: string, res_name: string, atom_name: string): string | undefined;
1864
+
1865
+ /**
1866
+ * Parse a PQR file and return every field (charge, radius, chain,
1867
+ * residue, inferred element, ...) as JSON: `{"atoms":[{...}]}`. See
1868
+ * [`chematic_mol::PqrAtomRecord`]'s doc comment for each field's meaning.
1869
+ */
1870
+ export function pqr_to_json(text: string): string;
1871
+
1589
1872
  /**
1590
1873
  * Predict pKa for all ionizable sites in a molecule.
1591
1874
  *
@@ -1595,6 +1878,34 @@ export function pharmacophore_fp_3d_summary(mol: MolHandle): string;
1595
1878
  */
1596
1879
  export function predict_pka_json(smiles: string): string;
1597
1880
 
1881
+ /**
1882
+ * Coordinates (Å) plus molecular charge/multiplicity from a QCSchema
1883
+ * `qcschema_molecule` document, in the SAME atom order
1884
+ * [`mol_from_qcschema_molecule`] returns topology for. Returns JSON
1885
+ * `{"coords":[[x,y,z],...],"molecular_charge":0.0,"molecular_multiplicity":1}`.
1886
+ */
1887
+ export function qcschema_molecule_coords_json(json: string): string;
1888
+
1889
+ /**
1890
+ * Parse a QCSchema `qcschema_input`/`qc_schema_input` JSON document
1891
+ * (molecule + driver + model + keywords) and re-emit it, validating and
1892
+ * canonicalizing field defaults in the process (e.g. a missing
1893
+ * `schema_name`/`schema_version` is filled in). Job-level fields
1894
+ * (`driver`, `model`, `keywords`, `protocols`, `extras`) are round-tripped
1895
+ * opaquely -- this binding validates/reformats the document; it does not
1896
+ * expose a separate JS-facing accessor for each field (out of scope for
1897
+ * this first pass, see module docs' "None of these formats carry a bond
1898
+ * table" section for the analogous molecule-centric scope choice made
1899
+ * elsewhere in this file).
1900
+ */
1901
+ export function qcschema_validate_atomic_input(json: string): string;
1902
+
1903
+ /**
1904
+ * Like [`qcschema_validate_atomic_input`], for a QCSchema
1905
+ * `qcschema_output`/`qc_schema_output` (`AtomicResult`) document.
1906
+ */
1907
+ export function qcschema_validate_atomic_result(json: string): string;
1908
+
1598
1909
  /**
1599
1910
  * Generate `count` random SMILES from a SMILES string using the given seed.
1600
1911
  * Atoms are permuted based on xorshift64 RNG. Each variant should parse back
@@ -2022,6 +2333,16 @@ export function to_mol_v3000_block(mol: MolHandle): string;
2022
2333
  */
2023
2334
  export function to_moljson(mol: MolHandle): string;
2024
2335
 
2336
+ /**
2337
+ * Serialize a `MolHandle` + coordinates (Å) + molecular charge/multiplicity
2338
+ * as a QCSchema `qcschema_molecule` JSON document (coordinates converted
2339
+ * to Bohr).
2340
+ *
2341
+ * `coords_json`: `[[x,y,z],...]` (Å), same order and length as `mol`'s
2342
+ * atoms.
2343
+ */
2344
+ export function to_qcschema_molecule_json(mol: MolHandle, coords_json: string, charge: number, multiplicity: bigint): string;
2345
+
2025
2346
  /**
2026
2347
  * Serialize a molecule to XYZ format.
2027
2348
  *
@@ -2060,6 +2381,76 @@ export function whim_descriptors_json(mol: MolHandle): string;
2060
2381
  */
2061
2382
  export function whim_getaway_combined_json(mol: MolHandle): string;
2062
2383
 
2384
+ /**
2385
+ * Write a grid (in the JSON shape [`cube_grid_json`] returns) as a
2386
+ * Gaussian Cube file.
2387
+ */
2388
+ export function write_cube_json(grid_json: string): string;
2389
+
2390
+ /**
2391
+ * Write a LAMMPS data file from the JSON shape [`lammps_data_to_json`]
2392
+ * returns.
2393
+ */
2394
+ export function write_lammps_data_json(json: string): string;
2395
+
2396
+ /**
2397
+ * Write a single LAMMPS dump frame from the JSON shape
2398
+ * [`lammps_dump_frame_to_json_str`] returns.
2399
+ */
2400
+ export function write_lammps_dump_frame_json(json: string): string;
2401
+
2402
+ /**
2403
+ * Write a LAMMPS trajectory (N frames concatenated back to back, matching
2404
+ * [`chematic_mol::write_lammps_trajectory`]) from a JSON array of frames
2405
+ * in the shape [`lammps_dump_frame_to_json_str`] returns.
2406
+ */
2407
+ export function write_lammps_trajectory_json(json: string): string;
2408
+
2409
+ /**
2410
+ * Write an mmCIF file from atom records in the JSON shape
2411
+ * [`mmcif_to_json`]'s `"atoms"` array uses (a full record per atom, not
2412
+ * just element+coordinates -- mmCIF has no equivalent of "build from a
2413
+ * bare `MolHandle`", since occupancy/B-factor/chain/residue fields have no
2414
+ * source in a plain [`MolHandle`]).
2415
+ *
2416
+ * `cell_json`: `"null"` or `{"a":...,"b":...,"c":...,"alpha":...,"beta":...,"gamma":...}`.
2417
+ * `space_group`: pass `""` for none.
2418
+ */
2419
+ export function write_mmcif_json(records_json: string, cell_json: string, space_group: string, data_block_name: string): string;
2420
+
2421
+ /**
2422
+ * Write a grid as an OpenDX file. Fails closed for a
2423
+ * [`chematic_mol::GridUnits::Bohr`]-tagged grid (OpenDX has no unit tag of
2424
+ * its own and is universally read back as Ångström -- see
2425
+ * `chematic_mol::opendx`'s module docs) and for a grid carrying any atoms
2426
+ * (OpenDX has no atom section). Use [`write_opendx_lossy_json`] to opt
2427
+ * into an explicit Bohr->Ångström conversion instead of failing.
2428
+ */
2429
+ export function write_opendx_json(grid_json: string): string;
2430
+
2431
+ /**
2432
+ * Like [`write_opendx_json`], but a [`chematic_mol::GridUnits::Bohr`] grid
2433
+ * has its `origin`/`axes` explicitly converted to Ångström rather than
2434
+ * rejected (`values` -- the scalar-field samples themselves -- are never
2435
+ * rescaled; see `write_opendx_lossy`'s doc comment). Still fails for a
2436
+ * grid carrying any atoms.
2437
+ */
2438
+ export function write_opendx_lossy_json(grid_json: string): string;
2439
+
2440
+ /**
2441
+ * Write an ORCA input file from the JSON shape [`orca_input_to_json`]
2442
+ * returns.
2443
+ */
2444
+ export function write_orca_input_json(json: string): string;
2445
+
2446
+ /**
2447
+ * Write a PQR file from atom records in the JSON shape [`pqr_to_json`]'s
2448
+ * `"atoms"` array uses. Each atom's `chain_id` independently controls
2449
+ * whether that line is written with or without the (optional) chain
2450
+ * column.
2451
+ */
2452
+ export function write_pqr_json(records_json: string): string;
2453
+
2063
2454
  /**
2064
2455
  * Non-canonical SMILES for `mol`.
2065
2456
  *
@@ -2103,6 +2494,7 @@ export interface InitOutput {
2103
2494
  readonly canonical_tautomer: (a: number) => number;
2104
2495
  readonly canonical_tautomer_with_blocked_atoms_json: (a: number, b: number, c: number) => [number, number];
2105
2496
  readonly cdxml_to_smiles_json: (a: number, b: number) => [number, number, number, number];
2497
+ readonly chematic_version: () => [number, number];
2106
2498
  readonly cip_assignments_accurate_json: (a: number) => [number, number];
2107
2499
  readonly cip_assignments_json: (a: number) => [number, number];
2108
2500
  readonly cip_unresolved_json: (a: number) => [number, number];
@@ -2120,6 +2512,9 @@ export interface InitOutput {
2120
2512
  readonly conformerhandle_new: (a: number, b: number) => [number, number, number];
2121
2513
  readonly conformerhandle_remove_conformer: (a: number, b: number) => number;
2122
2514
  readonly cpk_color: (a: number, b: number) => [number, number];
2515
+ readonly cube_grid_json: (a: number, b: number) => [number, number, number, number];
2516
+ readonly cube_shape_u32: (a: number, b: number) => [number, number, number];
2517
+ readonly cube_values_f64: (a: number, b: number) => [number, number, number];
2123
2518
  readonly depict_data_json: (a: number) => [number, number];
2124
2519
  readonly depict_data_with_coords_json: (a: number, b: number, c: number) => [number, number];
2125
2520
  readonly depict_reaction_svg: (a: number, b: number) => [number, number, number, number];
@@ -2181,6 +2576,12 @@ export interface InitOutput {
2181
2576
  readonly invert_stereocenter_at: (a: number, b: number) => [number, number, number];
2182
2577
  readonly is_valid_smiles: (a: number, b: number) => number;
2183
2578
  readonly labute_asa_per_atom_json: (a: number) => [number, number];
2579
+ readonly lammps_data_to_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
2580
+ readonly lammps_dump_cartesian_positions_f64: (a: number, b: number) => [number, number, number];
2581
+ readonly lammps_dump_cartesian_positions_json: (a: number, b: number) => [number, number, number, number];
2582
+ readonly lammps_dump_frame_to_json_str: (a: number, b: number) => [number, number, number, number];
2583
+ readonly lammps_dump_rows_f64: (a: number, b: number) => [number, number, number];
2584
+ readonly lammps_trajectory_to_json: (a: number, b: number) => [number, number, number, number];
2184
2585
  readonly largest_fragment: (a: number) => number;
2185
2586
  readonly logp_per_atom_json: (a: number) => [number, number];
2186
2587
  readonly maccs_bitvec: (a: number) => [number, number];
@@ -2198,6 +2599,8 @@ export interface InitOutput {
2198
2599
  readonly minimize_mmff94_json: (a: number, b: number) => [number, number];
2199
2600
  readonly minimize_mmff94_lbfgs_json: (a: number, b: number) => [number, number];
2200
2601
  readonly minimize_uff_json: (a: number, b: number, c: number, d: number, e: number) => [number, number];
2602
+ readonly mmcif_coords_json: (a: number, b: number) => [number, number, number, number];
2603
+ readonly mmcif_to_json: (a: number, b: number) => [number, number, number, number];
2201
2604
  readonly mmff94_charges_json: (a: number) => [number, number];
2202
2605
  readonly mmff94_charges_typed_json: (a: number) => [number, number];
2203
2606
  readonly mmff94_energy_breakdown_from_coords_json: (a: number, b: number, c: number) => [number, number];
@@ -2210,9 +2613,14 @@ export interface InitOutput {
2210
2613
  readonly mol_block_stereo_diagnostics_json: (a: number, b: number) => [number, number, number, number];
2211
2614
  readonly mol_from_cdxml: (a: number, b: number) => [number, number, number];
2212
2615
  readonly mol_from_cml: (a: number, b: number) => [number, number, number];
2616
+ readonly mol_from_cube: (a: number, b: number) => [number, number, number];
2213
2617
  readonly mol_from_extxyz: (a: number, b: number) => [number, number, number];
2618
+ readonly mol_from_mmcif: (a: number, b: number) => [number, number, number];
2214
2619
  readonly mol_from_moljson: (a: number, b: number) => [number, number, number];
2620
+ readonly mol_from_orca_input: (a: number, b: number) => [number, number, number];
2215
2621
  readonly mol_from_pdb: (a: number, b: number) => number;
2622
+ readonly mol_from_pqr: (a: number, b: number) => [number, number, number];
2623
+ readonly mol_from_qcschema_molecule: (a: number, b: number) => [number, number, number];
2216
2624
  readonly mol_from_sdf_block: (a: number, b: number) => [number, number, number];
2217
2625
  readonly mol_from_v3000_block: (a: number, b: number) => [number, number, number];
2218
2626
  readonly mol_from_xyz: (a: number, b: number) => [number, number, number];
@@ -2304,6 +2712,12 @@ export interface InitOutput {
2304
2712
  readonly neutralize_charges: (a: number) => number;
2305
2713
  readonly normalize_cxsmiles: (a: number, b: number) => [number, number, number, number];
2306
2714
  readonly normalize_reaction_smiles: (a: number, b: number) => [number, number, number, number];
2715
+ readonly opendx_grid_json: (a: number, b: number) => [number, number, number, number];
2716
+ readonly opendx_shape_u32: (a: number, b: number) => [number, number, number];
2717
+ readonly opendx_values_f64: (a: number, b: number) => [number, number, number];
2718
+ readonly orca_input_coords_json: (a: number, b: number) => [number, number, number, number];
2719
+ readonly orca_input_to_json: (a: number, b: number) => [number, number, number, number];
2720
+ readonly orca_output_to_json: (a: number, b: number) => [number, number, number, number];
2307
2721
  readonly pains_matches_json: (a: number) => [number, number];
2308
2722
  readonly parse_cxsmarts_json: (a: number, b: number) => [number, number, number, number];
2309
2723
  readonly parse_cxsmiles_json: (a: number, b: number) => [number, number, number, number];
@@ -2313,7 +2727,13 @@ export interface InitOutput {
2313
2727
  readonly pharmacophore_features_json: (a: number) => [number, number];
2314
2728
  readonly pharmacophore_fp_2d_summary: (a: number) => [number, number];
2315
2729
  readonly pharmacophore_fp_3d_summary: (a: number) => [number, number];
2730
+ readonly pqr_coords_json: (a: number, b: number) => [number, number, number, number];
2731
+ readonly pqr_infer_element: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
2732
+ readonly pqr_to_json: (a: number, b: number) => [number, number, number, number];
2316
2733
  readonly predict_pka_json: (a: number, b: number) => [number, number];
2734
+ readonly qcschema_molecule_coords_json: (a: number, b: number) => [number, number, number, number];
2735
+ readonly qcschema_validate_atomic_input: (a: number, b: number) => [number, number, number, number];
2736
+ readonly qcschema_validate_atomic_result: (a: number, b: number) => [number, number, number, number];
2317
2737
  readonly random_smiles_json: (a: number, b: number, c: number, d: bigint) => [number, number, number, number];
2318
2738
  readonly rdkit_ecfp4_bitvec: (a: number) => [number, number, number, number];
2319
2739
  readonly rdkit_ecfp4_detail_json: (a: number) => [number, number, number, number];
@@ -2358,11 +2778,21 @@ export interface InitOutput {
2358
2778
  readonly to_mol_block: (a: number) => [number, number];
2359
2779
  readonly to_mol_v3000_block: (a: number) => [number, number];
2360
2780
  readonly to_moljson: (a: number) => [number, number];
2781
+ readonly to_qcschema_molecule_json: (a: number, b: number, c: number, d: number, e: bigint) => [number, number, number, number];
2361
2782
  readonly to_xyz: (a: number) => [number, number];
2362
2783
  readonly torsion_bitvec: (a: number) => [number, number];
2363
2784
  readonly virtual_screen_ecfp4_json: (a: number, b: number, c: number, d: number, e: number) => [number, number];
2364
2785
  readonly whim_descriptors_json: (a: number) => [number, number];
2365
2786
  readonly whim_getaway_combined_json: (a: number) => [number, number];
2787
+ readonly write_cube_json: (a: number, b: number) => [number, number, number, number];
2788
+ readonly write_lammps_data_json: (a: number, b: number) => [number, number, number, number];
2789
+ readonly write_lammps_dump_frame_json: (a: number, b: number) => [number, number, number, number];
2790
+ readonly write_lammps_trajectory_json: (a: number, b: number) => [number, number, number, number];
2791
+ readonly write_mmcif_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
2792
+ readonly write_opendx_json: (a: number, b: number) => [number, number, number, number];
2793
+ readonly write_opendx_lossy_json: (a: number, b: number) => [number, number, number, number];
2794
+ readonly write_orca_input_json: (a: number, b: number) => [number, number, number, number];
2795
+ readonly write_pqr_json: (a: number, b: number) => [number, number, number, number];
2366
2796
  readonly write_smiles: (a: number) => [number, number];
2367
2797
  readonly xlogp3_json: (a: number) => [number, number];
2368
2798
  readonly xlogp3_per_atom_json: (a: number) => [number, number];