@kent-tokyo/chematic 1.2.2 → 1.2.4
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 +11 -73
- package/chematic_wasm.d.ts +1 -1
- package/chematic_wasm.js +4 -1
- package/chematic_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,9 +4,10 @@ WebAssembly bindings for [chematic](https://github.com/kent-tokyo/chematic), a p
|
|
|
4
4
|
|
|
5
5
|
Published to npm as [`@kent-tokyo/chematic`](https://www.npmjs.com/package/@kent-tokyo/chematic).
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
Use the [binding guide](../../docs/reference/language-bindings.md) for
|
|
8
|
+
data and error conventions and the [format matrix](../../docs/reference/format-capabilities.md)
|
|
9
|
+
for supported readers and writers. See [Cleanup migration](../../docs/reference/cleanup-migration.md)
|
|
10
|
+
for refusal codes in the unreleased source.
|
|
10
11
|
|
|
11
12
|
## Installation
|
|
12
13
|
|
|
@@ -16,52 +17,13 @@ npm install @kent-tokyo/chematic
|
|
|
16
17
|
|
|
17
18
|
## Features
|
|
18
19
|
|
|
19
|
-
- Parse SMILES
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
- Functional group identification (Ertl 2017 IFG)
|
|
27
|
-
- Canonical SMILES generation
|
|
28
|
-
- Separately named RDKit 2026.03.1 compatibility bindings for SMARTS/PDB,
|
|
29
|
-
format readers, Murcko/stereo/hash/Morgan inspection, bounded alignment,
|
|
30
|
-
seeded ETKDG, and distance bounds
|
|
31
|
-
- ECFP4/6, AtomPair, Torsion, path, and RDKit-compatible RDK fingerprints
|
|
32
|
-
with Tanimoto similarity
|
|
33
|
-
- BRICS fragment count
|
|
34
|
-
- SDF/MOL block parsing, including bounded resumable `sdf_records_batch_json`,
|
|
35
|
-
`xyz_frames_batch_json`, and `extxyz_frames_batch_json` manifests with
|
|
36
|
-
deterministic input indices and partial/complete status; bounded malformed
|
|
37
|
-
XYZ frames are grouped inline as rejected records when a later count-line
|
|
38
|
-
boundary is recoverable (core file-backed readers remain fail-stop)
|
|
39
|
-
- Bounded topology parsing for CML (`mol_from_cml_strict` provides the opt-in
|
|
40
|
-
non-empty, balanced, single-root boundary), ChemicalJSON (`mol_from_cjson`), MolJSON,
|
|
41
|
-
CDXML, MOL2, and PDB/mmCIF
|
|
42
|
-
- Index-aligned wildcard/R-group inspection with
|
|
43
|
-
`MolHandle.atom_pseudo_labels_json()` and immutable edits through
|
|
44
|
-
`mol_with_atom_pseudo_label`; labels are bounded to `*`, `R`, and
|
|
45
|
-
`R1..R9999`
|
|
46
|
-
- Label-stable R-group decomposition through
|
|
47
|
-
`rgroup_decompose_columns_json(smilesJson, coreSmarts)`. The returned JSON
|
|
48
|
-
contains input-aligned `Core`, `R1`, `R2`, ... columns and uses `null` for
|
|
49
|
-
unmatched molecules or substituents absent from a matched row. The legacy
|
|
50
|
-
`rgroup_decompose_json` row API is unchanged.
|
|
51
|
-
- PDBx/mmCIF, PQR, QCSchema JSON, ORCA input/output, Gaussian Cube, OpenDX,
|
|
52
|
-
and LAMMPS data/dump I/O (JSON-based bindings; see `format_io.rs`)
|
|
53
|
-
- Topological descriptors: Wiener index, Hall-Kier κ, χ connectivity indices, Bertz CT
|
|
54
|
-
- Shape descriptors (with 3D coordinates): PMI, NPR, radius of gyration, asphericity
|
|
55
|
-
- 2D SVG depiction with CPK colors and atom/bond highlighting
|
|
56
|
-
- SVG grid layout for multiple molecules
|
|
57
|
-
- Reaction SMILES/SMIRKS parsing and transform
|
|
58
|
-
(`run_reactants_checked` includes typed native and RDKit-profile rejection
|
|
59
|
-
diagnostics without returning rejected products as successes)
|
|
60
|
-
- Add/remove explicit hydrogens
|
|
61
|
-
- `embed_pipeline_v2_json`: torsion-knowledge-aware 3D embedding + stereo
|
|
62
|
-
verification/repair + policy-gated force field, mirroring the Python
|
|
63
|
-
`Mol.embed_pipeline_v2()` binding — opt-in, not a default 3D API
|
|
64
|
-
([usage](#3d-embedding-embed_pipeline_v2_json))
|
|
20
|
+
- Parse SMILES and common molecule files, calculate descriptors and
|
|
21
|
+
fingerprints, search substructures, and draw SVG.
|
|
22
|
+
- Process documented SDF, XYZ and Extended XYZ batches with indexed results and
|
|
23
|
+
explicit partial status.
|
|
24
|
+
- Run bounded reaction, R-group and RDKit-compatible workflows.
|
|
25
|
+
- Use the opt-in [3D pipeline](#3d-embedding-embed_pipeline_v2_json) with
|
|
26
|
+
per-stage diagnostics.
|
|
65
27
|
|
|
66
28
|
## Usage
|
|
67
29
|
|
|
@@ -170,30 +132,6 @@ console.log(mol.formula()); // C6H6
|
|
|
170
132
|
mol.free();
|
|
171
133
|
```
|
|
172
134
|
|
|
173
|
-
```js
|
|
174
|
-
// Sprint Q: New descriptors (v0.1.15)
|
|
175
|
-
console.log(mol.sa_score()); // synthetic accessibility [1,10]
|
|
176
|
-
console.log(mol.labute_asa()); // Labute approx. surface area (Ų)
|
|
177
|
-
|
|
178
|
-
// Gasteiger partial charges (per heavy atom)
|
|
179
|
-
const charges = JSON.parse(gasteiger_charges_json(mol));
|
|
180
|
-
console.log(charges); // [-0.08, 0.12, -0.43, ...]
|
|
181
|
-
|
|
182
|
-
// Explicit RDKit-compatibility descriptor profile (kept separate from the
|
|
183
|
-
// historical native get_descriptors_json() profile)
|
|
184
|
-
const rdkitDescriptors = JSON.parse(get_rdkit_descriptors_json(mol));
|
|
185
|
-
console.log(rdkitDescriptors.aromatic_ring_count);
|
|
186
|
-
|
|
187
|
-
// VSA descriptor bins
|
|
188
|
-
const slogpVsa = JSON.parse(slogp_vsa_json(mol));
|
|
189
|
-
const smrVsa = JSON.parse(smr_vsa_json(mol));
|
|
190
|
-
const peoeVsa = JSON.parse(peoe_vsa_json(mol));
|
|
191
|
-
|
|
192
|
-
// Functional group identification
|
|
193
|
-
const ifg = JSON.parse(identify_functional_groups(mol));
|
|
194
|
-
console.log(ifg); // [{"atoms":[1,2,3],"types":"OC=O"}, ...]
|
|
195
|
-
```
|
|
196
|
-
|
|
197
135
|
### 3D embedding (`embed_pipeline_v2_json`)
|
|
198
136
|
|
|
199
137
|
Opt-in — does not change behavior of any existing 3D API (`generate_coords`,
|
package/chematic_wasm.d.ts
CHANGED
|
@@ -3865,7 +3865,7 @@ export interface InitOutput {
|
|
|
3865
3865
|
readonly cip_assignments_accurate_json: (a: number) => [number, number];
|
|
3866
3866
|
readonly cip_assignments_json: (a: number) => [number, number];
|
|
3867
3867
|
readonly cip_unresolved_json: (a: number) => [number, number];
|
|
3868
|
-
readonly cleanup_mol: (a: number) => number;
|
|
3868
|
+
readonly cleanup_mol: (a: number) => [number, number, number];
|
|
3869
3869
|
readonly compare_molecules_batch_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
3870
3870
|
readonly compare_molecules_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
3871
3871
|
readonly compute_canonical_transform_from_coords_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
|
package/chematic_wasm.js
CHANGED
|
@@ -3067,7 +3067,10 @@ export function cip_unresolved_json(mol) {
|
|
|
3067
3067
|
export function cleanup_mol(mol) {
|
|
3068
3068
|
_assertClass(mol, MolHandle);
|
|
3069
3069
|
const ret = wasm.cleanup_mol(mol.__wbg_ptr);
|
|
3070
|
-
|
|
3070
|
+
if (ret[2]) {
|
|
3071
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3072
|
+
}
|
|
3073
|
+
return MolHandle.__wrap(ret[0]);
|
|
3071
3074
|
}
|
|
3072
3075
|
|
|
3073
3076
|
/**
|
package/chematic_wasm_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"Kentaro Tanabe (kent-tokyo) <kent-tokyo@users.noreply.github.com>"
|
|
6
6
|
],
|
|
7
7
|
"description": "WebAssembly bindings for chematic — use chematic from JavaScript/TypeScript",
|
|
8
|
-
"version": "1.2.
|
|
8
|
+
"version": "1.2.4",
|
|
9
9
|
"license": "MIT OR Apache-2.0",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|