@kent-tokyo/chematic 0.17.0 → 0.18.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 +2 -0
- package/chematic_wasm.d.ts +415 -0
- package/chematic_wasm.js +1094 -0
- package/chematic_wasm_bg.wasm +0 -0
- package/package.json +1 -1
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
|
package/chematic_wasm.d.ts
CHANGED
|
@@ -660,6 +660,30 @@ export function conformer_ensemble_json(mol: MolHandle, n: number, rmsd_threshol
|
|
|
660
660
|
*/
|
|
661
661
|
export function cpk_color(element_symbol: string): string;
|
|
662
662
|
|
|
663
|
+
/**
|
|
664
|
+
* Parse a Gaussian Cube file and return its full [`chematic_mol::VolumetricGrid`]
|
|
665
|
+
* as JSON: `{"origin":[x,y,z],"axes":[[..],[..],[..]],"shape":[nx,ny,nz],
|
|
666
|
+
* "values":[...flat, row-major third-axis-fastest...],
|
|
667
|
+
* "atoms":[{"element":"C","charge":6.0,"position":[x,y,z]}],
|
|
668
|
+
* "units":"bohr"|"angstrom"}`. See module docs for the perf tradeoff of a
|
|
669
|
+
* full `values` JSON round trip on a large grid.
|
|
670
|
+
*/
|
|
671
|
+
export function cube_grid_json(text: string): string;
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* `[nx, ny, nz]` for a Gaussian Cube file's grid, as a `Uint32Array`.
|
|
675
|
+
*/
|
|
676
|
+
export function cube_shape_u32(text: string): Uint32Array;
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* Flat `values` from a Gaussian Cube file's grid, as a `Float64Array` --
|
|
680
|
+
* same data [`cube_grid_json`]'s `"values"` field carries (row-major,
|
|
681
|
+
* third-axis-fastest order -- see `chematic_mol::volumetric`'s module
|
|
682
|
+
* docs for the exact index formula), as a real typed array instead of a
|
|
683
|
+
* JSON number array.
|
|
684
|
+
*/
|
|
685
|
+
export function cube_values_f64(text: string): Float64Array;
|
|
686
|
+
|
|
663
687
|
/**
|
|
664
688
|
* Compute structured depiction data for `mol` as a JSON object.
|
|
665
689
|
*
|
|
@@ -1118,6 +1142,114 @@ export function is_valid_smiles(s: string): boolean;
|
|
|
1118
1142
|
*/
|
|
1119
1143
|
export function labute_asa_per_atom_json(mol: MolHandle): string;
|
|
1120
1144
|
|
|
1145
|
+
/**
|
|
1146
|
+
* Parse a LAMMPS data file (`read_data` format) and return every section
|
|
1147
|
+
* as JSON: `{"counts":[["atoms",120],["atom types",4],...],
|
|
1148
|
+
* "atom_style":"atomic"|"charge"|"molecular"|"full"|"<other>",
|
|
1149
|
+
* "simulation_box":{"lo":[x,y,z],"hi":[x,y,z],"tilt":[xy,xz,yz]|null},
|
|
1150
|
+
* "masses":[{"atom_type":N,"mass":N}],
|
|
1151
|
+
* "atoms":[{"id":N,"molecule_id":N|null,"atom_type":N,"charge":N|null,"x":N,"y":N,"z":N,"image":[ix,iy,iz]|null}],
|
|
1152
|
+
* "velocities":[{"atom_id":N,"vx":N,"vy":N,"vz":N}],
|
|
1153
|
+
* "bonds":[{"id":N,"bond_type":N,"atom1":N,"atom2":N}],
|
|
1154
|
+
* "unparsed_sections":[["Angles","<raw row text>"],...]}`. `atom_type`
|
|
1155
|
+
* must be exactly `"atomic"`/`"charge"`/`"molecular"`/`"full"` -- LAMMPS's
|
|
1156
|
+
* atom style is not recoverable from the file itself (see
|
|
1157
|
+
* [`chematic_mol::LammpsData`]'s module doc comment); any other value is
|
|
1158
|
+
* rejected with a JS error, matching
|
|
1159
|
+
* [`chematic_mol::LammpsDataError::UnsupportedAtomStyle`].
|
|
1160
|
+
*
|
|
1161
|
+
* This module has no bond-perception step of its own: `Angles`/
|
|
1162
|
+
* `Dihedrals`/`Impropers`/`*Coeffs`/any other section not listed above
|
|
1163
|
+
* are preserved verbatim (byte-for-byte, `#` comments included) in
|
|
1164
|
+
* `unparsed_sections`, not modeled field-by-field.
|
|
1165
|
+
*/
|
|
1166
|
+
export function lammps_data_to_json(text: string, atom_style: string): string;
|
|
1167
|
+
|
|
1168
|
+
/**
|
|
1169
|
+
* Like [`lammps_dump_cartesian_positions_json`], but returns a flat
|
|
1170
|
+
* `Float64Array` (`[x0,y0,z0,x1,y1,z1,...]`, 3 values per atom) instead
|
|
1171
|
+
* of a JSON `[[x,y,z],...]` array.
|
|
1172
|
+
*
|
|
1173
|
+
* **Behavioral difference from the JSON sibling**: when the frame has no
|
|
1174
|
+
* recognized coordinate columns, [`lammps_dump_cartesian_positions_json`]
|
|
1175
|
+
* returns JSON `null`; a `Float64Array` has no `null`, so this function
|
|
1176
|
+
* returns `Err` instead, with a message naming the columns it looked for.
|
|
1177
|
+
*/
|
|
1178
|
+
export function lammps_dump_cartesian_positions_f64(frame_json: string): Float64Array;
|
|
1179
|
+
|
|
1180
|
+
/**
|
|
1181
|
+
* Real Cartesian positions for a LAMMPS dump frame (in the JSON shape
|
|
1182
|
+
* [`lammps_dump_frame_to_json_str`] returns), resolved by delegating
|
|
1183
|
+
* directly to [`chematic_mol::LammpsDumpFrame::cartesian_positions`] --
|
|
1184
|
+
* this function does not reimplement any part of the box-bounds or
|
|
1185
|
+
* scaled-coordinate math itself; that method is the single place this
|
|
1186
|
+
* crate gets the (orthogonal or triclinic) transform right, and every
|
|
1187
|
+
* WASM caller must go through it rather than re-deriving the transform in
|
|
1188
|
+
* JS (the same reasoning behind this crate's OpenDX fail-closed unit
|
|
1189
|
+
* handling and QCSchema's single Bohr<->Ångström conversion point).
|
|
1190
|
+
*
|
|
1191
|
+
* - `x y z` columns: passed straight through.
|
|
1192
|
+
* - `xs ys zs` columns: transformed through `frame.box_bounds` (including
|
|
1193
|
+
* the triclinic shear terms when a tilt is present).
|
|
1194
|
+
* - Neither present (including an `xu yu zu`-only frame -- "unwrapped" is
|
|
1195
|
+
* a materially different physical quantity from a scaled coordinate,
|
|
1196
|
+
* never resolved by this method): returns JSON `null`, not an error and
|
|
1197
|
+
* not an empty array, matching
|
|
1198
|
+
* [`chematic_mol::LammpsDumpFrame::cartesian_positions`]'s own
|
|
1199
|
+
* `Option` semantics exactly.
|
|
1200
|
+
*
|
|
1201
|
+
* Returns JSON `[[x,y,z],...]` on success, in the same atom order as
|
|
1202
|
+
* `frame.rows`. See [`lammps_dump_cartesian_positions_f64`] for a flat
|
|
1203
|
+
* `Float64Array` sibling -- note its `null` case becomes an `Err` there
|
|
1204
|
+
* instead, a disclosed, real API-shape difference (a typed array has no
|
|
1205
|
+
* `null`).
|
|
1206
|
+
*/
|
|
1207
|
+
export function lammps_dump_cartesian_positions_json(frame_json: string): string;
|
|
1208
|
+
|
|
1209
|
+
/**
|
|
1210
|
+
* Parse a single LAMMPS dump/trajectory frame and return it as JSON:
|
|
1211
|
+
* `{"timestep":N,"num_atoms":N,
|
|
1212
|
+
* "box_bounds":{"lo":[x,y,z],"hi":[x,y,z],"tilt":[xy,xz,yz]|null},
|
|
1213
|
+
* "boundary_flags":["pp","pp","pp"],"column_names":[...],
|
|
1214
|
+
* "rows":[[...values, one per column_names entry...],...]}`.
|
|
1215
|
+
* `box_bounds` is already the resolved TRUE simulation box (the parser
|
|
1216
|
+
* applies [`chematic_mol::box_bounds_to_true`] internally before
|
|
1217
|
+
* `LammpsDumpFrame` is ever built) -- not the file's raw
|
|
1218
|
+
* `xlo_bound`/`xhi_bound`/... values. `rows` is the raw per-atom column
|
|
1219
|
+
* data as declared by `column_names`, which may be `x y z`
|
|
1220
|
+
* (already-Cartesian), `xs ys zs` (box-scaled), `xu yu zu` (unwrapped), or
|
|
1221
|
+
* any other dump-command column -- use
|
|
1222
|
+
* [`lammps_dump_cartesian_positions_json`] to resolve real Cartesian
|
|
1223
|
+
* positions from whichever convention is present, rather than
|
|
1224
|
+
* reimplementing that resolution/transform in JS.
|
|
1225
|
+
*/
|
|
1226
|
+
export function lammps_dump_frame_to_json_str(text: string): string;
|
|
1227
|
+
|
|
1228
|
+
/**
|
|
1229
|
+
* Flattens a LAMMPS dump frame's `rows` (JSON shape
|
|
1230
|
+
* [`lammps_dump_frame_to_json_str`] returns) into a single flat
|
|
1231
|
+
* `Float64Array`, row-major (atom 0's `column_names.len()` values, then
|
|
1232
|
+
* atom 1's, ...). The caller already has `column_names` from
|
|
1233
|
+
* [`lammps_dump_frame_to_json_str`] and can compute the row length
|
|
1234
|
+
* itself (`column_names.length`); no separate row-length accessor is
|
|
1235
|
+
* provided here.
|
|
1236
|
+
*/
|
|
1237
|
+
export function lammps_dump_rows_f64(frame_json: string): Float64Array;
|
|
1238
|
+
|
|
1239
|
+
/**
|
|
1240
|
+
* Parse every frame of a LAMMPS dump/trajectory file and return them as a
|
|
1241
|
+
* JSON array (same per-frame shape as [`lammps_dump_frame_to_json_str`]).
|
|
1242
|
+
*
|
|
1243
|
+
* This reads the whole input, parses it fully, and returns every frame at
|
|
1244
|
+
* once -- [`chematic_mol::LammpsDumpReader`]'s per-frame streaming
|
|
1245
|
+
* iteration (reading one frame at a time from a `BufRead` without holding
|
|
1246
|
+
* the whole trajectory in memory) has no natural equivalent across the
|
|
1247
|
+
* JS/WASM boundary in this first pass and is deliberately not exposed
|
|
1248
|
+
* here, not silently dropped: a JS caller with a truly large trajectory
|
|
1249
|
+
* that needs bounded memory should process it server-side instead.
|
|
1250
|
+
*/
|
|
1251
|
+
export function lammps_trajectory_to_json(text: string): string;
|
|
1252
|
+
|
|
1121
1253
|
/**
|
|
1122
1254
|
* Return the largest fragment of `mol` (salt/solvent stripping).
|
|
1123
1255
|
*
|
|
@@ -1222,6 +1354,24 @@ export function minimize_mmff94_lbfgs_json(mol: MolHandle, max_iter: number): st
|
|
|
1222
1354
|
*/
|
|
1223
1355
|
export function minimize_uff_json(smiles: string, coords_json: string, max_iter: number): string;
|
|
1224
1356
|
|
|
1357
|
+
/**
|
|
1358
|
+
* Cartesian coordinates from an mmCIF file, in the SAME atom order
|
|
1359
|
+
* [`mol_from_mmcif`] returns topology for. Returns JSON `[[x,y,z],...]`
|
|
1360
|
+
* (Å).
|
|
1361
|
+
*/
|
|
1362
|
+
export function mmcif_coords_json(text: string): string;
|
|
1363
|
+
|
|
1364
|
+
/**
|
|
1365
|
+
* Parse an mmCIF file and return every `_atom_site` field (occupancy,
|
|
1366
|
+
* B-factor, chain/residue bookkeeping, formal charge, model number, ...),
|
|
1367
|
+
* the unit cell, space group, and any loop column this reader saw but
|
|
1368
|
+
* does not model, as JSON: `{"atoms":[{...}],"cell":{...}|null,
|
|
1369
|
+
* "space_group":"..."|null,"unhandled_columns":[...]}`. See
|
|
1370
|
+
* [`chematic_mol::MmcifAtomRecord`]'s doc comment for each atom field's
|
|
1371
|
+
* exact source column and defaulting rule.
|
|
1372
|
+
*/
|
|
1373
|
+
export function mmcif_to_json(text: string): string;
|
|
1374
|
+
|
|
1225
1375
|
/**
|
|
1226
1376
|
* MMFF94 partial charges (BCI table, ±0.1e accuracy) as a JSON array of f64.
|
|
1227
1377
|
*
|
|
@@ -1348,6 +1498,14 @@ export function mol_from_cdxml(cdxml: string): MolHandle;
|
|
|
1348
1498
|
*/
|
|
1349
1499
|
export function mol_from_cml(cml: string): MolHandle;
|
|
1350
1500
|
|
|
1501
|
+
/**
|
|
1502
|
+
* Parse a Gaussian Cube file and return a `MolHandle` (topology only --
|
|
1503
|
+
* element list, no bonds; Cube carries no bond table). Use
|
|
1504
|
+
* [`cube_grid_json`] to recover coordinates, the scalar field, and the
|
|
1505
|
+
* grid geometry.
|
|
1506
|
+
*/
|
|
1507
|
+
export function mol_from_cube(text: string): MolHandle;
|
|
1508
|
+
|
|
1351
1509
|
/**
|
|
1352
1510
|
* Parse an Extended XYZ (extxyz) frame and return a `MolHandle` (topology +
|
|
1353
1511
|
* element/position only; use [`extxyz_frame_json`] to recover coordinates,
|
|
@@ -1361,6 +1519,15 @@ export function mol_from_cml(cml: string): MolHandle;
|
|
|
1361
1519
|
*/
|
|
1362
1520
|
export function mol_from_extxyz(text: string): MolHandle;
|
|
1363
1521
|
|
|
1522
|
+
/**
|
|
1523
|
+
* Parse an mmCIF file and return a `MolHandle` (topology only -- element
|
|
1524
|
+
* list, no bonds; mmCIF's `_atom_site` category carries no connectivity).
|
|
1525
|
+
* Includes every model's atoms if the file has more than one -- use
|
|
1526
|
+
* [`mmcif_to_json`] to get each atom's `model_num` for filtering. Use
|
|
1527
|
+
* [`mmcif_coords_json`] to recover coordinates in the same atom order.
|
|
1528
|
+
*/
|
|
1529
|
+
export function mol_from_mmcif(text: string): MolHandle;
|
|
1530
|
+
|
|
1364
1531
|
/**
|
|
1365
1532
|
* Parse a MolJSON string into a `MolHandle`.
|
|
1366
1533
|
*
|
|
@@ -1369,6 +1536,18 @@ export function mol_from_extxyz(text: string): MolHandle;
|
|
|
1369
1536
|
*/
|
|
1370
1537
|
export function mol_from_moljson(json: string): MolHandle;
|
|
1371
1538
|
|
|
1539
|
+
/**
|
|
1540
|
+
* Parse an ORCA input file (`.inp`) and return a `MolHandle` (topology
|
|
1541
|
+
* only -- element list, no bonds; ORCA input carries no bond table).
|
|
1542
|
+
* Returns a JS error unless the file's coordinate block is an embedded
|
|
1543
|
+
* `* xyz ... *` block -- `xyzfile`/`gzmtfile`/`int` (Z-matrix) blocks
|
|
1544
|
+
* carry no atom list to convert, or none is present at all. Use
|
|
1545
|
+
* [`orca_input_coords_json`] to recover coordinates + charge +
|
|
1546
|
+
* multiplicity in the same atom order, or [`orca_input_to_json`] for the
|
|
1547
|
+
* full input (comments/keywords/blocks/any coordinate-block kind).
|
|
1548
|
+
*/
|
|
1549
|
+
export function mol_from_orca_input(text: string): MolHandle;
|
|
1550
|
+
|
|
1372
1551
|
/**
|
|
1373
1552
|
* Parse a PDB file and return a `MolHandle` (topology only; coordinates are
|
|
1374
1553
|
* discarded -- use [`pdb_coords_json`] to recover them in the SAME atom
|
|
@@ -1380,6 +1559,24 @@ export function mol_from_moljson(json: string): MolHandle;
|
|
|
1380
1559
|
*/
|
|
1381
1560
|
export function mol_from_pdb(pdb: string): MolHandle;
|
|
1382
1561
|
|
|
1562
|
+
/**
|
|
1563
|
+
* Parse a PQR file and return a `MolHandle` (topology only -- element
|
|
1564
|
+
* list inferred per-atom, no bonds; PQR carries no connectivity). Use
|
|
1565
|
+
* [`pqr_coords_json`] to recover coordinates in the same atom order.
|
|
1566
|
+
*/
|
|
1567
|
+
export function mol_from_pqr(text: string): MolHandle;
|
|
1568
|
+
|
|
1569
|
+
/**
|
|
1570
|
+
* Parse a QCSchema `qcschema_molecule` JSON document and return a
|
|
1571
|
+
* `MolHandle` (topology + `atomic_numbers`-derived isotopes -- no bonds
|
|
1572
|
+
* unless the document's optional `connectivity` list is present, in which
|
|
1573
|
+
* case those bond orders are mapped onto the nearest
|
|
1574
|
+
* [`chematic_core::BondOrder`]). Use [`qcschema_molecule_coords_json`] to
|
|
1575
|
+
* recover coordinates (converted Bohr -> Å) plus molecular
|
|
1576
|
+
* charge/multiplicity, in the same atom order.
|
|
1577
|
+
*/
|
|
1578
|
+
export function mol_from_qcschema_molecule(json: string): MolHandle;
|
|
1579
|
+
|
|
1383
1580
|
/**
|
|
1384
1581
|
* Parse a MOL V2000 block and return a `MolHandle`.
|
|
1385
1582
|
*
|
|
@@ -1519,6 +1716,58 @@ export function normalize_cxsmiles(s: string): string;
|
|
|
1519
1716
|
*/
|
|
1520
1717
|
export function normalize_reaction_smiles(rxn_smiles: string): string;
|
|
1521
1718
|
|
|
1719
|
+
/**
|
|
1720
|
+
* Parse an OpenDX (APBS scalar-field subset) file and return its full
|
|
1721
|
+
* [`chematic_mol::VolumetricGrid`] as JSON (same shape as
|
|
1722
|
+
* [`cube_grid_json`]; `atoms` is always empty -- OpenDX has no atom
|
|
1723
|
+
* section). No `mol_from_opendx` is provided: an OpenDX grid never carries
|
|
1724
|
+
* atoms, so a `MolHandle` from one would always be empty and is not a
|
|
1725
|
+
* useful binding.
|
|
1726
|
+
*/
|
|
1727
|
+
export function opendx_grid_json(text: string): string;
|
|
1728
|
+
|
|
1729
|
+
/**
|
|
1730
|
+
* `[nx, ny, nz]` for an OpenDX file's grid, as a `Uint32Array`.
|
|
1731
|
+
*/
|
|
1732
|
+
export function opendx_shape_u32(text: string): Uint32Array;
|
|
1733
|
+
|
|
1734
|
+
/**
|
|
1735
|
+
* Flat `values` from an OpenDX file's grid, as a `Float64Array` -- same
|
|
1736
|
+
* data [`opendx_grid_json`]'s `"values"` field carries.
|
|
1737
|
+
*/
|
|
1738
|
+
export function opendx_values_f64(text: string): Float64Array;
|
|
1739
|
+
|
|
1740
|
+
/**
|
|
1741
|
+
* Coordinates + charge + multiplicity from an ORCA input file's embedded
|
|
1742
|
+
* `* xyz ... *` block, in the SAME atom order [`mol_from_orca_input`]
|
|
1743
|
+
* returns topology for. Returns JSON
|
|
1744
|
+
* `{"coords":[[x,y,z],...],"charge":0,"multiplicity":1}`, or a JS error
|
|
1745
|
+
* under the same conditions as [`mol_from_orca_input`].
|
|
1746
|
+
*/
|
|
1747
|
+
export function orca_input_coords_json(text: string): string;
|
|
1748
|
+
|
|
1749
|
+
/**
|
|
1750
|
+
* Parse an ORCA input file and return every field as JSON:
|
|
1751
|
+
* `{"comments":[...],"keywords":[...],
|
|
1752
|
+
* "blocks":[{"name":"scf","raw":"...","has_end":true},...],
|
|
1753
|
+
* "coords":{"type":"xyz"|"xyzfile"|"gzmtfile"|"internal",...}|null}`.
|
|
1754
|
+
* See [`chematic_mol::OrcaInput`]'s doc comment for each field's meaning.
|
|
1755
|
+
*/
|
|
1756
|
+
export function orca_input_to_json(text: string): string;
|
|
1757
|
+
|
|
1758
|
+
/**
|
|
1759
|
+
* Parse an ORCA output file (`.out`/`.log`) and return every extracted
|
|
1760
|
+
* field as JSON: `{"charge":N|null,"multiplicity":N|null,
|
|
1761
|
+
* "final_energy_hartree":N|null,
|
|
1762
|
+
* "trajectory":[{"elements":[...],"coords":[[x,y,z],...]},...],
|
|
1763
|
+
* "frequencies_cm1":[...],
|
|
1764
|
+
* "termination":{"kind":"normal"|"error"|"incomplete","detail":"..."?},
|
|
1765
|
+
* "optimization_convergence":"not_requested"|"converged"|"not_converged"|"unknown"}`.
|
|
1766
|
+
* No writer is provided -- an ORCA output file is a job log, not a
|
|
1767
|
+
* document this crate constructs.
|
|
1768
|
+
*/
|
|
1769
|
+
export function orca_output_to_json(text: string): string;
|
|
1770
|
+
|
|
1522
1771
|
/**
|
|
1523
1772
|
* PAINS structural alert names matched by `mol` as a JSON array.
|
|
1524
1773
|
*
|
|
@@ -1586,6 +1835,26 @@ export function pharmacophore_fp_2d_summary(mol: MolHandle): string;
|
|
|
1586
1835
|
*/
|
|
1587
1836
|
export function pharmacophore_fp_3d_summary(mol: MolHandle): string;
|
|
1588
1837
|
|
|
1838
|
+
/**
|
|
1839
|
+
* Cartesian coordinates from a PQR file, in the SAME atom order
|
|
1840
|
+
* [`mol_from_pqr`] returns topology for. Returns JSON `[[x,y,z],...]` (Å).
|
|
1841
|
+
*/
|
|
1842
|
+
export function pqr_coords_json(text: string): string;
|
|
1843
|
+
|
|
1844
|
+
/**
|
|
1845
|
+
* Infer an element from a PQR atom name (see
|
|
1846
|
+
* [`chematic_mol::infer_element`]'s doc comment for the heuristic).
|
|
1847
|
+
* Returns `undefined` (JS) / `None` if no element could be inferred.
|
|
1848
|
+
*/
|
|
1849
|
+
export function pqr_infer_element(group_pdb: string, res_name: string, atom_name: string): string | undefined;
|
|
1850
|
+
|
|
1851
|
+
/**
|
|
1852
|
+
* Parse a PQR file and return every field (charge, radius, chain,
|
|
1853
|
+
* residue, inferred element, ...) as JSON: `{"atoms":[{...}]}`. See
|
|
1854
|
+
* [`chematic_mol::PqrAtomRecord`]'s doc comment for each field's meaning.
|
|
1855
|
+
*/
|
|
1856
|
+
export function pqr_to_json(text: string): string;
|
|
1857
|
+
|
|
1589
1858
|
/**
|
|
1590
1859
|
* Predict pKa for all ionizable sites in a molecule.
|
|
1591
1860
|
*
|
|
@@ -1595,6 +1864,34 @@ export function pharmacophore_fp_3d_summary(mol: MolHandle): string;
|
|
|
1595
1864
|
*/
|
|
1596
1865
|
export function predict_pka_json(smiles: string): string;
|
|
1597
1866
|
|
|
1867
|
+
/**
|
|
1868
|
+
* Coordinates (Å) plus molecular charge/multiplicity from a QCSchema
|
|
1869
|
+
* `qcschema_molecule` document, in the SAME atom order
|
|
1870
|
+
* [`mol_from_qcschema_molecule`] returns topology for. Returns JSON
|
|
1871
|
+
* `{"coords":[[x,y,z],...],"molecular_charge":0.0,"molecular_multiplicity":1}`.
|
|
1872
|
+
*/
|
|
1873
|
+
export function qcschema_molecule_coords_json(json: string): string;
|
|
1874
|
+
|
|
1875
|
+
/**
|
|
1876
|
+
* Parse a QCSchema `qcschema_input`/`qc_schema_input` JSON document
|
|
1877
|
+
* (molecule + driver + model + keywords) and re-emit it, validating and
|
|
1878
|
+
* canonicalizing field defaults in the process (e.g. a missing
|
|
1879
|
+
* `schema_name`/`schema_version` is filled in). Job-level fields
|
|
1880
|
+
* (`driver`, `model`, `keywords`, `protocols`, `extras`) are round-tripped
|
|
1881
|
+
* opaquely -- this binding validates/reformats the document; it does not
|
|
1882
|
+
* expose a separate JS-facing accessor for each field (out of scope for
|
|
1883
|
+
* this first pass, see module docs' "None of these formats carry a bond
|
|
1884
|
+
* table" section for the analogous molecule-centric scope choice made
|
|
1885
|
+
* elsewhere in this file).
|
|
1886
|
+
*/
|
|
1887
|
+
export function qcschema_validate_atomic_input(json: string): string;
|
|
1888
|
+
|
|
1889
|
+
/**
|
|
1890
|
+
* Like [`qcschema_validate_atomic_input`], for a QCSchema
|
|
1891
|
+
* `qcschema_output`/`qc_schema_output` (`AtomicResult`) document.
|
|
1892
|
+
*/
|
|
1893
|
+
export function qcschema_validate_atomic_result(json: string): string;
|
|
1894
|
+
|
|
1598
1895
|
/**
|
|
1599
1896
|
* Generate `count` random SMILES from a SMILES string using the given seed.
|
|
1600
1897
|
* Atoms are permuted based on xorshift64 RNG. Each variant should parse back
|
|
@@ -2022,6 +2319,16 @@ export function to_mol_v3000_block(mol: MolHandle): string;
|
|
|
2022
2319
|
*/
|
|
2023
2320
|
export function to_moljson(mol: MolHandle): string;
|
|
2024
2321
|
|
|
2322
|
+
/**
|
|
2323
|
+
* Serialize a `MolHandle` + coordinates (Å) + molecular charge/multiplicity
|
|
2324
|
+
* as a QCSchema `qcschema_molecule` JSON document (coordinates converted
|
|
2325
|
+
* to Bohr).
|
|
2326
|
+
*
|
|
2327
|
+
* `coords_json`: `[[x,y,z],...]` (Å), same order and length as `mol`'s
|
|
2328
|
+
* atoms.
|
|
2329
|
+
*/
|
|
2330
|
+
export function to_qcschema_molecule_json(mol: MolHandle, coords_json: string, charge: number, multiplicity: bigint): string;
|
|
2331
|
+
|
|
2025
2332
|
/**
|
|
2026
2333
|
* Serialize a molecule to XYZ format.
|
|
2027
2334
|
*
|
|
@@ -2060,6 +2367,76 @@ export function whim_descriptors_json(mol: MolHandle): string;
|
|
|
2060
2367
|
*/
|
|
2061
2368
|
export function whim_getaway_combined_json(mol: MolHandle): string;
|
|
2062
2369
|
|
|
2370
|
+
/**
|
|
2371
|
+
* Write a grid (in the JSON shape [`cube_grid_json`] returns) as a
|
|
2372
|
+
* Gaussian Cube file.
|
|
2373
|
+
*/
|
|
2374
|
+
export function write_cube_json(grid_json: string): string;
|
|
2375
|
+
|
|
2376
|
+
/**
|
|
2377
|
+
* Write a LAMMPS data file from the JSON shape [`lammps_data_to_json`]
|
|
2378
|
+
* returns.
|
|
2379
|
+
*/
|
|
2380
|
+
export function write_lammps_data_json(json: string): string;
|
|
2381
|
+
|
|
2382
|
+
/**
|
|
2383
|
+
* Write a single LAMMPS dump frame from the JSON shape
|
|
2384
|
+
* [`lammps_dump_frame_to_json_str`] returns.
|
|
2385
|
+
*/
|
|
2386
|
+
export function write_lammps_dump_frame_json(json: string): string;
|
|
2387
|
+
|
|
2388
|
+
/**
|
|
2389
|
+
* Write a LAMMPS trajectory (N frames concatenated back to back, matching
|
|
2390
|
+
* [`chematic_mol::write_lammps_trajectory`]) from a JSON array of frames
|
|
2391
|
+
* in the shape [`lammps_dump_frame_to_json_str`] returns.
|
|
2392
|
+
*/
|
|
2393
|
+
export function write_lammps_trajectory_json(json: string): string;
|
|
2394
|
+
|
|
2395
|
+
/**
|
|
2396
|
+
* Write an mmCIF file from atom records in the JSON shape
|
|
2397
|
+
* [`mmcif_to_json`]'s `"atoms"` array uses (a full record per atom, not
|
|
2398
|
+
* just element+coordinates -- mmCIF has no equivalent of "build from a
|
|
2399
|
+
* bare `MolHandle`", since occupancy/B-factor/chain/residue fields have no
|
|
2400
|
+
* source in a plain [`MolHandle`]).
|
|
2401
|
+
*
|
|
2402
|
+
* `cell_json`: `"null"` or `{"a":...,"b":...,"c":...,"alpha":...,"beta":...,"gamma":...}`.
|
|
2403
|
+
* `space_group`: pass `""` for none.
|
|
2404
|
+
*/
|
|
2405
|
+
export function write_mmcif_json(records_json: string, cell_json: string, space_group: string, data_block_name: string): string;
|
|
2406
|
+
|
|
2407
|
+
/**
|
|
2408
|
+
* Write a grid as an OpenDX file. Fails closed for a
|
|
2409
|
+
* [`chematic_mol::GridUnits::Bohr`]-tagged grid (OpenDX has no unit tag of
|
|
2410
|
+
* its own and is universally read back as Ångström -- see
|
|
2411
|
+
* `chematic_mol::opendx`'s module docs) and for a grid carrying any atoms
|
|
2412
|
+
* (OpenDX has no atom section). Use [`write_opendx_lossy_json`] to opt
|
|
2413
|
+
* into an explicit Bohr->Ångström conversion instead of failing.
|
|
2414
|
+
*/
|
|
2415
|
+
export function write_opendx_json(grid_json: string): string;
|
|
2416
|
+
|
|
2417
|
+
/**
|
|
2418
|
+
* Like [`write_opendx_json`], but a [`chematic_mol::GridUnits::Bohr`] grid
|
|
2419
|
+
* has its `origin`/`axes` explicitly converted to Ångström rather than
|
|
2420
|
+
* rejected (`values` -- the scalar-field samples themselves -- are never
|
|
2421
|
+
* rescaled; see `write_opendx_lossy`'s doc comment). Still fails for a
|
|
2422
|
+
* grid carrying any atoms.
|
|
2423
|
+
*/
|
|
2424
|
+
export function write_opendx_lossy_json(grid_json: string): string;
|
|
2425
|
+
|
|
2426
|
+
/**
|
|
2427
|
+
* Write an ORCA input file from the JSON shape [`orca_input_to_json`]
|
|
2428
|
+
* returns.
|
|
2429
|
+
*/
|
|
2430
|
+
export function write_orca_input_json(json: string): string;
|
|
2431
|
+
|
|
2432
|
+
/**
|
|
2433
|
+
* Write a PQR file from atom records in the JSON shape [`pqr_to_json`]'s
|
|
2434
|
+
* `"atoms"` array uses. Each atom's `chain_id` independently controls
|
|
2435
|
+
* whether that line is written with or without the (optional) chain
|
|
2436
|
+
* column.
|
|
2437
|
+
*/
|
|
2438
|
+
export function write_pqr_json(records_json: string): string;
|
|
2439
|
+
|
|
2063
2440
|
/**
|
|
2064
2441
|
* Non-canonical SMILES for `mol`.
|
|
2065
2442
|
*
|
|
@@ -2120,6 +2497,9 @@ export interface InitOutput {
|
|
|
2120
2497
|
readonly conformerhandle_new: (a: number, b: number) => [number, number, number];
|
|
2121
2498
|
readonly conformerhandle_remove_conformer: (a: number, b: number) => number;
|
|
2122
2499
|
readonly cpk_color: (a: number, b: number) => [number, number];
|
|
2500
|
+
readonly cube_grid_json: (a: number, b: number) => [number, number, number, number];
|
|
2501
|
+
readonly cube_shape_u32: (a: number, b: number) => [number, number, number];
|
|
2502
|
+
readonly cube_values_f64: (a: number, b: number) => [number, number, number];
|
|
2123
2503
|
readonly depict_data_json: (a: number) => [number, number];
|
|
2124
2504
|
readonly depict_data_with_coords_json: (a: number, b: number, c: number) => [number, number];
|
|
2125
2505
|
readonly depict_reaction_svg: (a: number, b: number) => [number, number, number, number];
|
|
@@ -2181,6 +2561,12 @@ export interface InitOutput {
|
|
|
2181
2561
|
readonly invert_stereocenter_at: (a: number, b: number) => [number, number, number];
|
|
2182
2562
|
readonly is_valid_smiles: (a: number, b: number) => number;
|
|
2183
2563
|
readonly labute_asa_per_atom_json: (a: number) => [number, number];
|
|
2564
|
+
readonly lammps_data_to_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
2565
|
+
readonly lammps_dump_cartesian_positions_f64: (a: number, b: number) => [number, number, number];
|
|
2566
|
+
readonly lammps_dump_cartesian_positions_json: (a: number, b: number) => [number, number, number, number];
|
|
2567
|
+
readonly lammps_dump_frame_to_json_str: (a: number, b: number) => [number, number, number, number];
|
|
2568
|
+
readonly lammps_dump_rows_f64: (a: number, b: number) => [number, number, number];
|
|
2569
|
+
readonly lammps_trajectory_to_json: (a: number, b: number) => [number, number, number, number];
|
|
2184
2570
|
readonly largest_fragment: (a: number) => number;
|
|
2185
2571
|
readonly logp_per_atom_json: (a: number) => [number, number];
|
|
2186
2572
|
readonly maccs_bitvec: (a: number) => [number, number];
|
|
@@ -2198,6 +2584,8 @@ export interface InitOutput {
|
|
|
2198
2584
|
readonly minimize_mmff94_json: (a: number, b: number) => [number, number];
|
|
2199
2585
|
readonly minimize_mmff94_lbfgs_json: (a: number, b: number) => [number, number];
|
|
2200
2586
|
readonly minimize_uff_json: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
2587
|
+
readonly mmcif_coords_json: (a: number, b: number) => [number, number, number, number];
|
|
2588
|
+
readonly mmcif_to_json: (a: number, b: number) => [number, number, number, number];
|
|
2201
2589
|
readonly mmff94_charges_json: (a: number) => [number, number];
|
|
2202
2590
|
readonly mmff94_charges_typed_json: (a: number) => [number, number];
|
|
2203
2591
|
readonly mmff94_energy_breakdown_from_coords_json: (a: number, b: number, c: number) => [number, number];
|
|
@@ -2210,9 +2598,14 @@ export interface InitOutput {
|
|
|
2210
2598
|
readonly mol_block_stereo_diagnostics_json: (a: number, b: number) => [number, number, number, number];
|
|
2211
2599
|
readonly mol_from_cdxml: (a: number, b: number) => [number, number, number];
|
|
2212
2600
|
readonly mol_from_cml: (a: number, b: number) => [number, number, number];
|
|
2601
|
+
readonly mol_from_cube: (a: number, b: number) => [number, number, number];
|
|
2213
2602
|
readonly mol_from_extxyz: (a: number, b: number) => [number, number, number];
|
|
2603
|
+
readonly mol_from_mmcif: (a: number, b: number) => [number, number, number];
|
|
2214
2604
|
readonly mol_from_moljson: (a: number, b: number) => [number, number, number];
|
|
2605
|
+
readonly mol_from_orca_input: (a: number, b: number) => [number, number, number];
|
|
2215
2606
|
readonly mol_from_pdb: (a: number, b: number) => number;
|
|
2607
|
+
readonly mol_from_pqr: (a: number, b: number) => [number, number, number];
|
|
2608
|
+
readonly mol_from_qcschema_molecule: (a: number, b: number) => [number, number, number];
|
|
2216
2609
|
readonly mol_from_sdf_block: (a: number, b: number) => [number, number, number];
|
|
2217
2610
|
readonly mol_from_v3000_block: (a: number, b: number) => [number, number, number];
|
|
2218
2611
|
readonly mol_from_xyz: (a: number, b: number) => [number, number, number];
|
|
@@ -2304,6 +2697,12 @@ export interface InitOutput {
|
|
|
2304
2697
|
readonly neutralize_charges: (a: number) => number;
|
|
2305
2698
|
readonly normalize_cxsmiles: (a: number, b: number) => [number, number, number, number];
|
|
2306
2699
|
readonly normalize_reaction_smiles: (a: number, b: number) => [number, number, number, number];
|
|
2700
|
+
readonly opendx_grid_json: (a: number, b: number) => [number, number, number, number];
|
|
2701
|
+
readonly opendx_shape_u32: (a: number, b: number) => [number, number, number];
|
|
2702
|
+
readonly opendx_values_f64: (a: number, b: number) => [number, number, number];
|
|
2703
|
+
readonly orca_input_coords_json: (a: number, b: number) => [number, number, number, number];
|
|
2704
|
+
readonly orca_input_to_json: (a: number, b: number) => [number, number, number, number];
|
|
2705
|
+
readonly orca_output_to_json: (a: number, b: number) => [number, number, number, number];
|
|
2307
2706
|
readonly pains_matches_json: (a: number) => [number, number];
|
|
2308
2707
|
readonly parse_cxsmarts_json: (a: number, b: number) => [number, number, number, number];
|
|
2309
2708
|
readonly parse_cxsmiles_json: (a: number, b: number) => [number, number, number, number];
|
|
@@ -2313,7 +2712,13 @@ export interface InitOutput {
|
|
|
2313
2712
|
readonly pharmacophore_features_json: (a: number) => [number, number];
|
|
2314
2713
|
readonly pharmacophore_fp_2d_summary: (a: number) => [number, number];
|
|
2315
2714
|
readonly pharmacophore_fp_3d_summary: (a: number) => [number, number];
|
|
2715
|
+
readonly pqr_coords_json: (a: number, b: number) => [number, number, number, number];
|
|
2716
|
+
readonly pqr_infer_element: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
2717
|
+
readonly pqr_to_json: (a: number, b: number) => [number, number, number, number];
|
|
2316
2718
|
readonly predict_pka_json: (a: number, b: number) => [number, number];
|
|
2719
|
+
readonly qcschema_molecule_coords_json: (a: number, b: number) => [number, number, number, number];
|
|
2720
|
+
readonly qcschema_validate_atomic_input: (a: number, b: number) => [number, number, number, number];
|
|
2721
|
+
readonly qcschema_validate_atomic_result: (a: number, b: number) => [number, number, number, number];
|
|
2317
2722
|
readonly random_smiles_json: (a: number, b: number, c: number, d: bigint) => [number, number, number, number];
|
|
2318
2723
|
readonly rdkit_ecfp4_bitvec: (a: number) => [number, number, number, number];
|
|
2319
2724
|
readonly rdkit_ecfp4_detail_json: (a: number) => [number, number, number, number];
|
|
@@ -2358,11 +2763,21 @@ export interface InitOutput {
|
|
|
2358
2763
|
readonly to_mol_block: (a: number) => [number, number];
|
|
2359
2764
|
readonly to_mol_v3000_block: (a: number) => [number, number];
|
|
2360
2765
|
readonly to_moljson: (a: number) => [number, number];
|
|
2766
|
+
readonly to_qcschema_molecule_json: (a: number, b: number, c: number, d: number, e: bigint) => [number, number, number, number];
|
|
2361
2767
|
readonly to_xyz: (a: number) => [number, number];
|
|
2362
2768
|
readonly torsion_bitvec: (a: number) => [number, number];
|
|
2363
2769
|
readonly virtual_screen_ecfp4_json: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
2364
2770
|
readonly whim_descriptors_json: (a: number) => [number, number];
|
|
2365
2771
|
readonly whim_getaway_combined_json: (a: number) => [number, number];
|
|
2772
|
+
readonly write_cube_json: (a: number, b: number) => [number, number, number, number];
|
|
2773
|
+
readonly write_lammps_data_json: (a: number, b: number) => [number, number, number, number];
|
|
2774
|
+
readonly write_lammps_dump_frame_json: (a: number, b: number) => [number, number, number, number];
|
|
2775
|
+
readonly write_lammps_trajectory_json: (a: number, b: number) => [number, number, number, number];
|
|
2776
|
+
readonly write_mmcif_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
|
|
2777
|
+
readonly write_opendx_json: (a: number, b: number) => [number, number, number, number];
|
|
2778
|
+
readonly write_opendx_lossy_json: (a: number, b: number) => [number, number, number, number];
|
|
2779
|
+
readonly write_orca_input_json: (a: number, b: number) => [number, number, number, number];
|
|
2780
|
+
readonly write_pqr_json: (a: number, b: number) => [number, number, number, number];
|
|
2366
2781
|
readonly write_smiles: (a: number) => [number, number];
|
|
2367
2782
|
readonly xlogp3_json: (a: number) => [number, number];
|
|
2368
2783
|
readonly xlogp3_per_atom_json: (a: number) => [number, number];
|